aboutsummaryrefslogtreecommitdiffstats
path: root/arch
diff options
context:
space:
mode:
Diffstat (limited to 'arch')
-rw-r--r--arch/alpha/include/asm/percpu.h6
-rw-r--r--arch/alpha/include/asm/thread_info.h1
-rw-r--r--arch/alpha/kernel/ptrace.c1
-rw-r--r--arch/arm/Kconfig.debug8
-rw-r--r--arch/arm/boot/compressed/misc.c1
-rw-r--r--arch/arm/configs/kb9202_defconfig1158
-rw-r--r--arch/arm/configs/s3c2410_defconfig2
-rw-r--r--arch/arm/configs/s3c6400_defconfig1
-rw-r--r--arch/arm/configs/tct_hammer_defconfig1
-rw-r--r--arch/arm/configs/u300_defconfig96
-rw-r--r--arch/arm/include/asm/atomic.h2
-rw-r--r--arch/arm/include/asm/page.h2
-rw-r--r--arch/arm/include/asm/pgtable.h53
-rw-r--r--arch/arm/include/asm/thread_info.h2
-rw-r--r--arch/arm/kernel/entry-common.S2
-rw-r--r--arch/arm/kernel/irq.c24
-rw-r--r--arch/arm/kernel/vmlinux.lds.S15
-rw-r--r--arch/arm/mach-at91/board-sam9g20ek.c54
-rw-r--r--arch/arm/mach-at91/board-sam9rlek.c6
-rw-r--r--arch/arm/mach-davinci/board-dm355-evm.c1
-rw-r--r--arch/arm/mach-davinci/board-dm355-leopard.c1
-rw-r--r--arch/arm/mach-davinci/board-dm644x-evm.c1
-rw-r--r--arch/arm/mach-davinci/board-dm646x-evm.c1
-rw-r--r--arch/arm/mach-davinci/board-sffsdr.c1
-rw-r--r--arch/arm/mach-ep93xx/dma-m2p.c1
-rw-r--r--arch/arm/mach-ep93xx/include/mach/ts72xx.h3
-rw-r--r--arch/arm/mach-ep93xx/ts72xx.c18
-rw-r--r--arch/arm/mach-kirkwood/mpp.h2
-rw-r--r--arch/arm/mach-mx3/Kconfig8
-rw-r--r--arch/arm/mach-mx3/Makefile1
-rw-r--r--arch/arm/mach-mx3/armadillo5x0.c63
-rw-r--r--arch/arm/mach-mx3/devices.c1
-rw-r--r--arch/arm/mach-mx3/pcm037.c183
-rw-r--r--arch/arm/mach-mx3/pcm037.h11
-rw-r--r--arch/arm/mach-mx3/pcm037_eet.c204
-rw-r--r--arch/arm/mach-omap1/board-nokia770.c3
-rw-r--r--arch/arm/mach-omap1/mailbox.c2
-rw-r--r--arch/arm/mach-omap1/mcbsp.c1
-rw-r--r--arch/arm/mach-omap2/board-rx51-peripherals.c1
-rw-r--r--arch/arm/mach-omap2/gpmc-onenand.c21
-rw-r--r--arch/arm/mach-omap2/id.c22
-rw-r--r--arch/arm/mach-omap2/mailbox.c6
-rw-r--r--arch/arm/mach-omap2/mcbsp.c1
-rw-r--r--arch/arm/mach-omap2/mmc-twl4030.c13
-rw-r--r--arch/arm/mach-pxa/treo680.c2
-rw-r--r--arch/arm/mach-realview/core.c3
-rw-r--r--arch/arm/mach-s3c2440/mach-mini2440.c3
-rw-r--r--arch/arm/mach-s3c2442/mach-gta02.c3
-rw-r--r--arch/arm/mach-u300/clock.c121
-rw-r--r--arch/arm/mach-u300/core.c4
-rw-r--r--arch/arm/mach-versatile/core.c3
-rw-r--r--arch/arm/mm/proc-syms.c1
-rw-r--r--arch/arm/plat-mxc/include/mach/iomux-mx3.h2
-rw-r--r--arch/arm/plat-omap/dma.c13
-rw-r--r--arch/arm/plat-omap/gpio.c1
-rw-r--r--arch/arm/plat-omap/include/mach/cpu.h22
-rw-r--r--arch/arm/plat-omap/include/mach/dma.h15
-rw-r--r--arch/arm/plat-omap/include/mach/io.h2
-rw-r--r--arch/arm/plat-omap/iommu.c2
-rw-r--r--arch/arm/plat-omap/sram.c7
-rw-r--r--arch/arm/plat-s3c/Makefile2
-rw-r--r--arch/arm/plat-s3c/include/plat/devs.h1
-rw-r--r--arch/arm/plat-s3c24xx/Makefile2
-rw-r--r--arch/arm/plat-s3c24xx/spi-bus0-gpe11_12_13.c3
-rw-r--r--arch/arm/plat-s3c24xx/spi-bus1-gpg5_6_7.c3
-rw-r--r--arch/arm/plat-s3c64xx/pm.c2
-rw-r--r--arch/arm/plat-stmp3xxx/pinmux.c1
-rw-r--r--arch/avr32/include/asm/thread_info.h2
-rw-r--r--arch/avr32/kernel/traps.c13
-rw-r--r--arch/blackfin/include/asm/context.S7
-rw-r--r--arch/blackfin/include/asm/cpu.h1
-rw-r--r--arch/blackfin/include/asm/hardirq.h3
-rw-r--r--arch/blackfin/include/asm/processor.h21
-rw-r--r--arch/blackfin/include/asm/thread_info.h2
-rw-r--r--arch/blackfin/kernel/bfin_dma_5xx.c29
-rw-r--r--arch/blackfin/kernel/bfin_gpio.c6
-rw-r--r--arch/blackfin/kernel/cplb-nompu/cplbinit.c23
-rw-r--r--arch/blackfin/kernel/process.c14
-rw-r--r--arch/blackfin/kernel/ptrace.c1
-rw-r--r--arch/blackfin/kernel/setup.c85
-rw-r--r--arch/blackfin/kernel/sys_bfin.c1
-rw-r--r--arch/blackfin/kernel/traps.c43
-rw-r--r--arch/blackfin/lib/lshrdi3.c16
-rw-r--r--arch/blackfin/mach-bf518/boards/ezbrd.c2
-rw-r--r--arch/blackfin/mach-bf518/include/mach/anomaly.h2
-rw-r--r--arch/blackfin/mach-bf518/include/mach/bfin_serial_5xx.h2
-rw-r--r--arch/blackfin/mach-bf527/boards/cm_bf527.c2
-rw-r--r--arch/blackfin/mach-bf527/boards/ezbrd.c2
-rw-r--r--arch/blackfin/mach-bf527/boards/ezkit.c2
-rw-r--r--arch/blackfin/mach-bf527/include/mach/anomaly.h4
-rw-r--r--arch/blackfin/mach-bf527/include/mach/bfin_serial_5xx.h2
-rw-r--r--arch/blackfin/mach-bf533/boards/stamp.c2
-rw-r--r--arch/blackfin/mach-bf533/include/mach/anomaly.h1
-rw-r--r--arch/blackfin/mach-bf533/include/mach/bfin_serial_5xx.h2
-rw-r--r--arch/blackfin/mach-bf537/boards/stamp.c4
-rw-r--r--arch/blackfin/mach-bf537/include/mach/anomaly.h2
-rw-r--r--arch/blackfin/mach-bf537/include/mach/bfin_serial_5xx.h2
-rw-r--r--arch/blackfin/mach-bf538/include/mach/anomaly.h2
-rw-r--r--arch/blackfin/mach-bf538/include/mach/bfin_serial_5xx.h2
-rw-r--r--arch/blackfin/mach-bf548/boards/ezkit.c2
-rw-r--r--arch/blackfin/mach-bf548/include/mach/anomaly.h2
-rw-r--r--arch/blackfin/mach-bf561/include/mach/anomaly.h1
-rw-r--r--arch/blackfin/mach-bf561/include/mach/bfin_serial_5xx.h2
-rw-r--r--arch/blackfin/mach-bf561/include/mach/mem_map.h23
-rw-r--r--arch/blackfin/mach-common/entry.S12
-rw-r--r--arch/blackfin/mach-common/smp.c10
-rw-r--r--arch/cris/include/asm/thread_info.h4
-rw-r--r--arch/cris/kernel/sys_cris.c1
-rw-r--r--arch/frv/Kconfig1
-rw-r--r--arch/frv/include/asm/atomic.h68
-rw-r--r--arch/frv/include/asm/perf_counter.h17
-rw-r--r--arch/frv/include/asm/system.h2
-rw-r--r--arch/frv/include/asm/thread_info.h4
-rw-r--r--arch/frv/include/asm/unistd.h4
-rw-r--r--arch/frv/kernel/entry.S2
-rw-r--r--arch/frv/kernel/frv_ksyms.c4
-rw-r--r--arch/frv/lib/Makefile4
-rw-r--r--arch/frv/lib/atomic-ops.S3
-rw-r--r--arch/frv/lib/atomic64-ops.S162
-rw-r--r--arch/frv/lib/perf_counter.c19
-rw-r--r--arch/h8300/include/asm/thread_info.h2
-rw-r--r--arch/ia64/include/asm/fpu.h2
-rw-r--r--arch/ia64/include/asm/thread_info.h2
-rw-r--r--arch/ia64/include/asm/xen/hypervisor.h1
-rw-r--r--arch/ia64/kernel/dma-mapping.c8
-rw-r--r--arch/ia64/kernel/esi.c2
-rw-r--r--arch/ia64/kernel/perfmon.c2
-rw-r--r--arch/ia64/kernel/ptrace.c1
-rw-r--r--arch/ia64/kernel/salinfo.c2
-rw-r--r--arch/ia64/kvm/kvm_lib.c6
-rw-r--r--arch/ia64/kvm/process.c6
-rw-r--r--arch/ia64/kvm/vcpu.c2
-rw-r--r--arch/ia64/kvm/vtlb.c4
-rw-r--r--arch/ia64/pci/pci.c2
-rw-r--r--arch/ia64/sn/kernel/io_common.c3
-rw-r--r--arch/m32r/include/asm/thread_info.h4
-rw-r--r--arch/m32r/kernel/ptrace.c1
-rw-r--r--arch/m68k/include/asm/thread_info_mm.h1
-rw-r--r--arch/m68k/include/asm/thread_info_no.h1
-rw-r--r--arch/m68knommu/kernel/process.c21
-rw-r--r--arch/m68knommu/kernel/traps.c6
-rw-r--r--arch/microblaze/Kconfig3
-rw-r--r--arch/microblaze/include/asm/atomic.h101
-rw-r--r--arch/microblaze/include/asm/bitops.h26
-rw-r--r--arch/microblaze/include/asm/bug.h14
-rw-r--r--arch/microblaze/include/asm/bugs.h18
-rw-r--r--arch/microblaze/include/asm/checksum.h70
-rw-r--r--arch/microblaze/include/asm/fb.h1
-rw-r--r--arch/microblaze/include/asm/hardirq.h14
-rw-r--r--arch/microblaze/include/asm/ioctls.h92
-rw-r--r--arch/microblaze/include/asm/ipcbuf.h37
-rw-r--r--arch/microblaze/include/asm/irq.h6
-rw-r--r--arch/microblaze/include/asm/mman.h24
-rw-r--r--arch/microblaze/include/asm/mmu.h7
-rw-r--r--arch/microblaze/include/asm/mmu_context.h2
-rw-r--r--arch/microblaze/include/asm/mmu_context_no.h23
-rw-r--r--arch/microblaze/include/asm/module.h10
-rw-r--r--arch/microblaze/include/asm/msgbuf.h32
-rw-r--r--arch/microblaze/include/asm/param.h31
-rw-r--r--arch/microblaze/include/asm/parport.h1
-rw-r--r--arch/microblaze/include/asm/pci.h2
-rw-r--r--arch/microblaze/include/asm/posix_types.h68
-rw-r--r--arch/microblaze/include/asm/scatterlist.h29
-rw-r--r--arch/microblaze/include/asm/sembuf.h35
-rw-r--r--arch/microblaze/include/asm/serial.h15
-rw-r--r--arch/microblaze/include/asm/shmbuf.h43
-rw-r--r--arch/microblaze/include/asm/shmparam.h7
-rw-r--r--arch/microblaze/include/asm/siginfo.h14
-rw-r--r--arch/microblaze/include/asm/signal.h166
-rw-r--r--arch/microblaze/include/asm/socket.h70
-rw-r--r--arch/microblaze/include/asm/sockios.h24
-rw-r--r--arch/microblaze/include/asm/stat.h69
-rw-r--r--arch/microblaze/include/asm/swab.h9
-rw-r--r--arch/microblaze/include/asm/syscalls.h46
-rw-r--r--arch/microblaze/include/asm/system.h3
-rw-r--r--arch/microblaze/include/asm/termbits.h204
-rw-r--r--arch/microblaze/include/asm/termios.h89
-rw-r--r--arch/microblaze/include/asm/thread_info.h4
-rw-r--r--arch/microblaze/include/asm/timex.h6
-rw-r--r--arch/microblaze/include/asm/types.h39
-rw-r--r--arch/microblaze/include/asm/ucontext.h23
-rw-r--r--arch/microblaze/include/asm/unistd.h6
-rw-r--r--arch/microblaze/include/asm/vga.h2
-rw-r--r--arch/microblaze/kernel/entry-nommu.S20
-rw-r--r--arch/microblaze/kernel/entry.S34
-rw-r--r--arch/microblaze/kernel/ptrace.c1
-rw-r--r--arch/microblaze/kernel/signal.c175
-rw-r--r--arch/microblaze/kernel/sys_microblaze.c21
-rw-r--r--arch/microblaze/kernel/syscall_table.S14
-rw-r--r--arch/microblaze/lib/Makefile2
-rw-r--r--arch/microblaze/lib/checksum.c172
-rw-r--r--arch/microblaze/mm/init.c6
-rw-r--r--arch/mips/Kconfig29
-rw-r--r--arch/mips/Makefile7
-rw-r--r--arch/mips/ar7/Makefile10
-rw-r--r--arch/mips/ar7/clock.c440
-rw-r--r--arch/mips/ar7/gpio.c48
-rw-r--r--arch/mips/ar7/irq.c176
-rw-r--r--arch/mips/ar7/memory.c72
-rw-r--r--arch/mips/ar7/platform.c555
-rw-r--r--arch/mips/ar7/prom.c297
-rw-r--r--arch/mips/ar7/setup.c94
-rw-r--r--arch/mips/ar7/time.c30
-rw-r--r--arch/mips/cavium-octeon/Makefile4
-rw-r--r--arch/mips/cavium-octeon/dma-octeon.c2
-rw-r--r--arch/mips/cavium-octeon/pci-common.c137
-rw-r--r--arch/mips/cobalt/buttons.c2
-rw-r--r--arch/mips/cobalt/lcd.c2
-rw-r--r--arch/mips/cobalt/led.c2
-rw-r--r--arch/mips/cobalt/mtd.c2
-rw-r--r--arch/mips/cobalt/rtc.c2
-rw-r--r--arch/mips/cobalt/serial.c2
-rw-r--r--arch/mips/cobalt/time.c2
-rw-r--r--arch/mips/configs/ar7_defconfig1182
-rw-r--r--arch/mips/gt64120/wrppmc/serial.c2
-rw-r--r--arch/mips/include/asm/amon.h7
-rw-r--r--arch/mips/include/asm/ds1287.h2
-rw-r--r--arch/mips/include/asm/elf.h4
-rw-r--r--arch/mips/include/asm/gcmpregs.h2
-rw-r--r--arch/mips/include/asm/gic.h6
-rw-r--r--arch/mips/include/asm/irq_gt641xx.h2
-rw-r--r--arch/mips/include/asm/mach-ar7/ar7.h178
-rw-r--r--arch/mips/include/asm/mach-ar7/gpio.h110
-rw-r--r--arch/mips/include/asm/mach-ar7/irq.h16
-rw-r--r--arch/mips/include/asm/mach-ar7/prom.h25
-rw-r--r--arch/mips/include/asm/mach-ar7/spaces.h22
-rw-r--r--arch/mips/include/asm/mach-ar7/war.h25
-rw-r--r--arch/mips/include/asm/mach-cobalt/irq.h2
-rw-r--r--arch/mips/include/asm/mach-cobalt/mach-gt64120.h2
-rw-r--r--arch/mips/include/asm/octeon/pci-octeon.h (renamed from arch/mips/cavium-octeon/pci-common.h)30
-rw-r--r--arch/mips/include/asm/page.h9
-rw-r--r--arch/mips/include/asm/reg.h2
-rw-r--r--arch/mips/include/asm/swab.h8
-rw-r--r--arch/mips/include/asm/thread_info.h4
-rw-r--r--arch/mips/include/asm/unistd.h18
-rw-r--r--arch/mips/include/asm/vr41xx/capcella.h2
-rw-r--r--arch/mips/include/asm/vr41xx/giu.h22
-rw-r--r--arch/mips/include/asm/vr41xx/irq.h2
-rw-r--r--arch/mips/include/asm/vr41xx/mpc30x.h2
-rw-r--r--arch/mips/include/asm/vr41xx/pci.h2
-rw-r--r--arch/mips/include/asm/vr41xx/siu.h2
-rw-r--r--arch/mips/include/asm/vr41xx/tb0219.h2
-rw-r--r--arch/mips/include/asm/vr41xx/tb0226.h2
-rw-r--r--arch/mips/include/asm/vr41xx/vr41xx.h2
-rw-r--r--arch/mips/kernel/binfmt_elfo32.c20
-rw-r--r--arch/mips/kernel/cevt-ds1287.c2
-rw-r--r--arch/mips/kernel/cevt-gt641xx.c2
-rw-r--r--arch/mips/kernel/csrc-ioasic.c2
-rw-r--r--arch/mips/kernel/irq-gic.c19
-rw-r--r--arch/mips/kernel/irq-gt641xx.c2
-rw-r--r--arch/mips/kernel/ptrace32.c1
-rw-r--r--arch/mips/kernel/scall32-o32.S2
-rw-r--r--arch/mips/kernel/scall64-64.S2
-rw-r--r--arch/mips/kernel/scall64-n32.S2
-rw-r--r--arch/mips/kernel/scall64-o32.S2
-rw-r--r--arch/mips/kernel/smp-cmp.c66
-rw-r--r--arch/mips/kernel/sync-r4k.c31
-rw-r--r--arch/mips/kernel/vpe.c2
-rw-r--r--arch/mips/mm/hugetlbpage.c1
-rw-r--r--arch/mips/mti-malta/malta-init.c14
-rw-r--r--arch/mips/mti-malta/malta-int.c89
-rw-r--r--arch/mips/mti-malta/malta-reset.c3
-rw-r--r--arch/mips/pci/Makefile5
-rw-r--r--arch/mips/pci/fixup-capcella.c2
-rw-r--r--arch/mips/pci/fixup-mpc30x.c2
-rw-r--r--arch/mips/pci/fixup-tb0219.c2
-rw-r--r--arch/mips/pci/fixup-tb0226.c2
-rw-r--r--arch/mips/pci/fixup-tb0287.c2
-rw-r--r--arch/mips/pci/msi-octeon.c (renamed from arch/mips/cavium-octeon/msi.c)56
-rw-r--r--arch/mips/pci/ops-vr41xx.c6
-rw-r--r--arch/mips/pci/pci-octeon.c (renamed from arch/mips/cavium-octeon/pci.c)147
-rw-r--r--arch/mips/pci/pci-vr41xx.c6
-rw-r--r--arch/mips/pci/pci-vr41xx.h4
-rw-r--r--arch/mips/pci/pcie-octeon.c (renamed from arch/mips/cavium-octeon/pcie.c)37
-rw-r--r--arch/mips/vr41xx/casio-e55/setup.c2
-rw-r--r--arch/mips/vr41xx/common/bcu.c8
-rw-r--r--arch/mips/vr41xx/common/cmu.c8
-rw-r--r--arch/mips/vr41xx/common/giu.c2
-rw-r--r--arch/mips/vr41xx/common/icu.c8
-rw-r--r--arch/mips/vr41xx/common/init.c2
-rw-r--r--arch/mips/vr41xx/common/irq.c2
-rw-r--r--arch/mips/vr41xx/common/pmu.c2
-rw-r--r--arch/mips/vr41xx/common/rtc.c2
-rw-r--r--arch/mips/vr41xx/common/siu.c2
-rw-r--r--arch/mips/vr41xx/common/type.c2
-rw-r--r--arch/mips/vr41xx/ibm-workpad/setup.c2
-rw-r--r--arch/mn10300/include/asm/pci.h4
-rw-r--r--arch/mn10300/include/asm/thread_info.h4
-rw-r--r--arch/mn10300/include/asm/unistd.h4
-rw-r--r--arch/mn10300/kernel/entry.S2
-rw-r--r--arch/mn10300/kernel/ptrace.c1
-rw-r--r--arch/mn10300/kernel/signal.c1
-rw-r--r--arch/mn10300/kernel/sys_mn10300.c2
-rw-r--r--arch/mn10300/kernel/traps.c22
-rw-r--r--arch/mn10300/kernel/vmlinux.lds.S4
-rw-r--r--arch/mn10300/mm/fault.c1
-rw-r--r--arch/mn10300/mm/misalignment.c1
-rw-r--r--arch/parisc/Kconfig2
-rw-r--r--arch/parisc/include/asm/atomic.h14
-rw-r--r--arch/parisc/include/asm/dma.h3
-rw-r--r--arch/parisc/include/asm/perf_counter.h7
-rw-r--r--arch/parisc/include/asm/processor.h3
-rw-r--r--arch/parisc/include/asm/system.h4
-rw-r--r--arch/parisc/include/asm/thread_info.h2
-rw-r--r--arch/parisc/include/asm/tlbflush.h14
-rw-r--r--arch/parisc/include/asm/unistd.h6
-rw-r--r--arch/parisc/kernel/cache.c26
-rw-r--r--arch/parisc/kernel/inventory.c41
-rw-r--r--arch/parisc/kernel/irq.c10
-rw-r--r--arch/parisc/kernel/pci-dma.c12
-rw-r--r--arch/parisc/kernel/pci.c3
-rw-r--r--arch/parisc/kernel/process.c2
-rw-r--r--arch/parisc/kernel/processor.c19
-rw-r--r--arch/parisc/kernel/setup.c3
-rw-r--r--arch/parisc/kernel/sys_parisc32.c62
-rw-r--r--arch/parisc/kernel/syscall_table.S4
-rw-r--r--arch/parisc/kernel/time.c90
-rw-r--r--arch/parisc/kernel/traps.c20
-rw-r--r--arch/parisc/lib/checksum.c2
-rw-r--r--arch/parisc/lib/memcpy.c2
-rw-r--r--arch/parisc/math-emu/decode_exc.c2
-rw-r--r--arch/parisc/mm/fault.c3
-rw-r--r--arch/parisc/mm/init.c29
-rw-r--r--arch/powerpc/Kconfig1
-rw-r--r--arch/powerpc/boot/.gitignore10
-rw-r--r--arch/powerpc/boot/dts/amigaone.dts4
-rw-r--r--arch/powerpc/boot/dts/mpc8569mds.dts1
-rw-r--r--arch/powerpc/boot/dts/warp.dts3
-rw-r--r--arch/powerpc/configs/44x/warp_defconfig200
-rw-r--r--arch/powerpc/include/asm/cpm1.h2
-rw-r--r--arch/powerpc/include/asm/delay.h2
-rw-r--r--arch/powerpc/include/asm/dma-mapping.h24
-rw-r--r--arch/powerpc/include/asm/highmem.h57
-rw-r--r--arch/powerpc/include/asm/hw_irq.h20
-rw-r--r--arch/powerpc/include/asm/perf_counter.h2
-rw-r--r--arch/powerpc/include/asm/pte-hash64-64k.h3
-rw-r--r--arch/powerpc/include/asm/rtas.h5
-rw-r--r--arch/powerpc/include/asm/thread_info.h4
-rw-r--r--arch/powerpc/kernel/entry_32.S127
-rw-r--r--arch/powerpc/kernel/head_32.S17
-rw-r--r--arch/powerpc/kernel/mpc7450-pmu.c1
-rw-r--r--arch/powerpc/kernel/of_device.c2
-rw-r--r--arch/powerpc/kernel/power7-pmu.c1
-rw-r--r--arch/powerpc/kernel/ppc970-pmu.c1
-rw-r--r--arch/powerpc/kernel/process.c2
-rw-r--r--arch/powerpc/kernel/ptrace.c17
-rw-r--r--arch/powerpc/kernel/ptrace32.c1
-rw-r--r--arch/powerpc/kernel/rtas.c69
-rw-r--r--arch/powerpc/kernel/setup_32.c2
-rw-r--r--arch/powerpc/kernel/smp.c3
-rw-r--r--arch/powerpc/kernel/udbg_16550.c2
-rw-r--r--arch/powerpc/kernel/vector.S6
-rw-r--r--arch/powerpc/mm/Makefile1
-rw-r--r--arch/powerpc/mm/gup.c10
-rw-r--r--arch/powerpc/mm/highmem.c77
-rw-r--r--arch/powerpc/mm/mmu_context_nohash.c16
-rw-r--r--arch/powerpc/mm/pgtable.c4
-rw-r--r--arch/powerpc/mm/slb.c13
-rw-r--r--arch/powerpc/mm/tlb_hash64.c2
-rw-r--r--arch/powerpc/oprofile/cell/vma_map.c2
-rw-r--r--arch/powerpc/platforms/44x/warp.c63
-rw-r--r--arch/powerpc/platforms/82xx/pq2ads-pci-pic.c2
-rw-r--r--arch/powerpc/platforms/85xx/mpc85xx_mds.c1
-rw-r--r--arch/powerpc/platforms/85xx/smp.c9
-rw-r--r--arch/powerpc/platforms/85xx/socrates.c6
-rw-r--r--arch/powerpc/platforms/85xx/xes_mpc85xx.c1
-rw-r--r--arch/powerpc/platforms/cell/axon_msi.c22
-rw-r--r--arch/powerpc/platforms/cell/smp.c30
-rw-r--r--arch/powerpc/platforms/chrp/smp.c33
-rw-r--r--arch/powerpc/platforms/pasemi/setup.c15
-rw-r--r--arch/powerpc/platforms/powermac/cpufreq_64.c2
-rw-r--r--arch/powerpc/platforms/powermac/pic.c2
-rw-r--r--arch/powerpc/platforms/powermac/setup.c41
-rw-r--r--arch/powerpc/platforms/powermac/smp.c166
-rw-r--r--arch/powerpc/platforms/ps3/system-bus.c1
-rw-r--r--arch/powerpc/platforms/pseries/lpar.c18
-rw-r--r--arch/powerpc/platforms/pseries/smp.c30
-rw-r--r--arch/powerpc/platforms/pseries/xics.c8
-rw-r--r--arch/powerpc/sysdev/fsl_rio.c2
-rw-r--r--arch/powerpc/sysdev/ipic.c4
-rw-r--r--arch/powerpc/sysdev/mpic.c43
-rw-r--r--arch/powerpc/sysdev/ppc4xx_pci.c4
-rw-r--r--arch/powerpc/sysdev/qe_lib/qe.c9
-rw-r--r--arch/powerpc/sysdev/qe_lib/qe_ic.c4
-rw-r--r--arch/powerpc/sysdev/uic.c3
-rw-r--r--arch/s390/Kconfig8
-rw-r--r--arch/s390/include/asm/atomic.h7
-rw-r--r--arch/s390/include/asm/kvm_host.h4
-rw-r--r--arch/s390/include/asm/perf_counter.h2
-rw-r--r--arch/s390/include/asm/thread_info.h2
-rw-r--r--arch/s390/kernel/dis.c1
-rw-r--r--arch/s390/kernel/ipl.c15
-rw-r--r--arch/s390/kernel/ptrace.c1
-rw-r--r--arch/s390/kvm/kvm-s390.c23
-rw-r--r--arch/s390/kvm/priv.c2
-rw-r--r--arch/s390/lib/Makefile2
-rw-r--r--arch/s390/lib/delay.c2
-rw-r--r--arch/s390/lib/ucmpdi2.c26
-rw-r--r--arch/s390/mm/fault.c1
-rw-r--r--arch/sh/Kconfig.debug4
-rw-r--r--arch/sh/boards/mach-se/7206/io.c2
-rw-r--r--arch/sh/boards/mach-se/7724/setup.c148
-rw-r--r--arch/sh/configs/migor_defconfig53
-rw-r--r--arch/sh/configs/se7724_defconfig25
-rw-r--r--arch/sh/include/asm/perf_counter.h4
-rw-r--r--arch/sh/include/asm/syscall_32.h1
-rw-r--r--arch/sh/include/asm/thread_info.h2
-rw-r--r--arch/sh/include/mach-se/mach/se7724.h5
-rw-r--r--arch/sh/mm/fault_32.c61
-rw-r--r--arch/sh/mm/tlb-sh3.c1
-rw-r--r--arch/sh/mm/tlbflush_64.c15
-rw-r--r--arch/sparc/boot/Makefile6
-rw-r--r--arch/sparc/boot/piggyback_32.c4
-rw-r--r--arch/sparc/boot/piggyback_64.c1
-rw-r--r--arch/sparc/include/asm/thread_info_32.h4
-rw-r--r--arch/sparc/include/asm/thread_info_64.h4
-rw-r--r--arch/sparc/kernel/irq_64.c45
-rw-r--r--arch/sparc/kernel/ptrace_32.c1
-rw-r--r--arch/sparc/kernel/ptrace_64.c1
-rw-r--r--arch/sparc/kernel/time_64.c1
-rw-r--r--arch/sparc/kernel/traps_32.c1
-rw-r--r--arch/sparc/kernel/vio.c7
-rw-r--r--arch/um/drivers/slip_kern.c1
-rw-r--r--arch/um/drivers/slirp_kern.c1
-rw-r--r--arch/um/include/asm/dma-mapping.h4
-rw-r--r--arch/um/include/asm/thread_info.h2
-rw-r--r--arch/um/kernel/sysrq.c4
-rw-r--r--arch/x86/Kconfig13
-rw-r--r--arch/x86/boot/video-bios.c3
-rw-r--r--arch/x86/boot/video-vesa.c4
-rw-r--r--arch/x86/include/asm/atomic_32.h185
-rw-r--r--arch/x86/include/asm/atomic_64.h42
-rw-r--r--arch/x86/include/asm/boot.h6
-rw-r--r--arch/x86/include/asm/fixmap.h10
-rw-r--r--arch/x86/include/asm/io_apic.h2
-rw-r--r--arch/x86/include/asm/lguest_hcall.h2
-rw-r--r--arch/x86/include/asm/msr-index.h4
-rw-r--r--arch/x86/include/asm/nmi.h1
-rw-r--r--arch/x86/include/asm/pci.h2
-rw-r--r--arch/x86/include/asm/percpu.h10
-rw-r--r--arch/x86/include/asm/perf_counter.h3
-rw-r--r--arch/x86/include/asm/proto.h11
-rw-r--r--arch/x86/include/asm/spinlock.h4
-rw-r--r--arch/x86/include/asm/stacktrace.h2
-rw-r--r--arch/x86/include/asm/thread_info.h2
-rw-r--r--arch/x86/kernel/Makefile2
-rw-r--r--arch/x86/kernel/amd_iommu.c4
-rw-r--r--arch/x86/kernel/amd_iommu_init.c13
-rw-r--r--arch/x86/kernel/apic/apic.c2
-rw-r--r--arch/x86/kernel/apic/es7000_32.c3
-rw-r--r--arch/x86/kernel/apic/io_apic.c44
-rw-r--r--arch/x86/kernel/apic/numaq_32.c3
-rw-r--r--arch/x86/kernel/cpu/amd.c4
-rw-r--r--arch/x86/kernel/cpu/common.c3
-rw-r--r--arch/x86/kernel/cpu/cpufreq/powernow-k8.c32
-rw-r--r--arch/x86/kernel/cpu/cpufreq/powernow-k8.h3
-rw-r--r--arch/x86/kernel/cpu/mcheck/mce.c16
-rw-r--r--arch/x86/kernel/cpu/perf_counter.c283
-rw-r--r--arch/x86/kernel/cpu/perfctr-watchdog.c5
-rw-r--r--arch/x86/kernel/dumpstack.c1
-rw-r--r--arch/x86/kernel/dumpstack_32.c6
-rw-r--r--arch/x86/kernel/dumpstack_64.c22
-rw-r--r--arch/x86/kernel/e820.c23
-rw-r--r--arch/x86/kernel/kvm.c2
-rw-r--r--arch/x86/kernel/pci-dma.c2
-rw-r--r--arch/x86/kernel/pci-gart_64.c2
-rw-r--r--arch/x86/kernel/pvclock.c2
-rw-r--r--arch/x86/kernel/setup.c16
-rw-r--r--arch/x86/kernel/setup_percpu.c219
-rw-r--r--arch/x86/kernel/tlb_uv.c9
-rw-r--r--arch/x86/kernel/traps.c3
-rw-r--r--arch/x86/kvm/mmu.c6
-rw-r--r--arch/x86/kvm/paging_tmpl.h2
-rw-r--r--arch/x86/kvm/vmx.c15
-rw-r--r--arch/x86/kvm/x86.c1
-rw-r--r--arch/x86/kvm/x86_emulate.c2
-rw-r--r--arch/x86/lguest/boot.c7
-rw-r--r--arch/x86/lib/Makefile1
-rw-r--r--arch/x86/lib/atomic64_32.c230
-rw-r--r--arch/x86/lib/clear_page_64.S5
-rw-r--r--arch/x86/lib/copy_user_64.S1
-rw-r--r--arch/x86/lib/delay.c3
-rw-r--r--arch/x86/lib/usercopy_32.c2
-rw-r--r--arch/x86/mm/fault.c11
-rw-r--r--arch/x86/mm/init.c18
-rw-r--r--arch/x86/mm/init_64.c9
-rw-r--r--arch/x86/mm/pageattr.c65
-rw-r--r--arch/x86/oprofile/nmi_int.c2
-rw-r--r--arch/x86/pci/acpi.c59
-rw-r--r--arch/x86/pci/amd_bus.c8
-rw-r--r--arch/x86/pci/i386.c7
-rw-r--r--arch/x86/power/Makefile2
-rw-r--r--arch/x86/power/cpu.c2
-rw-r--r--arch/xtensa/include/asm/thread_info.h4
-rw-r--r--arch/xtensa/kernel/traps.c6
495 files changed, 8428 insertions, 4305 deletions
diff --git a/arch/alpha/include/asm/percpu.h b/arch/alpha/include/asm/percpu.h
index 06c5c7a4afd3..b663f1f10b6a 100644
--- a/arch/alpha/include/asm/percpu.h
+++ b/arch/alpha/include/asm/percpu.h
@@ -30,7 +30,7 @@ extern unsigned long __per_cpu_offset[NR_CPUS];
30 30
31#ifndef MODULE 31#ifndef MODULE
32#define SHIFT_PERCPU_PTR(var, offset) RELOC_HIDE(&per_cpu_var(var), (offset)) 32#define SHIFT_PERCPU_PTR(var, offset) RELOC_HIDE(&per_cpu_var(var), (offset))
33#define PER_CPU_ATTRIBUTES 33#define PER_CPU_DEF_ATTRIBUTES
34#else 34#else
35/* 35/*
36 * To calculate addresses of locally defined variables, GCC uses 32-bit 36 * To calculate addresses of locally defined variables, GCC uses 32-bit
@@ -49,7 +49,7 @@ extern unsigned long __per_cpu_offset[NR_CPUS];
49 : "=&r"(__ptr), "=&r"(tmp_gp)); \ 49 : "=&r"(__ptr), "=&r"(tmp_gp)); \
50 (typeof(&per_cpu_var(var)))(__ptr + (offset)); }) 50 (typeof(&per_cpu_var(var)))(__ptr + (offset)); })
51 51
52#define PER_CPU_ATTRIBUTES __used 52#define PER_CPU_DEF_ATTRIBUTES __used
53 53
54#endif /* MODULE */ 54#endif /* MODULE */
55 55
@@ -71,7 +71,7 @@ extern unsigned long __per_cpu_offset[NR_CPUS];
71#define __get_cpu_var(var) per_cpu_var(var) 71#define __get_cpu_var(var) per_cpu_var(var)
72#define __raw_get_cpu_var(var) per_cpu_var(var) 72#define __raw_get_cpu_var(var) per_cpu_var(var)
73 73
74#define PER_CPU_ATTRIBUTES 74#define PER_CPU_DEF_ATTRIBUTES
75 75
76#endif /* SMP */ 76#endif /* SMP */
77 77
diff --git a/arch/alpha/include/asm/thread_info.h b/arch/alpha/include/asm/thread_info.h
index d069526bd767..60c83abfde70 100644
--- a/arch/alpha/include/asm/thread_info.h
+++ b/arch/alpha/include/asm/thread_info.h
@@ -37,6 +37,7 @@ struct thread_info {
37 .task = &tsk, \ 37 .task = &tsk, \
38 .exec_domain = &default_exec_domain, \ 38 .exec_domain = &default_exec_domain, \
39 .addr_limit = KERNEL_DS, \ 39 .addr_limit = KERNEL_DS, \
40 .preempt_count = INIT_PREEMPT_COUNT, \
40 .restart_block = { \ 41 .restart_block = { \
41 .fn = do_no_restart_syscall, \ 42 .fn = do_no_restart_syscall, \
42 }, \ 43 }, \
diff --git a/arch/alpha/kernel/ptrace.c b/arch/alpha/kernel/ptrace.c
index 1e9ad52c460e..e072041d19f8 100644
--- a/arch/alpha/kernel/ptrace.c
+++ b/arch/alpha/kernel/ptrace.c
@@ -8,7 +8,6 @@
8#include <linux/sched.h> 8#include <linux/sched.h>
9#include <linux/mm.h> 9#include <linux/mm.h>
10#include <linux/smp.h> 10#include <linux/smp.h>
11#include <linux/smp_lock.h>
12#include <linux/errno.h> 11#include <linux/errno.h>
13#include <linux/ptrace.h> 12#include <linux/ptrace.h>
14#include <linux/user.h> 13#include <linux/user.h>
diff --git a/arch/arm/Kconfig.debug b/arch/arm/Kconfig.debug
index a71fd941ade7..a89e4734b8f0 100644
--- a/arch/arm/Kconfig.debug
+++ b/arch/arm/Kconfig.debug
@@ -99,14 +99,6 @@ config DEBUG_CLPS711X_UART2
99 output to the second serial port on these devices. Saying N will 99 output to the second serial port on these devices. Saying N will
100 cause the debug messages to appear on the first serial port. 100 cause the debug messages to appear on the first serial port.
101 101
102config DEBUG_S3C_PORT
103 depends on DEBUG_LL && PLAT_S3C
104 bool "Kernel low-level debugging messages via S3C UART"
105 help
106 Say Y here if you want debug print routines to go to one of the
107 S3C internal UARTs. The chosen UART must have been configured
108 before it is used.
109
110config DEBUG_S3C_UART 102config DEBUG_S3C_UART
111 depends on PLAT_S3C 103 depends on PLAT_S3C
112 int "S3C UART to use for low-level debug" 104 int "S3C UART to use for low-level debug"
diff --git a/arch/arm/boot/compressed/misc.c b/arch/arm/boot/compressed/misc.c
index 9e6e512f0117..17153b54613b 100644
--- a/arch/arm/boot/compressed/misc.c
+++ b/arch/arm/boot/compressed/misc.c
@@ -29,7 +29,6 @@ unsigned int __machine_arch_type;
29 29
30static void putstr(const char *ptr); 30static void putstr(const char *ptr);
31 31
32#include <linux/compiler.h>
33#include <mach/uncompress.h> 32#include <mach/uncompress.h>
34 33
35#ifdef CONFIG_DEBUG_ICEDCC 34#ifdef CONFIG_DEBUG_ICEDCC
diff --git a/arch/arm/configs/kb9202_defconfig b/arch/arm/configs/kb9202_defconfig
index 8e74c66f239d..605a8462f172 100644
--- a/arch/arm/configs/kb9202_defconfig
+++ b/arch/arm/configs/kb9202_defconfig
@@ -1,109 +1,246 @@
1# 1#
2# Automatically generated make config: don't edit 2# Automatically generated make config: don't edit
3# Linux kernel version: 2.6.13-rc2 3# Linux kernel version: 2.6.30-rc8
4# Sun Aug 14 19:26:59 2005 4# Wed Jun 3 13:52:33 2009
5# 5#
6CONFIG_ARM=y 6CONFIG_ARM=y
7CONFIG_SYS_SUPPORTS_APM_EMULATION=y
8CONFIG_GENERIC_GPIO=y
9CONFIG_GENERIC_TIME=y
10CONFIG_GENERIC_CLOCKEVENTS=y
7CONFIG_MMU=y 11CONFIG_MMU=y
8CONFIG_UID16=y 12# CONFIG_NO_IOPORT is not set
13CONFIG_GENERIC_HARDIRQS=y
14CONFIG_STACKTRACE_SUPPORT=y
15CONFIG_HAVE_LATENCYTOP_SUPPORT=y
16CONFIG_LOCKDEP_SUPPORT=y
17CONFIG_TRACE_IRQFLAGS_SUPPORT=y
18CONFIG_HARDIRQS_SW_RESEND=y
19CONFIG_GENERIC_IRQ_PROBE=y
9CONFIG_RWSEM_GENERIC_SPINLOCK=y 20CONFIG_RWSEM_GENERIC_SPINLOCK=y
21# CONFIG_ARCH_HAS_ILOG2_U32 is not set
22# CONFIG_ARCH_HAS_ILOG2_U64 is not set
23CONFIG_GENERIC_HWEIGHT=y
10CONFIG_GENERIC_CALIBRATE_DELAY=y 24CONFIG_GENERIC_CALIBRATE_DELAY=y
25CONFIG_GENERIC_HARDIRQS_NO__DO_IRQ=y
26CONFIG_VECTORS_BASE=0xffff0000
27CONFIG_DEFCONFIG_LIST="/lib/modules/$UNAME_RELEASE/.config"
11 28
12# 29#
13# Code maturity level options 30# General setup
14# 31#
15# CONFIG_EXPERIMENTAL is not set 32CONFIG_EXPERIMENTAL=y
16CONFIG_CLEAN_COMPILE=y
17CONFIG_BROKEN_ON_SMP=y 33CONFIG_BROKEN_ON_SMP=y
34CONFIG_LOCK_KERNEL=y
18CONFIG_INIT_ENV_ARG_LIMIT=32 35CONFIG_INIT_ENV_ARG_LIMIT=32
19
20#
21# General setup
22#
23CONFIG_LOCALVERSION="" 36CONFIG_LOCALVERSION=""
37CONFIG_LOCALVERSION_AUTO=y
24# CONFIG_SWAP is not set 38# CONFIG_SWAP is not set
25# CONFIG_SYSVIPC is not set 39CONFIG_SYSVIPC=y
26# CONFIG_BSD_PROCESS_ACCT is not set 40CONFIG_SYSVIPC_SYSCTL=y
41CONFIG_POSIX_MQUEUE=y
42CONFIG_POSIX_MQUEUE_SYSCTL=y
43CONFIG_BSD_PROCESS_ACCT=y
44# CONFIG_BSD_PROCESS_ACCT_V3 is not set
45# CONFIG_TASKSTATS is not set
46CONFIG_AUDIT=y
47
48#
49# RCU Subsystem
50#
51CONFIG_CLASSIC_RCU=y
52# CONFIG_TREE_RCU is not set
53# CONFIG_PREEMPT_RCU is not set
54# CONFIG_TREE_RCU_TRACE is not set
55# CONFIG_PREEMPT_RCU_TRACE is not set
56CONFIG_IKCONFIG=y
57CONFIG_IKCONFIG_PROC=y
58CONFIG_LOG_BUF_SHIFT=17
59# CONFIG_GROUP_SCHED is not set
60# CONFIG_CGROUPS is not set
61# CONFIG_SYSFS_DEPRECATED_V2 is not set
62# CONFIG_RELAY is not set
63CONFIG_NAMESPACES=y
64# CONFIG_UTS_NS is not set
65# CONFIG_IPC_NS is not set
66# CONFIG_USER_NS is not set
67# CONFIG_PID_NS is not set
68# CONFIG_NET_NS is not set
69CONFIG_BLK_DEV_INITRD=y
70CONFIG_INITRAMFS_SOURCE=""
71CONFIG_RD_GZIP=y
72CONFIG_RD_BZIP2=y
73CONFIG_RD_LZMA=y
74CONFIG_CC_OPTIMIZE_FOR_SIZE=y
27CONFIG_SYSCTL=y 75CONFIG_SYSCTL=y
28# CONFIG_AUDIT is not set 76CONFIG_ANON_INODES=y
29CONFIG_HOTPLUG=y
30# CONFIG_KOBJECT_UEVENT is not set
31# CONFIG_IKCONFIG is not set
32# CONFIG_EMBEDDED is not set 77# CONFIG_EMBEDDED is not set
78CONFIG_UID16=y
79CONFIG_SYSCTL_SYSCALL=y
33CONFIG_KALLSYMS=y 80CONFIG_KALLSYMS=y
34# CONFIG_KALLSYMS_ALL is not set 81# CONFIG_KALLSYMS_ALL is not set
35# CONFIG_KALLSYMS_EXTRA_PASS is not set 82CONFIG_KALLSYMS_EXTRA_PASS=y
83# CONFIG_STRIP_ASM_SYMS is not set
84CONFIG_HOTPLUG=y
36CONFIG_PRINTK=y 85CONFIG_PRINTK=y
37CONFIG_BUG=y 86CONFIG_BUG=y
87CONFIG_ELF_CORE=y
38CONFIG_BASE_FULL=y 88CONFIG_BASE_FULL=y
39CONFIG_FUTEX=y 89CONFIG_FUTEX=y
40CONFIG_EPOLL=y 90CONFIG_EPOLL=y
41CONFIG_CC_OPTIMIZE_FOR_SIZE=y 91CONFIG_SIGNALFD=y
92CONFIG_TIMERFD=y
93CONFIG_EVENTFD=y
42CONFIG_SHMEM=y 94CONFIG_SHMEM=y
43CONFIG_CC_ALIGN_FUNCTIONS=0 95CONFIG_AIO=y
44CONFIG_CC_ALIGN_LABELS=0 96CONFIG_VM_EVENT_COUNTERS=y
45CONFIG_CC_ALIGN_LOOPS=0 97CONFIG_SLUB_DEBUG=y
46CONFIG_CC_ALIGN_JUMPS=0 98CONFIG_COMPAT_BRK=y
47# CONFIG_TINY_SHMEM is not set 99# CONFIG_SLAB is not set
100CONFIG_SLUB=y
101# CONFIG_SLOB is not set
102# CONFIG_PROFILING is not set
103CONFIG_TRACEPOINTS=y
104CONFIG_MARKERS=y
105CONFIG_HAVE_OPROFILE=y
106# CONFIG_KPROBES is not set
107CONFIG_HAVE_KPROBES=y
108CONFIG_HAVE_KRETPROBES=y
109CONFIG_HAVE_CLK=y
110# CONFIG_SLOW_WORK is not set
111CONFIG_HAVE_GENERIC_DMA_COHERENT=y
112CONFIG_SLABINFO=y
113CONFIG_RT_MUTEXES=y
48CONFIG_BASE_SMALL=0 114CONFIG_BASE_SMALL=0
115CONFIG_MODULES=y
116# CONFIG_MODULE_FORCE_LOAD is not set
117CONFIG_MODULE_UNLOAD=y
118# CONFIG_MODULE_FORCE_UNLOAD is not set
119CONFIG_MODVERSIONS=y
120CONFIG_MODULE_SRCVERSION_ALL=y
121CONFIG_BLOCK=y
122# CONFIG_LBD is not set
123# CONFIG_BLK_DEV_BSG is not set
124# CONFIG_BLK_DEV_INTEGRITY is not set
49 125
50# 126#
51# Loadable module support 127# IO Schedulers
52# 128#
53CONFIG_MODULES=y 129CONFIG_IOSCHED_NOOP=y
54CONFIG_MODULE_UNLOAD=y 130# CONFIG_IOSCHED_AS is not set
55CONFIG_OBSOLETE_MODPARM=y 131# CONFIG_IOSCHED_DEADLINE is not set
56# CONFIG_MODULE_SRCVERSION_ALL is not set 132CONFIG_IOSCHED_CFQ=y
57CONFIG_KMOD=y 133# CONFIG_DEFAULT_AS is not set
134# CONFIG_DEFAULT_DEADLINE is not set
135CONFIG_DEFAULT_CFQ=y
136# CONFIG_DEFAULT_NOOP is not set
137CONFIG_DEFAULT_IOSCHED="cfq"
138# CONFIG_FREEZER is not set
58 139
59# 140#
60# System Type 141# System Type
61# 142#
62# CONFIG_ARCH_CLPS7500 is not set 143# CONFIG_ARCH_AAEC2000 is not set
144# CONFIG_ARCH_INTEGRATOR is not set
145# CONFIG_ARCH_REALVIEW is not set
146# CONFIG_ARCH_VERSATILE is not set
147CONFIG_ARCH_AT91=y
63# CONFIG_ARCH_CLPS711X is not set 148# CONFIG_ARCH_CLPS711X is not set
64# CONFIG_ARCH_CO285 is not set
65# CONFIG_ARCH_EBSA110 is not set 149# CONFIG_ARCH_EBSA110 is not set
150# CONFIG_ARCH_EP93XX is not set
151# CONFIG_ARCH_GEMINI is not set
66# CONFIG_ARCH_FOOTBRIDGE is not set 152# CONFIG_ARCH_FOOTBRIDGE is not set
67# CONFIG_ARCH_INTEGRATOR is not set 153# CONFIG_ARCH_NETX is not set
68# CONFIG_ARCH_IOP3XX is not set 154# CONFIG_ARCH_H720X is not set
69# CONFIG_ARCH_IXP4XX is not set 155# CONFIG_ARCH_IMX is not set
156# CONFIG_ARCH_IOP13XX is not set
157# CONFIG_ARCH_IOP32X is not set
158# CONFIG_ARCH_IOP33X is not set
159# CONFIG_ARCH_IXP23XX is not set
70# CONFIG_ARCH_IXP2000 is not set 160# CONFIG_ARCH_IXP2000 is not set
161# CONFIG_ARCH_IXP4XX is not set
71# CONFIG_ARCH_L7200 is not set 162# CONFIG_ARCH_L7200 is not set
163# CONFIG_ARCH_KIRKWOOD is not set
164# CONFIG_ARCH_KS8695 is not set
165# CONFIG_ARCH_NS9XXX is not set
166# CONFIG_ARCH_LOKI is not set
167# CONFIG_ARCH_MV78XX0 is not set
168# CONFIG_ARCH_MXC is not set
169# CONFIG_ARCH_ORION5X is not set
170# CONFIG_ARCH_PNX4008 is not set
72# CONFIG_ARCH_PXA is not set 171# CONFIG_ARCH_PXA is not set
172# CONFIG_ARCH_MMP is not set
73# CONFIG_ARCH_RPC is not set 173# CONFIG_ARCH_RPC is not set
74# CONFIG_ARCH_SA1100 is not set 174# CONFIG_ARCH_SA1100 is not set
75# CONFIG_ARCH_S3C2410 is not set 175# CONFIG_ARCH_S3C2410 is not set
176# CONFIG_ARCH_S3C64XX is not set
76# CONFIG_ARCH_SHARK is not set 177# CONFIG_ARCH_SHARK is not set
77# CONFIG_ARCH_LH7A40X is not set 178# CONFIG_ARCH_LH7A40X is not set
179# CONFIG_ARCH_DAVINCI is not set
78# CONFIG_ARCH_OMAP is not set 180# CONFIG_ARCH_OMAP is not set
79# CONFIG_ARCH_VERSATILE is not set 181# CONFIG_ARCH_MSM is not set
80# CONFIG_ARCH_IMX is not set 182# CONFIG_ARCH_W90X900 is not set
81# CONFIG_ARCH_H720X is not set 183
82# CONFIG_ARCH_AAEC2000 is not set 184#
83CONFIG_ARCH_AT91=y 185# Atmel AT91 System-on-Chip
186#
84CONFIG_ARCH_AT91RM9200=y 187CONFIG_ARCH_AT91RM9200=y
188# CONFIG_ARCH_AT91SAM9260 is not set
189# CONFIG_ARCH_AT91SAM9261 is not set
190# CONFIG_ARCH_AT91SAM9263 is not set
191# CONFIG_ARCH_AT91SAM9RL is not set
192# CONFIG_ARCH_AT91SAM9G20 is not set
193# CONFIG_ARCH_AT91CAP9 is not set
194# CONFIG_ARCH_AT91X40 is not set
195CONFIG_AT91_PMC_UNIT=y
85 196
86# 197#
87# AT91RM9200 Implementations 198# AT91RM9200 Board Type
88# 199#
200# CONFIG_MACH_ONEARM is not set
89# CONFIG_ARCH_AT91RM9200DK is not set 201# CONFIG_ARCH_AT91RM9200DK is not set
90# CONFIG_MACH_AT91RM9200EK is not set 202# CONFIG_MACH_AT91RM9200EK is not set
91# CONFIG_MACH_CSB337 is not set 203# CONFIG_MACH_CSB337 is not set
92# CONFIG_MACH_CSB637 is not set 204# CONFIG_MACH_CSB637 is not set
93# CONFIG_MACH_CARMEVA is not set 205# CONFIG_MACH_CARMEVA is not set
206# CONFIG_MACH_ATEB9200 is not set
94CONFIG_MACH_KB9200=y 207CONFIG_MACH_KB9200=y
208# CONFIG_MACH_PICOTUX2XX is not set
209# CONFIG_MACH_KAFA is not set
210# CONFIG_MACH_ECBAT91 is not set
211# CONFIG_MACH_YL9200 is not set
212
213#
214# AT91 Board Options
215#
216
217#
218# AT91 Feature Selections
219#
220CONFIG_AT91_PROGRAMMABLE_CLOCKS=y
221CONFIG_AT91_TIMER_HZ=128
222CONFIG_AT91_EARLY_DBGU=y
223# CONFIG_AT91_EARLY_USART0 is not set
224# CONFIG_AT91_EARLY_USART1 is not set
225# CONFIG_AT91_EARLY_USART2 is not set
226# CONFIG_AT91_EARLY_USART3 is not set
227# CONFIG_AT91_EARLY_USART4 is not set
228# CONFIG_AT91_EARLY_USART5 is not set
95 229
96# 230#
97# Processor Type 231# Processor Type
98# 232#
99CONFIG_CPU_32=y 233CONFIG_CPU_32=y
100CONFIG_CPU_ARM920T=y 234CONFIG_CPU_ARM920T=y
101CONFIG_CPU_32v4=y 235CONFIG_CPU_32v4T=y
102CONFIG_CPU_ABRT_EV4T=y 236CONFIG_CPU_ABRT_EV4T=y
237CONFIG_CPU_PABRT_NOIFAR=y
103CONFIG_CPU_CACHE_V4WT=y 238CONFIG_CPU_CACHE_V4WT=y
104CONFIG_CPU_CACHE_VIVT=y 239CONFIG_CPU_CACHE_VIVT=y
105CONFIG_CPU_COPY_V4WB=y 240CONFIG_CPU_COPY_V4WB=y
106CONFIG_CPU_TLB_V4WBI=y 241CONFIG_CPU_TLB_V4WBI=y
242CONFIG_CPU_CP15=y
243CONFIG_CPU_CP15_MMU=y
107 244
108# 245#
109# Processor Features 246# Processor Features
@@ -112,23 +249,48 @@ CONFIG_ARM_THUMB=y
112# CONFIG_CPU_ICACHE_DISABLE is not set 249# CONFIG_CPU_ICACHE_DISABLE is not set
113# CONFIG_CPU_DCACHE_DISABLE is not set 250# CONFIG_CPU_DCACHE_DISABLE is not set
114# CONFIG_CPU_DCACHE_WRITETHROUGH is not set 251# CONFIG_CPU_DCACHE_WRITETHROUGH is not set
252# CONFIG_OUTER_CACHE is not set
115 253
116# 254#
117# Bus support 255# Bus support
118# 256#
119CONFIG_ISA_DMA_API=y 257# CONFIG_PCI_SYSCALL is not set
120 258# CONFIG_ARCH_SUPPORTS_MSI is not set
121#
122# PCCARD (PCMCIA/CardBus) support
123#
124# CONFIG_PCCARD is not set 259# CONFIG_PCCARD is not set
125 260
126# 261#
127# Kernel Features 262# Kernel Features
128# 263#
129# CONFIG_ARCH_DISCONTIGMEM_ENABLE is not set 264CONFIG_TICK_ONESHOT=y
265CONFIG_NO_HZ=y
266CONFIG_HIGH_RES_TIMERS=y
267CONFIG_GENERIC_CLOCKEVENTS_BUILD=y
268CONFIG_VMSPLIT_3G=y
269# CONFIG_VMSPLIT_2G is not set
270# CONFIG_VMSPLIT_1G is not set
271CONFIG_PAGE_OFFSET=0xC0000000
272CONFIG_PREEMPT=y
273CONFIG_HZ=128
274CONFIG_AEABI=y
275CONFIG_OABI_COMPAT=y
276# CONFIG_ARCH_HAS_HOLES_MEMORYMODEL is not set
277# CONFIG_ARCH_SPARSEMEM_DEFAULT is not set
278# CONFIG_ARCH_SELECT_MEMORY_MODEL is not set
279# CONFIG_HIGHMEM is not set
280CONFIG_SELECT_MEMORY_MODEL=y
281CONFIG_FLATMEM_MANUAL=y
282# CONFIG_DISCONTIGMEM_MANUAL is not set
283# CONFIG_SPARSEMEM_MANUAL is not set
130CONFIG_FLATMEM=y 284CONFIG_FLATMEM=y
131CONFIG_FLAT_NODE_MEM_MAP=y 285CONFIG_FLAT_NODE_MEM_MAP=y
286CONFIG_PAGEFLAGS_EXTENDED=y
287CONFIG_SPLIT_PTLOCK_CPUS=4096
288# CONFIG_PHYS_ADDR_T_64BIT is not set
289CONFIG_ZONE_DMA_FLAG=0
290CONFIG_VIRT_TO_BUS=y
291CONFIG_UNEVICTABLE_LRU=y
292CONFIG_HAVE_MLOCK=y
293CONFIG_HAVE_MLOCKED_PAGE_BIT=y
132# CONFIG_LEDS is not set 294# CONFIG_LEDS is not set
133CONFIG_ALIGNMENT_TRAP=y 295CONFIG_ALIGNMENT_TRAP=y
134 296
@@ -137,8 +299,16 @@ CONFIG_ALIGNMENT_TRAP=y
137# 299#
138CONFIG_ZBOOT_ROM_TEXT=0x10000000 300CONFIG_ZBOOT_ROM_TEXT=0x10000000
139CONFIG_ZBOOT_ROM_BSS=0x20040000 301CONFIG_ZBOOT_ROM_BSS=0x20040000
140CONFIG_ZBOOT_ROM=y 302# CONFIG_ZBOOT_ROM is not set
141CONFIG_CMDLINE="console=ttyS0,115200 root=/dev/ram rw initrd=0x20210000,654933" 303CONFIG_CMDLINE="noinitrd root=/dev/mtdblock0 rootfstype=jffs2 mem=64M"
304# CONFIG_XIP_KERNEL is not set
305CONFIG_KEXEC=y
306CONFIG_ATAGS_PROC=y
307
308#
309# CPU Power Management
310#
311# CONFIG_CPU_IDLE is not set
142 312
143# 313#
144# Floating point emulation 314# Floating point emulation
@@ -149,74 +319,251 @@ CONFIG_CMDLINE="console=ttyS0,115200 root=/dev/ram rw initrd=0x20210000,654933"
149# 319#
150CONFIG_FPE_NWFPE=y 320CONFIG_FPE_NWFPE=y
151# CONFIG_FPE_NWFPE_XP is not set 321# CONFIG_FPE_NWFPE_XP is not set
322# CONFIG_FPE_FASTFPE is not set
152 323
153# 324#
154# Userspace binary formats 325# Userspace binary formats
155# 326#
156CONFIG_BINFMT_ELF=y 327CONFIG_BINFMT_ELF=y
157CONFIG_BINFMT_AOUT=y 328# CONFIG_CORE_DUMP_DEFAULT_ELF_HEADERS is not set
329CONFIG_HAVE_AOUT=y
330# CONFIG_BINFMT_AOUT is not set
158CONFIG_BINFMT_MISC=y 331CONFIG_BINFMT_MISC=y
159# CONFIG_ARTHUR is not set
160 332
161# 333#
162# Power management options 334# Power management options
163# 335#
164# CONFIG_PM is not set 336# CONFIG_PM is not set
337CONFIG_ARCH_SUSPEND_POSSIBLE=y
338CONFIG_NET=y
165 339
166# 340#
167# Device Drivers 341# Networking options
168# 342#
343CONFIG_PACKET=y
344# CONFIG_PACKET_MMAP is not set
345CONFIG_UNIX=y
346# CONFIG_NET_KEY is not set
347CONFIG_INET=y
348# CONFIG_IP_MULTICAST is not set
349# CONFIG_IP_ADVANCED_ROUTER is not set
350CONFIG_IP_FIB_HASH=y
351CONFIG_IP_PNP=y
352CONFIG_IP_PNP_DHCP=y
353CONFIG_IP_PNP_BOOTP=y
354# CONFIG_IP_PNP_RARP is not set
355# CONFIG_NET_IPIP is not set
356# CONFIG_NET_IPGRE is not set
357# CONFIG_ARPD is not set
358# CONFIG_SYN_COOKIES is not set
359# CONFIG_INET_AH is not set
360# CONFIG_INET_ESP is not set
361# CONFIG_INET_IPCOMP is not set
362# CONFIG_INET_XFRM_TUNNEL is not set
363# CONFIG_INET_TUNNEL is not set
364# CONFIG_INET_XFRM_MODE_TRANSPORT is not set
365# CONFIG_INET_XFRM_MODE_TUNNEL is not set
366# CONFIG_INET_XFRM_MODE_BEET is not set
367# CONFIG_INET_LRO is not set
368# CONFIG_INET_DIAG is not set
369# CONFIG_TCP_CONG_ADVANCED is not set
370CONFIG_TCP_CONG_CUBIC=y
371CONFIG_DEFAULT_TCP_CONG="cubic"
372# CONFIG_TCP_MD5SIG is not set
373# CONFIG_IPV6 is not set
374# CONFIG_NETWORK_SECMARK is not set
375# CONFIG_NETFILTER is not set
376# CONFIG_IP_DCCP is not set
377# CONFIG_IP_SCTP is not set
378# CONFIG_TIPC is not set
379# CONFIG_ATM is not set
380# CONFIG_BRIDGE is not set
381# CONFIG_NET_DSA is not set
382# CONFIG_VLAN_8021Q is not set
383# CONFIG_DECNET is not set
384# CONFIG_LLC2 is not set
385# CONFIG_IPX is not set
386# CONFIG_ATALK is not set
387# CONFIG_X25 is not set
388# CONFIG_LAPB is not set
389# CONFIG_ECONET is not set
390# CONFIG_WAN_ROUTER is not set
391# CONFIG_PHONET is not set
392# CONFIG_NET_SCHED is not set
393# CONFIG_DCB is not set
169 394
170# 395#
171# Generic Driver Options 396# Network testing
172# 397#
173CONFIG_STANDALONE=y 398# CONFIG_NET_PKTGEN is not set
174CONFIG_PREVENT_FIRMWARE_BUILD=y 399# CONFIG_NET_DROP_MONITOR is not set
175# CONFIG_FW_LOADER is not set 400# CONFIG_HAMRADIO is not set
176CONFIG_DEBUG_DRIVER=y 401# CONFIG_CAN is not set
402# CONFIG_IRDA is not set
403# CONFIG_BT is not set
404# CONFIG_AF_RXRPC is not set
405# CONFIG_WIRELESS is not set
406# CONFIG_WIMAX is not set
407# CONFIG_RFKILL is not set
408# CONFIG_NET_9P is not set
177 409
178# 410#
179# Memory Technology Devices (MTD) 411# Device Drivers
180# 412#
181# CONFIG_MTD is not set
182 413
183# 414#
184# Parallel port support 415# Generic Driver Options
185# 416#
417CONFIG_UEVENT_HELPER_PATH="/sbin/hotplug"
418CONFIG_STANDALONE=y
419CONFIG_PREVENT_FIRMWARE_BUILD=y
420CONFIG_FW_LOADER=y
421# CONFIG_FIRMWARE_IN_KERNEL is not set
422CONFIG_EXTRA_FIRMWARE=""
423# CONFIG_DEBUG_DRIVER is not set
424# CONFIG_DEBUG_DEVRES is not set
425# CONFIG_SYS_HYPERVISOR is not set
426# CONFIG_CONNECTOR is not set
427CONFIG_MTD=y
428# CONFIG_MTD_DEBUG is not set
429CONFIG_MTD_CONCAT=y
430CONFIG_MTD_PARTITIONS=y
431# CONFIG_MTD_TESTS is not set
432# CONFIG_MTD_REDBOOT_PARTS is not set
433CONFIG_MTD_CMDLINE_PARTS=y
434# CONFIG_MTD_AFS_PARTS is not set
435# CONFIG_MTD_AR7_PARTS is not set
436
437#
438# User Modules And Translation Layers
439#
440CONFIG_MTD_CHAR=y
441CONFIG_MTD_BLKDEVS=y
442CONFIG_MTD_BLOCK=y
443# CONFIG_FTL is not set
444# CONFIG_NFTL is not set
445# CONFIG_INFTL is not set
446# CONFIG_RFD_FTL is not set
447# CONFIG_SSFDC is not set
448# CONFIG_MTD_OOPS is not set
449
450#
451# RAM/ROM/Flash chip drivers
452#
453CONFIG_MTD_CFI=y
454# CONFIG_MTD_JEDECPROBE is not set
455CONFIG_MTD_GEN_PROBE=y
456# CONFIG_MTD_CFI_ADV_OPTIONS is not set
457CONFIG_MTD_MAP_BANK_WIDTH_1=y
458CONFIG_MTD_MAP_BANK_WIDTH_2=y
459CONFIG_MTD_MAP_BANK_WIDTH_4=y
460# CONFIG_MTD_MAP_BANK_WIDTH_8 is not set
461# CONFIG_MTD_MAP_BANK_WIDTH_16 is not set
462# CONFIG_MTD_MAP_BANK_WIDTH_32 is not set
463CONFIG_MTD_CFI_I1=y
464CONFIG_MTD_CFI_I2=y
465# CONFIG_MTD_CFI_I4 is not set
466# CONFIG_MTD_CFI_I8 is not set
467CONFIG_MTD_CFI_INTELEXT=y
468# CONFIG_MTD_CFI_AMDSTD is not set
469# CONFIG_MTD_CFI_STAA is not set
470CONFIG_MTD_CFI_UTIL=y
471# CONFIG_MTD_RAM is not set
472# CONFIG_MTD_ROM is not set
473# CONFIG_MTD_ABSENT is not set
474
475#
476# Mapping drivers for chip access
477#
478CONFIG_MTD_COMPLEX_MAPPINGS=y
479CONFIG_MTD_PHYSMAP=y
480# CONFIG_MTD_PHYSMAP_COMPAT is not set
481# CONFIG_MTD_ARM_INTEGRATOR is not set
482# CONFIG_MTD_PLATRAM is not set
483
484#
485# Self-contained MTD device drivers
486#
487# CONFIG_MTD_SLRAM is not set
488# CONFIG_MTD_PHRAM is not set
489# CONFIG_MTD_MTDRAM is not set
490# CONFIG_MTD_BLOCK2MTD is not set
491
492#
493# Disk-On-Chip Device Drivers
494#
495# CONFIG_MTD_DOC2000 is not set
496# CONFIG_MTD_DOC2001 is not set
497# CONFIG_MTD_DOC2001PLUS is not set
498CONFIG_MTD_NAND=y
499# CONFIG_MTD_NAND_VERIFY_WRITE is not set
500# CONFIG_MTD_NAND_ECC_SMC is not set
501# CONFIG_MTD_NAND_MUSEUM_IDS is not set
502# CONFIG_MTD_NAND_GPIO is not set
503CONFIG_MTD_NAND_IDS=y
504# CONFIG_MTD_NAND_DISKONCHIP is not set
505CONFIG_MTD_NAND_ATMEL=y
506# CONFIG_MTD_NAND_ATMEL_ECC_HW is not set
507CONFIG_MTD_NAND_ATMEL_ECC_SOFT=y
508# CONFIG_MTD_NAND_ATMEL_ECC_NONE is not set
509# CONFIG_MTD_NAND_NANDSIM is not set
510# CONFIG_MTD_NAND_PLATFORM is not set
511# CONFIG_MTD_ALAUDA is not set
512# CONFIG_MTD_ONENAND is not set
513
514#
515# LPDDR flash memory drivers
516#
517# CONFIG_MTD_LPDDR is not set
518
519#
520# UBI - Unsorted block images
521#
522CONFIG_MTD_UBI=y
523CONFIG_MTD_UBI_WL_THRESHOLD=4096
524CONFIG_MTD_UBI_BEB_RESERVE=1
525CONFIG_MTD_UBI_GLUEBI=y
526
527#
528# UBI debugging options
529#
530# CONFIG_MTD_UBI_DEBUG is not set
186# CONFIG_PARPORT is not set 531# CONFIG_PARPORT is not set
187 532CONFIG_BLK_DEV=y
188#
189# Plug and Play support
190#
191
192#
193# Block devices
194#
195# CONFIG_BLK_DEV_COW_COMMON is not set 533# CONFIG_BLK_DEV_COW_COMMON is not set
196CONFIG_BLK_DEV_LOOP=y 534CONFIG_BLK_DEV_LOOP=y
197# CONFIG_BLK_DEV_CRYPTOLOOP is not set 535# CONFIG_BLK_DEV_CRYPTOLOOP is not set
198CONFIG_BLK_DEV_NBD=y 536# CONFIG_BLK_DEV_NBD is not set
199# CONFIG_BLK_DEV_UB is not set 537# CONFIG_BLK_DEV_UB is not set
200CONFIG_BLK_DEV_RAM=y 538CONFIG_BLK_DEV_RAM=y
201CONFIG_BLK_DEV_RAM_COUNT=16 539CONFIG_BLK_DEV_RAM_COUNT=16
202CONFIG_BLK_DEV_RAM_SIZE=4096 540CONFIG_BLK_DEV_RAM_SIZE=16384
203CONFIG_BLK_DEV_INITRD=y 541# CONFIG_BLK_DEV_XIP is not set
204CONFIG_INITRAMFS_SOURCE=""
205# CONFIG_CDROM_PKTCDVD is not set 542# CONFIG_CDROM_PKTCDVD is not set
543# CONFIG_ATA_OVER_ETH is not set
544CONFIG_MISC_DEVICES=y
545CONFIG_ATMEL_TCLIB=y
546CONFIG_ATMEL_TCB_CLKSRC=y
547CONFIG_ATMEL_TCB_CLKSRC_BLOCK=0
548CONFIG_ATMEL_SSC=y
549# CONFIG_ENCLOSURE_SERVICES is not set
550# CONFIG_C2PORT is not set
206 551
207# 552#
208# IO Schedulers 553# EEPROM support
209# 554#
210CONFIG_IOSCHED_NOOP=y 555# CONFIG_EEPROM_93CX6 is not set
211CONFIG_IOSCHED_AS=y 556CONFIG_HAVE_IDE=y
212CONFIG_IOSCHED_DEADLINE=y 557# CONFIG_IDE is not set
213CONFIG_IOSCHED_CFQ=y
214# CONFIG_ATA_OVER_ETH is not set
215 558
216# 559#
217# SCSI device support 560# SCSI device support
218# 561#
562# CONFIG_RAID_ATTRS is not set
219CONFIG_SCSI=y 563CONFIG_SCSI=y
564CONFIG_SCSI_DMA=y
565# CONFIG_SCSI_TGT is not set
566# CONFIG_SCSI_NETLINK is not set
220CONFIG_SCSI_PROC_FS=y 567CONFIG_SCSI_PROC_FS=y
221 568
222# 569#
@@ -232,145 +579,87 @@ CONFIG_CHR_DEV_SG=y
232# 579#
233# Some SCSI devices (e.g. CD jukebox) support multiple LUNs 580# Some SCSI devices (e.g. CD jukebox) support multiple LUNs
234# 581#
235# CONFIG_SCSI_MULTI_LUN is not set 582CONFIG_SCSI_MULTI_LUN=y
236# CONFIG_SCSI_CONSTANTS is not set 583CONFIG_SCSI_CONSTANTS=y
237# CONFIG_SCSI_LOGGING is not set 584CONFIG_SCSI_LOGGING=y
585# CONFIG_SCSI_SCAN_ASYNC is not set
586CONFIG_SCSI_WAIT_SCAN=m
238 587
239# 588#
240# SCSI Transport Attributes 589# SCSI Transports
241# 590#
242# CONFIG_SCSI_SPI_ATTRS is not set 591CONFIG_SCSI_SPI_ATTRS=m
243# CONFIG_SCSI_FC_ATTRS is not set 592# CONFIG_SCSI_FC_ATTRS is not set
244# CONFIG_SCSI_ISCSI_ATTRS is not set 593# CONFIG_SCSI_ISCSI_ATTRS is not set
245 594# CONFIG_SCSI_SAS_LIBSAS is not set
246# 595# CONFIG_SCSI_SRP_ATTRS is not set
247# SCSI low-level drivers 596# CONFIG_SCSI_LOWLEVEL is not set
248# 597# CONFIG_SCSI_DH is not set
249# CONFIG_SCSI_SATA is not set 598# CONFIG_SCSI_OSD_INITIATOR is not set
250# CONFIG_SCSI_DEBUG is not set 599# CONFIG_ATA is not set
251
252#
253# Multi-device support (RAID and LVM)
254#
255# CONFIG_MD is not set 600# CONFIG_MD is not set
256
257#
258# Fusion MPT device support
259#
260# CONFIG_FUSION is not set
261
262#
263# IEEE 1394 (FireWire) support
264#
265
266#
267# I2O device support
268#
269
270#
271# Networking support
272#
273CONFIG_NET=y
274
275#
276# Networking options
277#
278CONFIG_PACKET=y
279# CONFIG_PACKET_MMAP is not set
280CONFIG_UNIX=y
281# CONFIG_NET_KEY is not set
282CONFIG_INET=y
283CONFIG_IP_MULTICAST=y
284# CONFIG_IP_ADVANCED_ROUTER is not set
285CONFIG_IP_FIB_HASH=y
286CONFIG_IP_PNP=y
287CONFIG_IP_PNP_DHCP=y
288# CONFIG_IP_PNP_BOOTP is not set
289# CONFIG_IP_PNP_RARP is not set
290# CONFIG_NET_IPIP is not set
291# CONFIG_NET_IPGRE is not set
292# CONFIG_IP_MROUTE is not set
293# CONFIG_SYN_COOKIES is not set
294# CONFIG_INET_AH is not set
295# CONFIG_INET_ESP is not set
296# CONFIG_INET_IPCOMP is not set
297# CONFIG_INET_TUNNEL is not set
298# CONFIG_IP_TCPDIAG is not set
299# CONFIG_IP_TCPDIAG_IPV6 is not set
300# CONFIG_TCP_CONG_ADVANCED is not set
301CONFIG_TCP_CONG_BIC=y
302# CONFIG_IPV6 is not set
303# CONFIG_NETFILTER is not set
304# CONFIG_BRIDGE is not set
305# CONFIG_VLAN_8021Q is not set
306# CONFIG_DECNET is not set
307# CONFIG_LLC2 is not set
308# CONFIG_IPX is not set
309# CONFIG_ATALK is not set
310
311#
312# QoS and/or fair queueing
313#
314# CONFIG_NET_SCHED is not set
315# CONFIG_NET_CLS_ROUTE is not set
316
317#
318# Network testing
319#
320# CONFIG_NET_PKTGEN is not set
321# CONFIG_NETPOLL is not set
322# CONFIG_NET_POLL_CONTROLLER is not set
323# CONFIG_HAMRADIO is not set
324# CONFIG_IRDA is not set
325# CONFIG_BT is not set
326CONFIG_NETDEVICES=y 601CONFIG_NETDEVICES=y
602CONFIG_COMPAT_NET_DEV_OPS=y
327# CONFIG_DUMMY is not set 603# CONFIG_DUMMY is not set
328# CONFIG_BONDING is not set 604# CONFIG_BONDING is not set
605# CONFIG_MACVLAN is not set
329# CONFIG_EQUALIZER is not set 606# CONFIG_EQUALIZER is not set
330# CONFIG_TUN is not set 607# CONFIG_TUN is not set
331 608# CONFIG_VETH is not set
332# 609# CONFIG_PHYLIB is not set
333# Ethernet (10 or 100Mbit)
334#
335CONFIG_NET_ETHERNET=y 610CONFIG_NET_ETHERNET=y
336CONFIG_MII=y 611CONFIG_MII=y
337CONFIG_ARM_AT91_ETHER=y 612CONFIG_ARM_AT91_ETHER=y
613# CONFIG_AX88796 is not set
338# CONFIG_SMC91X is not set 614# CONFIG_SMC91X is not set
339# CONFIG_DM9000 is not set 615# CONFIG_DM9000 is not set
616# CONFIG_ETHOC is not set
617# CONFIG_SMC911X is not set
618# CONFIG_SMSC911X is not set
619# CONFIG_DNET is not set
620# CONFIG_IBM_NEW_EMAC_ZMII is not set
621# CONFIG_IBM_NEW_EMAC_RGMII is not set
622# CONFIG_IBM_NEW_EMAC_TAH is not set
623# CONFIG_IBM_NEW_EMAC_EMAC4 is not set
624# CONFIG_IBM_NEW_EMAC_NO_FLOW_CTRL is not set
625# CONFIG_IBM_NEW_EMAC_MAL_CLR_ICINTSTAT is not set
626# CONFIG_IBM_NEW_EMAC_MAL_COMMON_ERR is not set
627# CONFIG_B44 is not set
628# CONFIG_NETDEV_1000 is not set
629# CONFIG_NETDEV_10000 is not set
340 630
341# 631#
342# Ethernet (1000 Mbit) 632# Wireless LAN
343#
344
345#
346# Ethernet (10000 Mbit)
347#
348
349#
350# Token Ring devices
351# 633#
634# CONFIG_WLAN_PRE80211 is not set
635# CONFIG_WLAN_80211 is not set
352 636
353# 637#
354# Wireless LAN (non-hamradio) 638# Enable WiMAX (Networking options) to see the WiMAX drivers
355# 639#
356# CONFIG_NET_RADIO is not set
357 640
358# 641#
359# Wan interfaces 642# USB Network Adapters
360# 643#
644# CONFIG_USB_CATC is not set
645# CONFIG_USB_KAWETH is not set
646# CONFIG_USB_PEGASUS is not set
647# CONFIG_USB_RTL8150 is not set
648# CONFIG_USB_USBNET is not set
361# CONFIG_WAN is not set 649# CONFIG_WAN is not set
362# CONFIG_PPP is not set 650# CONFIG_PPP is not set
363# CONFIG_SLIP is not set 651# CONFIG_SLIP is not set
364 652# CONFIG_NETCONSOLE is not set
365# 653# CONFIG_NETPOLL is not set
366# ISDN subsystem 654# CONFIG_NET_POLL_CONTROLLER is not set
367#
368# CONFIG_ISDN is not set 655# CONFIG_ISDN is not set
369 656
370# 657#
371# Input device support 658# Input device support
372# 659#
373CONFIG_INPUT=y 660CONFIG_INPUT=y
661# CONFIG_INPUT_FF_MEMLESS is not set
662# CONFIG_INPUT_POLLDEV is not set
374 663
375# 664#
376# Userland interfaces 665# Userland interfaces
@@ -380,7 +669,6 @@ CONFIG_INPUT_MOUSEDEV=y
380CONFIG_INPUT_MOUSEDEV_SCREEN_X=1024 669CONFIG_INPUT_MOUSEDEV_SCREEN_X=1024
381CONFIG_INPUT_MOUSEDEV_SCREEN_Y=768 670CONFIG_INPUT_MOUSEDEV_SCREEN_Y=768
382# CONFIG_INPUT_JOYDEV is not set 671# CONFIG_INPUT_JOYDEV is not set
383# CONFIG_INPUT_TSDEV is not set
384# CONFIG_INPUT_EVDEV is not set 672# CONFIG_INPUT_EVDEV is not set
385# CONFIG_INPUT_EVBUG is not set 673# CONFIG_INPUT_EVBUG is not set
386 674
@@ -390,23 +678,25 @@ CONFIG_INPUT_MOUSEDEV_SCREEN_Y=768
390# CONFIG_INPUT_KEYBOARD is not set 678# CONFIG_INPUT_KEYBOARD is not set
391# CONFIG_INPUT_MOUSE is not set 679# CONFIG_INPUT_MOUSE is not set
392# CONFIG_INPUT_JOYSTICK is not set 680# CONFIG_INPUT_JOYSTICK is not set
681# CONFIG_INPUT_TABLET is not set
393# CONFIG_INPUT_TOUCHSCREEN is not set 682# CONFIG_INPUT_TOUCHSCREEN is not set
394# CONFIG_INPUT_MISC is not set 683# CONFIG_INPUT_MISC is not set
395 684
396# 685#
397# Hardware I/O ports 686# Hardware I/O ports
398# 687#
399CONFIG_SERIO=y 688# CONFIG_SERIO is not set
400# CONFIG_SERIO_SERPORT is not set
401# CONFIG_SERIO_RAW is not set
402# CONFIG_GAMEPORT is not set 689# CONFIG_GAMEPORT is not set
403 690
404# 691#
405# Character devices 692# Character devices
406# 693#
407CONFIG_VT=y 694CONFIG_VT=y
695CONFIG_CONSOLE_TRANSLATIONS=y
408CONFIG_VT_CONSOLE=y 696CONFIG_VT_CONSOLE=y
409CONFIG_HW_CONSOLE=y 697CONFIG_HW_CONSOLE=y
698# CONFIG_VT_HW_CONSOLE_BINDING is not set
699CONFIG_DEVKMEM=y
410# CONFIG_SERIAL_NONSTANDARD is not set 700# CONFIG_SERIAL_NONSTANDARD is not set
411 701
412# 702#
@@ -419,215 +709,362 @@ CONFIG_HW_CONSOLE=y
419# 709#
420CONFIG_SERIAL_ATMEL=y 710CONFIG_SERIAL_ATMEL=y
421CONFIG_SERIAL_ATMEL_CONSOLE=y 711CONFIG_SERIAL_ATMEL_CONSOLE=y
712CONFIG_SERIAL_ATMEL_PDC=y
713# CONFIG_SERIAL_ATMEL_TTYAT is not set
422CONFIG_SERIAL_CORE=y 714CONFIG_SERIAL_CORE=y
423CONFIG_SERIAL_CORE_CONSOLE=y 715CONFIG_SERIAL_CORE_CONSOLE=y
424CONFIG_UNIX98_PTYS=y 716CONFIG_UNIX98_PTYS=y
425CONFIG_LEGACY_PTYS=y 717# CONFIG_DEVPTS_MULTIPLE_INSTANCES is not set
426CONFIG_LEGACY_PTY_COUNT=256 718# CONFIG_LEGACY_PTYS is not set
719# CONFIG_IPMI_HANDLER is not set
720# CONFIG_HW_RANDOM is not set
721# CONFIG_R3964 is not set
722# CONFIG_RAW_DRIVER is not set
723# CONFIG_TCG_TPM is not set
724# CONFIG_I2C is not set
725# CONFIG_SPI is not set
726CONFIG_ARCH_REQUIRE_GPIOLIB=y
727CONFIG_GPIOLIB=y
728# CONFIG_DEBUG_GPIO is not set
729# CONFIG_GPIO_SYSFS is not set
427 730
428# 731#
429# IPMI 732# Memory mapped GPIO expanders:
430# 733#
431# CONFIG_IPMI_HANDLER is not set
432 734
433# 735#
434# Watchdog Cards 736# I2C GPIO expanders:
435# 737#
436# CONFIG_WATCHDOG is not set
437# CONFIG_NVRAM is not set
438# CONFIG_RTC is not set
439# CONFIG_AT91RM9200_RTC is not set
440# CONFIG_DTLK is not set
441# CONFIG_R3964 is not set
442 738
443# 739#
444# Ftape, the floppy tape device driver 740# PCI GPIO expanders:
445# 741#
446# CONFIG_RAW_DRIVER is not set
447 742
448# 743#
449# TPM devices 744# SPI GPIO expanders:
450# 745#
451# CONFIG_AT91_SPI is not set 746# CONFIG_W1 is not set
747# CONFIG_POWER_SUPPLY is not set
748# CONFIG_HWMON is not set
749# CONFIG_THERMAL is not set
750# CONFIG_THERMAL_HWMON is not set
751CONFIG_WATCHDOG=y
752# CONFIG_WATCHDOG_NOWAYOUT is not set
452 753
453# 754#
454# I2C support 755# Watchdog Device Drivers
455# 756#
456# CONFIG_I2C is not set 757# CONFIG_SOFT_WATCHDOG is not set
758CONFIG_AT91RM9200_WATCHDOG=y
759
760#
761# USB-based Watchdog Cards
762#
763# CONFIG_USBPCWATCHDOG is not set
764CONFIG_SSB_POSSIBLE=y
457 765
458# 766#
459# Misc devices 767# Sonics Silicon Backplane
460# 768#
769# CONFIG_SSB is not set
770
771#
772# Multifunction device drivers
773#
774# CONFIG_MFD_CORE is not set
775# CONFIG_MFD_SM501 is not set
776# CONFIG_MFD_ASIC3 is not set
777# CONFIG_HTC_EGPIO is not set
778# CONFIG_HTC_PASIC3 is not set
779# CONFIG_MFD_TMIO is not set
780# CONFIG_MFD_T7L66XB is not set
781# CONFIG_MFD_TC6387XB is not set
782# CONFIG_MFD_TC6393XB is not set
461 783
462# 784#
463# Multimedia devices 785# Multimedia devices
464# 786#
787
788#
789# Multimedia core support
790#
465# CONFIG_VIDEO_DEV is not set 791# CONFIG_VIDEO_DEV is not set
792# CONFIG_DVB_CORE is not set
793# CONFIG_VIDEO_MEDIA is not set
466 794
467# 795#
468# Digital Video Broadcasting Devices 796# Multimedia drivers
469# 797#
470# CONFIG_DVB is not set 798# CONFIG_DAB is not set
471 799
472# 800#
473# Graphics support 801# Graphics support
474# 802#
475# CONFIG_FB is not set 803# CONFIG_VGASTATE is not set
804# CONFIG_VIDEO_OUTPUT_CONTROL is not set
805CONFIG_FB=y
806# CONFIG_FIRMWARE_EDID is not set
807# CONFIG_FB_DDC is not set
808# CONFIG_FB_BOOT_VESA_SUPPORT is not set
809# CONFIG_FB_CFB_FILLRECT is not set
810# CONFIG_FB_CFB_COPYAREA is not set
811# CONFIG_FB_CFB_IMAGEBLIT is not set
812# CONFIG_FB_CFB_REV_PIXELS_IN_BYTE is not set
813# CONFIG_FB_SYS_FILLRECT is not set
814# CONFIG_FB_SYS_COPYAREA is not set
815# CONFIG_FB_SYS_IMAGEBLIT is not set
816# CONFIG_FB_FOREIGN_ENDIAN is not set
817# CONFIG_FB_SYS_FOPS is not set
818# CONFIG_FB_SVGALIB is not set
819# CONFIG_FB_MACMODES is not set
820# CONFIG_FB_BACKLIGHT is not set
821CONFIG_FB_MODE_HELPERS=y
822CONFIG_FB_TILEBLITTING=y
823
824#
825# Frame buffer hardware drivers
826#
827# CONFIG_FB_S1D13XXX is not set
828# CONFIG_FB_VIRTUAL is not set
829# CONFIG_FB_METRONOME is not set
830# CONFIG_FB_MB862XX is not set
831# CONFIG_FB_BROADSHEET is not set
832CONFIG_BACKLIGHT_LCD_SUPPORT=y
833# CONFIG_LCD_CLASS_DEVICE is not set
834CONFIG_BACKLIGHT_CLASS_DEVICE=y
835# CONFIG_BACKLIGHT_GENERIC is not set
836
837#
838# Display device support
839#
840# CONFIG_DISPLAY_SUPPORT is not set
476 841
477# 842#
478# Console display driver support 843# Console display driver support
479# 844#
480# CONFIG_VGA_CONSOLE is not set 845# CONFIG_VGA_CONSOLE is not set
481CONFIG_DUMMY_CONSOLE=y 846CONFIG_DUMMY_CONSOLE=y
482 847CONFIG_FRAMEBUFFER_CONSOLE=y
483# 848# CONFIG_FRAMEBUFFER_CONSOLE_DETECT_PRIMARY is not set
484# Sound 849# CONFIG_FRAMEBUFFER_CONSOLE_ROTATION is not set
485# 850CONFIG_FONTS=y
851# CONFIG_FONT_8x8 is not set
852# CONFIG_FONT_8x16 is not set
853# CONFIG_FONT_6x11 is not set
854# CONFIG_FONT_7x14 is not set
855# CONFIG_FONT_PEARL_8x8 is not set
856# CONFIG_FONT_ACORN_8x8 is not set
857CONFIG_FONT_MINI_4x6=y
858# CONFIG_FONT_SUN8x16 is not set
859# CONFIG_FONT_SUN12x22 is not set
860# CONFIG_FONT_10x18 is not set
861# CONFIG_LOGO is not set
486# CONFIG_SOUND is not set 862# CONFIG_SOUND is not set
487 863# CONFIG_HID_SUPPORT is not set
488# 864CONFIG_USB_SUPPORT=y
489# USB support
490#
491CONFIG_USB_ARCH_HAS_HCD=y 865CONFIG_USB_ARCH_HAS_HCD=y
492CONFIG_USB_ARCH_HAS_OHCI=y 866CONFIG_USB_ARCH_HAS_OHCI=y
867# CONFIG_USB_ARCH_HAS_EHCI is not set
493CONFIG_USB=y 868CONFIG_USB=y
494CONFIG_USB_DEBUG=y 869# CONFIG_USB_DEBUG is not set
870# CONFIG_USB_ANNOUNCE_NEW_DEVICES is not set
495 871
496# 872#
497# Miscellaneous USB options 873# Miscellaneous USB options
498# 874#
499CONFIG_USB_DEVICEFS=y 875CONFIG_USB_DEVICEFS=y
876CONFIG_USB_DEVICE_CLASS=y
877# CONFIG_USB_DYNAMIC_MINORS is not set
878# CONFIG_USB_OTG is not set
879# CONFIG_USB_MON is not set
880# CONFIG_USB_WUSB is not set
881# CONFIG_USB_WUSB_CBAF is not set
500 882
501# 883#
502# USB Host Controller Drivers 884# USB Host Controller Drivers
503# 885#
886# CONFIG_USB_C67X00_HCD is not set
887# CONFIG_USB_OXU210HP_HCD is not set
504# CONFIG_USB_ISP116X_HCD is not set 888# CONFIG_USB_ISP116X_HCD is not set
889# CONFIG_USB_ISP1760_HCD is not set
505CONFIG_USB_OHCI_HCD=y 890CONFIG_USB_OHCI_HCD=y
506# CONFIG_USB_OHCI_BIG_ENDIAN is not set 891# CONFIG_USB_OHCI_BIG_ENDIAN_DESC is not set
892# CONFIG_USB_OHCI_BIG_ENDIAN_MMIO is not set
507CONFIG_USB_OHCI_LITTLE_ENDIAN=y 893CONFIG_USB_OHCI_LITTLE_ENDIAN=y
508# CONFIG_USB_SL811_HCD is not set 894# CONFIG_USB_SL811_HCD is not set
895# CONFIG_USB_R8A66597_HCD is not set
896# CONFIG_USB_HWA_HCD is not set
897# CONFIG_USB_MUSB_HDRC is not set
509 898
510# 899#
511# USB Device Class drivers 900# USB Device Class drivers
512# 901#
513# CONFIG_USB_BLUETOOTH_TTY is not set
514# CONFIG_USB_ACM is not set 902# CONFIG_USB_ACM is not set
515# CONFIG_USB_PRINTER is not set 903# CONFIG_USB_PRINTER is not set
904# CONFIG_USB_WDM is not set
905# CONFIG_USB_TMC is not set
516 906
517# 907#
518# NOTE: USB_STORAGE enables SCSI, and 'SCSI disk support' may also be needed; see USB_STORAGE Help for more information 908# NOTE: USB_STORAGE depends on SCSI but BLK_DEV_SD may
519# 909#
520CONFIG_USB_STORAGE=y
521CONFIG_USB_STORAGE_DEBUG=y
522# CONFIG_USB_STORAGE_FREECOM is not set
523# CONFIG_USB_STORAGE_DPCM is not set
524
525#
526# USB Input Devices
527#
528# CONFIG_USB_HID is not set
529 910
530# 911#
531# USB HID Boot Protocol drivers 912# also be needed; see USB_STORAGE Help for more info
532# 913#
533# CONFIG_USB_KBD is not set 914CONFIG_USB_STORAGE=y
534# CONFIG_USB_MOUSE is not set 915# CONFIG_USB_STORAGE_DEBUG is not set
535# CONFIG_USB_AIPTEK is not set 916# CONFIG_USB_STORAGE_DATAFAB is not set
536# CONFIG_USB_WACOM is not set 917# CONFIG_USB_STORAGE_FREECOM is not set
537# CONFIG_USB_ACECAD is not set 918# CONFIG_USB_STORAGE_ISD200 is not set
538# CONFIG_USB_KBTAB is not set 919# CONFIG_USB_STORAGE_USBAT is not set
539# CONFIG_USB_POWERMATE is not set 920# CONFIG_USB_STORAGE_SDDR09 is not set
540# CONFIG_USB_MTOUCH is not set 921# CONFIG_USB_STORAGE_SDDR55 is not set
541# CONFIG_USB_ITMTOUCH is not set 922# CONFIG_USB_STORAGE_JUMPSHOT is not set
542# CONFIG_USB_EGALAX is not set 923# CONFIG_USB_STORAGE_ALAUDA is not set
543# CONFIG_USB_XPAD is not set 924# CONFIG_USB_STORAGE_ONETOUCH is not set
544# CONFIG_USB_ATI_REMOTE is not set 925# CONFIG_USB_STORAGE_KARMA is not set
926# CONFIG_USB_STORAGE_CYPRESS_ATACB is not set
927CONFIG_USB_LIBUSUAL=y
545 928
546# 929#
547# USB Imaging devices 930# USB Imaging devices
548# 931#
932# CONFIG_USB_MDC800 is not set
549# CONFIG_USB_MICROTEK is not set 933# CONFIG_USB_MICROTEK is not set
550 934
551# 935#
552# USB Multimedia devices 936# USB port drivers
553# 937#
554# CONFIG_USB_DABUSB is not set 938# CONFIG_USB_SERIAL is not set
555 939
556# 940#
557# Video4Linux support is needed for USB Multimedia device support 941# USB Miscellaneous drivers
558# 942#
943# CONFIG_USB_EMI62 is not set
944# CONFIG_USB_EMI26 is not set
945# CONFIG_USB_ADUTUX is not set
946# CONFIG_USB_SEVSEG is not set
947# CONFIG_USB_RIO500 is not set
948# CONFIG_USB_LEGOTOWER is not set
949# CONFIG_USB_LCD is not set
950# CONFIG_USB_BERRY_CHARGE is not set
951# CONFIG_USB_LED is not set
952# CONFIG_USB_CYPRESS_CY7C63 is not set
953# CONFIG_USB_CYTHERM is not set
954# CONFIG_USB_IDMOUSE is not set
955# CONFIG_USB_FTDI_ELAN is not set
956# CONFIG_USB_APPLEDISPLAY is not set
957# CONFIG_USB_LD is not set
958# CONFIG_USB_TRANCEVIBRATOR is not set
959# CONFIG_USB_IOWARRIOR is not set
960# CONFIG_USB_TEST is not set
961# CONFIG_USB_ISIGHTFW is not set
962# CONFIG_USB_VST is not set
963# CONFIG_USB_GADGET is not set
559 964
560# 965#
561# USB Network Adapters 966# OTG and related infrastructure
562# 967#
563# CONFIG_USB_KAWETH is not set 968# CONFIG_USB_GPIO_VBUS is not set
564# CONFIG_USB_PEGASUS is not set 969# CONFIG_NOP_USB_XCEIV is not set
565# CONFIG_USB_USBNET is not set 970CONFIG_MMC=y
566# CONFIG_USB_MON is not set 971# CONFIG_MMC_DEBUG is not set
972# CONFIG_MMC_UNSAFE_RESUME is not set
567 973
568# 974#
569# USB port drivers 975# MMC/SD/SDIO Card Drivers
570# 976#
977CONFIG_MMC_BLOCK=y
978CONFIG_MMC_BLOCK_BOUNCE=y
979# CONFIG_SDIO_UART is not set
980# CONFIG_MMC_TEST is not set
571 981
572# 982#
573# USB Serial Converter support 983# MMC/SD/SDIO Host Controller Drivers
574# 984#
575# CONFIG_USB_SERIAL is not set 985# CONFIG_MMC_SDHCI is not set
986CONFIG_MMC_AT91=y
987# CONFIG_MEMSTICK is not set
988# CONFIG_ACCESSIBILITY is not set
989# CONFIG_NEW_LEDS is not set
990CONFIG_RTC_LIB=y
991CONFIG_RTC_CLASS=y
992CONFIG_RTC_HCTOSYS=y
993CONFIG_RTC_HCTOSYS_DEVICE="rtc0"
994# CONFIG_RTC_DEBUG is not set
576 995
577# 996#
578# USB Miscellaneous drivers 997# RTC interfaces
579# 998#
580# CONFIG_USB_EMI62 is not set 999CONFIG_RTC_INTF_SYSFS=y
581# CONFIG_USB_EMI26 is not set 1000CONFIG_RTC_INTF_PROC=y
582# CONFIG_USB_LCD is not set 1001CONFIG_RTC_INTF_DEV=y
583# CONFIG_USB_LED is not set 1002# CONFIG_RTC_INTF_DEV_UIE_EMUL is not set
584# CONFIG_USB_CYTHERM is not set 1003# CONFIG_RTC_DRV_TEST is not set
585# CONFIG_USB_PHIDGETKIT is not set
586# CONFIG_USB_PHIDGETSERVO is not set
587# CONFIG_USB_IDMOUSE is not set
588 1004
589# 1005#
590# USB DSL modem support 1006# SPI RTC drivers
591# 1007#
592 1008
593# 1009#
594# USB Gadget Support 1010# Platform RTC drivers
595# 1011#
596# CONFIG_USB_GADGET is not set 1012# CONFIG_RTC_DRV_CMOS is not set
1013# CONFIG_RTC_DRV_DS1286 is not set
1014# CONFIG_RTC_DRV_DS1511 is not set
1015# CONFIG_RTC_DRV_DS1553 is not set
1016# CONFIG_RTC_DRV_DS1742 is not set
1017# CONFIG_RTC_DRV_STK17TA8 is not set
1018# CONFIG_RTC_DRV_M48T86 is not set
1019# CONFIG_RTC_DRV_M48T35 is not set
1020# CONFIG_RTC_DRV_M48T59 is not set
1021# CONFIG_RTC_DRV_BQ4802 is not set
1022# CONFIG_RTC_DRV_V3020 is not set
597 1023
598# 1024#
599# MMC/SD Card support 1025# on-CPU RTC drivers
600# 1026#
601# CONFIG_MMC is not set 1027CONFIG_RTC_DRV_AT91RM9200=y
1028# CONFIG_DMADEVICES is not set
1029# CONFIG_AUXDISPLAY is not set
1030# CONFIG_REGULATOR is not set
1031# CONFIG_UIO is not set
1032# CONFIG_STAGING is not set
602 1033
603# 1034#
604# File systems 1035# File systems
605# 1036#
606CONFIG_EXT2_FS=y 1037CONFIG_EXT2_FS=y
607CONFIG_EXT2_FS_XATTR=y 1038# CONFIG_EXT2_FS_XATTR is not set
608# CONFIG_EXT2_FS_POSIX_ACL is not set
609# CONFIG_EXT2_FS_SECURITY is not set
610# CONFIG_EXT2_FS_XIP is not set 1039# CONFIG_EXT2_FS_XIP is not set
611CONFIG_EXT3_FS=y 1040CONFIG_EXT3_FS=y
1041# CONFIG_EXT3_DEFAULTS_TO_ORDERED is not set
612CONFIG_EXT3_FS_XATTR=y 1042CONFIG_EXT3_FS_XATTR=y
613# CONFIG_EXT3_FS_POSIX_ACL is not set 1043# CONFIG_EXT3_FS_POSIX_ACL is not set
614# CONFIG_EXT3_FS_SECURITY is not set 1044# CONFIG_EXT3_FS_SECURITY is not set
1045# CONFIG_EXT4_FS is not set
615CONFIG_JBD=y 1046CONFIG_JBD=y
616# CONFIG_JBD_DEBUG is not set 1047# CONFIG_JBD_DEBUG is not set
617CONFIG_FS_MBCACHE=y 1048CONFIG_FS_MBCACHE=y
618# CONFIG_REISERFS_FS is not set 1049# CONFIG_REISERFS_FS is not set
619# CONFIG_JFS_FS is not set 1050# CONFIG_JFS_FS is not set
1051# CONFIG_FS_POSIX_ACL is not set
1052CONFIG_FILE_LOCKING=y
1053# CONFIG_XFS_FS is not set
1054# CONFIG_OCFS2_FS is not set
1055# CONFIG_BTRFS_FS is not set
1056# CONFIG_DNOTIFY is not set
1057CONFIG_INOTIFY=y
1058CONFIG_INOTIFY_USER=y
1059# CONFIG_QUOTA is not set
1060# CONFIG_AUTOFS_FS is not set
1061# CONFIG_AUTOFS4_FS is not set
1062# CONFIG_FUSE_FS is not set
620 1063
621# 1064#
622# XFS support 1065# Caches
623# 1066#
624# CONFIG_XFS_FS is not set 1067# CONFIG_FSCACHE is not set
625# CONFIG_MINIX_FS is not set
626# CONFIG_ROMFS_FS is not set
627# CONFIG_QUOTA is not set
628CONFIG_DNOTIFY=y
629CONFIG_AUTOFS_FS=y
630CONFIG_AUTOFS4_FS=y
631 1068
632# 1069#
633# CD-ROM/DVD Filesystems 1070# CD-ROM/DVD Filesystems
@@ -639,7 +1076,7 @@ CONFIG_AUTOFS4_FS=y
639# DOS/FAT/NT Filesystems 1076# DOS/FAT/NT Filesystems
640# 1077#
641CONFIG_FAT_FS=y 1078CONFIG_FAT_FS=y
642CONFIG_MSDOS_FS=y 1079# CONFIG_MSDOS_FS is not set
643CONFIG_VFAT_FS=y 1080CONFIG_VFAT_FS=y
644CONFIG_FAT_DEFAULT_CODEPAGE=437 1081CONFIG_FAT_DEFAULT_CODEPAGE=437
645CONFIG_FAT_DEFAULT_IOCHARSET="iso8859-1" 1082CONFIG_FAT_DEFAULT_IOCHARSET="iso8859-1"
@@ -649,53 +1086,70 @@ CONFIG_FAT_DEFAULT_IOCHARSET="iso8859-1"
649# Pseudo filesystems 1086# Pseudo filesystems
650# 1087#
651CONFIG_PROC_FS=y 1088CONFIG_PROC_FS=y
1089CONFIG_PROC_SYSCTL=y
1090CONFIG_PROC_PAGE_MONITOR=y
652CONFIG_SYSFS=y 1091CONFIG_SYSFS=y
653CONFIG_DEVPTS_FS_XATTR=y
654# CONFIG_DEVPTS_FS_SECURITY is not set
655CONFIG_TMPFS=y 1092CONFIG_TMPFS=y
656# CONFIG_TMPFS_XATTR is not set 1093# CONFIG_TMPFS_POSIX_ACL is not set
657# CONFIG_HUGETLB_PAGE is not set 1094# CONFIG_HUGETLB_PAGE is not set
658CONFIG_RAMFS=y 1095CONFIG_CONFIGFS_FS=y
659 1096CONFIG_MISC_FILESYSTEMS=y
660# 1097# CONFIG_ADFS_FS is not set
661# Miscellaneous filesystems 1098# CONFIG_AFFS_FS is not set
662# 1099# CONFIG_HFS_FS is not set
663# CONFIG_HFSPLUS_FS is not set 1100# CONFIG_HFSPLUS_FS is not set
1101# CONFIG_BEFS_FS is not set
1102# CONFIG_BFS_FS is not set
1103# CONFIG_EFS_FS is not set
1104CONFIG_JFFS2_FS=y
1105CONFIG_JFFS2_FS_DEBUG=0
1106CONFIG_JFFS2_FS_WRITEBUFFER=y
1107# CONFIG_JFFS2_FS_WBUF_VERIFY is not set
1108# CONFIG_JFFS2_SUMMARY is not set
1109# CONFIG_JFFS2_FS_XATTR is not set
1110# CONFIG_JFFS2_COMPRESSION_OPTIONS is not set
1111CONFIG_JFFS2_ZLIB=y
1112# CONFIG_JFFS2_LZO is not set
1113CONFIG_JFFS2_RTIME=y
1114# CONFIG_JFFS2_RUBIN is not set
1115# CONFIG_UBIFS_FS is not set
664# CONFIG_CRAMFS is not set 1116# CONFIG_CRAMFS is not set
1117# CONFIG_SQUASHFS is not set
665# CONFIG_VXFS_FS is not set 1118# CONFIG_VXFS_FS is not set
1119# CONFIG_MINIX_FS is not set
1120# CONFIG_OMFS_FS is not set
666# CONFIG_HPFS_FS is not set 1121# CONFIG_HPFS_FS is not set
667# CONFIG_QNX4FS_FS is not set 1122# CONFIG_QNX4FS_FS is not set
1123# CONFIG_ROMFS_FS is not set
668# CONFIG_SYSV_FS is not set 1124# CONFIG_SYSV_FS is not set
669# CONFIG_UFS_FS is not set 1125# CONFIG_UFS_FS is not set
670 1126# CONFIG_NILFS2_FS is not set
671# 1127CONFIG_NETWORK_FILESYSTEMS=y
672# Network File Systems
673#
674CONFIG_NFS_FS=y 1128CONFIG_NFS_FS=y
675CONFIG_NFS_V3=y 1129CONFIG_NFS_V3=y
676# CONFIG_NFS_V3_ACL is not set 1130# CONFIG_NFS_V3_ACL is not set
677# CONFIG_NFSD is not set 1131# CONFIG_NFS_V4 is not set
678CONFIG_ROOT_NFS=y 1132CONFIG_ROOT_NFS=y
1133# CONFIG_NFSD is not set
679CONFIG_LOCKD=y 1134CONFIG_LOCKD=y
680CONFIG_LOCKD_V4=y 1135CONFIG_LOCKD_V4=y
681CONFIG_NFS_COMMON=y 1136CONFIG_NFS_COMMON=y
682CONFIG_SUNRPC=y 1137CONFIG_SUNRPC=y
1138# CONFIG_RPCSEC_GSS_KRB5 is not set
1139# CONFIG_RPCSEC_GSS_SPKM3 is not set
683# CONFIG_SMB_FS is not set 1140# CONFIG_SMB_FS is not set
684# CONFIG_CIFS is not set 1141# CONFIG_CIFS is not set
685# CONFIG_NCP_FS is not set 1142# CONFIG_NCP_FS is not set
686# CONFIG_CODA_FS is not set 1143# CONFIG_CODA_FS is not set
1144# CONFIG_AFS_FS is not set
687 1145
688# 1146#
689# Partition Types 1147# Partition Types
690# 1148#
691# CONFIG_PARTITION_ADVANCED is not set 1149# CONFIG_PARTITION_ADVANCED is not set
692CONFIG_MSDOS_PARTITION=y 1150CONFIG_MSDOS_PARTITION=y
693
694#
695# Native Language Support
696#
697CONFIG_NLS=y 1151CONFIG_NLS=y
698CONFIG_NLS_DEFAULT="utf8" 1152CONFIG_NLS_DEFAULT="iso8859-1"
699CONFIG_NLS_CODEPAGE_437=y 1153CONFIG_NLS_CODEPAGE_437=y
700# CONFIG_NLS_CODEPAGE_737 is not set 1154# CONFIG_NLS_CODEPAGE_737 is not set
701# CONFIG_NLS_CODEPAGE_775 is not set 1155# CONFIG_NLS_CODEPAGE_775 is not set
@@ -719,7 +1173,7 @@ CONFIG_NLS_CODEPAGE_437=y
719# CONFIG_NLS_ISO8859_8 is not set 1173# CONFIG_NLS_ISO8859_8 is not set
720# CONFIG_NLS_CODEPAGE_1250 is not set 1174# CONFIG_NLS_CODEPAGE_1250 is not set
721# CONFIG_NLS_CODEPAGE_1251 is not set 1175# CONFIG_NLS_CODEPAGE_1251 is not set
722CONFIG_NLS_ASCII=y 1176# CONFIG_NLS_ASCII is not set
723# CONFIG_NLS_ISO8859_1 is not set 1177# CONFIG_NLS_ISO8859_1 is not set
724# CONFIG_NLS_ISO8859_2 is not set 1178# CONFIG_NLS_ISO8859_2 is not set
725# CONFIG_NLS_ISO8859_3 is not set 1179# CONFIG_NLS_ISO8859_3 is not set
@@ -733,47 +1187,119 @@ CONFIG_NLS_ASCII=y
733# CONFIG_NLS_ISO8859_15 is not set 1187# CONFIG_NLS_ISO8859_15 is not set
734# CONFIG_NLS_KOI8_R is not set 1188# CONFIG_NLS_KOI8_R is not set
735# CONFIG_NLS_KOI8_U is not set 1189# CONFIG_NLS_KOI8_U is not set
736# CONFIG_NLS_UTF8 is not set 1190CONFIG_NLS_UTF8=y
1191# CONFIG_DLM is not set
737 1192
738# 1193#
739# Kernel hacking 1194# Kernel hacking
740# 1195#
741# CONFIG_PRINTK_TIME is not set 1196# CONFIG_PRINTK_TIME is not set
1197CONFIG_ENABLE_WARN_DEPRECATED=y
1198CONFIG_ENABLE_MUST_CHECK=y
1199CONFIG_FRAME_WARN=1024
1200CONFIG_MAGIC_SYSRQ=y
1201# CONFIG_UNUSED_SYMBOLS is not set
1202CONFIG_DEBUG_FS=y
1203# CONFIG_HEADERS_CHECK is not set
742CONFIG_DEBUG_KERNEL=y 1204CONFIG_DEBUG_KERNEL=y
743# CONFIG_MAGIC_SYSRQ is not set 1205# CONFIG_DEBUG_SHIRQ is not set
744CONFIG_LOG_BUF_SHIFT=14 1206CONFIG_DETECT_SOFTLOCKUP=y
1207# CONFIG_BOOTPARAM_SOFTLOCKUP_PANIC is not set
1208CONFIG_BOOTPARAM_SOFTLOCKUP_PANIC_VALUE=0
1209CONFIG_DETECT_HUNG_TASK=y
1210# CONFIG_BOOTPARAM_HUNG_TASK_PANIC is not set
1211CONFIG_BOOTPARAM_HUNG_TASK_PANIC_VALUE=0
1212# CONFIG_SCHED_DEBUG is not set
745# CONFIG_SCHEDSTATS is not set 1213# CONFIG_SCHEDSTATS is not set
746# CONFIG_DEBUG_SLAB is not set 1214# CONFIG_TIMER_STATS is not set
1215# CONFIG_DEBUG_OBJECTS is not set
1216# CONFIG_SLUB_DEBUG_ON is not set
1217# CONFIG_SLUB_STATS is not set
1218# CONFIG_DEBUG_PREEMPT is not set
1219# CONFIG_DEBUG_RT_MUTEXES is not set
1220# CONFIG_RT_MUTEX_TESTER is not set
747# CONFIG_DEBUG_SPINLOCK is not set 1221# CONFIG_DEBUG_SPINLOCK is not set
1222# CONFIG_DEBUG_MUTEXES is not set
1223# CONFIG_DEBUG_LOCK_ALLOC is not set
1224# CONFIG_PROVE_LOCKING is not set
1225# CONFIG_LOCK_STAT is not set
748# CONFIG_DEBUG_SPINLOCK_SLEEP is not set 1226# CONFIG_DEBUG_SPINLOCK_SLEEP is not set
1227# CONFIG_DEBUG_LOCKING_API_SELFTESTS is not set
749# CONFIG_DEBUG_KOBJECT is not set 1228# CONFIG_DEBUG_KOBJECT is not set
750CONFIG_DEBUG_BUGVERBOSE=y 1229CONFIG_DEBUG_BUGVERBOSE=y
751# CONFIG_DEBUG_INFO is not set 1230# CONFIG_DEBUG_INFO is not set
752# CONFIG_DEBUG_FS is not set 1231# CONFIG_DEBUG_VM is not set
753CONFIG_FRAME_POINTER=y 1232# CONFIG_DEBUG_WRITECOUNT is not set
754CONFIG_DEBUG_USER=y 1233CONFIG_DEBUG_MEMORY_INIT=y
755CONFIG_DEBUG_ERRORS=y 1234# CONFIG_DEBUG_LIST is not set
756CONFIG_DEBUG_LL=y 1235# CONFIG_DEBUG_SG is not set
757# CONFIG_DEBUG_ICEDCC is not set 1236# CONFIG_DEBUG_NOTIFIERS is not set
1237# CONFIG_BOOT_PRINTK_DELAY is not set
1238# CONFIG_RCU_TORTURE_TEST is not set
1239# CONFIG_RCU_CPU_STALL_DETECTOR is not set
1240# CONFIG_BACKTRACE_SELF_TEST is not set
1241# CONFIG_DEBUG_BLOCK_EXT_DEVT is not set
1242# CONFIG_FAULT_INJECTION is not set
1243# CONFIG_LATENCYTOP is not set
1244# CONFIG_SYSCTL_SYSCALL_CHECK is not set
1245# CONFIG_PAGE_POISONING is not set
1246CONFIG_HAVE_FUNCTION_TRACER=y
1247CONFIG_TRACING_SUPPORT=y
1248
1249#
1250# Tracers
1251#
1252# CONFIG_FUNCTION_TRACER is not set
1253# CONFIG_IRQSOFF_TRACER is not set
1254# CONFIG_PREEMPT_TRACER is not set
1255# CONFIG_SCHED_TRACER is not set
1256# CONFIG_CONTEXT_SWITCH_TRACER is not set
1257# CONFIG_EVENT_TRACER is not set
1258# CONFIG_BOOT_TRACER is not set
1259# CONFIG_TRACE_BRANCH_PROFILING is not set
1260# CONFIG_STACK_TRACER is not set
1261# CONFIG_KMEMTRACE is not set
1262# CONFIG_WORKQUEUE_TRACER is not set
1263# CONFIG_BLK_DEV_IO_TRACE is not set
1264# CONFIG_DYNAMIC_DEBUG is not set
1265# CONFIG_SAMPLES is not set
1266CONFIG_HAVE_ARCH_KGDB=y
1267# CONFIG_KGDB is not set
1268CONFIG_ARM_UNWIND=y
1269# CONFIG_DEBUG_USER is not set
1270# CONFIG_DEBUG_ERRORS is not set
1271# CONFIG_DEBUG_STACK_USAGE is not set
1272# CONFIG_DEBUG_LL is not set
758 1273
759# 1274#
760# Security options 1275# Security options
761# 1276#
762# CONFIG_KEYS is not set 1277# CONFIG_KEYS is not set
763# CONFIG_SECURITY is not set 1278# CONFIG_SECURITY is not set
764 1279# CONFIG_SECURITYFS is not set
765# 1280# CONFIG_SECURITY_FILE_CAPABILITIES is not set
766# Cryptographic options
767#
768# CONFIG_CRYPTO is not set 1281# CONFIG_CRYPTO is not set
769 1282# CONFIG_BINARY_PRINTF is not set
770#
771# Hardware crypto devices
772#
773 1283
774# 1284#
775# Library routines 1285# Library routines
776# 1286#
1287CONFIG_BITREVERSE=y
1288CONFIG_GENERIC_FIND_LAST_BIT=y
777# CONFIG_CRC_CCITT is not set 1289# CONFIG_CRC_CCITT is not set
1290# CONFIG_CRC16 is not set
1291# CONFIG_CRC_T10DIF is not set
1292# CONFIG_CRC_ITU_T is not set
778CONFIG_CRC32=y 1293CONFIG_CRC32=y
1294# CONFIG_CRC7 is not set
779# CONFIG_LIBCRC32C is not set 1295# CONFIG_LIBCRC32C is not set
1296CONFIG_AUDIT_GENERIC=y
1297CONFIG_ZLIB_INFLATE=y
1298CONFIG_ZLIB_DEFLATE=y
1299CONFIG_DECOMPRESS_GZIP=y
1300CONFIG_DECOMPRESS_BZIP2=y
1301CONFIG_DECOMPRESS_LZMA=y
1302CONFIG_HAS_IOMEM=y
1303CONFIG_HAS_IOPORT=y
1304CONFIG_HAS_DMA=y
1305CONFIG_NLATTR=y
diff --git a/arch/arm/configs/s3c2410_defconfig b/arch/arm/configs/s3c2410_defconfig
index 2d58b8fe59be..b49810461e41 100644
--- a/arch/arm/configs/s3c2410_defconfig
+++ b/arch/arm/configs/s3c2410_defconfig
@@ -260,6 +260,7 @@ CONFIG_MACH_NEXCODER_2440=y
260CONFIG_SMDK2440_CPU2440=y 260CONFIG_SMDK2440_CPU2440=y
261CONFIG_MACH_AT2440EVB=y 261CONFIG_MACH_AT2440EVB=y
262CONFIG_CPU_S3C2442=y 262CONFIG_CPU_S3C2442=y
263CONFIG_MACH_MINI2440=y
263 264
264# 265#
265# S3C2442 Machines 266# S3C2442 Machines
@@ -2298,7 +2299,6 @@ CONFIG_DEBUG_ERRORS=y
2298# CONFIG_DEBUG_STACK_USAGE is not set 2299# CONFIG_DEBUG_STACK_USAGE is not set
2299CONFIG_DEBUG_LL=y 2300CONFIG_DEBUG_LL=y
2300# CONFIG_DEBUG_ICEDCC is not set 2301# CONFIG_DEBUG_ICEDCC is not set
2301CONFIG_DEBUG_S3C_PORT=y
2302CONFIG_DEBUG_S3C_UART=0 2302CONFIG_DEBUG_S3C_UART=0
2303 2303
2304# 2304#
diff --git a/arch/arm/configs/s3c6400_defconfig b/arch/arm/configs/s3c6400_defconfig
index 2e8fa50e9a09..32860609e057 100644
--- a/arch/arm/configs/s3c6400_defconfig
+++ b/arch/arm/configs/s3c6400_defconfig
@@ -816,7 +816,6 @@ CONFIG_DEBUG_ERRORS=y
816# CONFIG_DEBUG_STACK_USAGE is not set 816# CONFIG_DEBUG_STACK_USAGE is not set
817CONFIG_DEBUG_LL=y 817CONFIG_DEBUG_LL=y
818# CONFIG_DEBUG_ICEDCC is not set 818# CONFIG_DEBUG_ICEDCC is not set
819CONFIG_DEBUG_S3C_PORT=y
820CONFIG_DEBUG_S3C_UART=0 819CONFIG_DEBUG_S3C_UART=0
821 820
822# 821#
diff --git a/arch/arm/configs/tct_hammer_defconfig b/arch/arm/configs/tct_hammer_defconfig
index 07dfb98df4f0..9d32faef05f6 100644
--- a/arch/arm/configs/tct_hammer_defconfig
+++ b/arch/arm/configs/tct_hammer_defconfig
@@ -857,7 +857,6 @@ CONFIG_DEBUG_ERRORS=y
857# CONFIG_DEBUG_STACK_USAGE is not set 857# CONFIG_DEBUG_STACK_USAGE is not set
858CONFIG_DEBUG_LL=y 858CONFIG_DEBUG_LL=y
859# CONFIG_DEBUG_ICEDCC is not set 859# CONFIG_DEBUG_ICEDCC is not set
860# CONFIG_DEBUG_S3C_PORT is not set
861CONFIG_DEBUG_S3C_UART=0 860CONFIG_DEBUG_S3C_UART=0
862 861
863# 862#
diff --git a/arch/arm/configs/u300_defconfig b/arch/arm/configs/u300_defconfig
index 2d827e121147..7d61ae6e75da 100644
--- a/arch/arm/configs/u300_defconfig
+++ b/arch/arm/configs/u300_defconfig
@@ -1,7 +1,7 @@
1# 1#
2# Automatically generated make config: don't edit 2# Automatically generated make config: don't edit
3# Linux kernel version: 2.6.30-rc6 3# Linux kernel version: 2.6.31-rc3
4# Mon Jun 1 09:18:22 2009 4# Thu Jul 16 23:36:10 2009
5# 5#
6CONFIG_ARM=y 6CONFIG_ARM=y
7CONFIG_SYS_SUPPORTS_APM_EMULATION=y 7CONFIG_SYS_SUPPORTS_APM_EMULATION=y
@@ -9,7 +9,6 @@ CONFIG_GENERIC_GPIO=y
9CONFIG_GENERIC_TIME=y 9CONFIG_GENERIC_TIME=y
10CONFIG_GENERIC_CLOCKEVENTS=y 10CONFIG_GENERIC_CLOCKEVENTS=y
11CONFIG_MMU=y 11CONFIG_MMU=y
12# CONFIG_NO_IOPORT is not set
13CONFIG_GENERIC_HARDIRQS=y 12CONFIG_GENERIC_HARDIRQS=y
14CONFIG_STACKTRACE_SUPPORT=y 13CONFIG_STACKTRACE_SUPPORT=y
15CONFIG_HAVE_LATENCYTOP_SUPPORT=y 14CONFIG_HAVE_LATENCYTOP_SUPPORT=y
@@ -18,13 +17,12 @@ CONFIG_TRACE_IRQFLAGS_SUPPORT=y
18CONFIG_HARDIRQS_SW_RESEND=y 17CONFIG_HARDIRQS_SW_RESEND=y
19CONFIG_GENERIC_IRQ_PROBE=y 18CONFIG_GENERIC_IRQ_PROBE=y
20CONFIG_RWSEM_GENERIC_SPINLOCK=y 19CONFIG_RWSEM_GENERIC_SPINLOCK=y
21# CONFIG_ARCH_HAS_ILOG2_U32 is not set
22# CONFIG_ARCH_HAS_ILOG2_U64 is not set
23CONFIG_GENERIC_HWEIGHT=y 20CONFIG_GENERIC_HWEIGHT=y
24CONFIG_GENERIC_CALIBRATE_DELAY=y 21CONFIG_GENERIC_CALIBRATE_DELAY=y
25CONFIG_GENERIC_HARDIRQS_NO__DO_IRQ=y 22CONFIG_GENERIC_HARDIRQS_NO__DO_IRQ=y
26CONFIG_VECTORS_BASE=0xffff0000 23CONFIG_VECTORS_BASE=0xffff0000
27CONFIG_DEFCONFIG_LIST="/lib/modules/$UNAME_RELEASE/.config" 24CONFIG_DEFCONFIG_LIST="/lib/modules/$UNAME_RELEASE/.config"
25CONFIG_CONSTRUCTORS=y
28 26
29# 27#
30# General setup 28# General setup
@@ -68,7 +66,6 @@ CONFIG_SYSCTL_SYSCALL=y
68CONFIG_KALLSYMS=y 66CONFIG_KALLSYMS=y
69# CONFIG_KALLSYMS_ALL is not set 67# CONFIG_KALLSYMS_ALL is not set
70# CONFIG_KALLSYMS_EXTRA_PASS is not set 68# CONFIG_KALLSYMS_EXTRA_PASS is not set
71# CONFIG_STRIP_ASM_SYMS is not set
72CONFIG_HOTPLUG=y 69CONFIG_HOTPLUG=y
73CONFIG_PRINTK=y 70CONFIG_PRINTK=y
74CONFIG_BUG=y 71CONFIG_BUG=y
@@ -81,8 +78,13 @@ CONFIG_TIMERFD=y
81CONFIG_EVENTFD=y 78CONFIG_EVENTFD=y
82CONFIG_SHMEM=y 79CONFIG_SHMEM=y
83# CONFIG_AIO is not set 80# CONFIG_AIO is not set
81
82#
83# Performance Counters
84#
84# CONFIG_VM_EVENT_COUNTERS is not set 85# CONFIG_VM_EVENT_COUNTERS is not set
85CONFIG_SLUB_DEBUG=y 86CONFIG_SLUB_DEBUG=y
87# CONFIG_STRIP_ASM_SYMS is not set
86CONFIG_COMPAT_BRK=y 88CONFIG_COMPAT_BRK=y
87# CONFIG_SLAB is not set 89# CONFIG_SLAB is not set
88CONFIG_SLUB=y 90CONFIG_SLUB=y
@@ -94,6 +96,10 @@ CONFIG_HAVE_OPROFILE=y
94CONFIG_HAVE_KPROBES=y 96CONFIG_HAVE_KPROBES=y
95CONFIG_HAVE_KRETPROBES=y 97CONFIG_HAVE_KRETPROBES=y
96CONFIG_HAVE_CLK=y 98CONFIG_HAVE_CLK=y
99
100#
101# GCOV-based kernel profiling
102#
97# CONFIG_SLOW_WORK is not set 103# CONFIG_SLOW_WORK is not set
98CONFIG_HAVE_GENERIC_DMA_COHERENT=y 104CONFIG_HAVE_GENERIC_DMA_COHERENT=y
99CONFIG_SLABINFO=y 105CONFIG_SLABINFO=y
@@ -106,7 +112,7 @@ CONFIG_MODULE_UNLOAD=y
106# CONFIG_MODVERSIONS is not set 112# CONFIG_MODVERSIONS is not set
107# CONFIG_MODULE_SRCVERSION_ALL is not set 113# CONFIG_MODULE_SRCVERSION_ALL is not set
108CONFIG_BLOCK=y 114CONFIG_BLOCK=y
109# CONFIG_LBD is not set 115# CONFIG_LBDAF is not set
110# CONFIG_BLK_DEV_BSG is not set 116# CONFIG_BLK_DEV_BSG is not set
111# CONFIG_BLK_DEV_INTEGRITY is not set 117# CONFIG_BLK_DEV_INTEGRITY is not set
112 118
@@ -138,9 +144,9 @@ CONFIG_DEFAULT_IOSCHED="deadline"
138# CONFIG_ARCH_EP93XX is not set 144# CONFIG_ARCH_EP93XX is not set
139# CONFIG_ARCH_FOOTBRIDGE is not set 145# CONFIG_ARCH_FOOTBRIDGE is not set
140# CONFIG_ARCH_MXC is not set 146# CONFIG_ARCH_MXC is not set
147# CONFIG_ARCH_STMP3XXX is not set
141# CONFIG_ARCH_NETX is not set 148# CONFIG_ARCH_NETX is not set
142# CONFIG_ARCH_H720X is not set 149# CONFIG_ARCH_H720X is not set
143# CONFIG_ARCH_IMX is not set
144# CONFIG_ARCH_IOP13XX is not set 150# CONFIG_ARCH_IOP13XX is not set
145# CONFIG_ARCH_IOP32X is not set 151# CONFIG_ARCH_IOP32X is not set
146# CONFIG_ARCH_IOP33X is not set 152# CONFIG_ARCH_IOP33X is not set
@@ -216,8 +222,8 @@ CONFIG_ARM_THUMB=y
216# CONFIG_CPU_DCACHE_DISABLE is not set 222# CONFIG_CPU_DCACHE_DISABLE is not set
217# CONFIG_CPU_DCACHE_WRITETHROUGH is not set 223# CONFIG_CPU_DCACHE_WRITETHROUGH is not set
218# CONFIG_CPU_CACHE_ROUND_ROBIN is not set 224# CONFIG_CPU_CACHE_ROUND_ROBIN is not set
219# CONFIG_OUTER_CACHE is not set
220CONFIG_ARM_VIC=y 225CONFIG_ARM_VIC=y
226CONFIG_ARM_VIC_NR=2
221CONFIG_COMMON_CLKDEV=y 227CONFIG_COMMON_CLKDEV=y
222 228
223# 229#
@@ -243,7 +249,6 @@ CONFIG_PREEMPT=y
243CONFIG_HZ=100 249CONFIG_HZ=100
244CONFIG_AEABI=y 250CONFIG_AEABI=y
245CONFIG_OABI_COMPAT=y 251CONFIG_OABI_COMPAT=y
246CONFIG_ARCH_FLATMEM_HAS_HOLES=y
247# CONFIG_ARCH_SPARSEMEM_DEFAULT is not set 252# CONFIG_ARCH_SPARSEMEM_DEFAULT is not set
248# CONFIG_ARCH_SELECT_MEMORY_MODEL is not set 253# CONFIG_ARCH_SELECT_MEMORY_MODEL is not set
249# CONFIG_HIGHMEM is not set 254# CONFIG_HIGHMEM is not set
@@ -258,17 +263,18 @@ CONFIG_SPLIT_PTLOCK_CPUS=4096
258# CONFIG_PHYS_ADDR_T_64BIT is not set 263# CONFIG_PHYS_ADDR_T_64BIT is not set
259CONFIG_ZONE_DMA_FLAG=0 264CONFIG_ZONE_DMA_FLAG=0
260CONFIG_VIRT_TO_BUS=y 265CONFIG_VIRT_TO_BUS=y
261CONFIG_UNEVICTABLE_LRU=y
262CONFIG_HAVE_MLOCK=y 266CONFIG_HAVE_MLOCK=y
263CONFIG_HAVE_MLOCKED_PAGE_BIT=y 267CONFIG_HAVE_MLOCKED_PAGE_BIT=y
268CONFIG_DEFAULT_MMAP_MIN_ADDR=4096
264CONFIG_ALIGNMENT_TRAP=y 269CONFIG_ALIGNMENT_TRAP=y
270# CONFIG_UACCESS_WITH_MEMCPY is not set
265 271
266# 272#
267# Boot options 273# Boot options
268# 274#
269CONFIG_ZBOOT_ROM_TEXT=0x0 275CONFIG_ZBOOT_ROM_TEXT=0x0
270CONFIG_ZBOOT_ROM_BSS=0x0 276CONFIG_ZBOOT_ROM_BSS=0x0
271CONFIG_CMDLINE="root=/dev/mtdblock2 rw rootfstype=yaffs2 console=ttyAMA0,115200n8 ab3100.force=0,0x48 mtdparts=u300nand:128k@0x0(bootrecords)ro,8064k@128k(free)ro,253952k@8192k(platform) lpj=515072" 277CONFIG_CMDLINE="root=/dev/ram0 rw rootfstype=rootfs console=ttyAMA0,115200n8 lpj=515072"
272# CONFIG_XIP_KERNEL is not set 278# CONFIG_XIP_KERNEL is not set
273# CONFIG_KEXEC is not set 279# CONFIG_KEXEC is not set
274 280
@@ -359,6 +365,7 @@ CONFIG_DEFAULT_TCP_CONG="cubic"
359# CONFIG_ECONET is not set 365# CONFIG_ECONET is not set
360# CONFIG_WAN_ROUTER is not set 366# CONFIG_WAN_ROUTER is not set
361# CONFIG_PHONET is not set 367# CONFIG_PHONET is not set
368# CONFIG_IEEE802154 is not set
362# CONFIG_NET_SCHED is not set 369# CONFIG_NET_SCHED is not set
363# CONFIG_DCB is not set 370# CONFIG_DCB is not set
364 371
@@ -497,6 +504,7 @@ CONFIG_MISC_DEVICES=y
497# CONFIG_EEPROM_AT24 is not set 504# CONFIG_EEPROM_AT24 is not set
498# CONFIG_EEPROM_AT25 is not set 505# CONFIG_EEPROM_AT25 is not set
499# CONFIG_EEPROM_LEGACY is not set 506# CONFIG_EEPROM_LEGACY is not set
507# CONFIG_EEPROM_MAX6875 is not set
500# CONFIG_EEPROM_93CX6 is not set 508# CONFIG_EEPROM_93CX6 is not set
501CONFIG_HAVE_IDE=y 509CONFIG_HAVE_IDE=y
502# CONFIG_IDE is not set 510# CONFIG_IDE is not set
@@ -533,12 +541,14 @@ CONFIG_INPUT_EVDEV=y
533# 541#
534CONFIG_INPUT_KEYBOARD=y 542CONFIG_INPUT_KEYBOARD=y
535# CONFIG_KEYBOARD_ATKBD is not set 543# CONFIG_KEYBOARD_ATKBD is not set
536# CONFIG_KEYBOARD_SUNKBD is not set
537# CONFIG_KEYBOARD_LKKBD is not set 544# CONFIG_KEYBOARD_LKKBD is not set
538# CONFIG_KEYBOARD_XTKBD is not set 545# CONFIG_KEYBOARD_GPIO is not set
546# CONFIG_KEYBOARD_MATRIX is not set
547# CONFIG_KEYBOARD_LM8323 is not set
539# CONFIG_KEYBOARD_NEWTON is not set 548# CONFIG_KEYBOARD_NEWTON is not set
540# CONFIG_KEYBOARD_STOWAWAY is not set 549# CONFIG_KEYBOARD_STOWAWAY is not set
541# CONFIG_KEYBOARD_GPIO is not set 550# CONFIG_KEYBOARD_SUNKBD is not set
551# CONFIG_KEYBOARD_XTKBD is not set
542# CONFIG_INPUT_MOUSE is not set 552# CONFIG_INPUT_MOUSE is not set
543# CONFIG_INPUT_JOYSTICK is not set 553# CONFIG_INPUT_JOYSTICK is not set
544# CONFIG_INPUT_TABLET is not set 554# CONFIG_INPUT_TABLET is not set
@@ -597,9 +607,11 @@ CONFIG_I2C_HELPER_AUTO=y
597# 607#
598# I2C system bus drivers (mostly embedded / system-on-chip) 608# I2C system bus drivers (mostly embedded / system-on-chip)
599# 609#
610# CONFIG_I2C_DESIGNWARE is not set
600# CONFIG_I2C_GPIO is not set 611# CONFIG_I2C_GPIO is not set
601# CONFIG_I2C_OCORES is not set 612# CONFIG_I2C_OCORES is not set
602# CONFIG_I2C_SIMTEC is not set 613# CONFIG_I2C_SIMTEC is not set
614CONFIG_I2C_STU300=y
603 615
604# 616#
605# External I2C/SMBus adapter drivers 617# External I2C/SMBus adapter drivers
@@ -620,7 +632,6 @@ CONFIG_I2C_HELPER_AUTO=y
620# CONFIG_SENSORS_PCF8574 is not set 632# CONFIG_SENSORS_PCF8574 is not set
621# CONFIG_PCF8575 is not set 633# CONFIG_PCF8575 is not set
622# CONFIG_SENSORS_PCA9539 is not set 634# CONFIG_SENSORS_PCA9539 is not set
623# CONFIG_SENSORS_MAX6875 is not set
624# CONFIG_SENSORS_TSL2550 is not set 635# CONFIG_SENSORS_TSL2550 is not set
625# CONFIG_I2C_DEBUG_CORE is not set 636# CONFIG_I2C_DEBUG_CORE is not set
626# CONFIG_I2C_DEBUG_ALGO is not set 637# CONFIG_I2C_DEBUG_ALGO is not set
@@ -635,6 +646,7 @@ CONFIG_SPI_MASTER=y
635# 646#
636# CONFIG_SPI_BITBANG is not set 647# CONFIG_SPI_BITBANG is not set
637# CONFIG_SPI_GPIO is not set 648# CONFIG_SPI_GPIO is not set
649CONFIG_SPI_PL022=y
638 650
639# 651#
640# SPI Protocol Masters 652# SPI Protocol Masters
@@ -647,6 +659,7 @@ CONFIG_POWER_SUPPLY=y
647# CONFIG_PDA_POWER is not set 659# CONFIG_PDA_POWER is not set
648# CONFIG_BATTERY_DS2760 is not set 660# CONFIG_BATTERY_DS2760 is not set
649# CONFIG_BATTERY_BQ27x00 is not set 661# CONFIG_BATTERY_BQ27x00 is not set
662# CONFIG_BATTERY_MAX17040 is not set
650# CONFIG_HWMON is not set 663# CONFIG_HWMON is not set
651# CONFIG_THERMAL is not set 664# CONFIG_THERMAL is not set
652# CONFIG_THERMAL_HWMON is not set 665# CONFIG_THERMAL_HWMON is not set
@@ -657,6 +670,7 @@ CONFIG_WATCHDOG=y
657# Watchdog Device Drivers 670# Watchdog Device Drivers
658# 671#
659# CONFIG_SOFT_WATCHDOG is not set 672# CONFIG_SOFT_WATCHDOG is not set
673CONFIG_COH901327_WATCHDOG=y
660CONFIG_SSB_POSSIBLE=y 674CONFIG_SSB_POSSIBLE=y
661 675
662# 676#
@@ -678,22 +692,9 @@ CONFIG_SSB_POSSIBLE=y
678# CONFIG_MFD_WM8400 is not set 692# CONFIG_MFD_WM8400 is not set
679# CONFIG_MFD_WM8350_I2C is not set 693# CONFIG_MFD_WM8350_I2C is not set
680# CONFIG_MFD_PCF50633 is not set 694# CONFIG_MFD_PCF50633 is not set
681 695CONFIG_AB3100_CORE=y
682# 696# CONFIG_EZX_PCAP is not set
683# Multimedia devices 697# CONFIG_MEDIA_SUPPORT is not set
684#
685
686#
687# Multimedia core support
688#
689# CONFIG_VIDEO_DEV is not set
690# CONFIG_DVB_CORE is not set
691# CONFIG_VIDEO_MEDIA is not set
692
693#
694# Multimedia drivers
695#
696# CONFIG_DAB is not set
697 698
698# 699#
699# Graphics support 700# Graphics support
@@ -760,6 +761,11 @@ CONFIG_SND_JACK=y
760# CONFIG_SND_VERBOSE_PROCFS is not set 761# CONFIG_SND_VERBOSE_PROCFS is not set
761# CONFIG_SND_VERBOSE_PRINTK is not set 762# CONFIG_SND_VERBOSE_PRINTK is not set
762# CONFIG_SND_DEBUG is not set 763# CONFIG_SND_DEBUG is not set
764# CONFIG_SND_RAWMIDI_SEQ is not set
765# CONFIG_SND_OPL3_LIB_SEQ is not set
766# CONFIG_SND_OPL4_LIB_SEQ is not set
767# CONFIG_SND_SBAWE_SEQ is not set
768# CONFIG_SND_EMU10K1_SEQ is not set
763# CONFIG_SND_DRIVERS is not set 769# CONFIG_SND_DRIVERS is not set
764# CONFIG_SND_ARM is not set 770# CONFIG_SND_ARM is not set
765# CONFIG_SND_SPI is not set 771# CONFIG_SND_SPI is not set
@@ -770,7 +776,7 @@ CONFIG_SND_SOC_I2C_AND_SPI=y
770# CONFIG_HID_SUPPORT is not set 776# CONFIG_HID_SUPPORT is not set
771# CONFIG_USB_SUPPORT is not set 777# CONFIG_USB_SUPPORT is not set
772CONFIG_MMC=y 778CONFIG_MMC=y
773# CONFIG_MMC_DEBUG is not set 779CONFIG_MMC_DEBUG=y
774# CONFIG_MMC_UNSAFE_RESUME is not set 780# CONFIG_MMC_UNSAFE_RESUME is not set
775 781
776# 782#
@@ -797,7 +803,7 @@ CONFIG_LEDS_CLASS=y
797# 803#
798# CONFIG_LEDS_PCA9532 is not set 804# CONFIG_LEDS_PCA9532 is not set
799# CONFIG_LEDS_GPIO is not set 805# CONFIG_LEDS_GPIO is not set
800# CONFIG_LEDS_LP5521 is not set 806# CONFIG_LEDS_LP3944 is not set
801# CONFIG_LEDS_PCA955X is not set 807# CONFIG_LEDS_PCA955X is not set
802# CONFIG_LEDS_DAC124S085 is not set 808# CONFIG_LEDS_DAC124S085 is not set
803# CONFIG_LEDS_BD2802 is not set 809# CONFIG_LEDS_BD2802 is not set
@@ -845,6 +851,7 @@ CONFIG_RTC_INTF_DEV=y
845# CONFIG_RTC_DRV_S35390A is not set 851# CONFIG_RTC_DRV_S35390A is not set
846# CONFIG_RTC_DRV_FM3130 is not set 852# CONFIG_RTC_DRV_FM3130 is not set
847# CONFIG_RTC_DRV_RX8581 is not set 853# CONFIG_RTC_DRV_RX8581 is not set
854# CONFIG_RTC_DRV_RX8025 is not set
848 855
849# 856#
850# SPI RTC drivers 857# SPI RTC drivers
@@ -887,7 +894,10 @@ CONFIG_REGULATOR=y
887# CONFIG_REGULATOR_DEBUG is not set 894# CONFIG_REGULATOR_DEBUG is not set
888# CONFIG_REGULATOR_FIXED_VOLTAGE is not set 895# CONFIG_REGULATOR_FIXED_VOLTAGE is not set
889# CONFIG_REGULATOR_VIRTUAL_CONSUMER is not set 896# CONFIG_REGULATOR_VIRTUAL_CONSUMER is not set
897# CONFIG_REGULATOR_USERSPACE_CONSUMER is not set
890# CONFIG_REGULATOR_BQ24022 is not set 898# CONFIG_REGULATOR_BQ24022 is not set
899# CONFIG_REGULATOR_MAX1586 is not set
900# CONFIG_REGULATOR_LP3971 is not set
891# CONFIG_UIO is not set 901# CONFIG_UIO is not set
892# CONFIG_STAGING is not set 902# CONFIG_STAGING is not set
893 903
@@ -900,16 +910,19 @@ CONFIG_REGULATOR=y
900# CONFIG_REISERFS_FS is not set 910# CONFIG_REISERFS_FS is not set
901# CONFIG_JFS_FS is not set 911# CONFIG_JFS_FS is not set
902# CONFIG_FS_POSIX_ACL is not set 912# CONFIG_FS_POSIX_ACL is not set
903CONFIG_FILE_LOCKING=y
904# CONFIG_XFS_FS is not set 913# CONFIG_XFS_FS is not set
905# CONFIG_OCFS2_FS is not set 914# CONFIG_OCFS2_FS is not set
906# CONFIG_BTRFS_FS is not set 915# CONFIG_BTRFS_FS is not set
916CONFIG_FILE_LOCKING=y
917CONFIG_FSNOTIFY=y
907# CONFIG_DNOTIFY is not set 918# CONFIG_DNOTIFY is not set
908# CONFIG_INOTIFY is not set 919# CONFIG_INOTIFY is not set
920CONFIG_INOTIFY_USER=y
909# CONFIG_QUOTA is not set 921# CONFIG_QUOTA is not set
910# CONFIG_AUTOFS_FS is not set 922# CONFIG_AUTOFS_FS is not set
911# CONFIG_AUTOFS4_FS is not set 923# CONFIG_AUTOFS4_FS is not set
912CONFIG_FUSE_FS=y 924CONFIG_FUSE_FS=y
925# CONFIG_CUSE is not set
913 926
914# 927#
915# Caches 928# Caches
@@ -1033,6 +1046,7 @@ CONFIG_TIMER_STATS=y
1033# CONFIG_DEBUG_OBJECTS is not set 1046# CONFIG_DEBUG_OBJECTS is not set
1034# CONFIG_SLUB_DEBUG_ON is not set 1047# CONFIG_SLUB_DEBUG_ON is not set
1035# CONFIG_SLUB_STATS is not set 1048# CONFIG_SLUB_STATS is not set
1049# CONFIG_DEBUG_KMEMLEAK is not set
1036# CONFIG_DEBUG_PREEMPT is not set 1050# CONFIG_DEBUG_PREEMPT is not set
1037# CONFIG_DEBUG_RT_MUTEXES is not set 1051# CONFIG_DEBUG_RT_MUTEXES is not set
1038# CONFIG_RT_MUTEX_TESTER is not set 1052# CONFIG_RT_MUTEX_TESTER is not set
@@ -1063,18 +1077,16 @@ CONFIG_DEBUG_INFO=y
1063# CONFIG_PAGE_POISONING is not set 1077# CONFIG_PAGE_POISONING is not set
1064CONFIG_HAVE_FUNCTION_TRACER=y 1078CONFIG_HAVE_FUNCTION_TRACER=y
1065CONFIG_TRACING_SUPPORT=y 1079CONFIG_TRACING_SUPPORT=y
1066 1080CONFIG_FTRACE=y
1067#
1068# Tracers
1069#
1070# CONFIG_FUNCTION_TRACER is not set 1081# CONFIG_FUNCTION_TRACER is not set
1071# CONFIG_IRQSOFF_TRACER is not set 1082# CONFIG_IRQSOFF_TRACER is not set
1072# CONFIG_PREEMPT_TRACER is not set 1083# CONFIG_PREEMPT_TRACER is not set
1073# CONFIG_SCHED_TRACER is not set 1084# CONFIG_SCHED_TRACER is not set
1074# CONFIG_CONTEXT_SWITCH_TRACER is not set 1085# CONFIG_ENABLE_DEFAULT_TRACERS is not set
1075# CONFIG_EVENT_TRACER is not set
1076# CONFIG_BOOT_TRACER is not set 1086# CONFIG_BOOT_TRACER is not set
1077# CONFIG_TRACE_BRANCH_PROFILING is not set 1087CONFIG_BRANCH_PROFILE_NONE=y
1088# CONFIG_PROFILE_ANNOTATED_BRANCHES is not set
1089# CONFIG_PROFILE_ALL_BRANCHES is not set
1078# CONFIG_STACK_TRACER is not set 1090# CONFIG_STACK_TRACER is not set
1079# CONFIG_KMEMTRACE is not set 1091# CONFIG_KMEMTRACE is not set
1080# CONFIG_WORKQUEUE_TRACER is not set 1092# CONFIG_WORKQUEUE_TRACER is not set
diff --git a/arch/arm/include/asm/atomic.h b/arch/arm/include/asm/atomic.h
index 9e07fe507029..9ed2377fe8e5 100644
--- a/arch/arm/include/asm/atomic.h
+++ b/arch/arm/include/asm/atomic.h
@@ -159,8 +159,6 @@ static inline void atomic_clear_mask(unsigned long mask, unsigned long *addr)
159 159
160#else /* ARM_ARCH_6 */ 160#else /* ARM_ARCH_6 */
161 161
162#include <asm/system.h>
163
164#ifdef CONFIG_SMP 162#ifdef CONFIG_SMP
165#error SMP not supported on pre-ARMv6 CPUs 163#error SMP not supported on pre-ARMv6 CPUs
166#endif 164#endif
diff --git a/arch/arm/include/asm/page.h b/arch/arm/include/asm/page.h
index be962c1349c4..9c746af1bf6e 100644
--- a/arch/arm/include/asm/page.h
+++ b/arch/arm/include/asm/page.h
@@ -12,7 +12,7 @@
12 12
13/* PAGE_SHIFT determines the page size */ 13/* PAGE_SHIFT determines the page size */
14#define PAGE_SHIFT 12 14#define PAGE_SHIFT 12
15#define PAGE_SIZE (1UL << PAGE_SHIFT) 15#define PAGE_SIZE (_AC(1,UL) << PAGE_SHIFT)
16#define PAGE_MASK (~(PAGE_SIZE-1)) 16#define PAGE_MASK (~(PAGE_SIZE-1))
17 17
18#ifndef __ASSEMBLY__ 18#ifndef __ASSEMBLY__
diff --git a/arch/arm/include/asm/pgtable.h b/arch/arm/include/asm/pgtable.h
index 1cd2d6416bda..c433c6c73112 100644
--- a/arch/arm/include/asm/pgtable.h
+++ b/arch/arm/include/asm/pgtable.h
@@ -285,15 +285,6 @@ extern struct page *empty_zero_page;
285#define pte_young(pte) (pte_val(pte) & L_PTE_YOUNG) 285#define pte_young(pte) (pte_val(pte) & L_PTE_YOUNG)
286#define pte_special(pte) (0) 286#define pte_special(pte) (0)
287 287
288/*
289 * The following only works if pte_present() is not true.
290 */
291#define pte_file(pte) (pte_val(pte) & L_PTE_FILE)
292#define pte_to_pgoff(x) (pte_val(x) >> 2)
293#define pgoff_to_pte(x) __pte(((x) << 2) | L_PTE_FILE)
294
295#define PTE_FILE_MAX_BITS 30
296
297#define PTE_BIT_FUNC(fn,op) \ 288#define PTE_BIT_FUNC(fn,op) \
298static inline pte_t pte_##fn(pte_t pte) { pte_val(pte) op; return pte; } 289static inline pte_t pte_##fn(pte_t pte) { pte_val(pte) op; return pte; }
299 290
@@ -384,16 +375,50 @@ static inline pte_t pte_modify(pte_t pte, pgprot_t newprot)
384 375
385extern pgd_t swapper_pg_dir[PTRS_PER_PGD]; 376extern pgd_t swapper_pg_dir[PTRS_PER_PGD];
386 377
387/* Encode and decode a swap entry. 378/*
379 * Encode and decode a swap entry. Swap entries are stored in the Linux
380 * page tables as follows:
388 * 381 *
389 * We support up to 32GB of swap on 4k machines 382 * 3 3 2 2 2 2 2 2 2 2 2 2 1 1 1 1 1 1 1 1 1 1
383 * 1 0 9 8 7 6 5 4 3 2 1 0 9 8 7 6 5 4 3 2 1 0 9 8 7 6 5 4 3 2 1 0
384 * <--------------- offset --------------------> <--- type --> 0 0
385 *
386 * This gives us up to 127 swap files and 32GB per swap file. Note that
387 * the offset field is always non-zero.
390 */ 388 */
391#define __swp_type(x) (((x).val >> 2) & 0x7f) 389#define __SWP_TYPE_SHIFT 2
392#define __swp_offset(x) ((x).val >> 9) 390#define __SWP_TYPE_BITS 7
393#define __swp_entry(type,offset) ((swp_entry_t) { ((type) << 2) | ((offset) << 9) }) 391#define __SWP_TYPE_MASK ((1 << __SWP_TYPE_BITS) - 1)
392#define __SWP_OFFSET_SHIFT (__SWP_TYPE_BITS + __SWP_TYPE_SHIFT)
393
394#define __swp_type(x) (((x).val >> __SWP_TYPE_SHIFT) & __SWP_TYPE_MASK)
395#define __swp_offset(x) ((x).val >> __SWP_OFFSET_SHIFT)
396#define __swp_entry(type,offset) ((swp_entry_t) { ((type) << __SWP_TYPE_SHIFT) | ((offset) << __SWP_OFFSET_SHIFT) })
397
394#define __pte_to_swp_entry(pte) ((swp_entry_t) { pte_val(pte) }) 398#define __pte_to_swp_entry(pte) ((swp_entry_t) { pte_val(pte) })
395#define __swp_entry_to_pte(swp) ((pte_t) { (swp).val }) 399#define __swp_entry_to_pte(swp) ((pte_t) { (swp).val })
396 400
401/*
402 * It is an error for the kernel to have more swap files than we can
403 * encode in the PTEs. This ensures that we know when MAX_SWAPFILES
404 * is increased beyond what we presently support.
405 */
406#define MAX_SWAPFILES_CHECK() BUILD_BUG_ON(MAX_SWAPFILES_SHIFT > __SWP_TYPE_BITS)
407
408/*
409 * Encode and decode a file entry. File entries are stored in the Linux
410 * page tables as follows:
411 *
412 * 3 3 2 2 2 2 2 2 2 2 2 2 1 1 1 1 1 1 1 1 1 1
413 * 1 0 9 8 7 6 5 4 3 2 1 0 9 8 7 6 5 4 3 2 1 0 9 8 7 6 5 4 3 2 1 0
414 * <------------------------ offset -------------------------> 1 0
415 */
416#define pte_file(pte) (pte_val(pte) & L_PTE_FILE)
417#define pte_to_pgoff(x) (pte_val(x) >> 2)
418#define pgoff_to_pte(x) __pte(((x) << 2) | L_PTE_FILE)
419
420#define PTE_FILE_MAX_BITS 30
421
397/* Needs to be defined here and not in linux/mm.h, as it is arch dependent */ 422/* Needs to be defined here and not in linux/mm.h, as it is arch dependent */
398/* FIXME: this is not correct */ 423/* FIXME: this is not correct */
399#define kern_addr_valid(addr) (1) 424#define kern_addr_valid(addr) (1)
diff --git a/arch/arm/include/asm/thread_info.h b/arch/arm/include/asm/thread_info.h
index 4f8848260ee2..73394e50cbca 100644
--- a/arch/arm/include/asm/thread_info.h
+++ b/arch/arm/include/asm/thread_info.h
@@ -73,7 +73,7 @@ struct thread_info {
73 .task = &tsk, \ 73 .task = &tsk, \
74 .exec_domain = &default_exec_domain, \ 74 .exec_domain = &default_exec_domain, \
75 .flags = 0, \ 75 .flags = 0, \
76 .preempt_count = 1, \ 76 .preempt_count = INIT_PREEMPT_COUNT, \
77 .addr_limit = KERNEL_DS, \ 77 .addr_limit = KERNEL_DS, \
78 .cpu_domain = domain_val(DOMAIN_USER, DOMAIN_MANAGER) | \ 78 .cpu_domain = domain_val(DOMAIN_USER, DOMAIN_MANAGER) | \
79 domain_val(DOMAIN_KERNEL, DOMAIN_MANAGER) | \ 79 domain_val(DOMAIN_KERNEL, DOMAIN_MANAGER) | \
diff --git a/arch/arm/kernel/entry-common.S b/arch/arm/kernel/entry-common.S
index 366e5097a41a..8c3de1a350b5 100644
--- a/arch/arm/kernel/entry-common.S
+++ b/arch/arm/kernel/entry-common.S
@@ -148,7 +148,7 @@ trace:
148 sub r0, r0, #MCOUNT_INSN_SIZE 148 sub r0, r0, #MCOUNT_INSN_SIZE
149 mov lr, pc 149 mov lr, pc
150 mov pc, r2 150 mov pc, r2
151 mov lr, r1 @ restore lr 151 ldr lr, [fp, #-4] @ restore lr
152 ldmia sp!, {r0-r3, pc} 152 ldmia sp!, {r0-r3, pc}
153 153
154#endif /* CONFIG_DYNAMIC_FTRACE */ 154#endif /* CONFIG_DYNAMIC_FTRACE */
diff --git a/arch/arm/kernel/irq.c b/arch/arm/kernel/irq.c
index 096f600dc8d8..b7c3490eaa24 100644
--- a/arch/arm/kernel/irq.c
+++ b/arch/arm/kernel/irq.c
@@ -98,17 +98,6 @@ unlock:
98 return 0; 98 return 0;
99} 99}
100 100
101/* Handle bad interrupts */
102static struct irq_desc bad_irq_desc = {
103 .handle_irq = handle_bad_irq,
104 .lock = __SPIN_LOCK_UNLOCKED(bad_irq_desc.lock),
105};
106
107#ifdef CONFIG_CPUMASK_OFFSTACK
108/* We are not allocating bad_irq_desc.affinity or .pending_mask */
109#error "ARM architecture does not support CONFIG_CPUMASK_OFFSTACK."
110#endif
111
112/* 101/*
113 * do_IRQ handles all hardware IRQ's. Decoded IRQs should not 102 * do_IRQ handles all hardware IRQ's. Decoded IRQs should not
114 * come via this function. Instead, they should provide their 103 * come via this function. Instead, they should provide their
@@ -124,10 +113,13 @@ asmlinkage void __exception asm_do_IRQ(unsigned int irq, struct pt_regs *regs)
124 * Some hardware gives randomly wrong interrupts. Rather 113 * Some hardware gives randomly wrong interrupts. Rather
125 * than crashing, do something sensible. 114 * than crashing, do something sensible.
126 */ 115 */
127 if (irq >= NR_IRQS) 116 if (unlikely(irq >= NR_IRQS)) {
128 handle_bad_irq(irq, &bad_irq_desc); 117 if (printk_ratelimit())
129 else 118 printk(KERN_WARNING "Bad IRQ%u\n", irq);
119 ack_bad_irq(irq);
120 } else {
130 generic_handle_irq(irq); 121 generic_handle_irq(irq);
122 }
131 123
132 /* AT91 specific workaround */ 124 /* AT91 specific workaround */
133 irq_finish(irq); 125 irq_finish(irq);
@@ -165,10 +157,6 @@ void __init init_IRQ(void)
165 for (irq = 0; irq < NR_IRQS; irq++) 157 for (irq = 0; irq < NR_IRQS; irq++)
166 irq_desc[irq].status |= IRQ_NOREQUEST | IRQ_NOPROBE; 158 irq_desc[irq].status |= IRQ_NOREQUEST | IRQ_NOPROBE;
167 159
168#ifdef CONFIG_SMP
169 cpumask_setall(bad_irq_desc.affinity);
170 bad_irq_desc.node = smp_processor_id();
171#endif
172 init_arch_irq(); 160 init_arch_irq();
173} 161}
174 162
diff --git a/arch/arm/kernel/vmlinux.lds.S b/arch/arm/kernel/vmlinux.lds.S
index 4340bf3d2c84..69371028a202 100644
--- a/arch/arm/kernel/vmlinux.lds.S
+++ b/arch/arm/kernel/vmlinux.lds.S
@@ -6,6 +6,7 @@
6#include <asm-generic/vmlinux.lds.h> 6#include <asm-generic/vmlinux.lds.h>
7#include <asm/thread_info.h> 7#include <asm/thread_info.h>
8#include <asm/memory.h> 8#include <asm/memory.h>
9#include <asm/page.h>
9 10
10OUTPUT_ARCH(arm) 11OUTPUT_ARCH(arm)
11ENTRY(stext) 12ENTRY(stext)
@@ -63,7 +64,7 @@ SECTIONS
63 usr/built-in.o(.init.ramfs) 64 usr/built-in.o(.init.ramfs)
64 __initramfs_end = .; 65 __initramfs_end = .;
65#endif 66#endif
66 . = ALIGN(4096); 67 . = ALIGN(PAGE_SIZE);
67 __per_cpu_load = .; 68 __per_cpu_load = .;
68 __per_cpu_start = .; 69 __per_cpu_start = .;
69 *(.data.percpu.page_aligned) 70 *(.data.percpu.page_aligned)
@@ -73,7 +74,7 @@ SECTIONS
73#ifndef CONFIG_XIP_KERNEL 74#ifndef CONFIG_XIP_KERNEL
74 __init_begin = _stext; 75 __init_begin = _stext;
75 INIT_DATA 76 INIT_DATA
76 . = ALIGN(4096); 77 . = ALIGN(PAGE_SIZE);
77 __init_end = .; 78 __init_end = .;
78#endif 79#endif
79 } 80 }
@@ -118,7 +119,7 @@ SECTIONS
118 *(.got) /* Global offset table */ 119 *(.got) /* Global offset table */
119 } 120 }
120 121
121 RODATA 122 RO_DATA(PAGE_SIZE)
122 123
123 _etext = .; /* End of text and rodata section */ 124 _etext = .; /* End of text and rodata section */
124 125
@@ -158,17 +159,17 @@ SECTIONS
158 *(.data.init_task) 159 *(.data.init_task)
159 160
160#ifdef CONFIG_XIP_KERNEL 161#ifdef CONFIG_XIP_KERNEL
161 . = ALIGN(4096); 162 . = ALIGN(PAGE_SIZE);
162 __init_begin = .; 163 __init_begin = .;
163 INIT_DATA 164 INIT_DATA
164 . = ALIGN(4096); 165 . = ALIGN(PAGE_SIZE);
165 __init_end = .; 166 __init_end = .;
166#endif 167#endif
167 168
168 . = ALIGN(4096); 169 . = ALIGN(PAGE_SIZE);
169 __nosave_begin = .; 170 __nosave_begin = .;
170 *(.data.nosave) 171 *(.data.nosave)
171 . = ALIGN(4096); 172 . = ALIGN(PAGE_SIZE);
172 __nosave_end = .; 173 __nosave_end = .;
173 174
174 /* 175 /*
diff --git a/arch/arm/mach-at91/board-sam9g20ek.c b/arch/arm/mach-at91/board-sam9g20ek.c
index cc270beadd5d..a55398ed1211 100644
--- a/arch/arm/mach-at91/board-sam9g20ek.c
+++ b/arch/arm/mach-at91/board-sam9g20ek.c
@@ -24,6 +24,8 @@
24#include <linux/platform_device.h> 24#include <linux/platform_device.h>
25#include <linux/spi/spi.h> 25#include <linux/spi/spi.h>
26#include <linux/spi/at73c213.h> 26#include <linux/spi/at73c213.h>
27#include <linux/gpio_keys.h>
28#include <linux/input.h>
27#include <linux/clk.h> 29#include <linux/clk.h>
28 30
29#include <mach/hardware.h> 31#include <mach/hardware.h>
@@ -218,6 +220,56 @@ static struct gpio_led ek_leds[] = {
218 } 220 }
219}; 221};
220 222
223
224/*
225 * GPIO Buttons
226 */
227#if defined(CONFIG_KEYBOARD_GPIO) || defined(CONFIG_KEYBOARD_GPIO_MODULE)
228static struct gpio_keys_button ek_buttons[] = {
229 {
230 .gpio = AT91_PIN_PA30,
231 .code = BTN_3,
232 .desc = "Button 3",
233 .active_low = 1,
234 .wakeup = 1,
235 },
236 {
237 .gpio = AT91_PIN_PA31,
238 .code = BTN_4,
239 .desc = "Button 4",
240 .active_low = 1,
241 .wakeup = 1,
242 }
243};
244
245static struct gpio_keys_platform_data ek_button_data = {
246 .buttons = ek_buttons,
247 .nbuttons = ARRAY_SIZE(ek_buttons),
248};
249
250static struct platform_device ek_button_device = {
251 .name = "gpio-keys",
252 .id = -1,
253 .num_resources = 0,
254 .dev = {
255 .platform_data = &ek_button_data,
256 }
257};
258
259static void __init ek_add_device_buttons(void)
260{
261 at91_set_gpio_input(AT91_PIN_PA30, 1); /* btn3 */
262 at91_set_deglitch(AT91_PIN_PA30, 1);
263 at91_set_gpio_input(AT91_PIN_PA31, 1); /* btn4 */
264 at91_set_deglitch(AT91_PIN_PA31, 1);
265
266 platform_device_register(&ek_button_device);
267}
268#else
269static void __init ek_add_device_buttons(void) {}
270#endif
271
272
221static struct i2c_board_info __initdata ek_i2c_devices[] = { 273static struct i2c_board_info __initdata ek_i2c_devices[] = {
222 { 274 {
223 I2C_BOARD_INFO("24c512", 0x50), 275 I2C_BOARD_INFO("24c512", 0x50),
@@ -245,6 +297,8 @@ static void __init ek_board_init(void)
245 at91_add_device_i2c(ek_i2c_devices, ARRAY_SIZE(ek_i2c_devices)); 297 at91_add_device_i2c(ek_i2c_devices, ARRAY_SIZE(ek_i2c_devices));
246 /* LEDs */ 298 /* LEDs */
247 at91_gpio_leds(ek_leds, ARRAY_SIZE(ek_leds)); 299 at91_gpio_leds(ek_leds, ARRAY_SIZE(ek_leds));
300 /* Push Buttons */
301 ek_add_device_buttons();
248 /* PCK0 provides MCLK to the WM8731 */ 302 /* PCK0 provides MCLK to the WM8731 */
249 at91_set_B_periph(AT91_PIN_PC1, 0); 303 at91_set_B_periph(AT91_PIN_PC1, 0);
250 /* SSC (for WM8731) */ 304 /* SSC (for WM8731) */
diff --git a/arch/arm/mach-at91/board-sam9rlek.c b/arch/arm/mach-at91/board-sam9rlek.c
index 35e12a49d1a6..f6b5672cabd6 100644
--- a/arch/arm/mach-at91/board-sam9rlek.c
+++ b/arch/arm/mach-at91/board-sam9rlek.c
@@ -186,19 +186,21 @@ static struct fb_monspecs at91fb_default_monspecs = {
186static void at91_lcdc_power_control(int on) 186static void at91_lcdc_power_control(int on)
187{ 187{
188 if (on) 188 if (on)
189 at91_set_gpio_value(AT91_PIN_PA30, 0); /* power up */ 189 at91_set_gpio_value(AT91_PIN_PC1, 0); /* power up */
190 else 190 else
191 at91_set_gpio_value(AT91_PIN_PA30, 1); /* power down */ 191 at91_set_gpio_value(AT91_PIN_PC1, 1); /* power down */
192} 192}
193 193
194/* Driver datas */ 194/* Driver datas */
195static struct atmel_lcdfb_info __initdata ek_lcdc_data = { 195static struct atmel_lcdfb_info __initdata ek_lcdc_data = {
196 .lcdcon_is_backlight = true,
196 .default_bpp = 16, 197 .default_bpp = 16,
197 .default_dmacon = ATMEL_LCDC_DMAEN, 198 .default_dmacon = ATMEL_LCDC_DMAEN,
198 .default_lcdcon2 = AT91SAM9RL_DEFAULT_LCDCON2, 199 .default_lcdcon2 = AT91SAM9RL_DEFAULT_LCDCON2,
199 .default_monspecs = &at91fb_default_monspecs, 200 .default_monspecs = &at91fb_default_monspecs,
200 .atmel_lcdfb_power_control = at91_lcdc_power_control, 201 .atmel_lcdfb_power_control = at91_lcdc_power_control,
201 .guard_time = 1, 202 .guard_time = 1,
203 .lcd_wiring_mode = ATMEL_LCDC_WIRING_RGB,
202}; 204};
203 205
204#else 206#else
diff --git a/arch/arm/mach-davinci/board-dm355-evm.c b/arch/arm/mach-davinci/board-dm355-evm.c
index 5ac2f565d860..d6ab64ccd496 100644
--- a/arch/arm/mach-davinci/board-dm355-evm.c
+++ b/arch/arm/mach-davinci/board-dm355-evm.c
@@ -37,7 +37,6 @@
37#include <mach/serial.h> 37#include <mach/serial.h>
38#include <mach/nand.h> 38#include <mach/nand.h>
39#include <mach/mmc.h> 39#include <mach/mmc.h>
40#include <mach/common.h>
41 40
42#define DAVINCI_ASYNC_EMIF_CONTROL_BASE 0x01e10000 41#define DAVINCI_ASYNC_EMIF_CONTROL_BASE 0x01e10000
43#define DAVINCI_ASYNC_EMIF_DATA_CE0_BASE 0x02000000 42#define DAVINCI_ASYNC_EMIF_DATA_CE0_BASE 0x02000000
diff --git a/arch/arm/mach-davinci/board-dm355-leopard.c b/arch/arm/mach-davinci/board-dm355-leopard.c
index 28c9008df4f4..84ad5d161a87 100644
--- a/arch/arm/mach-davinci/board-dm355-leopard.c
+++ b/arch/arm/mach-davinci/board-dm355-leopard.c
@@ -36,7 +36,6 @@
36#include <mach/serial.h> 36#include <mach/serial.h>
37#include <mach/nand.h> 37#include <mach/nand.h>
38#include <mach/mmc.h> 38#include <mach/mmc.h>
39#include <mach/common.h>
40 39
41#define DAVINCI_ASYNC_EMIF_CONTROL_BASE 0x01e10000 40#define DAVINCI_ASYNC_EMIF_CONTROL_BASE 0x01e10000
42#define DAVINCI_ASYNC_EMIF_DATA_CE0_BASE 0x02000000 41#define DAVINCI_ASYNC_EMIF_DATA_CE0_BASE 0x02000000
diff --git a/arch/arm/mach-davinci/board-dm644x-evm.c b/arch/arm/mach-davinci/board-dm644x-evm.c
index d9d40450bdc5..56c8cd01de9a 100644
--- a/arch/arm/mach-davinci/board-dm644x-evm.c
+++ b/arch/arm/mach-davinci/board-dm644x-evm.c
@@ -45,7 +45,6 @@
45#include <mach/nand.h> 45#include <mach/nand.h>
46#include <mach/mmc.h> 46#include <mach/mmc.h>
47#include <mach/emac.h> 47#include <mach/emac.h>
48#include <mach/common.h>
49 48
50#define DM644X_EVM_PHY_MASK (0x2) 49#define DM644X_EVM_PHY_MASK (0x2)
51#define DM644X_EVM_MDIO_FREQUENCY (2200000) /* PHY bus frequency */ 50#define DM644X_EVM_MDIO_FREQUENCY (2200000) /* PHY bus frequency */
diff --git a/arch/arm/mach-davinci/board-dm646x-evm.c b/arch/arm/mach-davinci/board-dm646x-evm.c
index e17de6352624..8657e72debc1 100644
--- a/arch/arm/mach-davinci/board-dm646x-evm.c
+++ b/arch/arm/mach-davinci/board-dm646x-evm.c
@@ -47,7 +47,6 @@
47#include <mach/i2c.h> 47#include <mach/i2c.h>
48#include <mach/mmc.h> 48#include <mach/mmc.h>
49#include <mach/emac.h> 49#include <mach/emac.h>
50#include <mach/common.h>
51 50
52#define DM646X_EVM_PHY_MASK (0x2) 51#define DM646X_EVM_PHY_MASK (0x2)
53#define DM646X_EVM_MDIO_FREQUENCY (2200000) /* PHY bus frequency */ 52#define DM646X_EVM_MDIO_FREQUENCY (2200000) /* PHY bus frequency */
diff --git a/arch/arm/mach-davinci/board-sffsdr.c b/arch/arm/mach-davinci/board-sffsdr.c
index 748a8e48541e..7acdfd8ac071 100644
--- a/arch/arm/mach-davinci/board-sffsdr.c
+++ b/arch/arm/mach-davinci/board-sffsdr.c
@@ -52,7 +52,6 @@
52#include <mach/serial.h> 52#include <mach/serial.h>
53#include <mach/psc.h> 53#include <mach/psc.h>
54#include <mach/mux.h> 54#include <mach/mux.h>
55#include <mach/common.h>
56 55
57#define SFFSDR_PHY_MASK (0x2) 56#define SFFSDR_PHY_MASK (0x2)
58#define SFFSDR_MDIO_FREQUENCY (2200000) /* PHY bus frequency */ 57#define SFFSDR_MDIO_FREQUENCY (2200000) /* PHY bus frequency */
diff --git a/arch/arm/mach-ep93xx/dma-m2p.c b/arch/arm/mach-ep93xx/dma-m2p.c
index a2df5bb7dff0..dbcac9c40a28 100644
--- a/arch/arm/mach-ep93xx/dma-m2p.c
+++ b/arch/arm/mach-ep93xx/dma-m2p.c
@@ -33,6 +33,7 @@
33#include <linux/err.h> 33#include <linux/err.h>
34#include <linux/interrupt.h> 34#include <linux/interrupt.h>
35#include <linux/module.h> 35#include <linux/module.h>
36#include <linux/io.h>
36 37
37#include <mach/dma.h> 38#include <mach/dma.h>
38#include <mach/hardware.h> 39#include <mach/hardware.h>
diff --git a/arch/arm/mach-ep93xx/include/mach/ts72xx.h b/arch/arm/mach-ep93xx/include/mach/ts72xx.h
index 34ddec081c40..411734422c1d 100644
--- a/arch/arm/mach-ep93xx/include/mach/ts72xx.h
+++ b/arch/arm/mach-ep93xx/include/mach/ts72xx.h
@@ -41,9 +41,6 @@
41#define TS72XX_OPTIONS2_TS9420_BOOT 0x02 41#define TS72XX_OPTIONS2_TS9420_BOOT 0x02
42 42
43 43
44#define TS72XX_NOR_PHYS_BASE 0x60000000
45#define TS72XX_NOR2_PHYS_BASE 0x62000000
46
47#define TS72XX_NAND1_DATA_PHYS_BASE 0x60000000 44#define TS72XX_NAND1_DATA_PHYS_BASE 0x60000000
48#define TS72XX_NAND2_DATA_PHYS_BASE 0x70000000 45#define TS72XX_NAND2_DATA_PHYS_BASE 0x70000000
49#define TS72XX_NAND_DATA_VIRT_BASE 0xfebfc000 46#define TS72XX_NAND_DATA_VIRT_BASE 0xfebfc000
diff --git a/arch/arm/mach-ep93xx/ts72xx.c b/arch/arm/mach-ep93xx/ts72xx.c
index 7ee024d34829..aaf1371412af 100644
--- a/arch/arm/mach-ep93xx/ts72xx.c
+++ b/arch/arm/mach-ep93xx/ts72xx.c
@@ -112,13 +112,16 @@ static void __init ts72xx_map_io(void)
112 } 112 }
113} 113}
114 114
115/*************************************************************************
116 * NOR flash (TS-7200 only)
117 *************************************************************************/
115static struct physmap_flash_data ts72xx_flash_data = { 118static struct physmap_flash_data ts72xx_flash_data = {
116 .width = 1, 119 .width = 2,
117}; 120};
118 121
119static struct resource ts72xx_flash_resource = { 122static struct resource ts72xx_flash_resource = {
120 .start = TS72XX_NOR_PHYS_BASE, 123 .start = EP93XX_CS6_PHYS_BASE,
121 .end = TS72XX_NOR_PHYS_BASE + SZ_16M - 1, 124 .end = EP93XX_CS6_PHYS_BASE + SZ_16M - 1,
122 .flags = IORESOURCE_MEM, 125 .flags = IORESOURCE_MEM,
123}; 126};
124 127
@@ -132,6 +135,12 @@ static struct platform_device ts72xx_flash = {
132 .resource = &ts72xx_flash_resource, 135 .resource = &ts72xx_flash_resource,
133}; 136};
134 137
138static void __init ts72xx_register_flash(void)
139{
140 if (board_is_ts7200())
141 platform_device_register(&ts72xx_flash);
142}
143
135static unsigned char ts72xx_rtc_readbyte(unsigned long addr) 144static unsigned char ts72xx_rtc_readbyte(unsigned long addr)
136{ 145{
137 __raw_writeb(addr, TS72XX_RTC_INDEX_VIRT_BASE); 146 __raw_writeb(addr, TS72XX_RTC_INDEX_VIRT_BASE);
@@ -165,8 +174,7 @@ static struct ep93xx_eth_data ts72xx_eth_data = {
165static void __init ts72xx_init_machine(void) 174static void __init ts72xx_init_machine(void)
166{ 175{
167 ep93xx_init_devices(); 176 ep93xx_init_devices();
168 if (board_is_ts7200()) 177 ts72xx_register_flash();
169 platform_device_register(&ts72xx_flash);
170 platform_device_register(&ts72xx_rtc_device); 178 platform_device_register(&ts72xx_rtc_device);
171 179
172 ep93xx_register_eth(&ts72xx_eth_data, 1); 180 ep93xx_register_eth(&ts72xx_eth_data, 1);
diff --git a/arch/arm/mach-kirkwood/mpp.h b/arch/arm/mach-kirkwood/mpp.h
index e021a80c2caf..bc74278ed311 100644
--- a/arch/arm/mach-kirkwood/mpp.h
+++ b/arch/arm/mach-kirkwood/mpp.h
@@ -289,7 +289,7 @@
289 289
290#define MPP48_GPIO MPP( 48, 0x0, 1, 1, 0, 0, 0, 1 ) 290#define MPP48_GPIO MPP( 48, 0x0, 1, 1, 0, 0, 0, 1 )
291#define MPP48_TSMP12 MPP( 48, 0x1, 1, 1, 0, 0, 0, 1 ) 291#define MPP48_TSMP12 MPP( 48, 0x1, 1, 1, 0, 0, 0, 1 )
292#define MPP48_TDM_DTX MPP( 48. 0x2, 0, 1, 0, 0, 0, 1 ) 292#define MPP48_TDM_DTX MPP( 48, 0x2, 0, 1, 0, 0, 0, 1 )
293 293
294#define MPP49_GPIO MPP( 49, 0x0, 1, 1, 0, 0, 0, 1 ) 294#define MPP49_GPIO MPP( 49, 0x0, 1, 1, 0, 0, 0, 1 )
295#define MPP49_TSMP9 MPP( 49, 0x1, 1, 1, 0, 0, 0, 1 ) 295#define MPP49_TSMP9 MPP( 49, 0x1, 1, 1, 0, 0, 0, 1 )
diff --git a/arch/arm/mach-mx3/Kconfig b/arch/arm/mach-mx3/Kconfig
index 17a21a291e2f..851f2458bf65 100644
--- a/arch/arm/mach-mx3/Kconfig
+++ b/arch/arm/mach-mx3/Kconfig
@@ -36,6 +36,14 @@ config MACH_PCM037
36 Include support for Phytec pcm037 platform. This includes 36 Include support for Phytec pcm037 platform. This includes
37 specific configurations for the board and its peripherals. 37 specific configurations for the board and its peripherals.
38 38
39config MACH_PCM037_EET
40 bool "Support pcm037 EET board extensions"
41 depends on MACH_PCM037
42 help
43 Add support for PCM037 EET baseboard extensions. If you are using the
44 OLED display with EET, use "video=mx3fb:CMEL-OLED" kernel
45 command-line parameter.
46
39config MACH_MX31LITE 47config MACH_MX31LITE
40 bool "Support MX31 LITEKIT (LogicPD)" 48 bool "Support MX31 LITEKIT (LogicPD)"
41 select ARCH_MX31 49 select ARCH_MX31
diff --git a/arch/arm/mach-mx3/Makefile b/arch/arm/mach-mx3/Makefile
index 0322696bd11a..6b9775471be6 100644
--- a/arch/arm/mach-mx3/Makefile
+++ b/arch/arm/mach-mx3/Makefile
@@ -11,6 +11,7 @@ obj-$(CONFIG_MACH_MX31ADS) += mx31ads.o
11obj-$(CONFIG_MACH_MX31LILLY) += mx31lilly.o mx31lilly-db.o 11obj-$(CONFIG_MACH_MX31LILLY) += mx31lilly.o mx31lilly-db.o
12obj-$(CONFIG_MACH_MX31LITE) += mx31lite.o 12obj-$(CONFIG_MACH_MX31LITE) += mx31lite.o
13obj-$(CONFIG_MACH_PCM037) += pcm037.o 13obj-$(CONFIG_MACH_PCM037) += pcm037.o
14obj-$(CONFIG_MACH_PCM037_EET) += pcm037_eet.o
14obj-$(CONFIG_MACH_MX31_3DS) += mx31pdk.o 15obj-$(CONFIG_MACH_MX31_3DS) += mx31pdk.o
15obj-$(CONFIG_MACH_MX31MOBOARD) += mx31moboard.o mx31moboard-devboard.o \ 16obj-$(CONFIG_MACH_MX31MOBOARD) += mx31moboard.o mx31moboard-devboard.o \
16 mx31moboard-marxbot.o 17 mx31moboard-marxbot.o
diff --git a/arch/arm/mach-mx3/armadillo5x0.c b/arch/arm/mach-mx3/armadillo5x0.c
index 541181090b37..ee331fd6b1bd 100644
--- a/arch/arm/mach-mx3/armadillo5x0.c
+++ b/arch/arm/mach-mx3/armadillo5x0.c
@@ -31,6 +31,8 @@
31#include <linux/smsc911x.h> 31#include <linux/smsc911x.h>
32#include <linux/interrupt.h> 32#include <linux/interrupt.h>
33#include <linux/irq.h> 33#include <linux/irq.h>
34#include <linux/mtd/physmap.h>
35#include <linux/io.h>
34 36
35#include <mach/hardware.h> 37#include <mach/hardware.h>
36#include <asm/mach-types.h> 38#include <asm/mach-types.h>
@@ -46,8 +48,10 @@
46#include <mach/mmc.h> 48#include <mach/mmc.h>
47#include <mach/ipu.h> 49#include <mach/ipu.h>
48#include <mach/mx3fb.h> 50#include <mach/mx3fb.h>
51#include <mach/mxc_nand.h>
49 52
50#include "devices.h" 53#include "devices.h"
54#include "crm_regs.h"
51 55
52static int armadillo5x0_pins[] = { 56static int armadillo5x0_pins[] = {
53 /* UART1 */ 57 /* UART1 */
@@ -93,7 +97,56 @@ static int armadillo5x0_pins[] = {
93 MX31_PIN_FPSHIFT__FPSHIFT, 97 MX31_PIN_FPSHIFT__FPSHIFT,
94 MX31_PIN_DRDY0__DRDY0, 98 MX31_PIN_DRDY0__DRDY0,
95 IOMUX_MODE(MX31_PIN_LCS1, IOMUX_CONFIG_GPIO), /*ADV7125_PSAVE*/ 99 IOMUX_MODE(MX31_PIN_LCS1, IOMUX_CONFIG_GPIO), /*ADV7125_PSAVE*/
100};
96 101
102/*
103 * NAND Flash
104 */
105static struct mxc_nand_platform_data armadillo5x0_nand_flash_pdata = {
106 .width = 1,
107 .hw_ecc = 1,
108};
109
110/*
111 * MTD NOR Flash
112 */
113static struct mtd_partition armadillo5x0_nor_flash_partitions[] = {
114 {
115 .name = "nor.bootloader",
116 .offset = 0x00000000,
117 .size = 4*32*1024,
118 }, {
119 .name = "nor.kernel",
120 .offset = MTDPART_OFS_APPEND,
121 .size = 16*128*1024,
122 }, {
123 .name = "nor.userland",
124 .offset = MTDPART_OFS_APPEND,
125 .size = 110*128*1024,
126 }, {
127 .name = "nor.config",
128 .offset = MTDPART_OFS_APPEND,
129 .size = 1*128*1024,
130 },
131};
132
133static struct physmap_flash_data armadillo5x0_nor_flash_pdata = {
134 .width = 2,
135 .parts = armadillo5x0_nor_flash_partitions,
136 .nr_parts = ARRAY_SIZE(armadillo5x0_nor_flash_partitions),
137};
138
139static struct resource armadillo5x0_nor_flash_resource = {
140 .flags = IORESOURCE_MEM,
141 .start = CS0_BASE_ADDR,
142 .end = CS0_BASE_ADDR + SZ_64M - 1,
143};
144
145static struct platform_device armadillo5x0_nor_flash = {
146 .name = "physmap-flash",
147 .id = -1,
148 .num_resources = 1,
149 .resource = &armadillo5x0_nor_flash_resource,
97}; 150};
98 151
99/* 152/*
@@ -272,6 +325,16 @@ static void __init armadillo5x0_init(void)
272 /* Register FB */ 325 /* Register FB */
273 mxc_register_device(&mx3_ipu, &mx3_ipu_data); 326 mxc_register_device(&mx3_ipu, &mx3_ipu_data);
274 mxc_register_device(&mx3_fb, &mx3fb_pdata); 327 mxc_register_device(&mx3_fb, &mx3fb_pdata);
328
329 /* Register NOR Flash */
330 mxc_register_device(&armadillo5x0_nor_flash,
331 &armadillo5x0_nor_flash_pdata);
332
333 /* Register NAND Flash */
334 mxc_register_device(&mxc_nand_device, &armadillo5x0_nand_flash_pdata);
335
336 /* set NAND page size to 2k if not configured via boot mode pins */
337 __raw_writel(__raw_readl(MXC_CCM_RCSR) | (1 << 30), MXC_CCM_RCSR);
275} 338}
276 339
277static void __init armadillo5x0_timer_init(void) 340static void __init armadillo5x0_timer_init(void)
diff --git a/arch/arm/mach-mx3/devices.c b/arch/arm/mach-mx3/devices.c
index d927eddcad46..9e87e08fb121 100644
--- a/arch/arm/mach-mx3/devices.c
+++ b/arch/arm/mach-mx3/devices.c
@@ -22,7 +22,6 @@
22#include <linux/platform_device.h> 22#include <linux/platform_device.h>
23#include <linux/serial.h> 23#include <linux/serial.h>
24#include <linux/gpio.h> 24#include <linux/gpio.h>
25#include <linux/dma-mapping.h>
26#include <mach/hardware.h> 25#include <mach/hardware.h>
27#include <mach/irqs.h> 26#include <mach/irqs.h>
28#include <mach/common.h> 27#include <mach/common.h>
diff --git a/arch/arm/mach-mx3/pcm037.c b/arch/arm/mach-mx3/pcm037.c
index c6f61a1f06c8..840cfda341d0 100644
--- a/arch/arm/mach-mx3/pcm037.c
+++ b/arch/arm/mach-mx3/pcm037.c
@@ -18,7 +18,7 @@
18 18
19#include <linux/types.h> 19#include <linux/types.h>
20#include <linux/init.h> 20#include <linux/init.h>
21 21#include <linux/dma-mapping.h>
22#include <linux/platform_device.h> 22#include <linux/platform_device.h>
23#include <linux/mtd/physmap.h> 23#include <linux/mtd/physmap.h>
24#include <linux/mtd/plat-ram.h> 24#include <linux/mtd/plat-ram.h>
@@ -33,29 +33,67 @@
33#include <linux/irq.h> 33#include <linux/irq.h>
34#include <linux/fsl_devices.h> 34#include <linux/fsl_devices.h>
35 35
36#include <mach/hardware.h> 36#include <media/soc_camera.h>
37
37#include <asm/mach-types.h> 38#include <asm/mach-types.h>
38#include <asm/mach/arch.h> 39#include <asm/mach/arch.h>
39#include <asm/mach/time.h> 40#include <asm/mach/time.h>
40#include <asm/mach/map.h> 41#include <asm/mach/map.h>
42#include <mach/board-pcm037.h>
41#include <mach/common.h> 43#include <mach/common.h>
44#include <mach/hardware.h>
45#include <mach/i2c.h>
42#include <mach/imx-uart.h> 46#include <mach/imx-uart.h>
43#include <mach/iomux-mx3.h> 47#include <mach/iomux-mx3.h>
44#include <mach/ipu.h> 48#include <mach/ipu.h>
45#include <mach/board-pcm037.h> 49#include <mach/mmc.h>
50#include <mach/mx3_camera.h>
46#include <mach/mx3fb.h> 51#include <mach/mx3fb.h>
47#include <mach/mxc_nand.h> 52#include <mach/mxc_nand.h>
48#include <mach/mmc.h>
49#ifdef CONFIG_I2C_IMX
50#include <mach/i2c.h>
51#endif
52 53
53#include "devices.h" 54#include "devices.h"
55#include "pcm037.h"
56
57static enum pcm037_board_variant pcm037_instance = PCM037_PCM970;
58
59static int __init pcm037_variant_setup(char *str)
60{
61 if (!strcmp("eet", str))
62 pcm037_instance = PCM037_EET;
63 else if (strcmp("pcm970", str))
64 pr_warning("Unknown pcm037 baseboard variant %s\n", str);
65
66 return 1;
67}
68
69/* Supported values: "pcm970" (default) and "eet" */
70__setup("pcm037_variant=", pcm037_variant_setup);
71
72enum pcm037_board_variant pcm037_variant(void)
73{
74 return pcm037_instance;
75}
76
77/* UART1 with RTS/CTS handshake signals */
78static unsigned int pcm037_uart1_handshake_pins[] = {
79 MX31_PIN_CTS1__CTS1,
80 MX31_PIN_RTS1__RTS1,
81 MX31_PIN_TXD1__TXD1,
82 MX31_PIN_RXD1__RXD1,
83};
84
85/* UART1 without RTS/CTS handshake signals */
86static unsigned int pcm037_uart1_pins[] = {
87 MX31_PIN_TXD1__TXD1,
88 MX31_PIN_RXD1__RXD1,
89};
54 90
55static unsigned int pcm037_pins[] = { 91static unsigned int pcm037_pins[] = {
56 /* I2C */ 92 /* I2C */
57 MX31_PIN_CSPI2_MOSI__SCL, 93 MX31_PIN_CSPI2_MOSI__SCL,
58 MX31_PIN_CSPI2_MISO__SDA, 94 MX31_PIN_CSPI2_MISO__SDA,
95 MX31_PIN_CSPI2_SS2__I2C3_SDA,
96 MX31_PIN_CSPI2_SCLK__I2C3_SCL,
59 /* SDHC1 */ 97 /* SDHC1 */
60 MX31_PIN_SD1_DATA3__SD1_DATA3, 98 MX31_PIN_SD1_DATA3__SD1_DATA3,
61 MX31_PIN_SD1_DATA2__SD1_DATA2, 99 MX31_PIN_SD1_DATA2__SD1_DATA2,
@@ -73,11 +111,6 @@ static unsigned int pcm037_pins[] = {
73 MX31_PIN_CSPI1_SS0__SS0, 111 MX31_PIN_CSPI1_SS0__SS0,
74 MX31_PIN_CSPI1_SS1__SS1, 112 MX31_PIN_CSPI1_SS1__SS1,
75 MX31_PIN_CSPI1_SS2__SS2, 113 MX31_PIN_CSPI1_SS2__SS2,
76 /* UART1 */
77 MX31_PIN_CTS1__CTS1,
78 MX31_PIN_RTS1__RTS1,
79 MX31_PIN_TXD1__TXD1,
80 MX31_PIN_RXD1__RXD1,
81 /* UART2 */ 114 /* UART2 */
82 MX31_PIN_TXD2__TXD2, 115 MX31_PIN_TXD2__TXD2,
83 MX31_PIN_RXD2__RXD2, 116 MX31_PIN_RXD2__RXD2,
@@ -120,6 +153,22 @@ static unsigned int pcm037_pins[] = {
120 MX31_PIN_D3_SPL__D3_SPL, 153 MX31_PIN_D3_SPL__D3_SPL,
121 MX31_PIN_D3_CLS__D3_CLS, 154 MX31_PIN_D3_CLS__D3_CLS,
122 MX31_PIN_LCS0__GPI03_23, 155 MX31_PIN_LCS0__GPI03_23,
156 /* CSI */
157 IOMUX_MODE(MX31_PIN_CSI_D5, IOMUX_CONFIG_GPIO),
158 MX31_PIN_CSI_D6__CSI_D6,
159 MX31_PIN_CSI_D7__CSI_D7,
160 MX31_PIN_CSI_D8__CSI_D8,
161 MX31_PIN_CSI_D9__CSI_D9,
162 MX31_PIN_CSI_D10__CSI_D10,
163 MX31_PIN_CSI_D11__CSI_D11,
164 MX31_PIN_CSI_D12__CSI_D12,
165 MX31_PIN_CSI_D13__CSI_D13,
166 MX31_PIN_CSI_D14__CSI_D14,
167 MX31_PIN_CSI_D15__CSI_D15,
168 MX31_PIN_CSI_HSYNC__CSI_HSYNC,
169 MX31_PIN_CSI_MCLK__CSI_MCLK,
170 MX31_PIN_CSI_PIXCLK__CSI_PIXCLK,
171 MX31_PIN_CSI_VSYNC__CSI_VSYNC,
123}; 172};
124 173
125static struct physmap_flash_data pcm037_flash_data = { 174static struct physmap_flash_data pcm037_flash_data = {
@@ -250,19 +299,43 @@ static struct mxc_nand_platform_data pcm037_nand_board_info = {
250 .hw_ecc = 1, 299 .hw_ecc = 1,
251}; 300};
252 301
253#ifdef CONFIG_I2C_IMX
254static struct imxi2c_platform_data pcm037_i2c_1_data = { 302static struct imxi2c_platform_data pcm037_i2c_1_data = {
255 .bitrate = 100000, 303 .bitrate = 100000,
256}; 304};
257 305
306static struct imxi2c_platform_data pcm037_i2c_2_data = {
307 .bitrate = 20000,
308};
309
258static struct at24_platform_data board_eeprom = { 310static struct at24_platform_data board_eeprom = {
259 .byte_len = 4096, 311 .byte_len = 4096,
260 .page_size = 32, 312 .page_size = 32,
261 .flags = AT24_FLAG_ADDR16, 313 .flags = AT24_FLAG_ADDR16,
262}; 314};
263 315
316static int pcm037_camera_power(struct device *dev, int on)
317{
318 /* disable or enable the camera in X7 or X8 PCM970 connector */
319 gpio_set_value(IOMUX_TO_GPIO(MX31_PIN_CSI_D5), !on);
320 return 0;
321}
322
323static struct i2c_board_info pcm037_i2c_2_devices[] = {
324 {
325 I2C_BOARD_INFO("mt9t031", 0x5d),
326 },
327};
328
329static struct soc_camera_link iclink = {
330 .bus_id = 0, /* Must match with the camera ID */
331 .power = pcm037_camera_power,
332 .board_info = &pcm037_i2c_2_devices[0],
333 .i2c_adapter_id = 2,
334 .module_name = "mt9t031",
335};
336
264static struct i2c_board_info pcm037_i2c_devices[] = { 337static struct i2c_board_info pcm037_i2c_devices[] = {
265 { 338 {
266 I2C_BOARD_INFO("at24", 0x52), /* E0=0, E1=1, E2=0 */ 339 I2C_BOARD_INFO("at24", 0x52), /* E0=0, E1=1, E2=0 */
267 .platform_data = &board_eeprom, 340 .platform_data = &board_eeprom,
268 }, { 341 }, {
@@ -270,7 +343,14 @@ static struct i2c_board_info pcm037_i2c_devices[] = {
270 .type = "pcf8563", 343 .type = "pcf8563",
271 } 344 }
272}; 345};
273#endif 346
347static struct platform_device pcm037_camera = {
348 .name = "soc-camera-pdrv",
349 .id = 0,
350 .dev = {
351 .platform_data = &iclink,
352 },
353};
274 354
275/* Not connected by default */ 355/* Not connected by default */
276#ifdef PCM970_SDHC_RW_SWITCH 356#ifdef PCM970_SDHC_RW_SWITCH
@@ -334,9 +414,41 @@ static struct imxmmc_platform_data sdhc_pdata = {
334 .exit = pcm970_sdhc1_exit, 414 .exit = pcm970_sdhc1_exit,
335}; 415};
336 416
417struct mx3_camera_pdata camera_pdata = {
418 .dma_dev = &mx3_ipu.dev,
419 .flags = MX3_CAMERA_DATAWIDTH_8 | MX3_CAMERA_DATAWIDTH_10,
420 .mclk_10khz = 2000,
421};
422
423static int __init pcm037_camera_alloc_dma(const size_t buf_size)
424{
425 dma_addr_t dma_handle;
426 void *buf;
427 int dma;
428
429 if (buf_size < 2 * 1024 * 1024)
430 return -EINVAL;
431
432 buf = dma_alloc_coherent(NULL, buf_size, &dma_handle, GFP_KERNEL);
433 if (!buf) {
434 pr_err("%s: cannot allocate camera buffer-memory\n", __func__);
435 return -ENOMEM;
436 }
437
438 memset(buf, 0, buf_size);
439
440 dma = dma_declare_coherent_memory(&mx3_camera.dev,
441 dma_handle, dma_handle, buf_size,
442 DMA_MEMORY_MAP | DMA_MEMORY_EXCLUSIVE);
443
444 /* The way we call dma_declare_coherent_memory only a malloc can fail */
445 return dma & DMA_MEMORY_MAP ? 0 : -ENOMEM;
446}
447
337static struct platform_device *devices[] __initdata = { 448static struct platform_device *devices[] __initdata = {
338 &pcm037_flash, 449 &pcm037_flash,
339 &pcm037_sram_device, 450 &pcm037_sram_device,
451 &pcm037_camera,
340}; 452};
341 453
342static struct ipu_platform_data mx3_ipu_data = { 454static struct ipu_platform_data mx3_ipu_data = {
@@ -377,6 +489,22 @@ static const struct fb_videomode fb_modedb[] = {
377 .sync = FB_SYNC_VERT_HIGH_ACT | FB_SYNC_OE_ACT_HIGH, 489 .sync = FB_SYNC_VERT_HIGH_ACT | FB_SYNC_OE_ACT_HIGH,
378 .vmode = FB_VMODE_NONINTERLACED, 490 .vmode = FB_VMODE_NONINTERLACED,
379 .flag = 0, 491 .flag = 0,
492 }, {
493 /* 240x320 @ 60 Hz */
494 .name = "CMEL-OLED",
495 .refresh = 60,
496 .xres = 240,
497 .yres = 320,
498 .pixclock = 185925,
499 .left_margin = 9,
500 .right_margin = 16,
501 .upper_margin = 7,
502 .lower_margin = 9,
503 .hsync_len = 1,
504 .vsync_len = 1,
505 .sync = FB_SYNC_OE_ACT_HIGH | FB_SYNC_CLK_INVERT,
506 .vmode = FB_VMODE_NONINTERLACED,
507 .flag = 0,
380 }, 508 },
381}; 509};
382 510
@@ -397,6 +525,14 @@ static void __init mxc_board_init(void)
397 mxc_iomux_setup_multiple_pins(pcm037_pins, ARRAY_SIZE(pcm037_pins), 525 mxc_iomux_setup_multiple_pins(pcm037_pins, ARRAY_SIZE(pcm037_pins),
398 "pcm037"); 526 "pcm037");
399 527
528 if (pcm037_variant() == PCM037_EET)
529 mxc_iomux_setup_multiple_pins(pcm037_uart1_pins,
530 ARRAY_SIZE(pcm037_uart1_pins), "pcm037_uart1");
531 else
532 mxc_iomux_setup_multiple_pins(pcm037_uart1_handshake_pins,
533 ARRAY_SIZE(pcm037_uart1_handshake_pins),
534 "pcm037_uart1");
535
400 platform_add_devices(devices, ARRAY_SIZE(devices)); 536 platform_add_devices(devices, ARRAY_SIZE(devices));
401 537
402 mxc_register_device(&mxc_uart_device0, &uart_pdata); 538 mxc_register_device(&mxc_uart_device0, &uart_pdata);
@@ -415,18 +551,30 @@ static void __init mxc_board_init(void)
415 } 551 }
416 552
417 553
418#ifdef CONFIG_I2C_IMX 554 /* I2C adapters and devices */
419 i2c_register_board_info(1, pcm037_i2c_devices, 555 i2c_register_board_info(1, pcm037_i2c_devices,
420 ARRAY_SIZE(pcm037_i2c_devices)); 556 ARRAY_SIZE(pcm037_i2c_devices));
421 557
422 mxc_register_device(&mxc_i2c_device1, &pcm037_i2c_1_data); 558 mxc_register_device(&mxc_i2c_device1, &pcm037_i2c_1_data);
423#endif 559 mxc_register_device(&mxc_i2c_device2, &pcm037_i2c_2_data);
560
424 mxc_register_device(&mxc_nand_device, &pcm037_nand_board_info); 561 mxc_register_device(&mxc_nand_device, &pcm037_nand_board_info);
425 mxc_register_device(&mxcsdhc_device0, &sdhc_pdata); 562 mxc_register_device(&mxcsdhc_device0, &sdhc_pdata);
426 mxc_register_device(&mx3_ipu, &mx3_ipu_data); 563 mxc_register_device(&mx3_ipu, &mx3_ipu_data);
427 mxc_register_device(&mx3_fb, &mx3fb_pdata); 564 mxc_register_device(&mx3_fb, &mx3fb_pdata);
428 if (!gpio_usbotg_hs_activate()) 565 if (!gpio_usbotg_hs_activate())
429 mxc_register_device(&mxc_otg_udc_device, &usb_pdata); 566 mxc_register_device(&mxc_otg_udc_device, &usb_pdata);
567
568 /* CSI */
569 /* Camera power: default - off */
570 ret = gpio_request(IOMUX_TO_GPIO(MX31_PIN_CSI_D5), "mt9t031-power");
571 if (!ret)
572 gpio_direction_output(IOMUX_TO_GPIO(MX31_PIN_CSI_D5), 1);
573 else
574 iclink.power = NULL;
575
576 if (!pcm037_camera_alloc_dma(4 * 1024 * 1024))
577 mxc_register_device(&mx3_camera, &camera_pdata);
430} 578}
431 579
432static void __init pcm037_timer_init(void) 580static void __init pcm037_timer_init(void)
@@ -448,4 +596,3 @@ MACHINE_START(PCM037, "Phytec Phycore pcm037")
448 .init_machine = mxc_board_init, 596 .init_machine = mxc_board_init,
449 .timer = &pcm037_timer, 597 .timer = &pcm037_timer,
450MACHINE_END 598MACHINE_END
451
diff --git a/arch/arm/mach-mx3/pcm037.h b/arch/arm/mach-mx3/pcm037.h
new file mode 100644
index 000000000000..d6929721a5fd
--- /dev/null
+++ b/arch/arm/mach-mx3/pcm037.h
@@ -0,0 +1,11 @@
1#ifndef __PCM037_H__
2#define __PCM037_H__
3
4enum pcm037_board_variant {
5 PCM037_PCM970,
6 PCM037_EET,
7};
8
9extern enum pcm037_board_variant pcm037_variant(void);
10
11#endif
diff --git a/arch/arm/mach-mx3/pcm037_eet.c b/arch/arm/mach-mx3/pcm037_eet.c
new file mode 100644
index 000000000000..fe52fb1bb8b7
--- /dev/null
+++ b/arch/arm/mach-mx3/pcm037_eet.c
@@ -0,0 +1,204 @@
1/*
2 * Copyright (C) 2009
3 * Guennadi Liakhovetski, DENX Software Engineering, <lg@denx.de>
4 *
5 * This program is free software; you can redistribute it and/or modify
6 * it under the terms of the GNU General Public License version 2 as
7 * published by the Free Software Foundation.
8 */
9#include <linux/gpio.h>
10#include <linux/gpio_keys.h>
11#include <linux/input.h>
12#include <linux/platform_device.h>
13#include <linux/spi/spi.h>
14
15#include <mach/common.h>
16#if defined(CONFIG_SPI_IMX) || defined(CONFIG_SPI_IMX_MODULE)
17#include <mach/spi.h>
18#endif
19#include <mach/iomux-mx3.h>
20
21#include <asm/mach-types.h>
22
23#include "pcm037.h"
24#include "devices.h"
25
26static unsigned int pcm037_eet_pins[] = {
27 /* SPI #1 */
28 MX31_PIN_CSPI1_MISO__MISO,
29 MX31_PIN_CSPI1_MOSI__MOSI,
30 MX31_PIN_CSPI1_SCLK__SCLK,
31 MX31_PIN_CSPI1_SPI_RDY__SPI_RDY,
32 MX31_PIN_CSPI1_SS0__SS0,
33 MX31_PIN_CSPI1_SS1__SS1,
34 MX31_PIN_CSPI1_SS2__SS2,
35
36 /* Reserve and hardwire GPIO 57 high - S6E63D6 chipselect */
37 IOMUX_MODE(MX31_PIN_KEY_COL7, IOMUX_CONFIG_GPIO),
38 /* GPIO keys */
39 IOMUX_MODE(MX31_PIN_GPIO1_0, IOMUX_CONFIG_GPIO), /* 0 */
40 IOMUX_MODE(MX31_PIN_GPIO1_1, IOMUX_CONFIG_GPIO), /* 1 */
41 IOMUX_MODE(MX31_PIN_GPIO1_2, IOMUX_CONFIG_GPIO), /* 2 */
42 IOMUX_MODE(MX31_PIN_GPIO1_3, IOMUX_CONFIG_GPIO), /* 3 */
43 IOMUX_MODE(MX31_PIN_SVEN0, IOMUX_CONFIG_GPIO), /* 32 */
44 IOMUX_MODE(MX31_PIN_STX0, IOMUX_CONFIG_GPIO), /* 33 */
45 IOMUX_MODE(MX31_PIN_SRX0, IOMUX_CONFIG_GPIO), /* 34 */
46 IOMUX_MODE(MX31_PIN_SIMPD0, IOMUX_CONFIG_GPIO), /* 35 */
47 IOMUX_MODE(MX31_PIN_RTS1, IOMUX_CONFIG_GPIO), /* 38 */
48 IOMUX_MODE(MX31_PIN_CTS1, IOMUX_CONFIG_GPIO), /* 39 */
49 IOMUX_MODE(MX31_PIN_KEY_ROW4, IOMUX_CONFIG_GPIO), /* 50 */
50 IOMUX_MODE(MX31_PIN_KEY_ROW5, IOMUX_CONFIG_GPIO), /* 51 */
51 IOMUX_MODE(MX31_PIN_KEY_ROW6, IOMUX_CONFIG_GPIO), /* 52 */
52 IOMUX_MODE(MX31_PIN_KEY_ROW7, IOMUX_CONFIG_GPIO), /* 53 */
53
54 /* LEDs */
55 IOMUX_MODE(MX31_PIN_DTR_DTE1, IOMUX_CONFIG_GPIO), /* 44 */
56 IOMUX_MODE(MX31_PIN_DSR_DTE1, IOMUX_CONFIG_GPIO), /* 45 */
57 IOMUX_MODE(MX31_PIN_KEY_COL5, IOMUX_CONFIG_GPIO), /* 55 */
58 IOMUX_MODE(MX31_PIN_KEY_COL6, IOMUX_CONFIG_GPIO), /* 56 */
59};
60
61/* SPI */
62static struct spi_board_info pcm037_spi_dev[] = {
63 {
64 .modalias = "dac124s085",
65 .max_speed_hz = 400000,
66 .bus_num = 0,
67 .chip_select = 0, /* Index in pcm037_spi1_cs[] */
68 .mode = SPI_CPHA,
69 },
70};
71
72/* Platform Data for MXC CSPI */
73#if defined(CONFIG_SPI_IMX) || defined(CONFIG_SPI_IMX_MODULE)
74static int pcm037_spi1_cs[] = {MXC_SPI_CS(1), IOMUX_TO_GPIO(MX31_PIN_KEY_COL7)};
75
76struct spi_imx_master pcm037_spi1_master = {
77 .chipselect = pcm037_spi1_cs,
78 .num_chipselect = ARRAY_SIZE(pcm037_spi1_cs),
79};
80#endif
81
82/* GPIO-keys input device */
83static struct gpio_keys_button pcm037_gpio_keys[] = {
84 {
85 .type = EV_KEY,
86 .code = KEY_L,
87 .gpio = 0,
88 .desc = "Wheel Manual",
89 .wakeup = 0,
90 }, {
91 .type = EV_KEY,
92 .code = KEY_A,
93 .gpio = 1,
94 .desc = "Wheel AF",
95 .wakeup = 0,
96 }, {
97 .type = EV_KEY,
98 .code = KEY_V,
99 .gpio = 2,
100 .desc = "Wheel View",
101 .wakeup = 0,
102 }, {
103 .type = EV_KEY,
104 .code = KEY_M,
105 .gpio = 3,
106 .desc = "Wheel Menu",
107 .wakeup = 0,
108 }, {
109 .type = EV_KEY,
110 .code = KEY_UP,
111 .gpio = 32,
112 .desc = "Nav Pad Up",
113 .wakeup = 0,
114 }, {
115 .type = EV_KEY,
116 .code = KEY_RIGHT,
117 .gpio = 33,
118 .desc = "Nav Pad Right",
119 .wakeup = 0,
120 }, {
121 .type = EV_KEY,
122 .code = KEY_DOWN,
123 .gpio = 34,
124 .desc = "Nav Pad Down",
125 .wakeup = 0,
126 }, {
127 .type = EV_KEY,
128 .code = KEY_LEFT,
129 .gpio = 35,
130 .desc = "Nav Pad Left",
131 .wakeup = 0,
132 }, {
133 .type = EV_KEY,
134 .code = KEY_ENTER,
135 .gpio = 38,
136 .desc = "Nav Pad Ok",
137 .wakeup = 0,
138 }, {
139 .type = EV_KEY,
140 .code = KEY_O,
141 .gpio = 39,
142 .desc = "Wheel Off",
143 .wakeup = 0,
144 }, {
145 .type = EV_KEY,
146 .code = BTN_FORWARD,
147 .gpio = 50,
148 .desc = "Focus Forward",
149 .wakeup = 0,
150 }, {
151 .type = EV_KEY,
152 .code = BTN_BACK,
153 .gpio = 51,
154 .desc = "Focus Backward",
155 .wakeup = 0,
156 }, {
157 .type = EV_KEY,
158 .code = BTN_MIDDLE,
159 .gpio = 52,
160 .desc = "Release Half",
161 .wakeup = 0,
162 }, {
163 .type = EV_KEY,
164 .code = BTN_EXTRA,
165 .gpio = 53,
166 .desc = "Release Full",
167 .wakeup = 0,
168 },
169};
170
171static struct gpio_keys_platform_data pcm037_gpio_keys_platform_data = {
172 .buttons = pcm037_gpio_keys,
173 .nbuttons = ARRAY_SIZE(pcm037_gpio_keys),
174 .rep = 0, /* No auto-repeat */
175};
176
177static struct platform_device pcm037_gpio_keys_device = {
178 .name = "gpio-keys",
179 .id = -1,
180 .dev = {
181 .platform_data = &pcm037_gpio_keys_platform_data,
182 },
183};
184
185static int eet_init_devices(void)
186{
187 if (!machine_is_pcm037() || pcm037_variant() != PCM037_EET)
188 return 0;
189
190 mxc_iomux_setup_multiple_pins(pcm037_eet_pins,
191 ARRAY_SIZE(pcm037_eet_pins), "pcm037_eet");
192
193 /* SPI */
194 spi_register_board_info(pcm037_spi_dev, ARRAY_SIZE(pcm037_spi_dev));
195#if defined(CONFIG_SPI_IMX) || defined(CONFIG_SPI_IMX_MODULE)
196 mxc_register_device(&mxc_spi_device0, &pcm037_spi1_master);
197#endif
198
199 platform_device_register(&pcm037_gpio_keys_device);
200
201 return 0;
202}
203
204late_initcall(eet_init_devices);
diff --git a/arch/arm/mach-omap1/board-nokia770.c b/arch/arm/mach-omap1/board-nokia770.c
index e70fc7c66bbb..ed2a48a9ce74 100644
--- a/arch/arm/mach-omap1/board-nokia770.c
+++ b/arch/arm/mach-omap1/board-nokia770.c
@@ -36,7 +36,6 @@
36#include <mach/hwa742.h> 36#include <mach/hwa742.h>
37#include <mach/lcd_mipid.h> 37#include <mach/lcd_mipid.h>
38#include <mach/mmc.h> 38#include <mach/mmc.h>
39#include <mach/usb.h>
40#include <mach/clock.h> 39#include <mach/clock.h>
41 40
42#define ADS7846_PENDOWN_GPIO 15 41#define ADS7846_PENDOWN_GPIO 15
@@ -205,9 +204,11 @@ static int nokia770_mmc_get_cover_state(struct device *dev, int slot)
205static struct omap_mmc_platform_data nokia770_mmc2_data = { 204static struct omap_mmc_platform_data nokia770_mmc2_data = {
206 .nr_slots = 1, 205 .nr_slots = 1,
207 .dma_mask = 0xffffffff, 206 .dma_mask = 0xffffffff,
207 .max_freq = 12000000,
208 .slots[0] = { 208 .slots[0] = {
209 .set_power = nokia770_mmc_set_power, 209 .set_power = nokia770_mmc_set_power,
210 .get_cover_state = nokia770_mmc_get_cover_state, 210 .get_cover_state = nokia770_mmc_get_cover_state,
211 .ocr_mask = MMC_VDD_32_33|MMC_VDD_33_34,
211 .name = "mmcblk", 212 .name = "mmcblk",
212 }, 213 },
213}; 214};
diff --git a/arch/arm/mach-omap1/mailbox.c b/arch/arm/mach-omap1/mailbox.c
index 0af4d6c85b47..6810b4aeb02c 100644
--- a/arch/arm/mach-omap1/mailbox.c
+++ b/arch/arm/mach-omap1/mailbox.c
@@ -203,5 +203,5 @@ module_exit(omap1_mbox_exit);
203 203
204MODULE_LICENSE("GPL v2"); 204MODULE_LICENSE("GPL v2");
205MODULE_DESCRIPTION("omap mailbox: omap1 architecture specific functions"); 205MODULE_DESCRIPTION("omap mailbox: omap1 architecture specific functions");
206MODULE_AUTHOR("Hiroshi DOYU" <Hiroshi.DOYU@nokia.com>); 206MODULE_AUTHOR("Hiroshi DOYU <Hiroshi.DOYU@nokia.com>");
207MODULE_ALIAS("platform:omap1-mailbox"); 207MODULE_ALIAS("platform:omap1-mailbox");
diff --git a/arch/arm/mach-omap1/mcbsp.c b/arch/arm/mach-omap1/mcbsp.c
index a2d7814896be..505d98cfe508 100644
--- a/arch/arm/mach-omap1/mcbsp.c
+++ b/arch/arm/mach-omap1/mcbsp.c
@@ -19,7 +19,6 @@
19 19
20#include <mach/irqs.h> 20#include <mach/irqs.h>
21#include <mach/dma.h> 21#include <mach/dma.h>
22#include <mach/irqs.h>
23#include <mach/mux.h> 22#include <mach/mux.h>
24#include <mach/cpu.h> 23#include <mach/cpu.h>
25#include <mach/mcbsp.h> 24#include <mach/mcbsp.h>
diff --git a/arch/arm/mach-omap2/board-rx51-peripherals.c b/arch/arm/mach-omap2/board-rx51-peripherals.c
index da93b86234ed..9a0bf6744a05 100644
--- a/arch/arm/mach-omap2/board-rx51-peripherals.c
+++ b/arch/arm/mach-omap2/board-rx51-peripherals.c
@@ -362,6 +362,7 @@ static struct omap_onenand_platform_data board_onenand_data = {
362 .gpio_irq = 65, 362 .gpio_irq = 65,
363 .parts = onenand_partitions, 363 .parts = onenand_partitions,
364 .nr_parts = ARRAY_SIZE(onenand_partitions), 364 .nr_parts = ARRAY_SIZE(onenand_partitions),
365 .flags = ONENAND_SYNC_READWRITE,
365}; 366};
366 367
367static void __init board_onenand_init(void) 368static void __init board_onenand_init(void)
diff --git a/arch/arm/mach-omap2/gpmc-onenand.c b/arch/arm/mach-omap2/gpmc-onenand.c
index 2fd22f9c5f0e..54fec53a48e7 100644
--- a/arch/arm/mach-omap2/gpmc-onenand.c
+++ b/arch/arm/mach-omap2/gpmc-onenand.c
@@ -31,6 +31,8 @@ static struct platform_device gpmc_onenand_device = {
31static int omap2_onenand_set_async_mode(int cs, void __iomem *onenand_base) 31static int omap2_onenand_set_async_mode(int cs, void __iomem *onenand_base)
32{ 32{
33 struct gpmc_timings t; 33 struct gpmc_timings t;
34 u32 reg;
35 int err;
34 36
35 const int t_cer = 15; 37 const int t_cer = 15;
36 const int t_avdp = 12; 38 const int t_avdp = 12;
@@ -43,6 +45,11 @@ static int omap2_onenand_set_async_mode(int cs, void __iomem *onenand_base)
43 const int t_wpl = 40; 45 const int t_wpl = 40;
44 const int t_wph = 30; 46 const int t_wph = 30;
45 47
48 /* Ensure sync read and sync write are disabled */
49 reg = readw(onenand_base + ONENAND_REG_SYS_CFG1);
50 reg &= ~ONENAND_SYS_CFG1_SYNC_READ & ~ONENAND_SYS_CFG1_SYNC_WRITE;
51 writew(reg, onenand_base + ONENAND_REG_SYS_CFG1);
52
46 memset(&t, 0, sizeof(t)); 53 memset(&t, 0, sizeof(t));
47 t.sync_clk = 0; 54 t.sync_clk = 0;
48 t.cs_on = 0; 55 t.cs_on = 0;
@@ -74,7 +81,16 @@ static int omap2_onenand_set_async_mode(int cs, void __iomem *onenand_base)
74 GPMC_CONFIG1_DEVICESIZE_16 | 81 GPMC_CONFIG1_DEVICESIZE_16 |
75 GPMC_CONFIG1_MUXADDDATA); 82 GPMC_CONFIG1_MUXADDDATA);
76 83
77 return gpmc_cs_set_timings(cs, &t); 84 err = gpmc_cs_set_timings(cs, &t);
85 if (err)
86 return err;
87
88 /* Ensure sync read and sync write are disabled */
89 reg = readw(onenand_base + ONENAND_REG_SYS_CFG1);
90 reg &= ~ONENAND_SYS_CFG1_SYNC_READ & ~ONENAND_SYS_CFG1_SYNC_WRITE;
91 writew(reg, onenand_base + ONENAND_REG_SYS_CFG1);
92
93 return 0;
78} 94}
79 95
80static void set_onenand_cfg(void __iomem *onenand_base, int latency, 96static void set_onenand_cfg(void __iomem *onenand_base, int latency,
@@ -124,7 +140,8 @@ static int omap2_onenand_set_sync_mode(struct omap_onenand_platform_data *cfg,
124 } else if (cfg->flags & ONENAND_SYNC_READWRITE) { 140 } else if (cfg->flags & ONENAND_SYNC_READWRITE) {
125 sync_read = 1; 141 sync_read = 1;
126 sync_write = 1; 142 sync_write = 1;
127 } 143 } else
144 return omap2_onenand_set_async_mode(cs, onenand_base);
128 145
129 if (!freq) { 146 if (!freq) {
130 /* Very first call freq is not known */ 147 /* Very first call freq is not known */
diff --git a/arch/arm/mach-omap2/id.c b/arch/arm/mach-omap2/id.c
index 458990e20c60..a98201cc265c 100644
--- a/arch/arm/mach-omap2/id.c
+++ b/arch/arm/mach-omap2/id.c
@@ -48,6 +48,28 @@ int omap_chip_is(struct omap_chip_id oci)
48} 48}
49EXPORT_SYMBOL(omap_chip_is); 49EXPORT_SYMBOL(omap_chip_is);
50 50
51int omap_type(void)
52{
53 u32 val = 0;
54
55 if (cpu_is_omap24xx())
56 val = omap_ctrl_readl(OMAP24XX_CONTROL_STATUS);
57 else if (cpu_is_omap34xx())
58 val = omap_ctrl_readl(OMAP343X_CONTROL_STATUS);
59 else {
60 pr_err("Cannot detect omap type!\n");
61 goto out;
62 }
63
64 val &= OMAP2_DEVICETYPE_MASK;
65 val >>= 8;
66
67out:
68 return val;
69}
70EXPORT_SYMBOL(omap_type);
71
72
51/*----------------------------------------------------------------------------*/ 73/*----------------------------------------------------------------------------*/
52 74
53#define OMAP_TAP_IDCODE 0x0204 75#define OMAP_TAP_IDCODE 0x0204
diff --git a/arch/arm/mach-omap2/mailbox.c b/arch/arm/mach-omap2/mailbox.c
index fd5b8a5925cc..6f71f3730c97 100644
--- a/arch/arm/mach-omap2/mailbox.c
+++ b/arch/arm/mach-omap2/mailbox.c
@@ -282,12 +282,12 @@ static int __devinit omap2_mbox_probe(struct platform_device *pdev)
282 return -ENOMEM; 282 return -ENOMEM;
283 283
284 /* DSP or IVA2 IRQ */ 284 /* DSP or IVA2 IRQ */
285 mbox_dsp_info.irq = platform_get_irq(pdev, 0); 285 ret = platform_get_irq(pdev, 0);
286 if (mbox_dsp_info.irq < 0) { 286 if (ret < 0) {
287 dev_err(&pdev->dev, "invalid irq resource\n"); 287 dev_err(&pdev->dev, "invalid irq resource\n");
288 ret = -ENODEV;
289 goto err_dsp; 288 goto err_dsp;
290 } 289 }
290 mbox_dsp_info.irq = ret;
291 291
292 ret = omap_mbox_register(&pdev->dev, &mbox_dsp_info); 292 ret = omap_mbox_register(&pdev->dev, &mbox_dsp_info);
293 if (ret) 293 if (ret)
diff --git a/arch/arm/mach-omap2/mcbsp.c b/arch/arm/mach-omap2/mcbsp.c
index a5c0f0435cd6..99b6e1546311 100644
--- a/arch/arm/mach-omap2/mcbsp.c
+++ b/arch/arm/mach-omap2/mcbsp.c
@@ -19,7 +19,6 @@
19 19
20#include <mach/irqs.h> 20#include <mach/irqs.h>
21#include <mach/dma.h> 21#include <mach/dma.h>
22#include <mach/irqs.h>
23#include <mach/mux.h> 22#include <mach/mux.h>
24#include <mach/cpu.h> 23#include <mach/cpu.h>
25#include <mach/mcbsp.h> 24#include <mach/mcbsp.h>
diff --git a/arch/arm/mach-omap2/mmc-twl4030.c b/arch/arm/mach-omap2/mmc-twl4030.c
index 9756a878fd90..1541fd4c8d0f 100644
--- a/arch/arm/mach-omap2/mmc-twl4030.c
+++ b/arch/arm/mach-omap2/mmc-twl4030.c
@@ -263,8 +263,19 @@ static int twl_mmc1_set_power(struct device *dev, int slot, int power_on,
263static int twl_mmc23_set_power(struct device *dev, int slot, int power_on, int vdd) 263static int twl_mmc23_set_power(struct device *dev, int slot, int power_on, int vdd)
264{ 264{
265 int ret = 0; 265 int ret = 0;
266 struct twl_mmc_controller *c = &hsmmc[1]; 266 struct twl_mmc_controller *c = NULL;
267 struct omap_mmc_platform_data *mmc = dev->platform_data; 267 struct omap_mmc_platform_data *mmc = dev->platform_data;
268 int i;
269
270 for (i = 1; i < ARRAY_SIZE(hsmmc); i++) {
271 if (mmc == hsmmc[i].mmc) {
272 c = &hsmmc[i];
273 break;
274 }
275 }
276
277 if (c == NULL)
278 return -ENODEV;
268 279
269 /* If we don't see a Vcc regulator, assume it's a fixed 280 /* If we don't see a Vcc regulator, assume it's a fixed
270 * voltage always-on regulator. 281 * voltage always-on regulator.
diff --git a/arch/arm/mach-pxa/treo680.c b/arch/arm/mach-pxa/treo680.c
index a06f19edebb3..753ec4df17b9 100644
--- a/arch/arm/mach-pxa/treo680.c
+++ b/arch/arm/mach-pxa/treo680.c
@@ -409,7 +409,7 @@ err1:
409 409
410static void treo680_irda_shutdown(struct device *dev) 410static void treo680_irda_shutdown(struct device *dev)
411{ 411{
412 gpio_free(GPIO_NR_TREO680_AMP_EN); 412 gpio_free(GPIO_NR_TREO680_IR_EN);
413} 413}
414 414
415static struct pxaficp_platform_data treo680_ficp_info = { 415static struct pxaficp_platform_data treo680_ficp_info = {
diff --git a/arch/arm/mach-realview/core.c b/arch/arm/mach-realview/core.c
index 9ea9c05093cd..facbd49eec67 100644
--- a/arch/arm/mach-realview/core.c
+++ b/arch/arm/mach-realview/core.c
@@ -208,8 +208,7 @@ struct platform_device realview_i2c_device = {
208 208
209static struct i2c_board_info realview_i2c_board_info[] = { 209static struct i2c_board_info realview_i2c_board_info[] = {
210 { 210 {
211 I2C_BOARD_INFO("rtc-ds1307", 0xd0 >> 1), 211 I2C_BOARD_INFO("ds1338", 0xd0 >> 1),
212 .type = "ds1338",
213 }, 212 },
214}; 213};
215 214
diff --git a/arch/arm/mach-s3c2440/mach-mini2440.c b/arch/arm/mach-s3c2440/mach-mini2440.c
index 6a5bc3021bdb..ec71a6965786 100644
--- a/arch/arm/mach-s3c2440/mach-mini2440.c
+++ b/arch/arm/mach-s3c2440/mach-mini2440.c
@@ -48,8 +48,6 @@
48#include <plat/mci.h> 48#include <plat/mci.h>
49#include <plat/udc.h> 49#include <plat/udc.h>
50 50
51#include <plat/regs-serial.h>
52
53#include <linux/mtd/mtd.h> 51#include <linux/mtd/mtd.h>
54#include <linux/mtd/nand.h> 52#include <linux/mtd/nand.h>
55#include <linux/mtd/nand_ecc.h> 53#include <linux/mtd/nand_ecc.h>
@@ -275,6 +273,7 @@ static struct s3c2410_nand_set mini2440_nand_sets[] __initdata = {
275 .nr_chips = 1, 273 .nr_chips = 1,
276 .nr_partitions = ARRAY_SIZE(mini2440_default_nand_part), 274 .nr_partitions = ARRAY_SIZE(mini2440_default_nand_part),
277 .partitions = mini2440_default_nand_part, 275 .partitions = mini2440_default_nand_part,
276 .flash_bbt = 1, /* we use u-boot to create a BBT */
278 }, 277 },
279}; 278};
280 279
diff --git a/arch/arm/mach-s3c2442/mach-gta02.c b/arch/arm/mach-s3c2442/mach-gta02.c
index e23b581aa0e1..0fb385bd9cd9 100644
--- a/arch/arm/mach-s3c2442/mach-gta02.c
+++ b/arch/arm/mach-s3c2442/mach-gta02.c
@@ -433,8 +433,7 @@ static struct s3c2410_nand_set gta02_nand_sets[] = {
433 */ 433 */
434 .name = "neo1973-nand", 434 .name = "neo1973-nand",
435 .nr_chips = 1, 435 .nr_chips = 1,
436 .use_bbt = 1, 436 .flash_bbt = 1,
437 .force_soft_ecc = 1,
438 }, 437 },
439}; 438};
440 439
diff --git a/arch/arm/mach-u300/clock.c b/arch/arm/mach-u300/clock.c
index 5cd04d6751b3..111f7ea32b38 100644
--- a/arch/arm/mach-u300/clock.c
+++ b/arch/arm/mach-u300/clock.c
@@ -24,6 +24,7 @@
24#include <linux/init.h> 24#include <linux/init.h>
25#include <linux/timer.h> 25#include <linux/timer.h>
26#include <linux/io.h> 26#include <linux/io.h>
27#include <linux/seq_file.h>
27 28
28#include <asm/clkdev.h> 29#include <asm/clkdev.h>
29#include <mach/hardware.h> 30#include <mach/hardware.h>
@@ -702,6 +703,7 @@ static struct clk amba_clk = {
702 .rate = 52000000, /* this varies! */ 703 .rate = 52000000, /* this varies! */
703 .hw_ctrld = true, 704 .hw_ctrld = true,
704 .reset = false, 705 .reset = false,
706 .lock = __SPIN_LOCK_UNLOCKED(amba_clk.lock),
705}; 707};
706 708
707/* 709/*
@@ -720,6 +722,7 @@ static struct clk cpu_clk = {
720 .set_rate = clk_set_rate_cpuclk, 722 .set_rate = clk_set_rate_cpuclk,
721 .get_rate = clk_get_rate_cpuclk, 723 .get_rate = clk_get_rate_cpuclk,
722 .round_rate = clk_round_rate_cpuclk, 724 .round_rate = clk_round_rate_cpuclk,
725 .lock = __SPIN_LOCK_UNLOCKED(cpu_clk.lock),
723}; 726};
724 727
725static struct clk nandif_clk = { 728static struct clk nandif_clk = {
@@ -732,6 +735,7 @@ static struct clk nandif_clk = {
732 .clk_val = U300_SYSCON_SBCER_NANDIF_CLK_EN, 735 .clk_val = U300_SYSCON_SBCER_NANDIF_CLK_EN,
733 .enable = syscon_clk_enable, 736 .enable = syscon_clk_enable,
734 .disable = syscon_clk_disable, 737 .disable = syscon_clk_disable,
738 .lock = __SPIN_LOCK_UNLOCKED(nandif_clk.lock),
735}; 739};
736 740
737static struct clk semi_clk = { 741static struct clk semi_clk = {
@@ -744,6 +748,7 @@ static struct clk semi_clk = {
744 .clk_val = U300_SYSCON_SBCER_SEMI_CLK_EN, 748 .clk_val = U300_SYSCON_SBCER_SEMI_CLK_EN,
745 .enable = syscon_clk_enable, 749 .enable = syscon_clk_enable,
746 .disable = syscon_clk_disable, 750 .disable = syscon_clk_disable,
751 .lock = __SPIN_LOCK_UNLOCKED(semi_clk.lock),
747}; 752};
748 753
749#ifdef CONFIG_MACH_U300_BS335 754#ifdef CONFIG_MACH_U300_BS335
@@ -758,6 +763,7 @@ static struct clk isp_clk = {
758 .clk_val = U300_SYSCON_SBCER_ISP_CLK_EN, 763 .clk_val = U300_SYSCON_SBCER_ISP_CLK_EN,
759 .enable = syscon_clk_enable, 764 .enable = syscon_clk_enable,
760 .disable = syscon_clk_disable, 765 .disable = syscon_clk_disable,
766 .lock = __SPIN_LOCK_UNLOCKED(isp_clk.lock),
761}; 767};
762 768
763static struct clk cds_clk = { 769static struct clk cds_clk = {
@@ -771,6 +777,7 @@ static struct clk cds_clk = {
771 .clk_val = U300_SYSCON_SBCER_CDS_CLK_EN, 777 .clk_val = U300_SYSCON_SBCER_CDS_CLK_EN,
772 .enable = syscon_clk_enable, 778 .enable = syscon_clk_enable,
773 .disable = syscon_clk_disable, 779 .disable = syscon_clk_disable,
780 .lock = __SPIN_LOCK_UNLOCKED(cds_clk.lock),
774}; 781};
775#endif 782#endif
776 783
@@ -785,6 +792,7 @@ static struct clk dma_clk = {
785 .clk_val = U300_SYSCON_SBCER_DMAC_CLK_EN, 792 .clk_val = U300_SYSCON_SBCER_DMAC_CLK_EN,
786 .enable = syscon_clk_enable, 793 .enable = syscon_clk_enable,
787 .disable = syscon_clk_disable, 794 .disable = syscon_clk_disable,
795 .lock = __SPIN_LOCK_UNLOCKED(dma_clk.lock),
788}; 796};
789 797
790static struct clk aaif_clk = { 798static struct clk aaif_clk = {
@@ -798,6 +806,7 @@ static struct clk aaif_clk = {
798 .clk_val = U300_SYSCON_SBCER_AAIF_CLK_EN, 806 .clk_val = U300_SYSCON_SBCER_AAIF_CLK_EN,
799 .enable = syscon_clk_enable, 807 .enable = syscon_clk_enable,
800 .disable = syscon_clk_disable, 808 .disable = syscon_clk_disable,
809 .lock = __SPIN_LOCK_UNLOCKED(aaif_clk.lock),
801}; 810};
802 811
803static struct clk apex_clk = { 812static struct clk apex_clk = {
@@ -811,6 +820,7 @@ static struct clk apex_clk = {
811 .clk_val = U300_SYSCON_SBCER_APEX_CLK_EN, 820 .clk_val = U300_SYSCON_SBCER_APEX_CLK_EN,
812 .enable = syscon_clk_enable, 821 .enable = syscon_clk_enable,
813 .disable = syscon_clk_disable, 822 .disable = syscon_clk_disable,
823 .lock = __SPIN_LOCK_UNLOCKED(apex_clk.lock),
814}; 824};
815 825
816static struct clk video_enc_clk = { 826static struct clk video_enc_clk = {
@@ -825,6 +835,7 @@ static struct clk video_enc_clk = {
825 .clk_val = U300_SYSCON_SBCER_VIDEO_ENC_CLK_EN, 835 .clk_val = U300_SYSCON_SBCER_VIDEO_ENC_CLK_EN,
826 .enable = syscon_clk_enable, 836 .enable = syscon_clk_enable,
827 .disable = syscon_clk_disable, 837 .disable = syscon_clk_disable,
838 .lock = __SPIN_LOCK_UNLOCKED(video_enc_clk.lock),
828}; 839};
829 840
830static struct clk xgam_clk = { 841static struct clk xgam_clk = {
@@ -839,6 +850,7 @@ static struct clk xgam_clk = {
839 .get_rate = clk_get_rate_xgamclk, 850 .get_rate = clk_get_rate_xgamclk,
840 .enable = syscon_clk_enable, 851 .enable = syscon_clk_enable,
841 .disable = syscon_clk_disable, 852 .disable = syscon_clk_disable,
853 .lock = __SPIN_LOCK_UNLOCKED(xgam_clk.lock),
842}; 854};
843 855
844/* This clock is used to activate the video encoder */ 856/* This clock is used to activate the video encoder */
@@ -854,6 +866,7 @@ static struct clk ahb_clk = {
854 .enable = syscon_clk_enable, 866 .enable = syscon_clk_enable,
855 .disable = syscon_clk_disable, 867 .disable = syscon_clk_disable,
856 .get_rate = clk_get_rate_ahb_clk, 868 .get_rate = clk_get_rate_ahb_clk,
869 .lock = __SPIN_LOCK_UNLOCKED(ahb_clk.lock),
857}; 870};
858 871
859 872
@@ -871,6 +884,7 @@ static struct clk ahb_subsys_clk = {
871 .enable = syscon_clk_enable, 884 .enable = syscon_clk_enable,
872 .disable = syscon_clk_disable, 885 .disable = syscon_clk_disable,
873 .get_rate = clk_get_rate_ahb_clk, 886 .get_rate = clk_get_rate_ahb_clk,
887 .lock = __SPIN_LOCK_UNLOCKED(ahb_subsys_clk.lock),
874}; 888};
875 889
876static struct clk intcon_clk = { 890static struct clk intcon_clk = {
@@ -882,6 +896,8 @@ static struct clk intcon_clk = {
882 .res_reg = U300_SYSCON_VBASE + U300_SYSCON_RRR, 896 .res_reg = U300_SYSCON_VBASE + U300_SYSCON_RRR,
883 .res_mask = U300_SYSCON_RRR_INTCON_RESET_EN, 897 .res_mask = U300_SYSCON_RRR_INTCON_RESET_EN,
884 /* INTCON can be reset but not clock-gated */ 898 /* INTCON can be reset but not clock-gated */
899 .lock = __SPIN_LOCK_UNLOCKED(intcon_clk.lock),
900
885}; 901};
886 902
887static struct clk mspro_clk = { 903static struct clk mspro_clk = {
@@ -895,6 +911,7 @@ static struct clk mspro_clk = {
895 .clk_val = U300_SYSCON_SBCER_MSPRO_CLK_EN, 911 .clk_val = U300_SYSCON_SBCER_MSPRO_CLK_EN,
896 .enable = syscon_clk_enable, 912 .enable = syscon_clk_enable,
897 .disable = syscon_clk_disable, 913 .disable = syscon_clk_disable,
914 .lock = __SPIN_LOCK_UNLOCKED(mspro_clk.lock),
898}; 915};
899 916
900static struct clk emif_clk = { 917static struct clk emif_clk = {
@@ -909,6 +926,7 @@ static struct clk emif_clk = {
909 .enable = syscon_clk_enable, 926 .enable = syscon_clk_enable,
910 .disable = syscon_clk_disable, 927 .disable = syscon_clk_disable,
911 .get_rate = clk_get_rate_emif_clk, 928 .get_rate = clk_get_rate_emif_clk,
929 .lock = __SPIN_LOCK_UNLOCKED(emif_clk.lock),
912}; 930};
913 931
914 932
@@ -926,6 +944,7 @@ static struct clk fast_clk = {
926 .clk_val = U300_SYSCON_SBCER_FAST_BRIDGE_CLK_EN, 944 .clk_val = U300_SYSCON_SBCER_FAST_BRIDGE_CLK_EN,
927 .enable = syscon_clk_enable, 945 .enable = syscon_clk_enable,
928 .disable = syscon_clk_disable, 946 .disable = syscon_clk_disable,
947 .lock = __SPIN_LOCK_UNLOCKED(fast_clk.lock),
929}; 948};
930 949
931static struct clk mmcsd_clk = { 950static struct clk mmcsd_clk = {
@@ -942,6 +961,7 @@ static struct clk mmcsd_clk = {
942 .round_rate = clk_round_rate_mclk, 961 .round_rate = clk_round_rate_mclk,
943 .disable = syscon_clk_disable, 962 .disable = syscon_clk_disable,
944 .enable = syscon_clk_enable, 963 .enable = syscon_clk_enable,
964 .lock = __SPIN_LOCK_UNLOCKED(mmcsd_clk.lock),
945}; 965};
946 966
947static struct clk i2s0_clk = { 967static struct clk i2s0_clk = {
@@ -956,6 +976,7 @@ static struct clk i2s0_clk = {
956 .enable = syscon_clk_enable, 976 .enable = syscon_clk_enable,
957 .disable = syscon_clk_disable, 977 .disable = syscon_clk_disable,
958 .get_rate = clk_get_rate_i2s_i2c_spi, 978 .get_rate = clk_get_rate_i2s_i2c_spi,
979 .lock = __SPIN_LOCK_UNLOCKED(i2s0_clk.lock),
959}; 980};
960 981
961static struct clk i2s1_clk = { 982static struct clk i2s1_clk = {
@@ -970,6 +991,7 @@ static struct clk i2s1_clk = {
970 .enable = syscon_clk_enable, 991 .enable = syscon_clk_enable,
971 .disable = syscon_clk_disable, 992 .disable = syscon_clk_disable,
972 .get_rate = clk_get_rate_i2s_i2c_spi, 993 .get_rate = clk_get_rate_i2s_i2c_spi,
994 .lock = __SPIN_LOCK_UNLOCKED(i2s1_clk.lock),
973}; 995};
974 996
975static struct clk i2c0_clk = { 997static struct clk i2c0_clk = {
@@ -984,6 +1006,7 @@ static struct clk i2c0_clk = {
984 .enable = syscon_clk_enable, 1006 .enable = syscon_clk_enable,
985 .disable = syscon_clk_disable, 1007 .disable = syscon_clk_disable,
986 .get_rate = clk_get_rate_i2s_i2c_spi, 1008 .get_rate = clk_get_rate_i2s_i2c_spi,
1009 .lock = __SPIN_LOCK_UNLOCKED(i2c0_clk.lock),
987}; 1010};
988 1011
989static struct clk i2c1_clk = { 1012static struct clk i2c1_clk = {
@@ -998,6 +1021,7 @@ static struct clk i2c1_clk = {
998 .enable = syscon_clk_enable, 1021 .enable = syscon_clk_enable,
999 .disable = syscon_clk_disable, 1022 .disable = syscon_clk_disable,
1000 .get_rate = clk_get_rate_i2s_i2c_spi, 1023 .get_rate = clk_get_rate_i2s_i2c_spi,
1024 .lock = __SPIN_LOCK_UNLOCKED(i2c1_clk.lock),
1001}; 1025};
1002 1026
1003static struct clk spi_clk = { 1027static struct clk spi_clk = {
@@ -1012,6 +1036,7 @@ static struct clk spi_clk = {
1012 .enable = syscon_clk_enable, 1036 .enable = syscon_clk_enable,
1013 .disable = syscon_clk_disable, 1037 .disable = syscon_clk_disable,
1014 .get_rate = clk_get_rate_i2s_i2c_spi, 1038 .get_rate = clk_get_rate_i2s_i2c_spi,
1039 .lock = __SPIN_LOCK_UNLOCKED(spi_clk.lock),
1015}; 1040};
1016 1041
1017#ifdef CONFIG_MACH_U300_BS335 1042#ifdef CONFIG_MACH_U300_BS335
@@ -1026,6 +1051,7 @@ static struct clk uart1_clk = {
1026 .clk_val = U300_SYSCON_SBCER_UART1_CLK_EN, 1051 .clk_val = U300_SYSCON_SBCER_UART1_CLK_EN,
1027 .enable = syscon_clk_enable, 1052 .enable = syscon_clk_enable,
1028 .disable = syscon_clk_disable, 1053 .disable = syscon_clk_disable,
1054 .lock = __SPIN_LOCK_UNLOCKED(uart1_clk.lock),
1029}; 1055};
1030#endif 1056#endif
1031 1057
@@ -1044,6 +1070,7 @@ static struct clk slow_clk = {
1044 .clk_val = U300_SYSCON_SBCER_SLOW_BRIDGE_CLK_EN, 1070 .clk_val = U300_SYSCON_SBCER_SLOW_BRIDGE_CLK_EN,
1045 .enable = syscon_clk_enable, 1071 .enable = syscon_clk_enable,
1046 .disable = syscon_clk_disable, 1072 .disable = syscon_clk_disable,
1073 .lock = __SPIN_LOCK_UNLOCKED(slow_clk.lock),
1047}; 1074};
1048 1075
1049/* TODO: implement SYSCON clock? */ 1076/* TODO: implement SYSCON clock? */
@@ -1055,6 +1082,7 @@ static struct clk wdog_clk = {
1055 .rate = 32768, 1082 .rate = 32768,
1056 .reset = false, 1083 .reset = false,
1057 /* This is always on, cannot be enabled/disabled or reset */ 1084 /* This is always on, cannot be enabled/disabled or reset */
1085 .lock = __SPIN_LOCK_UNLOCKED(wdog_clk.lock),
1058}; 1086};
1059 1087
1060/* This one is hardwired to PLL13 */ 1088/* This one is hardwired to PLL13 */
@@ -1069,6 +1097,7 @@ static struct clk uart_clk = {
1069 .clk_val = U300_SYSCON_SBCER_UART_CLK_EN, 1097 .clk_val = U300_SYSCON_SBCER_UART_CLK_EN,
1070 .enable = syscon_clk_enable, 1098 .enable = syscon_clk_enable,
1071 .disable = syscon_clk_disable, 1099 .disable = syscon_clk_disable,
1100 .lock = __SPIN_LOCK_UNLOCKED(uart_clk.lock),
1072}; 1101};
1073 1102
1074static struct clk keypad_clk = { 1103static struct clk keypad_clk = {
@@ -1082,6 +1111,7 @@ static struct clk keypad_clk = {
1082 .clk_val = U300_SYSCON_SBCER_KEYPAD_CLK_EN, 1111 .clk_val = U300_SYSCON_SBCER_KEYPAD_CLK_EN,
1083 .enable = syscon_clk_enable, 1112 .enable = syscon_clk_enable,
1084 .disable = syscon_clk_disable, 1113 .disable = syscon_clk_disable,
1114 .lock = __SPIN_LOCK_UNLOCKED(keypad_clk.lock),
1085}; 1115};
1086 1116
1087static struct clk gpio_clk = { 1117static struct clk gpio_clk = {
@@ -1095,6 +1125,7 @@ static struct clk gpio_clk = {
1095 .clk_val = U300_SYSCON_SBCER_GPIO_CLK_EN, 1125 .clk_val = U300_SYSCON_SBCER_GPIO_CLK_EN,
1096 .enable = syscon_clk_enable, 1126 .enable = syscon_clk_enable,
1097 .disable = syscon_clk_disable, 1127 .disable = syscon_clk_disable,
1128 .lock = __SPIN_LOCK_UNLOCKED(gpio_clk.lock),
1098}; 1129};
1099 1130
1100static struct clk rtc_clk = { 1131static struct clk rtc_clk = {
@@ -1106,6 +1137,7 @@ static struct clk rtc_clk = {
1106 .res_reg = U300_SYSCON_VBASE + U300_SYSCON_RSR, 1137 .res_reg = U300_SYSCON_VBASE + U300_SYSCON_RSR,
1107 .res_mask = U300_SYSCON_RSR_RTC_RESET_EN, 1138 .res_mask = U300_SYSCON_RSR_RTC_RESET_EN,
1108 /* This clock is always on, cannot be enabled/disabled */ 1139 /* This clock is always on, cannot be enabled/disabled */
1140 .lock = __SPIN_LOCK_UNLOCKED(rtc_clk.lock),
1109}; 1141};
1110 1142
1111static struct clk bustr_clk = { 1143static struct clk bustr_clk = {
@@ -1119,6 +1151,7 @@ static struct clk bustr_clk = {
1119 .clk_val = U300_SYSCON_SBCER_BTR_CLK_EN, 1151 .clk_val = U300_SYSCON_SBCER_BTR_CLK_EN,
1120 .enable = syscon_clk_enable, 1152 .enable = syscon_clk_enable,
1121 .disable = syscon_clk_disable, 1153 .disable = syscon_clk_disable,
1154 .lock = __SPIN_LOCK_UNLOCKED(bustr_clk.lock),
1122}; 1155};
1123 1156
1124static struct clk evhist_clk = { 1157static struct clk evhist_clk = {
@@ -1132,6 +1165,7 @@ static struct clk evhist_clk = {
1132 .clk_val = U300_SYSCON_SBCER_EH_CLK_EN, 1165 .clk_val = U300_SYSCON_SBCER_EH_CLK_EN,
1133 .enable = syscon_clk_enable, 1166 .enable = syscon_clk_enable,
1134 .disable = syscon_clk_disable, 1167 .disable = syscon_clk_disable,
1168 .lock = __SPIN_LOCK_UNLOCKED(evhist_clk.lock),
1135}; 1169};
1136 1170
1137static struct clk timer_clk = { 1171static struct clk timer_clk = {
@@ -1145,6 +1179,7 @@ static struct clk timer_clk = {
1145 .clk_val = U300_SYSCON_SBCER_ACC_TMR_CLK_EN, 1179 .clk_val = U300_SYSCON_SBCER_ACC_TMR_CLK_EN,
1146 .enable = syscon_clk_enable, 1180 .enable = syscon_clk_enable,
1147 .disable = syscon_clk_disable, 1181 .disable = syscon_clk_disable,
1182 .lock = __SPIN_LOCK_UNLOCKED(timer_clk.lock),
1148}; 1183};
1149 1184
1150static struct clk app_timer_clk = { 1185static struct clk app_timer_clk = {
@@ -1158,6 +1193,7 @@ static struct clk app_timer_clk = {
1158 .clk_val = U300_SYSCON_SBCER_APP_TMR_CLK_EN, 1193 .clk_val = U300_SYSCON_SBCER_APP_TMR_CLK_EN,
1159 .enable = syscon_clk_enable, 1194 .enable = syscon_clk_enable,
1160 .disable = syscon_clk_disable, 1195 .disable = syscon_clk_disable,
1196 .lock = __SPIN_LOCK_UNLOCKED(app_timer_clk.lock),
1161}; 1197};
1162 1198
1163#ifdef CONFIG_MACH_U300_BS335 1199#ifdef CONFIG_MACH_U300_BS335
@@ -1172,6 +1208,7 @@ static struct clk ppm_clk = {
1172 .clk_val = U300_SYSCON_SBCER_PPM_CLK_EN, 1208 .clk_val = U300_SYSCON_SBCER_PPM_CLK_EN,
1173 .enable = syscon_clk_enable, 1209 .enable = syscon_clk_enable,
1174 .disable = syscon_clk_disable, 1210 .disable = syscon_clk_disable,
1211 .lock = __SPIN_LOCK_UNLOCKED(ppm_clk.lock),
1175}; 1212};
1176#endif 1213#endif
1177 1214
@@ -1187,53 +1224,53 @@ static struct clk ppm_clk = {
1187 */ 1224 */
1188static struct clk_lookup lookups[] = { 1225static struct clk_lookup lookups[] = {
1189 /* Connected directly to the AMBA bus */ 1226 /* Connected directly to the AMBA bus */
1190 DEF_LOOKUP("amba", &amba_clk), 1227 DEF_LOOKUP("amba", &amba_clk),
1191 DEF_LOOKUP("cpu", &cpu_clk), 1228 DEF_LOOKUP("cpu", &cpu_clk),
1192 DEF_LOOKUP("nandif", &nandif_clk), 1229 DEF_LOOKUP("fsmc", &nandif_clk),
1193 DEF_LOOKUP("semi", &semi_clk), 1230 DEF_LOOKUP("semi", &semi_clk),
1194#ifdef CONFIG_MACH_U300_BS335 1231#ifdef CONFIG_MACH_U300_BS335
1195 DEF_LOOKUP("isp", &isp_clk), 1232 DEF_LOOKUP("isp", &isp_clk),
1196 DEF_LOOKUP("cds", &cds_clk), 1233 DEF_LOOKUP("cds", &cds_clk),
1197#endif 1234#endif
1198 DEF_LOOKUP("dma", &dma_clk), 1235 DEF_LOOKUP("dma", &dma_clk),
1199 DEF_LOOKUP("aaif", &aaif_clk), 1236 DEF_LOOKUP("msl", &aaif_clk),
1200 DEF_LOOKUP("apex", &apex_clk), 1237 DEF_LOOKUP("apex", &apex_clk),
1201 DEF_LOOKUP("video_enc", &video_enc_clk), 1238 DEF_LOOKUP("video_enc", &video_enc_clk),
1202 DEF_LOOKUP("xgam", &xgam_clk), 1239 DEF_LOOKUP("xgam", &xgam_clk),
1203 DEF_LOOKUP("ahb", &ahb_clk), 1240 DEF_LOOKUP("ahb", &ahb_clk),
1204 /* AHB bridge clocks */ 1241 /* AHB bridge clocks */
1205 DEF_LOOKUP("ahb", &ahb_subsys_clk), 1242 DEF_LOOKUP("ahb_subsys", &ahb_subsys_clk),
1206 DEF_LOOKUP("intcon", &intcon_clk), 1243 DEF_LOOKUP("intcon", &intcon_clk),
1207 DEF_LOOKUP("mspro", &mspro_clk), 1244 DEF_LOOKUP("mspro", &mspro_clk),
1208 DEF_LOOKUP("pl172", &emif_clk), 1245 DEF_LOOKUP("pl172", &emif_clk),
1209 /* FAST bridge clocks */ 1246 /* FAST bridge clocks */
1210 DEF_LOOKUP("fast", &fast_clk), 1247 DEF_LOOKUP("fast", &fast_clk),
1211 DEF_LOOKUP("mmci", &mmcsd_clk), 1248 DEF_LOOKUP("mmci", &mmcsd_clk),
1212 /* 1249 /*
1213 * The .0 and .1 identifiers on these comes from the platform device 1250 * The .0 and .1 identifiers on these comes from the platform device
1214 * .id field and are assigned when the platform devices are registered. 1251 * .id field and are assigned when the platform devices are registered.
1215 */ 1252 */
1216 DEF_LOOKUP("i2s.0", &i2s0_clk), 1253 DEF_LOOKUP("i2s.0", &i2s0_clk),
1217 DEF_LOOKUP("i2s.1", &i2s1_clk), 1254 DEF_LOOKUP("i2s.1", &i2s1_clk),
1218 DEF_LOOKUP("stddci2c.0", &i2c0_clk), 1255 DEF_LOOKUP("stu300.0", &i2c0_clk),
1219 DEF_LOOKUP("stddci2c.1", &i2c1_clk), 1256 DEF_LOOKUP("stu300.1", &i2c1_clk),
1220 DEF_LOOKUP("pl022", &spi_clk), 1257 DEF_LOOKUP("pl022", &spi_clk),
1221#ifdef CONFIG_MACH_U300_BS335 1258#ifdef CONFIG_MACH_U300_BS335
1222 DEF_LOOKUP("uart1", &uart1_clk), 1259 DEF_LOOKUP("uart1", &uart1_clk),
1223#endif 1260#endif
1224 /* SLOW bridge clocks */ 1261 /* SLOW bridge clocks */
1225 DEF_LOOKUP("slow", &slow_clk), 1262 DEF_LOOKUP("slow", &slow_clk),
1226 DEF_LOOKUP("wdog", &wdog_clk), 1263 DEF_LOOKUP("coh901327_wdog", &wdog_clk),
1227 DEF_LOOKUP("uart0", &uart_clk), 1264 DEF_LOOKUP("uart0", &uart_clk),
1228 DEF_LOOKUP("apptimer", &app_timer_clk), 1265 DEF_LOOKUP("apptimer", &app_timer_clk),
1229 DEF_LOOKUP("keypad", &keypad_clk), 1266 DEF_LOOKUP("coh901461-keypad", &keypad_clk),
1230 DEF_LOOKUP("u300-gpio", &gpio_clk), 1267 DEF_LOOKUP("u300-gpio", &gpio_clk),
1231 DEF_LOOKUP("rtc0", &rtc_clk), 1268 DEF_LOOKUP("rtc-coh901331", &rtc_clk),
1232 DEF_LOOKUP("bustr", &bustr_clk), 1269 DEF_LOOKUP("bustr", &bustr_clk),
1233 DEF_LOOKUP("evhist", &evhist_clk), 1270 DEF_LOOKUP("evhist", &evhist_clk),
1234 DEF_LOOKUP("timer", &timer_clk), 1271 DEF_LOOKUP("timer", &timer_clk),
1235#ifdef CONFIG_MACH_U300_BS335 1272#ifdef CONFIG_MACH_U300_BS335
1236 DEF_LOOKUP("ppm", &ppm_clk), 1273 DEF_LOOKUP("ppm", &ppm_clk),
1237#endif 1274#endif
1238}; 1275};
1239 1276
@@ -1427,16 +1464,20 @@ static const struct file_operations u300_clocks_operations = {
1427 .release = single_release, 1464 .release = single_release,
1428}; 1465};
1429 1466
1430static void init_clk_read_procfs(void) 1467static int __init init_clk_read_debugfs(void)
1431{ 1468{
1432 /* Expose a simple debugfs interface to view all clocks */ 1469 /* Expose a simple debugfs interface to view all clocks */
1433 (void) debugfs_create_file("u300_clocks", S_IFREG | S_IRUGO, 1470 (void) debugfs_create_file("u300_clocks", S_IFREG | S_IRUGO,
1434 NULL, NULL, &u300_clocks_operations); 1471 NULL, NULL,
1435} 1472 &u300_clocks_operations);
1436#else 1473 return 0;
1437static inline void init_clk_read_procfs(void)
1438{
1439} 1474}
1475/*
1476 * This needs to come in after the core_initcall() for the
1477 * overall clocks, because debugfs is not available until
1478 * the subsystems come up.
1479 */
1480module_init(init_clk_read_debugfs);
1440#endif 1481#endif
1441 1482
1442static int __init u300_clock_init(void) 1483static int __init u300_clock_init(void)
@@ -1462,8 +1503,6 @@ static int __init u300_clock_init(void)
1462 1503
1463 clk_register(); 1504 clk_register();
1464 1505
1465 init_clk_read_procfs();
1466
1467 /* 1506 /*
1468 * Some of these may be on when we boot the system so make sure they 1507 * Some of these may be on when we boot the system so make sure they
1469 * are turned OFF. 1508 * are turned OFF.
diff --git a/arch/arm/mach-u300/core.c b/arch/arm/mach-u300/core.c
index 89b3ccf35e1b..7936085dd758 100644
--- a/arch/arm/mach-u300/core.c
+++ b/arch/arm/mach-u300/core.c
@@ -455,8 +455,8 @@ void __init u300_init_irq(void)
455 for (i = 0; i < NR_IRQS; i++) 455 for (i = 0; i < NR_IRQS; i++)
456 set_bit(i, (unsigned long *) &mask[0]); 456 set_bit(i, (unsigned long *) &mask[0]);
457 u300_enable_intcon_clock(); 457 u300_enable_intcon_clock();
458 vic_init((void __iomem *) U300_INTCON0_VBASE, 0, mask[0], 0); 458 vic_init((void __iomem *) U300_INTCON0_VBASE, 0, mask[0], mask[0]);
459 vic_init((void __iomem *) U300_INTCON1_VBASE, 32, mask[1], 0); 459 vic_init((void __iomem *) U300_INTCON1_VBASE, 32, mask[1], mask[1]);
460} 460}
461 461
462 462
diff --git a/arch/arm/mach-versatile/core.c b/arch/arm/mach-versatile/core.c
index 69214fc8bd19..31093af7d052 100644
--- a/arch/arm/mach-versatile/core.c
+++ b/arch/arm/mach-versatile/core.c
@@ -342,8 +342,7 @@ static struct platform_device versatile_i2c_device = {
342 342
343static struct i2c_board_info versatile_i2c_board_info[] = { 343static struct i2c_board_info versatile_i2c_board_info[] = {
344 { 344 {
345 I2C_BOARD_INFO("rtc-ds1307", 0xd0 >> 1), 345 I2C_BOARD_INFO("ds1338", 0xd0 >> 1),
346 .type = "ds1338",
347 }, 346 },
348}; 347};
349 348
diff --git a/arch/arm/mm/proc-syms.c b/arch/arm/mm/proc-syms.c
index 195e48edd8c2..ac5c80062b70 100644
--- a/arch/arm/mm/proc-syms.c
+++ b/arch/arm/mm/proc-syms.c
@@ -27,6 +27,7 @@ EXPORT_SYMBOL(__cpuc_flush_kern_all);
27EXPORT_SYMBOL(__cpuc_flush_user_all); 27EXPORT_SYMBOL(__cpuc_flush_user_all);
28EXPORT_SYMBOL(__cpuc_flush_user_range); 28EXPORT_SYMBOL(__cpuc_flush_user_range);
29EXPORT_SYMBOL(__cpuc_coherent_kern_range); 29EXPORT_SYMBOL(__cpuc_coherent_kern_range);
30EXPORT_SYMBOL(__cpuc_flush_dcache_page);
30EXPORT_SYMBOL(dmac_inv_range); /* because of flush_ioremap_region() */ 31EXPORT_SYMBOL(dmac_inv_range); /* because of flush_ioremap_region() */
31#else 32#else
32EXPORT_SYMBOL(cpu_cache); 33EXPORT_SYMBOL(cpu_cache);
diff --git a/arch/arm/plat-mxc/include/mach/iomux-mx3.h b/arch/arm/plat-mxc/include/mach/iomux-mx3.h
index 27f8d1b2bc6b..2eb182f73876 100644
--- a/arch/arm/plat-mxc/include/mach/iomux-mx3.h
+++ b/arch/arm/plat-mxc/include/mach/iomux-mx3.h
@@ -602,6 +602,8 @@ enum iomux_pins {
602#define MX31_PIN_I2C_DAT__SDA IOMUX_MODE(MX31_PIN_I2C_DAT, IOMUX_CONFIG_FUNC) 602#define MX31_PIN_I2C_DAT__SDA IOMUX_MODE(MX31_PIN_I2C_DAT, IOMUX_CONFIG_FUNC)
603#define MX31_PIN_DCD_DTE1__I2C2_SDA IOMUX_MODE(MX31_PIN_DCD_DTE1, IOMUX_CONFIG_ALT2) 603#define MX31_PIN_DCD_DTE1__I2C2_SDA IOMUX_MODE(MX31_PIN_DCD_DTE1, IOMUX_CONFIG_ALT2)
604#define MX31_PIN_RI_DTE1__I2C2_SCL IOMUX_MODE(MX31_PIN_RI_DTE1, IOMUX_CONFIG_ALT2) 604#define MX31_PIN_RI_DTE1__I2C2_SCL IOMUX_MODE(MX31_PIN_RI_DTE1, IOMUX_CONFIG_ALT2)
605#define MX31_PIN_CSPI2_SS2__I2C3_SDA IOMUX_MODE(MX31_PIN_CSPI2_SS2, IOMUX_CONFIG_ALT1)
606#define MX31_PIN_CSPI2_SCLK__I2C3_SCL IOMUX_MODE(MX31_PIN_CSPI2_SCLK, IOMUX_CONFIG_ALT1)
605#define MX31_PIN_CSI_D4__CSI_D4 IOMUX_MODE(MX31_PIN_CSI_D4, IOMUX_CONFIG_FUNC) 607#define MX31_PIN_CSI_D4__CSI_D4 IOMUX_MODE(MX31_PIN_CSI_D4, IOMUX_CONFIG_FUNC)
606#define MX31_PIN_CSI_D5__CSI_D5 IOMUX_MODE(MX31_PIN_CSI_D5, IOMUX_CONFIG_FUNC) 608#define MX31_PIN_CSI_D5__CSI_D5 IOMUX_MODE(MX31_PIN_CSI_D5, IOMUX_CONFIG_FUNC)
607#define MX31_PIN_CSI_D6__CSI_D6 IOMUX_MODE(MX31_PIN_CSI_D6, IOMUX_CONFIG_FUNC) 609#define MX31_PIN_CSI_D6__CSI_D6 IOMUX_MODE(MX31_PIN_CSI_D6, IOMUX_CONFIG_FUNC)
diff --git a/arch/arm/plat-omap/dma.c b/arch/arm/plat-omap/dma.c
index def14ec265b3..7677a4a1cef2 100644
--- a/arch/arm/plat-omap/dma.c
+++ b/arch/arm/plat-omap/dma.c
@@ -2457,6 +2457,19 @@ static int __init omap_init_dma(void)
2457 setup_irq(irq, &omap24xx_dma_irq); 2457 setup_irq(irq, &omap24xx_dma_irq);
2458 } 2458 }
2459 2459
2460 /* Enable smartidle idlemodes and autoidle */
2461 if (cpu_is_omap34xx()) {
2462 u32 v = dma_read(OCP_SYSCONFIG);
2463 v &= ~(DMA_SYSCONFIG_MIDLEMODE_MASK |
2464 DMA_SYSCONFIG_SIDLEMODE_MASK |
2465 DMA_SYSCONFIG_AUTOIDLE);
2466 v |= (DMA_SYSCONFIG_MIDLEMODE(DMA_IDLEMODE_SMARTIDLE) |
2467 DMA_SYSCONFIG_SIDLEMODE(DMA_IDLEMODE_SMARTIDLE) |
2468 DMA_SYSCONFIG_AUTOIDLE);
2469 dma_write(v , OCP_SYSCONFIG);
2470 }
2471
2472
2460 /* FIXME: Update LCD DMA to work on 24xx */ 2473 /* FIXME: Update LCD DMA to work on 24xx */
2461 if (cpu_class_is_omap1()) { 2474 if (cpu_class_is_omap1()) {
2462 r = request_irq(INT_DMA_LCD, lcd_dma_irq_handler, 0, 2475 r = request_irq(INT_DMA_LCD, lcd_dma_irq_handler, 0,
diff --git a/arch/arm/plat-omap/gpio.c b/arch/arm/plat-omap/gpio.c
index 7fd89ba8d3b5..26b387c12423 100644
--- a/arch/arm/plat-omap/gpio.c
+++ b/arch/arm/plat-omap/gpio.c
@@ -1585,6 +1585,7 @@ static int __init _omap_gpio_init(void)
1585 __raw_writel(0x00000000, bank->base + OMAP24XX_GPIO_IRQENABLE1); 1585 __raw_writel(0x00000000, bank->base + OMAP24XX_GPIO_IRQENABLE1);
1586 __raw_writel(0xffffffff, bank->base + OMAP24XX_GPIO_IRQSTATUS1); 1586 __raw_writel(0xffffffff, bank->base + OMAP24XX_GPIO_IRQSTATUS1);
1587 __raw_writew(0x0015, bank->base + OMAP24XX_GPIO_SYSCONFIG); 1587 __raw_writew(0x0015, bank->base + OMAP24XX_GPIO_SYSCONFIG);
1588 __raw_writel(0x00000000, bank->base + OMAP24XX_GPIO_DEBOUNCE_EN);
1588 1589
1589 /* Initialize interface clock ungated, module enabled */ 1590 /* Initialize interface clock ungated, module enabled */
1590 __raw_writel(0, bank->base + OMAP24XX_GPIO_CTRL); 1591 __raw_writel(0, bank->base + OMAP24XX_GPIO_CTRL);
diff --git a/arch/arm/plat-omap/include/mach/cpu.h b/arch/arm/plat-omap/include/mach/cpu.h
index fc60c4ebcc28..285eaa3a8275 100644
--- a/arch/arm/plat-omap/include/mach/cpu.h
+++ b/arch/arm/plat-omap/include/mach/cpu.h
@@ -30,6 +30,17 @@
30#ifndef __ASM_ARCH_OMAP_CPU_H 30#ifndef __ASM_ARCH_OMAP_CPU_H
31#define __ASM_ARCH_OMAP_CPU_H 31#define __ASM_ARCH_OMAP_CPU_H
32 32
33/*
34 * Omap device type i.e. EMU/HS/TST/GP/BAD
35 */
36#define OMAP2_DEVICE_TYPE_TEST 0
37#define OMAP2_DEVICE_TYPE_EMU 1
38#define OMAP2_DEVICE_TYPE_SEC 2
39#define OMAP2_DEVICE_TYPE_GP 3
40#define OMAP2_DEVICE_TYPE_BAD 4
41
42int omap_type(void);
43
33struct omap_chip_id { 44struct omap_chip_id {
34 u8 oc; 45 u8 oc;
35 u8 type; 46 u8 type;
@@ -424,17 +435,6 @@ IS_OMAP_TYPE(3430, 0x3430)
424 435
425 436
426int omap_chip_is(struct omap_chip_id oci); 437int omap_chip_is(struct omap_chip_id oci);
427int omap_type(void);
428
429/*
430 * Macro to detect device type i.e. EMU/HS/TST/GP/BAD
431 */
432#define OMAP2_DEVICE_TYPE_TEST 0
433#define OMAP2_DEVICE_TYPE_EMU 1
434#define OMAP2_DEVICE_TYPE_SEC 2
435#define OMAP2_DEVICE_TYPE_GP 3
436#define OMAP2_DEVICE_TYPE_BAD 4
437
438void omap2_check_revision(void); 438void omap2_check_revision(void);
439 439
440#endif /* defined(CONFIG_ARCH_OMAP2) || defined(CONFIG_ARCH_OMAP3) */ 440#endif /* defined(CONFIG_ARCH_OMAP2) || defined(CONFIG_ARCH_OMAP3) */
diff --git a/arch/arm/plat-omap/include/mach/dma.h b/arch/arm/plat-omap/include/mach/dma.h
index 8c1eae88737e..7b939cc01962 100644
--- a/arch/arm/plat-omap/include/mach/dma.h
+++ b/arch/arm/plat-omap/include/mach/dma.h
@@ -389,6 +389,21 @@
389#define DMA_THREAD_FIFO_25 (0x02 << 14) 389#define DMA_THREAD_FIFO_25 (0x02 << 14)
390#define DMA_THREAD_FIFO_50 (0x03 << 14) 390#define DMA_THREAD_FIFO_50 (0x03 << 14)
391 391
392/* DMA4_OCP_SYSCONFIG bits */
393#define DMA_SYSCONFIG_MIDLEMODE_MASK (3 << 12)
394#define DMA_SYSCONFIG_CLOCKACTIVITY_MASK (3 << 8)
395#define DMA_SYSCONFIG_EMUFREE (1 << 5)
396#define DMA_SYSCONFIG_SIDLEMODE_MASK (3 << 3)
397#define DMA_SYSCONFIG_SOFTRESET (1 << 2)
398#define DMA_SYSCONFIG_AUTOIDLE (1 << 0)
399
400#define DMA_SYSCONFIG_MIDLEMODE(n) ((n) << 12)
401#define DMA_SYSCONFIG_SIDLEMODE(n) ((n) << 3)
402
403#define DMA_IDLEMODE_SMARTIDLE 0x2
404#define DMA_IDLEMODE_NO_IDLE 0x1
405#define DMA_IDLEMODE_FORCE_IDLE 0x0
406
392/* Chaining modes*/ 407/* Chaining modes*/
393#ifndef CONFIG_ARCH_OMAP1 408#ifndef CONFIG_ARCH_OMAP1
394#define OMAP_DMA_STATIC_CHAIN 0x1 409#define OMAP_DMA_STATIC_CHAIN 0x1
diff --git a/arch/arm/plat-omap/include/mach/io.h b/arch/arm/plat-omap/include/mach/io.h
index 3b2814720569..73f483d56ca6 100644
--- a/arch/arm/plat-omap/include/mach/io.h
+++ b/arch/arm/plat-omap/include/mach/io.h
@@ -201,7 +201,7 @@
201#define OMAP2_IO_ADDRESS(pa) IOMEM(__OMAP2_IO_ADDRESS(pa)) 201#define OMAP2_IO_ADDRESS(pa) IOMEM(__OMAP2_IO_ADDRESS(pa))
202 202
203#ifdef __ASSEMBLER__ 203#ifdef __ASSEMBLER__
204#define IOMEM(x) x 204#define IOMEM(x) (x)
205#else 205#else
206#define IOMEM(x) ((void __force __iomem *)(x)) 206#define IOMEM(x) ((void __force __iomem *)(x))
207 207
diff --git a/arch/arm/plat-omap/iommu.c b/arch/arm/plat-omap/iommu.c
index 4cf449fa2cb5..4a0301399013 100644
--- a/arch/arm/plat-omap/iommu.c
+++ b/arch/arm/plat-omap/iommu.c
@@ -298,7 +298,7 @@ void flush_iotlb_page(struct iommu *obj, u32 da)
298 if ((start <= da) && (da < start + bytes)) { 298 if ((start <= da) && (da < start + bytes)) {
299 dev_dbg(obj->dev, "%s: %08x<=%08x(%x)\n", 299 dev_dbg(obj->dev, "%s: %08x<=%08x(%x)\n",
300 __func__, start, da, bytes); 300 __func__, start, da, bytes);
301 301 iotlb_load_cr(obj, &cr);
302 iommu_write_reg(obj, 1, MMU_FLUSH_ENTRY); 302 iommu_write_reg(obj, 1, MMU_FLUSH_ENTRY);
303 } 303 }
304 } 304 }
diff --git a/arch/arm/plat-omap/sram.c b/arch/arm/plat-omap/sram.c
index 65006df3f1b7..4ea73804d21e 100644
--- a/arch/arm/plat-omap/sram.c
+++ b/arch/arm/plat-omap/sram.c
@@ -133,7 +133,12 @@ void __init omap_detect_sram(void)
133 if (cpu_is_omap34xx()) { 133 if (cpu_is_omap34xx()) {
134 omap_sram_base = OMAP3_SRAM_PUB_VA; 134 omap_sram_base = OMAP3_SRAM_PUB_VA;
135 omap_sram_start = OMAP3_SRAM_PUB_PA; 135 omap_sram_start = OMAP3_SRAM_PUB_PA;
136 omap_sram_size = 0x8000; /* 32K */ 136 if ((omap_type() == OMAP2_DEVICE_TYPE_EMU) ||
137 (omap_type() == OMAP2_DEVICE_TYPE_SEC)) {
138 omap_sram_size = 0x7000; /* 28K */
139 } else {
140 omap_sram_size = 0x8000; /* 32K */
141 }
137 } else { 142 } else {
138 omap_sram_base = OMAP2_SRAM_PUB_VA; 143 omap_sram_base = OMAP2_SRAM_PUB_VA;
139 omap_sram_start = OMAP2_SRAM_PUB_PA; 144 omap_sram_start = OMAP2_SRAM_PUB_PA;
diff --git a/arch/arm/plat-s3c/Makefile b/arch/arm/plat-s3c/Makefile
index 74bb7cb5da49..0761766b1833 100644
--- a/arch/arm/plat-s3c/Makefile
+++ b/arch/arm/plat-s3c/Makefile
@@ -34,7 +34,7 @@ obj-$(CONFIG_S3C_DEV_HSMMC) += dev-hsmmc.o
34obj-$(CONFIG_S3C_DEV_HSMMC1) += dev-hsmmc1.o 34obj-$(CONFIG_S3C_DEV_HSMMC1) += dev-hsmmc1.o
35obj-y += dev-i2c0.o 35obj-y += dev-i2c0.o
36obj-$(CONFIG_S3C_DEV_I2C1) += dev-i2c1.o 36obj-$(CONFIG_S3C_DEV_I2C1) += dev-i2c1.o
37obj-$(CONFIG_SND_S3C24XX_SOC) += dev-audio.o 37obj-$(CONFIG_SND_S3C64XX_SOC_I2S) += dev-audio.o
38obj-$(CONFIG_S3C_DEV_FB) += dev-fb.o 38obj-$(CONFIG_S3C_DEV_FB) += dev-fb.o
39obj-$(CONFIG_S3C_DEV_USB_HOST) += dev-usb.o 39obj-$(CONFIG_S3C_DEV_USB_HOST) += dev-usb.o
40obj-$(CONFIG_S3C_DEV_USB_HSOTG) += dev-usb-hsotg.o 40obj-$(CONFIG_S3C_DEV_USB_HSOTG) += dev-usb-hsotg.o
diff --git a/arch/arm/plat-s3c/include/plat/devs.h b/arch/arm/plat-s3c/include/plat/devs.h
index b5b9c4d46e9a..2e170827e0b0 100644
--- a/arch/arm/plat-s3c/include/plat/devs.h
+++ b/arch/arm/plat-s3c/include/plat/devs.h
@@ -37,6 +37,7 @@ extern struct platform_device s3c_device_i2c1;
37extern struct platform_device s3c_device_rtc; 37extern struct platform_device s3c_device_rtc;
38extern struct platform_device s3c_device_adc; 38extern struct platform_device s3c_device_adc;
39extern struct platform_device s3c_device_sdi; 39extern struct platform_device s3c_device_sdi;
40extern struct platform_device s3c_device_iis;
40extern struct platform_device s3c_device_hwmon; 41extern struct platform_device s3c_device_hwmon;
41extern struct platform_device s3c_device_hsmmc0; 42extern struct platform_device s3c_device_hsmmc0;
42extern struct platform_device s3c_device_hsmmc1; 43extern struct platform_device s3c_device_hsmmc1;
diff --git a/arch/arm/plat-s3c24xx/Makefile b/arch/arm/plat-s3c24xx/Makefile
index 636cb12711df..579a165c2827 100644
--- a/arch/arm/plat-s3c24xx/Makefile
+++ b/arch/arm/plat-s3c24xx/Makefile
@@ -29,7 +29,7 @@ obj-$(CONFIG_PM_SIMTEC) += pm-simtec.o
29obj-$(CONFIG_PM) += pm.o 29obj-$(CONFIG_PM) += pm.o
30obj-$(CONFIG_PM) += irq-pm.o 30obj-$(CONFIG_PM) += irq-pm.o
31obj-$(CONFIG_PM) += sleep.o 31obj-$(CONFIG_PM) += sleep.o
32obj-$(CONFIG_HAVE_PWM) += pwm.o 32obj-$(CONFIG_S3C24XX_PWM) += pwm.o
33obj-$(CONFIG_S3C2410_CLOCK) += s3c2410-clock.o 33obj-$(CONFIG_S3C2410_CLOCK) += s3c2410-clock.o
34obj-$(CONFIG_S3C2410_DMA) += dma.o 34obj-$(CONFIG_S3C2410_DMA) += dma.o
35obj-$(CONFIG_S3C24XX_ADC) += adc.o 35obj-$(CONFIG_S3C24XX_ADC) += adc.o
diff --git a/arch/arm/plat-s3c24xx/spi-bus0-gpe11_12_13.c b/arch/arm/plat-s3c24xx/spi-bus0-gpe11_12_13.c
index 9edf7894eedd..da7a61728c18 100644
--- a/arch/arm/plat-s3c24xx/spi-bus0-gpe11_12_13.c
+++ b/arch/arm/plat-s3c24xx/spi-bus0-gpe11_12_13.c
@@ -12,8 +12,7 @@
12*/ 12*/
13 13
14#include <linux/kernel.h> 14#include <linux/kernel.h>
15 15#include <linux/gpio.h>
16#include <mach/hardware.h>
17 16
18#include <mach/spi.h> 17#include <mach/spi.h>
19#include <mach/regs-gpio.h> 18#include <mach/regs-gpio.h>
diff --git a/arch/arm/plat-s3c24xx/spi-bus1-gpg5_6_7.c b/arch/arm/plat-s3c24xx/spi-bus1-gpg5_6_7.c
index f34d0fc69ad8..86b9edc67413 100644
--- a/arch/arm/plat-s3c24xx/spi-bus1-gpg5_6_7.c
+++ b/arch/arm/plat-s3c24xx/spi-bus1-gpg5_6_7.c
@@ -12,8 +12,7 @@
12*/ 12*/
13 13
14#include <linux/kernel.h> 14#include <linux/kernel.h>
15 15#include <linux/gpio.h>
16#include <mach/hardware.h>
17 16
18#include <mach/spi.h> 17#include <mach/spi.h>
19#include <mach/regs-gpio.h> 18#include <mach/regs-gpio.h>
diff --git a/arch/arm/plat-s3c64xx/pm.c b/arch/arm/plat-s3c64xx/pm.c
index 07a6516a4f3c..47632fc7eb66 100644
--- a/arch/arm/plat-s3c64xx/pm.c
+++ b/arch/arm/plat-s3c64xx/pm.c
@@ -117,8 +117,6 @@ void s3c_pm_save_core(void)
117 * this. 117 * this.
118 */ 118 */
119 119
120#include <plat/regs-gpio.h>
121
122static void s3c64xx_cpu_suspend(void) 120static void s3c64xx_cpu_suspend(void)
123{ 121{
124 unsigned long tmp; 122 unsigned long tmp;
diff --git a/arch/arm/plat-stmp3xxx/pinmux.c b/arch/arm/plat-stmp3xxx/pinmux.c
index d41200382208..6d6b1a468eda 100644
--- a/arch/arm/plat-stmp3xxx/pinmux.c
+++ b/arch/arm/plat-stmp3xxx/pinmux.c
@@ -22,7 +22,6 @@
22#include <linux/sysdev.h> 22#include <linux/sysdev.h>
23#include <linux/string.h> 23#include <linux/string.h>
24#include <linux/bitops.h> 24#include <linux/bitops.h>
25#include <linux/sysdev.h>
26#include <linux/irq.h> 25#include <linux/irq.h>
27 26
28#include <mach/hardware.h> 27#include <mach/hardware.h>
diff --git a/arch/avr32/include/asm/thread_info.h b/arch/avr32/include/asm/thread_info.h
index 4442f8d2d423..fc42de5ca209 100644
--- a/arch/avr32/include/asm/thread_info.h
+++ b/arch/avr32/include/asm/thread_info.h
@@ -40,7 +40,7 @@ struct thread_info {
40 .exec_domain = &default_exec_domain, \ 40 .exec_domain = &default_exec_domain, \
41 .flags = 0, \ 41 .flags = 0, \
42 .cpu = 0, \ 42 .cpu = 0, \
43 .preempt_count = 1, \ 43 .preempt_count = INIT_PREEMPT_COUNT, \
44 .restart_block = { \ 44 .restart_block = { \
45 .fn = do_no_restart_syscall \ 45 .fn = do_no_restart_syscall \
46 } \ 46 } \
diff --git a/arch/avr32/kernel/traps.c b/arch/avr32/kernel/traps.c
index 6e3d491184ea..b91b2044af9c 100644
--- a/arch/avr32/kernel/traps.c
+++ b/arch/avr32/kernel/traps.c
@@ -32,22 +32,25 @@ void NORET_TYPE die(const char *str, struct pt_regs *regs, long err)
32 spin_lock_irq(&die_lock); 32 spin_lock_irq(&die_lock);
33 bust_spinlocks(1); 33 bust_spinlocks(1);
34 34
35 printk(KERN_ALERT "Oops: %s, sig: %ld [#%d]\n" KERN_EMERG, 35 printk(KERN_ALERT "Oops: %s, sig: %ld [#%d]\n",
36 str, err, ++die_counter); 36 str, err, ++die_counter);
37
38 printk(KERN_EMERG);
39
37#ifdef CONFIG_PREEMPT 40#ifdef CONFIG_PREEMPT
38 printk("PREEMPT "); 41 printk(KERN_CONT "PREEMPT ");
39#endif 42#endif
40#ifdef CONFIG_FRAME_POINTER 43#ifdef CONFIG_FRAME_POINTER
41 printk("FRAME_POINTER "); 44 printk(KERN_CONT "FRAME_POINTER ");
42#endif 45#endif
43 if (current_cpu_data.features & AVR32_FEATURE_OCD) { 46 if (current_cpu_data.features & AVR32_FEATURE_OCD) {
44 unsigned long did = ocd_read(DID); 47 unsigned long did = ocd_read(DID);
45 printk("chip: 0x%03lx:0x%04lx rev %lu\n", 48 printk(KERN_CONT "chip: 0x%03lx:0x%04lx rev %lu\n",
46 (did >> 1) & 0x7ff, 49 (did >> 1) & 0x7ff,
47 (did >> 12) & 0x7fff, 50 (did >> 12) & 0x7fff,
48 (did >> 28) & 0xf); 51 (did >> 28) & 0xf);
49 } else { 52 } else {
50 printk("cpu: arch %u r%u / core %u r%u\n", 53 printk(KERN_CONT "cpu: arch %u r%u / core %u r%u\n",
51 current_cpu_data.arch_type, 54 current_cpu_data.arch_type,
52 current_cpu_data.arch_revision, 55 current_cpu_data.arch_revision,
53 current_cpu_data.cpu_type, 56 current_cpu_data.cpu_type,
diff --git a/arch/blackfin/include/asm/context.S b/arch/blackfin/include/asm/context.S
index 16561ab18b38..f8a664f022b1 100644
--- a/arch/blackfin/include/asm/context.S
+++ b/arch/blackfin/include/asm/context.S
@@ -223,9 +223,10 @@
223 [--sp] = RETN; 223 [--sp] = RETN;
224 [--sp] = RETE; 224 [--sp] = RETE;
225 [--sp] = SEQSTAT; 225 [--sp] = SEQSTAT;
226#ifdef CONFIG_KGDB 226#ifdef CONFIG_DEBUG_KERNEL
227 r1.l = lo(IPEND); 227 p1.l = lo(IPEND);
228 r1.h = hi(IPEND); 228 p1.h = hi(IPEND);
229 r1 = [p1];
229 [--sp] = r1; 230 [--sp] = r1;
230#else 231#else
231 [--sp] = r0; /* Skip IPEND as well. */ 232 [--sp] = r0; /* Skip IPEND as well. */
diff --git a/arch/blackfin/include/asm/cpu.h b/arch/blackfin/include/asm/cpu.h
index 565b8136855e..fadfa82f93b2 100644
--- a/arch/blackfin/include/asm/cpu.h
+++ b/arch/blackfin/include/asm/cpu.h
@@ -32,7 +32,6 @@ struct blackfin_cpudata {
32 struct task_struct *idle; 32 struct task_struct *idle;
33 unsigned int imemctl; 33 unsigned int imemctl;
34 unsigned int dmemctl; 34 unsigned int dmemctl;
35 unsigned long loops_per_jiffy;
36 unsigned long dcache_invld_count; 35 unsigned long dcache_invld_count;
37 unsigned long icache_invld_count; 36 unsigned long icache_invld_count;
38}; 37};
diff --git a/arch/blackfin/include/asm/hardirq.h b/arch/blackfin/include/asm/hardirq.h
index cbd52f86bb9f..0b78b873df51 100644
--- a/arch/blackfin/include/asm/hardirq.h
+++ b/arch/blackfin/include/asm/hardirq.h
@@ -6,6 +6,9 @@
6extern void ack_bad_irq(unsigned int irq); 6extern void ack_bad_irq(unsigned int irq);
7#define ack_bad_irq ack_bad_irq 7#define ack_bad_irq ack_bad_irq
8 8
9/* Define until common code gets sane defaults */
10#define HARDIRQ_BITS 9
11
9#include <asm-generic/hardirq.h> 12#include <asm-generic/hardirq.h>
10 13
11#endif 14#endif
diff --git a/arch/blackfin/include/asm/processor.h b/arch/blackfin/include/asm/processor.h
index d0be99be8308..a36ad8dac068 100644
--- a/arch/blackfin/include/asm/processor.h
+++ b/arch/blackfin/include/asm/processor.h
@@ -105,23 +105,16 @@ static inline uint32_t __pure bfin_revid(void)
105 /* Always use CHIPID, to work around ANOMALY_05000234 */ 105 /* Always use CHIPID, to work around ANOMALY_05000234 */
106 uint32_t revid = (bfin_read_CHIPID() & CHIPID_VERSION) >> 28; 106 uint32_t revid = (bfin_read_CHIPID() & CHIPID_VERSION) >> 28;
107 107
108#ifdef CONFIG_BF52x 108#ifdef _BOOTROM_GET_DXE_ADDRESS_TWI
109 /* ANOMALY_05000357 109 /*
110 * ANOMALY_05000364
110 * Incorrect Revision Number in DSPID Register 111 * Incorrect Revision Number in DSPID Register
111 */ 112 */
112 if (revid == 0) 113 if (ANOMALY_05000364 &&
113 switch (bfin_read16(_BOOTROM_GET_DXE_ADDRESS_TWI)) { 114 bfin_read16(_BOOTROM_GET_DXE_ADDRESS_TWI) == 0x2796)
114 case 0x0010: 115 revid = 1;
115 revid = 0;
116 break;
117 case 0x2796:
118 revid = 1;
119 break;
120 default:
121 revid = 0xFFFF;
122 break;
123 }
124#endif 116#endif
117
125 return revid; 118 return revid;
126} 119}
127 120
diff --git a/arch/blackfin/include/asm/thread_info.h b/arch/blackfin/include/asm/thread_info.h
index 2920087516f2..2bbfdd950afc 100644
--- a/arch/blackfin/include/asm/thread_info.h
+++ b/arch/blackfin/include/asm/thread_info.h
@@ -77,7 +77,7 @@ struct thread_info {
77 .exec_domain = &default_exec_domain, \ 77 .exec_domain = &default_exec_domain, \
78 .flags = 0, \ 78 .flags = 0, \
79 .cpu = 0, \ 79 .cpu = 0, \
80 .preempt_count = 1, \ 80 .preempt_count = INIT_PREEMPT_COUNT, \
81 .restart_block = { \ 81 .restart_block = { \
82 .fn = do_no_restart_syscall, \ 82 .fn = do_no_restart_syscall, \
83 }, \ 83 }, \
diff --git a/arch/blackfin/kernel/bfin_dma_5xx.c b/arch/blackfin/kernel/bfin_dma_5xx.c
index e0bf8cc06907..9f9b82816652 100644
--- a/arch/blackfin/kernel/bfin_dma_5xx.c
+++ b/arch/blackfin/kernel/bfin_dma_5xx.c
@@ -253,32 +253,31 @@ void __init early_dma_memcpy(void *pdst, const void *psrc, size_t size)
253 BUG_ON(src % 4); 253 BUG_ON(src % 4);
254 BUG_ON(size % 4); 254 BUG_ON(size % 4);
255 255
256 /* Force a sync in case a previous config reset on this channel
257 * occurred. This is needed so subsequent writes to DMA registers
258 * are not spuriously lost/corrupted.
259 */
260 __builtin_bfin_ssync();
261
262 src_ch = 0; 256 src_ch = 0;
263 /* Find an avalible memDMA channel */ 257 /* Find an avalible memDMA channel */
264 while (1) { 258 while (1) {
265 if (!src_ch || src_ch == (struct dma_register *)MDMA_S1_NEXT_DESC_PTR) { 259 if (src_ch == (struct dma_register *)MDMA_S0_NEXT_DESC_PTR) {
266 dst_ch = (struct dma_register *)MDMA_D0_NEXT_DESC_PTR;
267 src_ch = (struct dma_register *)MDMA_S0_NEXT_DESC_PTR;
268 } else {
269 dst_ch = (struct dma_register *)MDMA_D1_NEXT_DESC_PTR; 260 dst_ch = (struct dma_register *)MDMA_D1_NEXT_DESC_PTR;
270 src_ch = (struct dma_register *)MDMA_S1_NEXT_DESC_PTR; 261 src_ch = (struct dma_register *)MDMA_S1_NEXT_DESC_PTR;
262 } else {
263 dst_ch = (struct dma_register *)MDMA_D0_NEXT_DESC_PTR;
264 src_ch = (struct dma_register *)MDMA_S0_NEXT_DESC_PTR;
271 } 265 }
272 266
273 if (!bfin_read16(&src_ch->cfg)) { 267 if (!bfin_read16(&src_ch->cfg))
268 break;
269 else if (bfin_read16(&dst_ch->irq_status) & DMA_DONE) {
270 bfin_write16(&src_ch->cfg, 0);
274 break; 271 break;
275 } else {
276 if (bfin_read16(&src_ch->irq_status) & DMA_DONE)
277 bfin_write16(&src_ch->cfg, 0);
278 } 272 }
279
280 } 273 }
281 274
275 /* Force a sync in case a previous config reset on this channel
276 * occurred. This is needed so subsequent writes to DMA registers
277 * are not spuriously lost/corrupted.
278 */
279 __builtin_bfin_ssync();
280
282 /* Destination */ 281 /* Destination */
283 bfin_write32(&dst_ch->start_addr, dst); 282 bfin_write32(&dst_ch->start_addr, dst);
284 bfin_write16(&dst_ch->x_count, size >> 2); 283 bfin_write16(&dst_ch->x_count, size >> 2);
diff --git a/arch/blackfin/kernel/bfin_gpio.c b/arch/blackfin/kernel/bfin_gpio.c
index beffa00a93c3..6b9446271371 100644
--- a/arch/blackfin/kernel/bfin_gpio.c
+++ b/arch/blackfin/kernel/bfin_gpio.c
@@ -686,14 +686,12 @@ void bfin_gpio_pm_hibernate_restore(void)
686 *port_fer[bank] = gpio_bank_saved[bank].fer; 686 *port_fer[bank] = gpio_bank_saved[bank].fer;
687#endif 687#endif
688 gpio_array[bank]->inen = gpio_bank_saved[bank].inen; 688 gpio_array[bank]->inen = gpio_bank_saved[bank].inen;
689 gpio_array[bank]->data_set = gpio_bank_saved[bank].data
690 & gpio_bank_saved[bank].dir;
689 gpio_array[bank]->dir = gpio_bank_saved[bank].dir; 691 gpio_array[bank]->dir = gpio_bank_saved[bank].dir;
690 gpio_array[bank]->polar = gpio_bank_saved[bank].polar; 692 gpio_array[bank]->polar = gpio_bank_saved[bank].polar;
691 gpio_array[bank]->edge = gpio_bank_saved[bank].edge; 693 gpio_array[bank]->edge = gpio_bank_saved[bank].edge;
692 gpio_array[bank]->both = gpio_bank_saved[bank].both; 694 gpio_array[bank]->both = gpio_bank_saved[bank].both;
693
694 gpio_array[bank]->data_set = gpio_bank_saved[bank].data
695 | gpio_bank_saved[bank].dir;
696
697 gpio_array[bank]->maska = gpio_bank_saved[bank].maska; 695 gpio_array[bank]->maska = gpio_bank_saved[bank].maska;
698 } 696 }
699 AWA_DUMMY_READ(maska); 697 AWA_DUMMY_READ(maska);
diff --git a/arch/blackfin/kernel/cplb-nompu/cplbinit.c b/arch/blackfin/kernel/cplb-nompu/cplbinit.c
index d6c067782e63..685f160a5a36 100644
--- a/arch/blackfin/kernel/cplb-nompu/cplbinit.c
+++ b/arch/blackfin/kernel/cplb-nompu/cplbinit.c
@@ -72,13 +72,24 @@ void __init generate_cplb_tables_cpu(unsigned int cpu)
72 } 72 }
73 73
74 /* Cover L1 memory. One 4M area for code and data each is enough. */ 74 /* Cover L1 memory. One 4M area for code and data each is enough. */
75 if (L1_DATA_A_LENGTH || L1_DATA_B_LENGTH) { 75 if (cpu == 0) {
76 d_tbl[i_d].addr = L1_DATA_A_START; 76 if (L1_DATA_A_LENGTH || L1_DATA_B_LENGTH) {
77 d_tbl[i_d++].data = L1_DMEMORY | PAGE_SIZE_4MB; 77 d_tbl[i_d].addr = L1_DATA_A_START;
78 d_tbl[i_d++].data = L1_DMEMORY | PAGE_SIZE_4MB;
79 }
80 i_tbl[i_i].addr = L1_CODE_START;
81 i_tbl[i_i++].data = L1_IMEMORY | PAGE_SIZE_4MB;
78 } 82 }
79 i_tbl[i_i].addr = L1_CODE_START; 83#ifdef CONFIG_SMP
80 i_tbl[i_i++].data = L1_IMEMORY | PAGE_SIZE_4MB; 84 else {
81 85 if (L1_DATA_A_LENGTH || L1_DATA_B_LENGTH) {
86 d_tbl[i_d].addr = COREB_L1_DATA_A_START;
87 d_tbl[i_d++].data = L1_DMEMORY | PAGE_SIZE_4MB;
88 }
89 i_tbl[i_i].addr = COREB_L1_CODE_START;
90 i_tbl[i_i++].data = L1_IMEMORY | PAGE_SIZE_4MB;
91 }
92#endif
82 first_switched_dcplb = i_d; 93 first_switched_dcplb = i_d;
83 first_switched_icplb = i_i; 94 first_switched_icplb = i_i;
84 95
diff --git a/arch/blackfin/kernel/process.c b/arch/blackfin/kernel/process.c
index 79cad0ac5892..9da36bab7ccb 100644
--- a/arch/blackfin/kernel/process.c
+++ b/arch/blackfin/kernel/process.c
@@ -361,7 +361,7 @@ static inline
361int in_mem_const(unsigned long addr, unsigned long size, 361int in_mem_const(unsigned long addr, unsigned long size,
362 unsigned long const_addr, unsigned long const_size) 362 unsigned long const_addr, unsigned long const_size)
363{ 363{
364 return in_mem_const_off(addr, 0, size, const_addr, const_size); 364 return in_mem_const_off(addr, size, 0, const_addr, const_size);
365} 365}
366#define IN_ASYNC(bnum, bctlnum) \ 366#define IN_ASYNC(bnum, bctlnum) \
367({ \ 367({ \
@@ -390,13 +390,13 @@ int bfin_mem_access_type(unsigned long addr, unsigned long size)
390 if (in_mem_const(addr, size, L1_DATA_B_START, L1_DATA_B_LENGTH)) 390 if (in_mem_const(addr, size, L1_DATA_B_START, L1_DATA_B_LENGTH))
391 return cpu == 0 ? BFIN_MEM_ACCESS_CORE : BFIN_MEM_ACCESS_IDMA; 391 return cpu == 0 ? BFIN_MEM_ACCESS_CORE : BFIN_MEM_ACCESS_IDMA;
392#ifdef COREB_L1_CODE_START 392#ifdef COREB_L1_CODE_START
393 if (in_mem_const(addr, size, COREB_L1_CODE_START, L1_CODE_LENGTH)) 393 if (in_mem_const(addr, size, COREB_L1_CODE_START, COREB_L1_CODE_LENGTH))
394 return cpu == 1 ? BFIN_MEM_ACCESS_ITEST : BFIN_MEM_ACCESS_IDMA; 394 return cpu == 1 ? BFIN_MEM_ACCESS_ITEST : BFIN_MEM_ACCESS_IDMA;
395 if (in_mem_const(addr, size, COREB_L1_SCRATCH_START, L1_SCRATCH_LENGTH)) 395 if (in_mem_const(addr, size, COREB_L1_SCRATCH_START, L1_SCRATCH_LENGTH))
396 return cpu == 1 ? BFIN_MEM_ACCESS_CORE_ONLY : -EFAULT; 396 return cpu == 1 ? BFIN_MEM_ACCESS_CORE_ONLY : -EFAULT;
397 if (in_mem_const(addr, size, COREB_L1_DATA_A_START, L1_DATA_A_LENGTH)) 397 if (in_mem_const(addr, size, COREB_L1_DATA_A_START, COREB_L1_DATA_A_LENGTH))
398 return cpu == 1 ? BFIN_MEM_ACCESS_CORE : BFIN_MEM_ACCESS_IDMA; 398 return cpu == 1 ? BFIN_MEM_ACCESS_CORE : BFIN_MEM_ACCESS_IDMA;
399 if (in_mem_const(addr, size, COREB_L1_DATA_B_START, L1_DATA_B_LENGTH)) 399 if (in_mem_const(addr, size, COREB_L1_DATA_B_START, COREB_L1_DATA_B_LENGTH))
400 return cpu == 1 ? BFIN_MEM_ACCESS_CORE : BFIN_MEM_ACCESS_IDMA; 400 return cpu == 1 ? BFIN_MEM_ACCESS_CORE : BFIN_MEM_ACCESS_IDMA;
401#endif 401#endif
402 if (in_mem_const(addr, size, L2_START, L2_LENGTH)) 402 if (in_mem_const(addr, size, L2_START, L2_LENGTH))
@@ -472,13 +472,13 @@ int _access_ok(unsigned long addr, unsigned long size)
472 if (in_mem_const_off(addr, size, _ebss_b_l1 - _sdata_b_l1, L1_DATA_B_START, L1_DATA_B_LENGTH)) 472 if (in_mem_const_off(addr, size, _ebss_b_l1 - _sdata_b_l1, L1_DATA_B_START, L1_DATA_B_LENGTH))
473 return 1; 473 return 1;
474#ifdef COREB_L1_CODE_START 474#ifdef COREB_L1_CODE_START
475 if (in_mem_const(addr, size, COREB_L1_CODE_START, L1_CODE_LENGTH)) 475 if (in_mem_const(addr, size, COREB_L1_CODE_START, COREB_L1_CODE_LENGTH))
476 return 1; 476 return 1;
477 if (in_mem_const(addr, size, COREB_L1_SCRATCH_START, L1_SCRATCH_LENGTH)) 477 if (in_mem_const(addr, size, COREB_L1_SCRATCH_START, L1_SCRATCH_LENGTH))
478 return 1; 478 return 1;
479 if (in_mem_const(addr, size, COREB_L1_DATA_A_START, L1_DATA_A_LENGTH)) 479 if (in_mem_const(addr, size, COREB_L1_DATA_A_START, COREB_L1_DATA_A_LENGTH))
480 return 1; 480 return 1;
481 if (in_mem_const(addr, size, COREB_L1_DATA_B_START, L1_DATA_B_LENGTH)) 481 if (in_mem_const(addr, size, COREB_L1_DATA_B_START, COREB_L1_DATA_B_LENGTH))
482 return 1; 482 return 1;
483#endif 483#endif
484 if (in_mem_const_off(addr, size, _ebss_l2 - _stext_l2, L2_START, L2_LENGTH)) 484 if (in_mem_const_off(addr, size, _ebss_l2 - _stext_l2, L2_START, L2_LENGTH))
diff --git a/arch/blackfin/kernel/ptrace.c b/arch/blackfin/kernel/ptrace.c
index d76618db50df..6a387eec6b65 100644
--- a/arch/blackfin/kernel/ptrace.c
+++ b/arch/blackfin/kernel/ptrace.c
@@ -31,7 +31,6 @@
31#include <linux/sched.h> 31#include <linux/sched.h>
32#include <linux/mm.h> 32#include <linux/mm.h>
33#include <linux/smp.h> 33#include <linux/smp.h>
34#include <linux/smp_lock.h>
35#include <linux/errno.h> 34#include <linux/errno.h>
36#include <linux/ptrace.h> 35#include <linux/ptrace.h>
37#include <linux/user.h> 36#include <linux/user.h>
diff --git a/arch/blackfin/kernel/setup.c b/arch/blackfin/kernel/setup.c
index 298f023bcc09..6225edae488e 100644
--- a/arch/blackfin/kernel/setup.c
+++ b/arch/blackfin/kernel/setup.c
@@ -168,7 +168,6 @@ void __cpuinit bfin_setup_cpudata(unsigned int cpu)
168 struct blackfin_cpudata *cpudata = &per_cpu(cpu_data, cpu); 168 struct blackfin_cpudata *cpudata = &per_cpu(cpu_data, cpu);
169 169
170 cpudata->idle = current; 170 cpudata->idle = current;
171 cpudata->loops_per_jiffy = loops_per_jiffy;
172 cpudata->imemctl = bfin_read_IMEM_CONTROL(); 171 cpudata->imemctl = bfin_read_IMEM_CONTROL();
173 cpudata->dmemctl = bfin_read_DMEM_CONTROL(); 172 cpudata->dmemctl = bfin_read_DMEM_CONTROL();
174} 173}
@@ -408,13 +407,14 @@ static void __init print_memory_map(char *who)
408 bfin_memmap.map[i].addr + bfin_memmap.map[i].size); 407 bfin_memmap.map[i].addr + bfin_memmap.map[i].size);
409 switch (bfin_memmap.map[i].type) { 408 switch (bfin_memmap.map[i].type) {
410 case BFIN_MEMMAP_RAM: 409 case BFIN_MEMMAP_RAM:
411 printk("(usable)\n"); 410 printk(KERN_CONT "(usable)\n");
412 break; 411 break;
413 case BFIN_MEMMAP_RESERVED: 412 case BFIN_MEMMAP_RESERVED:
414 printk("(reserved)\n"); 413 printk(KERN_CONT "(reserved)\n");
415 break; 414 break;
416 default: printk("type %lu\n", bfin_memmap.map[i].type); 415 default:
417 break; 416 printk(KERN_CONT "type %lu\n", bfin_memmap.map[i].type);
417 break;
418 } 418 }
419 } 419 }
420} 420}
@@ -567,17 +567,23 @@ static __init void memory_setup(void)
567# endif /* ANOMALY_05000263 */ 567# endif /* ANOMALY_05000263 */
568# endif /* CONFIG_ROMFS_FS */ 568# endif /* CONFIG_ROMFS_FS */
569 569
570 memory_end -= mtd_size; 570 /* Since the default MTD_UCLINUX has no magic number, we just blindly
571 571 * read 8 past the end of the kernel's image, and look at it.
572 if (mtd_size == 0) { 572 * When no image is attached, mtd_size is set to a random number
573 console_init(); 573 * Do some basic sanity checks before operating on things
574 panic("Don't boot kernel without rootfs attached."); 574 */
575 if (mtd_size == 0 || memory_end <= mtd_size) {
576 pr_emerg("Could not find valid ram mtd attached.\n");
577 } else {
578 memory_end -= mtd_size;
579
580 /* Relocate MTD image to the top of memory after the uncached memory area */
581 uclinux_ram_map.phys = memory_mtd_start = memory_end;
582 uclinux_ram_map.size = mtd_size;
583 pr_info("Found mtd parition at 0x%p, (len=0x%lx), moving to 0x%p\n",
584 _end, mtd_size, (void *)memory_mtd_start);
585 dma_memcpy((void *)uclinux_ram_map.phys, _end, uclinux_ram_map.size);
575 } 586 }
576
577 /* Relocate MTD image to the top of memory after the uncached memory area */
578 uclinux_ram_map.phys = memory_mtd_start = memory_end;
579 uclinux_ram_map.size = mtd_size;
580 dma_memcpy((void *)uclinux_ram_map.phys, _end, uclinux_ram_map.size);
581#endif /* CONFIG_MTD_UCLINUX */ 587#endif /* CONFIG_MTD_UCLINUX */
582 588
583#if (defined(CONFIG_BFIN_EXTMEM_ICACHEABLE) && ANOMALY_05000263) 589#if (defined(CONFIG_BFIN_EXTMEM_ICACHEABLE) && ANOMALY_05000263)
@@ -614,19 +620,19 @@ static __init void memory_setup(void)
614 printk(KERN_INFO "Kernel Managed Memory: %ldMB\n", _ramend >> 20); 620 printk(KERN_INFO "Kernel Managed Memory: %ldMB\n", _ramend >> 20);
615 621
616 printk(KERN_INFO "Memory map:\n" 622 printk(KERN_INFO "Memory map:\n"
617 KERN_INFO " fixedcode = 0x%p-0x%p\n" 623 " fixedcode = 0x%p-0x%p\n"
618 KERN_INFO " text = 0x%p-0x%p\n" 624 " text = 0x%p-0x%p\n"
619 KERN_INFO " rodata = 0x%p-0x%p\n" 625 " rodata = 0x%p-0x%p\n"
620 KERN_INFO " bss = 0x%p-0x%p\n" 626 " bss = 0x%p-0x%p\n"
621 KERN_INFO " data = 0x%p-0x%p\n" 627 " data = 0x%p-0x%p\n"
622 KERN_INFO " stack = 0x%p-0x%p\n" 628 " stack = 0x%p-0x%p\n"
623 KERN_INFO " init = 0x%p-0x%p\n" 629 " init = 0x%p-0x%p\n"
624 KERN_INFO " available = 0x%p-0x%p\n" 630 " available = 0x%p-0x%p\n"
625#ifdef CONFIG_MTD_UCLINUX 631#ifdef CONFIG_MTD_UCLINUX
626 KERN_INFO " rootfs = 0x%p-0x%p\n" 632 " rootfs = 0x%p-0x%p\n"
627#endif 633#endif
628#if DMA_UNCACHED_REGION > 0 634#if DMA_UNCACHED_REGION > 0
629 KERN_INFO " DMA Zone = 0x%p-0x%p\n" 635 " DMA Zone = 0x%p-0x%p\n"
630#endif 636#endif
631 , (void *)FIXED_CODE_START, (void *)FIXED_CODE_END, 637 , (void *)FIXED_CODE_START, (void *)FIXED_CODE_END,
632 _stext, _etext, 638 _stext, _etext,
@@ -859,20 +865,13 @@ void __init setup_arch(char **cmdline_p)
859#endif 865#endif
860 printk(KERN_INFO "Hardware Trace "); 866 printk(KERN_INFO "Hardware Trace ");
861 if (bfin_read_TBUFCTL() & 0x1) 867 if (bfin_read_TBUFCTL() & 0x1)
862 printk("Active "); 868 printk(KERN_CONT "Active ");
863 else 869 else
864 printk("Off "); 870 printk(KERN_CONT "Off ");
865 if (bfin_read_TBUFCTL() & 0x2) 871 if (bfin_read_TBUFCTL() & 0x2)
866 printk("and Enabled\n"); 872 printk(KERN_CONT "and Enabled\n");
867 else 873 else
868 printk("and Disabled\n"); 874 printk(KERN_CONT "and Disabled\n");
869
870#if defined(CONFIG_CHR_DEV_FLASH) || defined(CONFIG_BLK_DEV_FLASH)
871 /* we need to initialize the Flashrom device here since we might
872 * do things with flash early on in the boot
873 */
874 flash_probe();
875#endif
876 875
877 printk(KERN_INFO "Boot Mode: %i\n", bfin_read_SYSCR() & 0xF); 876 printk(KERN_INFO "Boot Mode: %i\n", bfin_read_SYSCR() & 0xF);
878 877
@@ -937,10 +936,6 @@ void __init setup_arch(char **cmdline_p)
937 CPU, bfin_revid()); 936 CPU, bfin_revid());
938 } 937 }
939 938
940 /* We can't run on BF548-0.1 due to ANOMALY 05000448 */
941 if (bfin_cpuid() == 0x27de && bfin_revid() == 1)
942 panic("You can't run on this processor due to 05000448");
943
944 printk(KERN_INFO "Blackfin Linux support by http://blackfin.uclinux.org/\n"); 939 printk(KERN_INFO "Blackfin Linux support by http://blackfin.uclinux.org/\n");
945 940
946 printk(KERN_INFO "Processor Speed: %lu MHz core clock and %lu MHz System Clock\n", 941 printk(KERN_INFO "Processor Speed: %lu MHz core clock and %lu MHz System Clock\n",
@@ -1163,9 +1158,9 @@ static int show_cpuinfo(struct seq_file *m, void *v)
1163 sclk/1000000, sclk%1000000); 1158 sclk/1000000, sclk%1000000);
1164 seq_printf(m, "bogomips\t: %lu.%02lu\n" 1159 seq_printf(m, "bogomips\t: %lu.%02lu\n"
1165 "Calibration\t: %lu loops\n", 1160 "Calibration\t: %lu loops\n",
1166 (cpudata->loops_per_jiffy * HZ) / 500000, 1161 (loops_per_jiffy * HZ) / 500000,
1167 ((cpudata->loops_per_jiffy * HZ) / 5000) % 100, 1162 ((loops_per_jiffy * HZ) / 5000) % 100,
1168 (cpudata->loops_per_jiffy * HZ)); 1163 (loops_per_jiffy * HZ));
1169 1164
1170 /* Check Cache configutation */ 1165 /* Check Cache configutation */
1171 switch (cpudata->dmemctl & (1 << DMC0_P | 1 << DMC1_P)) { 1166 switch (cpudata->dmemctl & (1 << DMC0_P | 1 << DMC1_P)) {
diff --git a/arch/blackfin/kernel/sys_bfin.c b/arch/blackfin/kernel/sys_bfin.c
index a8f1329c15a4..3da60fb13ce4 100644
--- a/arch/blackfin/kernel/sys_bfin.c
+++ b/arch/blackfin/kernel/sys_bfin.c
@@ -29,7 +29,6 @@
29 * 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA 29 * 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
30 */ 30 */
31 31
32#include <linux/smp_lock.h>
33#include <linux/spinlock.h> 32#include <linux/spinlock.h>
34#include <linux/sem.h> 33#include <linux/sem.h>
35#include <linux/msg.h> 34#include <linux/msg.h>
diff --git a/arch/blackfin/kernel/traps.c b/arch/blackfin/kernel/traps.c
index 8eeb457ce5d5..bf2b2d1f8ae5 100644
--- a/arch/blackfin/kernel/traps.c
+++ b/arch/blackfin/kernel/traps.c
@@ -212,7 +212,7 @@ asmlinkage void double_fault_c(struct pt_regs *fp)
212 console_verbose(); 212 console_verbose();
213 oops_in_progress = 1; 213 oops_in_progress = 1;
214#ifdef CONFIG_DEBUG_VERBOSE 214#ifdef CONFIG_DEBUG_VERBOSE
215 printk(KERN_EMERG "\n" KERN_EMERG "Double Fault\n"); 215 printk(KERN_EMERG "Double Fault\n");
216#ifdef CONFIG_DEBUG_DOUBLEFAULT_PRINT 216#ifdef CONFIG_DEBUG_DOUBLEFAULT_PRINT
217 if (((long)fp->seqstat & SEQSTAT_EXCAUSE) == VEC_UNCOV) { 217 if (((long)fp->seqstat & SEQSTAT_EXCAUSE) == VEC_UNCOV) {
218 unsigned int cpu = smp_processor_id(); 218 unsigned int cpu = smp_processor_id();
@@ -570,11 +570,12 @@ asmlinkage void trap_c(struct pt_regs *fp)
570 if (kernel_mode_regs(fp) || (current && !current->mm)) { 570 if (kernel_mode_regs(fp) || (current && !current->mm)) {
571 console_verbose(); 571 console_verbose();
572 oops_in_progress = 1; 572 oops_in_progress = 1;
573 if (strerror)
574 verbose_printk(strerror);
575 } 573 }
576 574
577 if (sig != SIGTRAP) { 575 if (sig != SIGTRAP) {
576 if (strerror)
577 verbose_printk(strerror);
578
578 dump_bfin_process(fp); 579 dump_bfin_process(fp);
579 dump_bfin_mem(fp); 580 dump_bfin_mem(fp);
580 show_regs(fp); 581 show_regs(fp);
@@ -583,15 +584,14 @@ asmlinkage void trap_c(struct pt_regs *fp)
583#ifndef CONFIG_DEBUG_BFIN_NO_KERN_HWTRACE 584#ifndef CONFIG_DEBUG_BFIN_NO_KERN_HWTRACE
584 if (trapnr == VEC_CPLB_I_M || trapnr == VEC_CPLB_M) 585 if (trapnr == VEC_CPLB_I_M || trapnr == VEC_CPLB_M)
585 verbose_printk(KERN_NOTICE "No trace since you do not have " 586 verbose_printk(KERN_NOTICE "No trace since you do not have "
586 "CONFIG_DEBUG_BFIN_NO_KERN_HWTRACE enabled\n" 587 "CONFIG_DEBUG_BFIN_NO_KERN_HWTRACE enabled\n\n");
587 KERN_NOTICE "\n");
588 else 588 else
589#endif 589#endif
590 dump_bfin_trace_buffer(); 590 dump_bfin_trace_buffer();
591 591
592 if (oops_in_progress) { 592 if (oops_in_progress) {
593 /* Dump the current kernel stack */ 593 /* Dump the current kernel stack */
594 verbose_printk(KERN_NOTICE "\n" KERN_NOTICE "Kernel Stack\n"); 594 verbose_printk(KERN_NOTICE "Kernel Stack\n");
595 show_stack(current, NULL); 595 show_stack(current, NULL);
596 print_modules(); 596 print_modules();
597#ifndef CONFIG_ACCESS_CHECK 597#ifndef CONFIG_ACCESS_CHECK
@@ -620,7 +620,9 @@ asmlinkage void trap_c(struct pt_regs *fp)
620 force_sig_info(sig, &info, current); 620 force_sig_info(sig, &info, current);
621 } 621 }
622 622
623 if (ANOMALY_05000461 && trapnr == VEC_HWERR && !access_ok(VERIFY_READ, fp->pc, 8)) 623 if ((ANOMALY_05000461 && trapnr == VEC_HWERR && !access_ok(VERIFY_READ, fp->pc, 8)) ||
624 (ANOMALY_05000281 && trapnr == VEC_HWERR) ||
625 (ANOMALY_05000189 && (trapnr == VEC_CPLB_I_VL || trapnr == VEC_CPLB_VL)))
624 fp->pc = SAFE_USER_INSTRUCTION; 626 fp->pc = SAFE_USER_INSTRUCTION;
625 627
626 traps_done: 628 traps_done:
@@ -906,7 +908,7 @@ void show_stack(struct task_struct *task, unsigned long *stack)
906 908
907 ret_addr = 0; 909 ret_addr = 0;
908 if (!j && i % 8 == 0) 910 if (!j && i % 8 == 0)
909 printk("\n" KERN_NOTICE "%p:",addr); 911 printk(KERN_NOTICE "%p:",addr);
910 912
911 /* if it is an odd address, or zero, just skip it */ 913 /* if it is an odd address, or zero, just skip it */
912 if (*addr & 0x1 || !*addr) 914 if (*addr & 0x1 || !*addr)
@@ -996,9 +998,9 @@ void dump_bfin_process(struct pt_regs *fp)
996 998
997 printk(KERN_NOTICE "CPU = %d\n", current_thread_info()->cpu); 999 printk(KERN_NOTICE "CPU = %d\n", current_thread_info()->cpu);
998 if (!((unsigned long)current->mm & 0x3) && (unsigned long)current->mm >= FIXED_CODE_START) 1000 if (!((unsigned long)current->mm & 0x3) && (unsigned long)current->mm >= FIXED_CODE_START)
999 verbose_printk(KERN_NOTICE "TEXT = 0x%p-0x%p DATA = 0x%p-0x%p\n" 1001 verbose_printk(KERN_NOTICE
1000 KERN_NOTICE " BSS = 0x%p-0x%p USER-STACK = 0x%p\n" 1002 "TEXT = 0x%p-0x%p DATA = 0x%p-0x%p\n"
1001 KERN_NOTICE "\n", 1003 " BSS = 0x%p-0x%p USER-STACK = 0x%p\n\n",
1002 (void *)current->mm->start_code, 1004 (void *)current->mm->start_code,
1003 (void *)current->mm->end_code, 1005 (void *)current->mm->end_code,
1004 (void *)current->mm->start_data, 1006 (void *)current->mm->start_data,
@@ -1009,8 +1011,8 @@ void dump_bfin_process(struct pt_regs *fp)
1009 else 1011 else
1010 verbose_printk(KERN_NOTICE "invalid mm\n"); 1012 verbose_printk(KERN_NOTICE "invalid mm\n");
1011 } else 1013 } else
1012 verbose_printk(KERN_NOTICE "\n" KERN_NOTICE 1014 verbose_printk(KERN_NOTICE
1013 "No Valid process in current context\n"); 1015 "No Valid process in current context\n");
1014#endif 1016#endif
1015} 1017}
1016 1018
@@ -1028,7 +1030,7 @@ void dump_bfin_mem(struct pt_regs *fp)
1028 addr < (unsigned short *)((unsigned long)erraddr & ~0xF) + 0x10; 1030 addr < (unsigned short *)((unsigned long)erraddr & ~0xF) + 0x10;
1029 addr++) { 1031 addr++) {
1030 if (!((unsigned long)addr & 0xF)) 1032 if (!((unsigned long)addr & 0xF))
1031 verbose_printk("\n" KERN_NOTICE "0x%p: ", addr); 1033 verbose_printk(KERN_NOTICE "0x%p: ", addr);
1032 1034
1033 if (!get_instruction(&val, addr)) { 1035 if (!get_instruction(&val, addr)) {
1034 val = 0; 1036 val = 0;
@@ -1056,9 +1058,9 @@ void dump_bfin_mem(struct pt_regs *fp)
1056 oops_in_progress)){ 1058 oops_in_progress)){
1057 verbose_printk(KERN_NOTICE "Looks like this was a deferred error - sorry\n"); 1059 verbose_printk(KERN_NOTICE "Looks like this was a deferred error - sorry\n");
1058#ifndef CONFIG_DEBUG_HWERR 1060#ifndef CONFIG_DEBUG_HWERR
1059 verbose_printk(KERN_NOTICE "The remaining message may be meaningless\n" 1061 verbose_printk(KERN_NOTICE
1060 KERN_NOTICE "You should enable CONFIG_DEBUG_HWERR to get a" 1062"The remaining message may be meaningless\n"
1061 " better idea where it came from\n"); 1063"You should enable CONFIG_DEBUG_HWERR to get a better idea where it came from\n");
1062#else 1064#else
1063 /* If we are handling only one peripheral interrupt 1065 /* If we are handling only one peripheral interrupt
1064 * and current mm and pid are valid, and the last error 1066 * and current mm and pid are valid, and the last error
@@ -1114,9 +1116,10 @@ void show_regs(struct pt_regs *fp)
1114 1116
1115 verbose_printk(KERN_NOTICE "%s", linux_banner); 1117 verbose_printk(KERN_NOTICE "%s", linux_banner);
1116 1118
1117 verbose_printk(KERN_NOTICE "\n" KERN_NOTICE "SEQUENCER STATUS:\t\t%s\n", print_tainted()); 1119 verbose_printk(KERN_NOTICE "\nSEQUENCER STATUS:\t\t%s\n",
1120 print_tainted());
1118 verbose_printk(KERN_NOTICE " SEQSTAT: %08lx IPEND: %04lx SYSCFG: %04lx\n", 1121 verbose_printk(KERN_NOTICE " SEQSTAT: %08lx IPEND: %04lx SYSCFG: %04lx\n",
1119 (long)fp->seqstat, fp->ipend, fp->syscfg); 1122 (long)fp->seqstat, fp->ipend, fp->syscfg);
1120 if ((fp->seqstat & SEQSTAT_EXCAUSE) == VEC_HWERR) { 1123 if ((fp->seqstat & SEQSTAT_EXCAUSE) == VEC_HWERR) {
1121 verbose_printk(KERN_NOTICE " HWERRCAUSE: 0x%lx\n", 1124 verbose_printk(KERN_NOTICE " HWERRCAUSE: 0x%lx\n",
1122 (fp->seqstat & SEQSTAT_HWERRCAUSE) >> 14); 1125 (fp->seqstat & SEQSTAT_HWERRCAUSE) >> 14);
@@ -1184,7 +1187,7 @@ unlock:
1184 verbose_printk(KERN_NOTICE "ICPLB_FAULT_ADDR: %s\n", buf); 1187 verbose_printk(KERN_NOTICE "ICPLB_FAULT_ADDR: %s\n", buf);
1185 } 1188 }
1186 1189
1187 verbose_printk(KERN_NOTICE "\n" KERN_NOTICE "PROCESSOR STATE:\n"); 1190 verbose_printk(KERN_NOTICE "PROCESSOR STATE:\n");
1188 verbose_printk(KERN_NOTICE " R0 : %08lx R1 : %08lx R2 : %08lx R3 : %08lx\n", 1191 verbose_printk(KERN_NOTICE " R0 : %08lx R1 : %08lx R2 : %08lx R3 : %08lx\n",
1189 fp->r0, fp->r1, fp->r2, fp->r3); 1192 fp->r0, fp->r1, fp->r2, fp->r3);
1190 verbose_printk(KERN_NOTICE " R4 : %08lx R5 : %08lx R6 : %08lx R7 : %08lx\n", 1193 verbose_printk(KERN_NOTICE " R4 : %08lx R5 : %08lx R6 : %08lx R7 : %08lx\n",
diff --git a/arch/blackfin/lib/lshrdi3.c b/arch/blackfin/lib/lshrdi3.c
index 84b9c5592220..e57bf6fbdf3f 100644
--- a/arch/blackfin/lib/lshrdi3.c
+++ b/arch/blackfin/lib/lshrdi3.c
@@ -27,21 +27,7 @@
27 * 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA 27 * 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
28 */ 28 */
29 29
30#define BITS_PER_UNIT 8 30#include "gcclib.h"
31
32typedef int SItype __attribute__ ((mode(SI)));
33typedef unsigned int USItype __attribute__ ((mode(SI)));
34typedef int DItype __attribute__ ((mode(DI)));
35typedef int word_type __attribute__ ((mode(__word__)));
36
37struct DIstruct {
38 SItype high, low;
39};
40
41typedef union {
42 struct DIstruct s;
43 DItype ll;
44} DIunion;
45 31
46#ifdef CONFIG_ARITHMETIC_OPS_L1 32#ifdef CONFIG_ARITHMETIC_OPS_L1
47DItype __lshrdi3(DItype u, word_type b)__attribute__((l1_text)); 33DItype __lshrdi3(DItype u, word_type b)__attribute__((l1_text));
diff --git a/arch/blackfin/mach-bf518/boards/ezbrd.c b/arch/blackfin/mach-bf518/boards/ezbrd.c
index d9791106be9f..809be268e42d 100644
--- a/arch/blackfin/mach-bf518/boards/ezbrd.c
+++ b/arch/blackfin/mach-bf518/boards/ezbrd.c
@@ -534,7 +534,7 @@ static struct platform_device i2c_bfin_twi_device = {
534#endif 534#endif
535 535
536static struct i2c_board_info __initdata bfin_i2c_board_info[] = { 536static struct i2c_board_info __initdata bfin_i2c_board_info[] = {
537#if defined(CONFIG_BFIN_TWI_LCD) || defined(CONFIG_TWI_LCD_MODULE) 537#if defined(CONFIG_BFIN_TWI_LCD) || defined(CONFIG_BFIN_TWI_LCD_MODULE)
538 { 538 {
539 I2C_BOARD_INFO("pcf8574_lcd", 0x22), 539 I2C_BOARD_INFO("pcf8574_lcd", 0x22),
540 }, 540 },
diff --git a/arch/blackfin/mach-bf518/include/mach/anomaly.h b/arch/blackfin/mach-bf518/include/mach/anomaly.h
index 426e064062a0..753ed810e1c6 100644
--- a/arch/blackfin/mach-bf518/include/mach/anomaly.h
+++ b/arch/blackfin/mach-bf518/include/mach/anomaly.h
@@ -82,6 +82,7 @@
82#define ANOMALY_05000179 (0) 82#define ANOMALY_05000179 (0)
83#define ANOMALY_05000182 (0) 83#define ANOMALY_05000182 (0)
84#define ANOMALY_05000183 (0) 84#define ANOMALY_05000183 (0)
85#define ANOMALY_05000189 (0)
85#define ANOMALY_05000198 (0) 86#define ANOMALY_05000198 (0)
86#define ANOMALY_05000202 (0) 87#define ANOMALY_05000202 (0)
87#define ANOMALY_05000215 (0) 88#define ANOMALY_05000215 (0)
@@ -117,6 +118,7 @@
117#define ANOMALY_05000357 (0) 118#define ANOMALY_05000357 (0)
118#define ANOMALY_05000362 (1) 119#define ANOMALY_05000362 (1)
119#define ANOMALY_05000363 (0) 120#define ANOMALY_05000363 (0)
121#define ANOMALY_05000364 (0)
120#define ANOMALY_05000371 (0) 122#define ANOMALY_05000371 (0)
121#define ANOMALY_05000380 (0) 123#define ANOMALY_05000380 (0)
122#define ANOMALY_05000386 (0) 124#define ANOMALY_05000386 (0)
diff --git a/arch/blackfin/mach-bf518/include/mach/bfin_serial_5xx.h b/arch/blackfin/mach-bf518/include/mach/bfin_serial_5xx.h
index 0fb2ce5d840e..dbade93395eb 100644
--- a/arch/blackfin/mach-bf518/include/mach/bfin_serial_5xx.h
+++ b/arch/blackfin/mach-bf518/include/mach/bfin_serial_5xx.h
@@ -53,7 +53,7 @@
53#define UART_SET_DLAB(uart) do { UART_PUT_LCR(uart, UART_GET_LCR(uart) | DLAB); SSYNC(); } while (0) 53#define UART_SET_DLAB(uart) do { UART_PUT_LCR(uart, UART_GET_LCR(uart) | DLAB); SSYNC(); } while (0)
54#define UART_CLEAR_DLAB(uart) do { UART_PUT_LCR(uart, UART_GET_LCR(uart) & ~DLAB); SSYNC(); } while (0) 54#define UART_CLEAR_DLAB(uart) do { UART_PUT_LCR(uart, UART_GET_LCR(uart) & ~DLAB); SSYNC(); } while (0)
55 55
56#define UART_GET_CTS(x) (!gpio_get_value(x->cts_pin)) 56#define UART_GET_CTS(x) gpio_get_value(x->cts_pin)
57#define UART_DISABLE_RTS(x) gpio_set_value(x->rts_pin, 1) 57#define UART_DISABLE_RTS(x) gpio_set_value(x->rts_pin, 1)
58#define UART_ENABLE_RTS(x) gpio_set_value(x->rts_pin, 0) 58#define UART_ENABLE_RTS(x) gpio_set_value(x->rts_pin, 0)
59#define UART_ENABLE_INTS(x, v) UART_PUT_IER(x, v) 59#define UART_ENABLE_INTS(x, v) UART_PUT_IER(x, v)
diff --git a/arch/blackfin/mach-bf527/boards/cm_bf527.c b/arch/blackfin/mach-bf527/boards/cm_bf527.c
index f4867ce0c618..b09484f538f4 100644
--- a/arch/blackfin/mach-bf527/boards/cm_bf527.c
+++ b/arch/blackfin/mach-bf527/boards/cm_bf527.c
@@ -793,7 +793,7 @@ static struct platform_device i2c_bfin_twi_device = {
793#endif 793#endif
794 794
795static struct i2c_board_info __initdata bfin_i2c_board_info[] = { 795static struct i2c_board_info __initdata bfin_i2c_board_info[] = {
796#if defined(CONFIG_BFIN_TWI_LCD) || defined(CONFIG_TWI_LCD_MODULE) 796#if defined(CONFIG_BFIN_TWI_LCD) || defined(CONFIG_BFIN_TWI_LCD_MODULE)
797 { 797 {
798 I2C_BOARD_INFO("pcf8574_lcd", 0x22), 798 I2C_BOARD_INFO("pcf8574_lcd", 0x22),
799 .type = "pcf8574_lcd", 799 .type = "pcf8574_lcd",
diff --git a/arch/blackfin/mach-bf527/boards/ezbrd.c b/arch/blackfin/mach-bf527/boards/ezbrd.c
index b2f30f06b73e..2ad68cd10ae6 100644
--- a/arch/blackfin/mach-bf527/boards/ezbrd.c
+++ b/arch/blackfin/mach-bf527/boards/ezbrd.c
@@ -591,7 +591,7 @@ static struct platform_device i2c_bfin_twi_device = {
591#endif 591#endif
592 592
593static struct i2c_board_info __initdata bfin_i2c_board_info[] = { 593static struct i2c_board_info __initdata bfin_i2c_board_info[] = {
594#if defined(CONFIG_BFIN_TWI_LCD) || defined(CONFIG_TWI_LCD_MODULE) 594#if defined(CONFIG_BFIN_TWI_LCD) || defined(CONFIG_BFIN_TWI_LCD_MODULE)
595 { 595 {
596 I2C_BOARD_INFO("pcf8574_lcd", 0x22), 596 I2C_BOARD_INFO("pcf8574_lcd", 0x22),
597 }, 597 },
diff --git a/arch/blackfin/mach-bf527/boards/ezkit.c b/arch/blackfin/mach-bf527/boards/ezkit.c
index 799a1d1fa890..75e563d3f9d4 100644
--- a/arch/blackfin/mach-bf527/boards/ezkit.c
+++ b/arch/blackfin/mach-bf527/boards/ezkit.c
@@ -858,7 +858,7 @@ static struct platform_device i2c_bfin_twi_device = {
858#endif 858#endif
859 859
860static struct i2c_board_info __initdata bfin_i2c_board_info[] = { 860static struct i2c_board_info __initdata bfin_i2c_board_info[] = {
861#if defined(CONFIG_BFIN_TWI_LCD) || defined(CONFIG_TWI_LCD_MODULE) 861#if defined(CONFIG_BFIN_TWI_LCD) || defined(CONFIG_BFIN_TWI_LCD_MODULE)
862 { 862 {
863 I2C_BOARD_INFO("pcf8574_lcd", 0x22), 863 I2C_BOARD_INFO("pcf8574_lcd", 0x22),
864 }, 864 },
diff --git a/arch/blackfin/mach-bf527/include/mach/anomaly.h b/arch/blackfin/mach-bf527/include/mach/anomaly.h
index 0d63f7406168..c438ca89d8c9 100644
--- a/arch/blackfin/mach-bf527/include/mach/anomaly.h
+++ b/arch/blackfin/mach-bf527/include/mach/anomaly.h
@@ -176,6 +176,8 @@
176#define ANOMALY_05000443 (1) 176#define ANOMALY_05000443 (1)
177/* The WURESET Bit in the SYSCR Register is not Functional */ 177/* The WURESET Bit in the SYSCR Register is not Functional */
178#define ANOMALY_05000445 (1) 178#define ANOMALY_05000445 (1)
179/* USB DMA Short Packet Data Corruption */
180#define ANOMALY_05000450 (1)
179/* BCODE_QUICKBOOT, BCODE_ALLBOOT, and BCODE_FULLBOOT Settings in SYSCR Register Not Functional */ 181/* BCODE_QUICKBOOT, BCODE_ALLBOOT, and BCODE_FULLBOOT Settings in SYSCR Register Not Functional */
180#define ANOMALY_05000451 (1) 182#define ANOMALY_05000451 (1)
181/* Incorrect Default Hysteresis Setting for RESET, NMI, and BMODE Signals */ 183/* Incorrect Default Hysteresis Setting for RESET, NMI, and BMODE Signals */
@@ -201,6 +203,7 @@
201#define ANOMALY_05000179 (0) 203#define ANOMALY_05000179 (0)
202#define ANOMALY_05000182 (0) 204#define ANOMALY_05000182 (0)
203#define ANOMALY_05000183 (0) 205#define ANOMALY_05000183 (0)
206#define ANOMALY_05000189 (0)
204#define ANOMALY_05000198 (0) 207#define ANOMALY_05000198 (0)
205#define ANOMALY_05000202 (0) 208#define ANOMALY_05000202 (0)
206#define ANOMALY_05000215 (0) 209#define ANOMALY_05000215 (0)
@@ -238,6 +241,5 @@
238#define ANOMALY_05000412 (0) 241#define ANOMALY_05000412 (0)
239#define ANOMALY_05000447 (0) 242#define ANOMALY_05000447 (0)
240#define ANOMALY_05000448 (0) 243#define ANOMALY_05000448 (0)
241#define ANOMALY_05000450 (0)
242 244
243#endif 245#endif
diff --git a/arch/blackfin/mach-bf527/include/mach/bfin_serial_5xx.h b/arch/blackfin/mach-bf527/include/mach/bfin_serial_5xx.h
index a625659dd67f..ebd6cebc1fbc 100644
--- a/arch/blackfin/mach-bf527/include/mach/bfin_serial_5xx.h
+++ b/arch/blackfin/mach-bf527/include/mach/bfin_serial_5xx.h
@@ -53,7 +53,7 @@
53#define UART_SET_DLAB(uart) do { UART_PUT_LCR(uart, UART_GET_LCR(uart) | DLAB); SSYNC(); } while (0) 53#define UART_SET_DLAB(uart) do { UART_PUT_LCR(uart, UART_GET_LCR(uart) | DLAB); SSYNC(); } while (0)
54#define UART_CLEAR_DLAB(uart) do { UART_PUT_LCR(uart, UART_GET_LCR(uart) & ~DLAB); SSYNC(); } while (0) 54#define UART_CLEAR_DLAB(uart) do { UART_PUT_LCR(uart, UART_GET_LCR(uart) & ~DLAB); SSYNC(); } while (0)
55 55
56#define UART_GET_CTS(x) (!gpio_get_value(x->cts_pin)) 56#define UART_GET_CTS(x) gpio_get_value(x->cts_pin)
57#define UART_DISABLE_RTS(x) gpio_set_value(x->rts_pin, 1) 57#define UART_DISABLE_RTS(x) gpio_set_value(x->rts_pin, 1)
58#define UART_ENABLE_RTS(x) gpio_set_value(x->rts_pin, 0) 58#define UART_ENABLE_RTS(x) gpio_set_value(x->rts_pin, 0)
59#define UART_ENABLE_INTS(x, v) UART_PUT_IER(x, v) 59#define UART_ENABLE_INTS(x, v) UART_PUT_IER(x, v)
diff --git a/arch/blackfin/mach-bf533/boards/stamp.c b/arch/blackfin/mach-bf533/boards/stamp.c
index a68ade8a3ca2..3d743ccaff6a 100644
--- a/arch/blackfin/mach-bf533/boards/stamp.c
+++ b/arch/blackfin/mach-bf533/boards/stamp.c
@@ -453,7 +453,7 @@ static struct i2c_board_info __initdata bfin_i2c_board_info[] = {
453 .irq = 39, 453 .irq = 39,
454 }, 454 },
455#endif 455#endif
456#if defined(CONFIG_BFIN_TWI_LCD) || defined(CONFIG_TWI_LCD_MODULE) 456#if defined(CONFIG_BFIN_TWI_LCD) || defined(CONFIG_BFIN_TWI_LCD_MODULE)
457 { 457 {
458 I2C_BOARD_INFO("pcf8574_lcd", 0x22), 458 I2C_BOARD_INFO("pcf8574_lcd", 0x22),
459 }, 459 },
diff --git a/arch/blackfin/mach-bf533/include/mach/anomaly.h b/arch/blackfin/mach-bf533/include/mach/anomaly.h
index 70a0ad69c610..cd83db2fb1a1 100644
--- a/arch/blackfin/mach-bf533/include/mach/anomaly.h
+++ b/arch/blackfin/mach-bf533/include/mach/anomaly.h
@@ -335,6 +335,7 @@
335#define ANOMALY_05000323 (0) 335#define ANOMALY_05000323 (0)
336#define ANOMALY_05000353 (1) 336#define ANOMALY_05000353 (1)
337#define ANOMALY_05000362 (1) 337#define ANOMALY_05000362 (1)
338#define ANOMALY_05000364 (0)
338#define ANOMALY_05000380 (0) 339#define ANOMALY_05000380 (0)
339#define ANOMALY_05000386 (1) 340#define ANOMALY_05000386 (1)
340#define ANOMALY_05000389 (0) 341#define ANOMALY_05000389 (0)
diff --git a/arch/blackfin/mach-bf533/include/mach/bfin_serial_5xx.h b/arch/blackfin/mach-bf533/include/mach/bfin_serial_5xx.h
index a3789d7ccf8c..4062e24e759b 100644
--- a/arch/blackfin/mach-bf533/include/mach/bfin_serial_5xx.h
+++ b/arch/blackfin/mach-bf533/include/mach/bfin_serial_5xx.h
@@ -53,7 +53,7 @@
53#define UART_SET_DLAB(uart) do { UART_PUT_LCR(uart, UART_GET_LCR(uart) | DLAB); SSYNC(); } while (0) 53#define UART_SET_DLAB(uart) do { UART_PUT_LCR(uart, UART_GET_LCR(uart) | DLAB); SSYNC(); } while (0)
54#define UART_CLEAR_DLAB(uart) do { UART_PUT_LCR(uart, UART_GET_LCR(uart) & ~DLAB); SSYNC(); } while (0) 54#define UART_CLEAR_DLAB(uart) do { UART_PUT_LCR(uart, UART_GET_LCR(uart) & ~DLAB); SSYNC(); } while (0)
55 55
56#define UART_GET_CTS(x) (!gpio_get_value(x->cts_pin)) 56#define UART_GET_CTS(x) gpio_get_value(x->cts_pin)
57#define UART_DISABLE_RTS(x) gpio_set_value(x->rts_pin, 1) 57#define UART_DISABLE_RTS(x) gpio_set_value(x->rts_pin, 1)
58#define UART_ENABLE_RTS(x) gpio_set_value(x->rts_pin, 0) 58#define UART_ENABLE_RTS(x) gpio_set_value(x->rts_pin, 0)
59#define UART_ENABLE_INTS(x, v) UART_PUT_IER(x, v) 59#define UART_ENABLE_INTS(x, v) UART_PUT_IER(x, v)
diff --git a/arch/blackfin/mach-bf537/boards/stamp.c b/arch/blackfin/mach-bf537/boards/stamp.c
index c1f76dd2c4ed..bd656907b8c0 100644
--- a/arch/blackfin/mach-bf537/boards/stamp.c
+++ b/arch/blackfin/mach-bf537/boards/stamp.c
@@ -1313,10 +1313,10 @@ static struct i2c_board_info __initdata bfin_i2c_board_info[] = {
1313#if defined(CONFIG_JOYSTICK_AD7142) || defined(CONFIG_JOYSTICK_AD7142_MODULE) 1313#if defined(CONFIG_JOYSTICK_AD7142) || defined(CONFIG_JOYSTICK_AD7142_MODULE)
1314 { 1314 {
1315 I2C_BOARD_INFO("ad7142_joystick", 0x2C), 1315 I2C_BOARD_INFO("ad7142_joystick", 0x2C),
1316 .irq = IRQ_PF5, 1316 .irq = IRQ_PG5,
1317 }, 1317 },
1318#endif 1318#endif
1319#if defined(CONFIG_BFIN_TWI_LCD) || defined(CONFIG_TWI_LCD_MODULE) 1319#if defined(CONFIG_BFIN_TWI_LCD) || defined(CONFIG_BFIN_TWI_LCD_MODULE)
1320 { 1320 {
1321 I2C_BOARD_INFO("pcf8574_lcd", 0x22), 1321 I2C_BOARD_INFO("pcf8574_lcd", 0x22),
1322 }, 1322 },
diff --git a/arch/blackfin/mach-bf537/include/mach/anomaly.h b/arch/blackfin/mach-bf537/include/mach/anomaly.h
index 57c128cc3b64..e66aa131f517 100644
--- a/arch/blackfin/mach-bf537/include/mach/anomaly.h
+++ b/arch/blackfin/mach-bf537/include/mach/anomaly.h
@@ -167,6 +167,7 @@
167#define ANOMALY_05000179 (0) 167#define ANOMALY_05000179 (0)
168#define ANOMALY_05000182 (0) 168#define ANOMALY_05000182 (0)
169#define ANOMALY_05000183 (0) 169#define ANOMALY_05000183 (0)
170#define ANOMALY_05000189 (0)
170#define ANOMALY_05000198 (0) 171#define ANOMALY_05000198 (0)
171#define ANOMALY_05000202 (0) 172#define ANOMALY_05000202 (0)
172#define ANOMALY_05000215 (0) 173#define ANOMALY_05000215 (0)
@@ -186,6 +187,7 @@
186#define ANOMALY_05000353 (1) 187#define ANOMALY_05000353 (1)
187#define ANOMALY_05000362 (1) 188#define ANOMALY_05000362 (1)
188#define ANOMALY_05000363 (0) 189#define ANOMALY_05000363 (0)
190#define ANOMALY_05000364 (0)
189#define ANOMALY_05000380 (0) 191#define ANOMALY_05000380 (0)
190#define ANOMALY_05000386 (1) 192#define ANOMALY_05000386 (1)
191#define ANOMALY_05000389 (0) 193#define ANOMALY_05000389 (0)
diff --git a/arch/blackfin/mach-bf537/include/mach/bfin_serial_5xx.h b/arch/blackfin/mach-bf537/include/mach/bfin_serial_5xx.h
index b86662fb9de7..e95d54f9af6c 100644
--- a/arch/blackfin/mach-bf537/include/mach/bfin_serial_5xx.h
+++ b/arch/blackfin/mach-bf537/include/mach/bfin_serial_5xx.h
@@ -53,7 +53,7 @@
53#define UART_SET_DLAB(uart) do { UART_PUT_LCR(uart, UART_GET_LCR(uart) | DLAB); SSYNC(); } while (0) 53#define UART_SET_DLAB(uart) do { UART_PUT_LCR(uart, UART_GET_LCR(uart) | DLAB); SSYNC(); } while (0)
54#define UART_CLEAR_DLAB(uart) do { UART_PUT_LCR(uart, UART_GET_LCR(uart) & ~DLAB); SSYNC(); } while (0) 54#define UART_CLEAR_DLAB(uart) do { UART_PUT_LCR(uart, UART_GET_LCR(uart) & ~DLAB); SSYNC(); } while (0)
55 55
56#define UART_GET_CTS(x) (!gpio_get_value(x->cts_pin)) 56#define UART_GET_CTS(x) gpio_get_value(x->cts_pin)
57#define UART_DISABLE_RTS(x) gpio_set_value(x->rts_pin, 1) 57#define UART_DISABLE_RTS(x) gpio_set_value(x->rts_pin, 1)
58#define UART_ENABLE_RTS(x) gpio_set_value(x->rts_pin, 0) 58#define UART_ENABLE_RTS(x) gpio_set_value(x->rts_pin, 0)
59#define UART_ENABLE_INTS(x, v) UART_PUT_IER(x, v) 59#define UART_ENABLE_INTS(x, v) UART_PUT_IER(x, v)
diff --git a/arch/blackfin/mach-bf538/include/mach/anomaly.h b/arch/blackfin/mach-bf538/include/mach/anomaly.h
index c97acdf85cd3..451cf8a82a42 100644
--- a/arch/blackfin/mach-bf538/include/mach/anomaly.h
+++ b/arch/blackfin/mach-bf538/include/mach/anomaly.h
@@ -137,6 +137,7 @@
137#define ANOMALY_05000158 (0) 137#define ANOMALY_05000158 (0)
138#define ANOMALY_05000171 (0) 138#define ANOMALY_05000171 (0)
139#define ANOMALY_05000182 (0) 139#define ANOMALY_05000182 (0)
140#define ANOMALY_05000189 (0)
140#define ANOMALY_05000198 (0) 141#define ANOMALY_05000198 (0)
141#define ANOMALY_05000202 (0) 142#define ANOMALY_05000202 (0)
142#define ANOMALY_05000215 (0) 143#define ANOMALY_05000215 (0)
@@ -160,6 +161,7 @@
160#define ANOMALY_05000353 (1) 161#define ANOMALY_05000353 (1)
161#define ANOMALY_05000362 (1) 162#define ANOMALY_05000362 (1)
162#define ANOMALY_05000363 (0) 163#define ANOMALY_05000363 (0)
164#define ANOMALY_05000364 (0)
163#define ANOMALY_05000380 (0) 165#define ANOMALY_05000380 (0)
164#define ANOMALY_05000386 (1) 166#define ANOMALY_05000386 (1)
165#define ANOMALY_05000389 (0) 167#define ANOMALY_05000389 (0)
diff --git a/arch/blackfin/mach-bf538/include/mach/bfin_serial_5xx.h b/arch/blackfin/mach-bf538/include/mach/bfin_serial_5xx.h
index c536551eb4b8..999f239fe1a6 100644
--- a/arch/blackfin/mach-bf538/include/mach/bfin_serial_5xx.h
+++ b/arch/blackfin/mach-bf538/include/mach/bfin_serial_5xx.h
@@ -53,7 +53,7 @@
53#define UART_SET_DLAB(uart) do { UART_PUT_LCR(uart, UART_GET_LCR(uart) | DLAB); SSYNC(); } while (0) 53#define UART_SET_DLAB(uart) do { UART_PUT_LCR(uart, UART_GET_LCR(uart) | DLAB); SSYNC(); } while (0)
54#define UART_CLEAR_DLAB(uart) do { UART_PUT_LCR(uart, UART_GET_LCR(uart) & ~DLAB); SSYNC(); } while (0) 54#define UART_CLEAR_DLAB(uart) do { UART_PUT_LCR(uart, UART_GET_LCR(uart) & ~DLAB); SSYNC(); } while (0)
55 55
56#define UART_GET_CTS(x) (!gpio_get_value(x->cts_pin)) 56#define UART_GET_CTS(x) gpio_get_value(x->cts_pin)
57#define UART_DISABLE_RTS(x) gpio_set_value(x->rts_pin, 1) 57#define UART_DISABLE_RTS(x) gpio_set_value(x->rts_pin, 1)
58#define UART_ENABLE_RTS(x) gpio_set_value(x->rts_pin, 0) 58#define UART_ENABLE_RTS(x) gpio_set_value(x->rts_pin, 0)
59#define UART_ENABLE_INTS(x, v) UART_PUT_IER(x, v) 59#define UART_ENABLE_INTS(x, v) UART_PUT_IER(x, v)
diff --git a/arch/blackfin/mach-bf548/boards/ezkit.c b/arch/blackfin/mach-bf548/boards/ezkit.c
index 81f5b95cc361..dc0dd9b2bcef 100644
--- a/arch/blackfin/mach-bf548/boards/ezkit.c
+++ b/arch/blackfin/mach-bf548/boards/ezkit.c
@@ -864,7 +864,7 @@ static struct i2c_board_info __initdata bfin_i2c_board_info0[] = {
864 864
865#if !defined(CONFIG_BF542) /* The BF542 only has 1 TWI */ 865#if !defined(CONFIG_BF542) /* The BF542 only has 1 TWI */
866static struct i2c_board_info __initdata bfin_i2c_board_info1[] = { 866static struct i2c_board_info __initdata bfin_i2c_board_info1[] = {
867#if defined(CONFIG_BFIN_TWI_LCD) || defined(CONFIG_TWI_LCD_MODULE) 867#if defined(CONFIG_BFIN_TWI_LCD) || defined(CONFIG_BFIN_TWI_LCD_MODULE)
868 { 868 {
869 I2C_BOARD_INFO("pcf8574_lcd", 0x22), 869 I2C_BOARD_INFO("pcf8574_lcd", 0x22),
870 }, 870 },
diff --git a/arch/blackfin/mach-bf548/include/mach/anomaly.h b/arch/blackfin/mach-bf548/include/mach/anomaly.h
index 18a4cd24f673..cd040fe0bc5c 100644
--- a/arch/blackfin/mach-bf548/include/mach/anomaly.h
+++ b/arch/blackfin/mach-bf548/include/mach/anomaly.h
@@ -195,6 +195,7 @@
195#define ANOMALY_05000179 (0) 195#define ANOMALY_05000179 (0)
196#define ANOMALY_05000182 (0) 196#define ANOMALY_05000182 (0)
197#define ANOMALY_05000183 (0) 197#define ANOMALY_05000183 (0)
198#define ANOMALY_05000189 (0)
198#define ANOMALY_05000198 (0) 199#define ANOMALY_05000198 (0)
199#define ANOMALY_05000202 (0) 200#define ANOMALY_05000202 (0)
200#define ANOMALY_05000215 (0) 201#define ANOMALY_05000215 (0)
@@ -226,6 +227,7 @@
226#define ANOMALY_05000323 (0) 227#define ANOMALY_05000323 (0)
227#define ANOMALY_05000362 (1) 228#define ANOMALY_05000362 (1)
228#define ANOMALY_05000363 (0) 229#define ANOMALY_05000363 (0)
230#define ANOMALY_05000364 (0)
229#define ANOMALY_05000380 (0) 231#define ANOMALY_05000380 (0)
230#define ANOMALY_05000400 (0) 232#define ANOMALY_05000400 (0)
231#define ANOMALY_05000412 (0) 233#define ANOMALY_05000412 (0)
diff --git a/arch/blackfin/mach-bf561/include/mach/anomaly.h b/arch/blackfin/mach-bf561/include/mach/anomaly.h
index 94b8e277f09d..a5312b2d267e 100644
--- a/arch/blackfin/mach-bf561/include/mach/anomaly.h
+++ b/arch/blackfin/mach-bf561/include/mach/anomaly.h
@@ -288,6 +288,7 @@
288#define ANOMALY_05000273 (0) 288#define ANOMALY_05000273 (0)
289#define ANOMALY_05000311 (0) 289#define ANOMALY_05000311 (0)
290#define ANOMALY_05000353 (1) 290#define ANOMALY_05000353 (1)
291#define ANOMALY_05000364 (0)
291#define ANOMALY_05000380 (0) 292#define ANOMALY_05000380 (0)
292#define ANOMALY_05000386 (1) 293#define ANOMALY_05000386 (1)
293#define ANOMALY_05000389 (0) 294#define ANOMALY_05000389 (0)
diff --git a/arch/blackfin/mach-bf561/include/mach/bfin_serial_5xx.h b/arch/blackfin/mach-bf561/include/mach/bfin_serial_5xx.h
index a1b50878553f..fd5e8878b8c4 100644
--- a/arch/blackfin/mach-bf561/include/mach/bfin_serial_5xx.h
+++ b/arch/blackfin/mach-bf561/include/mach/bfin_serial_5xx.h
@@ -53,7 +53,7 @@
53#define UART_SET_DLAB(uart) do { UART_PUT_LCR(uart, UART_GET_LCR(uart) | DLAB); SSYNC(); } while (0) 53#define UART_SET_DLAB(uart) do { UART_PUT_LCR(uart, UART_GET_LCR(uart) | DLAB); SSYNC(); } while (0)
54#define UART_CLEAR_DLAB(uart) do { UART_PUT_LCR(uart, UART_GET_LCR(uart) & ~DLAB); SSYNC(); } while (0) 54#define UART_CLEAR_DLAB(uart) do { UART_PUT_LCR(uart, UART_GET_LCR(uart) & ~DLAB); SSYNC(); } while (0)
55 55
56#define UART_GET_CTS(x) (!gpio_get_value(x->cts_pin)) 56#define UART_GET_CTS(x) gpio_get_value(x->cts_pin)
57#define UART_DISABLE_RTS(x) gpio_set_value(x->rts_pin, 1) 57#define UART_DISABLE_RTS(x) gpio_set_value(x->rts_pin, 1)
58#define UART_ENABLE_RTS(x) gpio_set_value(x->rts_pin, 0) 58#define UART_ENABLE_RTS(x) gpio_set_value(x->rts_pin, 0)
59#define UART_ENABLE_INTS(x, v) UART_PUT_IER(x, v) 59#define UART_ENABLE_INTS(x, v) UART_PUT_IER(x, v)
diff --git a/arch/blackfin/mach-bf561/include/mach/mem_map.h b/arch/blackfin/mach-bf561/include/mach/mem_map.h
index a63e15c86d90..5b96ea549a04 100644
--- a/arch/blackfin/mach-bf561/include/mach/mem_map.h
+++ b/arch/blackfin/mach-bf561/include/mach/mem_map.h
@@ -37,7 +37,6 @@
37 37
38/* Memory Map for ADSP-BF561 processors */ 38/* Memory Map for ADSP-BF561 processors */
39 39
40#ifdef CONFIG_BF561
41#define COREA_L1_CODE_START 0xFFA00000 40#define COREA_L1_CODE_START 0xFFA00000
42#define COREA_L1_DATA_A_START 0xFF800000 41#define COREA_L1_DATA_A_START 0xFF800000
43#define COREA_L1_DATA_B_START 0xFF900000 42#define COREA_L1_DATA_B_START 0xFF900000
@@ -74,6 +73,28 @@
74#define BFIN_DCACHESIZE (0*1024) 73#define BFIN_DCACHESIZE (0*1024)
75#define BFIN_DSUPBANKS 0 74#define BFIN_DSUPBANKS 0
76#endif /*CONFIG_BFIN_DCACHE*/ 75#endif /*CONFIG_BFIN_DCACHE*/
76
77/*
78 * If we are in SMP mode, then the cache settings of Core B will match
79 * the settings of Core A. If we aren't, then we assume Core B is not
80 * using any cache. This allows the rest of the kernel to work with
81 * the core in either mode as we are only loading user code into it and
82 * it is the user's problem to make sure they aren't doing something
83 * stupid there.
84 *
85 * Note that we treat the L1 code region as a contiguous blob to make
86 * the rest of the kernel simpler. Easier to check one region than a
87 * bunch of small ones. Again, possible misbehavior here is the fault
88 * of the user -- don't try to use memory that doesn't exist.
89 */
90#ifdef CONFIG_SMP
91# define COREB_L1_CODE_LENGTH L1_CODE_LENGTH
92# define COREB_L1_DATA_A_LENGTH L1_DATA_A_LENGTH
93# define COREB_L1_DATA_B_LENGTH L1_DATA_B_LENGTH
94#else
95# define COREB_L1_CODE_LENGTH 0x14000
96# define COREB_L1_DATA_A_LENGTH 0x8000
97# define COREB_L1_DATA_B_LENGTH 0x8000
77#endif 98#endif
78 99
79/* Level 2 Memory */ 100/* Level 2 Memory */
diff --git a/arch/blackfin/mach-common/entry.S b/arch/blackfin/mach-common/entry.S
index 5a4e7c7fd92c..fb1795d5be2a 100644
--- a/arch/blackfin/mach-common/entry.S
+++ b/arch/blackfin/mach-common/entry.S
@@ -218,7 +218,7 @@ ENTRY(_ex_single_step)
218 /* Single stepping only a single instruction, so clear the trace 218 /* Single stepping only a single instruction, so clear the trace
219 * bit here. */ 219 * bit here. */
220 r7 = syscfg; 220 r7 = syscfg;
221 bitclr (r7, 0); 221 bitclr (r7, SYSCFG_SSSTEP_P);
222 syscfg = R7; 222 syscfg = R7;
223 jump _ex_trap_c; 223 jump _ex_trap_c;
224 224
@@ -251,7 +251,7 @@ ENTRY(_ex_single_step)
251 if !cc jump _bfin_return_from_exception; 251 if !cc jump _bfin_return_from_exception;
252 252
253 r7 = syscfg; 253 r7 = syscfg;
254 bitclr (r7, 0); 254 bitclr (r7, SYSCFG_SSSTEP_P); /* Turn off single step */
255 syscfg = R7; 255 syscfg = R7;
256 256
257 /* Fall through to _bfin_return_from_exception. */ 257 /* Fall through to _bfin_return_from_exception. */
@@ -342,9 +342,11 @@ ENTRY(_ex_trap_c)
342 r6 = retx; 342 r6 = retx;
343 [p5 + PDA_RETX] = r6; 343 [p5 + PDA_RETX] = r6;
344#endif 344#endif
345 /* Save the state of single stepping */
345 r6 = SYSCFG; 346 r6 = SYSCFG;
346 [p5 + PDA_SYSCFG] = r6; 347 [p5 + PDA_SYSCFG] = r6;
347 BITCLR(r6, 0); 348 /* Clear it while we handle the exception in IRQ5 mode */
349 BITCLR(r6, SYSCFG_SSSTEP_P);
348 SYSCFG = r6; 350 SYSCFG = r6;
349 351
350 /* Disable all interrupts, but make sure level 5 is enabled so 352 /* Disable all interrupts, but make sure level 5 is enabled so
@@ -367,7 +369,7 @@ ENDPROC(_ex_trap_c)
367 * exception. This is a unrecoverable event, so crash. 369 * exception. This is a unrecoverable event, so crash.
368 * Note: this cannot be ENTRY() as we jump here with "if cc jump" ... 370 * Note: this cannot be ENTRY() as we jump here with "if cc jump" ...
369 */ 371 */
370_double_fault: 372ENTRY(_double_fault)
371 /* Turn caches & protection off, to ensure we don't get any more 373 /* Turn caches & protection off, to ensure we don't get any more
372 * double exceptions 374 * double exceptions
373 */ 375 */
@@ -872,7 +874,7 @@ ENTRY(_ret_from_exception)
872 raise 15; /* raise evt15 to do signal or reschedule */ 874 raise 15; /* raise evt15 to do signal or reschedule */
8734: 8754:
874 r0 = syscfg; 876 r0 = syscfg;
875 bitclr(r0, 0); 877 bitclr(r0, SYSCFG_SSSTEP_P); /* Turn off single step */
876 syscfg = r0; 878 syscfg = r0;
8775: 8795:
878 rts; 880 rts;
diff --git a/arch/blackfin/mach-common/smp.c b/arch/blackfin/mach-common/smp.c
index 61840059dfac..349ee3f5466a 100644
--- a/arch/blackfin/mach-common/smp.c
+++ b/arch/blackfin/mach-common/smp.c
@@ -211,6 +211,8 @@ int smp_call_function(void (*func)(void *info), void *info, int wait)
211 return 0; 211 return 0;
212 212
213 msg = kmalloc(sizeof(*msg), GFP_ATOMIC); 213 msg = kmalloc(sizeof(*msg), GFP_ATOMIC);
214 if (!msg)
215 return -ENOMEM;
214 INIT_LIST_HEAD(&msg->list); 216 INIT_LIST_HEAD(&msg->list);
215 msg->call_struct.func = func; 217 msg->call_struct.func = func;
216 msg->call_struct.info = info; 218 msg->call_struct.info = info;
@@ -252,6 +254,8 @@ int smp_call_function_single(int cpuid, void (*func) (void *info), void *info,
252 cpu_set(cpu, callmap); 254 cpu_set(cpu, callmap);
253 255
254 msg = kmalloc(sizeof(*msg), GFP_ATOMIC); 256 msg = kmalloc(sizeof(*msg), GFP_ATOMIC);
257 if (!msg)
258 return -ENOMEM;
255 INIT_LIST_HEAD(&msg->list); 259 INIT_LIST_HEAD(&msg->list);
256 msg->call_struct.func = func; 260 msg->call_struct.func = func;
257 msg->call_struct.info = info; 261 msg->call_struct.info = info;
@@ -287,6 +291,8 @@ void smp_send_reschedule(int cpu)
287 return; 291 return;
288 292
289 msg = kmalloc(sizeof(*msg), GFP_ATOMIC); 293 msg = kmalloc(sizeof(*msg), GFP_ATOMIC);
294 if (!msg)
295 return;
290 memset(msg, 0, sizeof(msg)); 296 memset(msg, 0, sizeof(msg));
291 INIT_LIST_HEAD(&msg->list); 297 INIT_LIST_HEAD(&msg->list);
292 msg->type = BFIN_IPI_RESCHEDULE; 298 msg->type = BFIN_IPI_RESCHEDULE;
@@ -314,6 +320,8 @@ void smp_send_stop(void)
314 return; 320 return;
315 321
316 msg = kmalloc(sizeof(*msg), GFP_ATOMIC); 322 msg = kmalloc(sizeof(*msg), GFP_ATOMIC);
323 if (!msg)
324 return;
317 memset(msg, 0, sizeof(msg)); 325 memset(msg, 0, sizeof(msg));
318 INIT_LIST_HEAD(&msg->list); 326 INIT_LIST_HEAD(&msg->list);
319 msg->type = BFIN_IPI_CPU_STOP; 327 msg->type = BFIN_IPI_CPU_STOP;
@@ -450,7 +458,7 @@ void __init smp_cpus_done(unsigned int max_cpus)
450 unsigned int cpu; 458 unsigned int cpu;
451 459
452 for_each_online_cpu(cpu) 460 for_each_online_cpu(cpu)
453 bogosum += per_cpu(cpu_data, cpu).loops_per_jiffy; 461 bogosum += loops_per_jiffy;
454 462
455 printk(KERN_INFO "SMP: Total of %d processors activated " 463 printk(KERN_INFO "SMP: Total of %d processors activated "
456 "(%lu.%02lu BogoMIPS).\n", 464 "(%lu.%02lu BogoMIPS).\n",
diff --git a/arch/cris/include/asm/thread_info.h b/arch/cris/include/asm/thread_info.h
index bc5b2935ca53..c3aade36c330 100644
--- a/arch/cris/include/asm/thread_info.h
+++ b/arch/cris/include/asm/thread_info.h
@@ -50,8 +50,6 @@ struct thread_info {
50 50
51/* 51/*
52 * macros/functions for gaining access to the thread information structure 52 * macros/functions for gaining access to the thread information structure
53 *
54 * preempt_count needs to be 1 initially, until the scheduler is functional.
55 */ 53 */
56#ifndef __ASSEMBLY__ 54#ifndef __ASSEMBLY__
57#define INIT_THREAD_INFO(tsk) \ 55#define INIT_THREAD_INFO(tsk) \
@@ -60,7 +58,7 @@ struct thread_info {
60 .exec_domain = &default_exec_domain, \ 58 .exec_domain = &default_exec_domain, \
61 .flags = 0, \ 59 .flags = 0, \
62 .cpu = 0, \ 60 .cpu = 0, \
63 .preempt_count = 1, \ 61 .preempt_count = INIT_PREEMPT_COUNT, \
64 .addr_limit = KERNEL_DS, \ 62 .addr_limit = KERNEL_DS, \
65 .restart_block = { \ 63 .restart_block = { \
66 .fn = do_no_restart_syscall, \ 64 .fn = do_no_restart_syscall, \
diff --git a/arch/cris/kernel/sys_cris.c b/arch/cris/kernel/sys_cris.c
index a79fbd87021b..2ad962c7e88e 100644
--- a/arch/cris/kernel/sys_cris.c
+++ b/arch/cris/kernel/sys_cris.c
@@ -15,7 +15,6 @@
15#include <linux/mm.h> 15#include <linux/mm.h>
16#include <linux/fs.h> 16#include <linux/fs.h>
17#include <linux/smp.h> 17#include <linux/smp.h>
18#include <linux/smp_lock.h>
19#include <linux/sem.h> 18#include <linux/sem.h>
20#include <linux/msg.h> 19#include <linux/msg.h>
21#include <linux/shm.h> 20#include <linux/shm.h>
diff --git a/arch/frv/Kconfig b/arch/frv/Kconfig
index 8a5bd7a9c6f5..b86e19c9b5b0 100644
--- a/arch/frv/Kconfig
+++ b/arch/frv/Kconfig
@@ -7,6 +7,7 @@ config FRV
7 default y 7 default y
8 select HAVE_IDE 8 select HAVE_IDE
9 select HAVE_ARCH_TRACEHOOK 9 select HAVE_ARCH_TRACEHOOK
10 select HAVE_PERF_COUNTERS
10 11
11config ZONE_DMA 12config ZONE_DMA
12 bool 13 bool
diff --git a/arch/frv/include/asm/atomic.h b/arch/frv/include/asm/atomic.h
index 0409d981fd39..00a57af79afc 100644
--- a/arch/frv/include/asm/atomic.h
+++ b/arch/frv/include/asm/atomic.h
@@ -121,10 +121,72 @@ static inline void atomic_dec(atomic_t *v)
121#define atomic_dec_and_test(v) (atomic_sub_return(1, (v)) == 0) 121#define atomic_dec_and_test(v) (atomic_sub_return(1, (v)) == 0)
122#define atomic_inc_and_test(v) (atomic_add_return(1, (v)) == 0) 122#define atomic_inc_and_test(v) (atomic_add_return(1, (v)) == 0)
123 123
124/*
125 * 64-bit atomic ops
126 */
127typedef struct {
128 volatile long long counter;
129} atomic64_t;
130
131#define ATOMIC64_INIT(i) { (i) }
132
133static inline long long atomic64_read(atomic64_t *v)
134{
135 long long counter;
136
137 asm("ldd%I1 %M1,%0"
138 : "=e"(counter)
139 : "m"(v->counter));
140 return counter;
141}
142
143static inline void atomic64_set(atomic64_t *v, long long i)
144{
145 asm volatile("std%I0 %1,%M0"
146 : "=m"(v->counter)
147 : "e"(i));
148}
149
150extern long long atomic64_inc_return(atomic64_t *v);
151extern long long atomic64_dec_return(atomic64_t *v);
152extern long long atomic64_add_return(long long i, atomic64_t *v);
153extern long long atomic64_sub_return(long long i, atomic64_t *v);
154
155static inline long long atomic64_add_negative(long long i, atomic64_t *v)
156{
157 return atomic64_add_return(i, v) < 0;
158}
159
160static inline void atomic64_add(long long i, atomic64_t *v)
161{
162 atomic64_add_return(i, v);
163}
164
165static inline void atomic64_sub(long long i, atomic64_t *v)
166{
167 atomic64_sub_return(i, v);
168}
169
170static inline void atomic64_inc(atomic64_t *v)
171{
172 atomic64_inc_return(v);
173}
174
175static inline void atomic64_dec(atomic64_t *v)
176{
177 atomic64_dec_return(v);
178}
179
180#define atomic64_sub_and_test(i,v) (atomic64_sub_return((i), (v)) == 0)
181#define atomic64_dec_and_test(v) (atomic64_dec_return((v)) == 0)
182#define atomic64_inc_and_test(v) (atomic64_inc_return((v)) == 0)
183
124/*****************************************************************************/ 184/*****************************************************************************/
125/* 185/*
126 * exchange value with memory 186 * exchange value with memory
127 */ 187 */
188extern uint64_t __xchg_64(uint64_t i, volatile void *v);
189
128#ifndef CONFIG_FRV_OUTOFLINE_ATOMIC_OPS 190#ifndef CONFIG_FRV_OUTOFLINE_ATOMIC_OPS
129 191
130#define xchg(ptr, x) \ 192#define xchg(ptr, x) \
@@ -174,8 +236,10 @@ extern uint32_t __xchg_32(uint32_t i, volatile void *v);
174 236
175#define tas(ptr) (xchg((ptr), 1)) 237#define tas(ptr) (xchg((ptr), 1))
176 238
177#define atomic_cmpxchg(v, old, new) (cmpxchg(&((v)->counter), old, new)) 239#define atomic_cmpxchg(v, old, new) (cmpxchg(&(v)->counter, old, new))
178#define atomic_xchg(v, new) (xchg(&((v)->counter), new)) 240#define atomic_xchg(v, new) (xchg(&(v)->counter, new))
241#define atomic64_cmpxchg(v, old, new) (__cmpxchg_64(old, new, &(v)->counter))
242#define atomic64_xchg(v, new) (__xchg_64(new, &(v)->counter))
179 243
180static __inline__ int atomic_add_unless(atomic_t *v, int a, int u) 244static __inline__ int atomic_add_unless(atomic_t *v, int a, int u)
181{ 245{
diff --git a/arch/frv/include/asm/perf_counter.h b/arch/frv/include/asm/perf_counter.h
new file mode 100644
index 000000000000..ccf726e61b2e
--- /dev/null
+++ b/arch/frv/include/asm/perf_counter.h
@@ -0,0 +1,17 @@
1/* FRV performance counter support
2 *
3 * Copyright (C) 2009 Red Hat, Inc. All Rights Reserved.
4 * Written by David Howells (dhowells@redhat.com)
5 *
6 * This program is free software; you can redistribute it and/or
7 * modify it under the terms of the GNU General Public Licence
8 * as published by the Free Software Foundation; either version
9 * 2 of the Licence, or (at your option) any later version.
10 */
11
12#ifndef _ASM_PERF_COUNTER_H
13#define _ASM_PERF_COUNTER_H
14
15#define PERF_COUNTER_INDEX_OFFSET 0
16
17#endif /* _ASM_PERF_COUNTER_H */
diff --git a/arch/frv/include/asm/system.h b/arch/frv/include/asm/system.h
index 7742ec000cc4..efd22d9077ac 100644
--- a/arch/frv/include/asm/system.h
+++ b/arch/frv/include/asm/system.h
@@ -208,6 +208,8 @@ extern void free_initmem(void);
208 * - if (*ptr == test) then orig = *ptr; *ptr = test; 208 * - if (*ptr == test) then orig = *ptr; *ptr = test;
209 * - if (*ptr != test) then orig = *ptr; 209 * - if (*ptr != test) then orig = *ptr;
210 */ 210 */
211extern uint64_t __cmpxchg_64(uint64_t test, uint64_t new, volatile uint64_t *v);
212
211#ifndef CONFIG_FRV_OUTOFLINE_ATOMIC_OPS 213#ifndef CONFIG_FRV_OUTOFLINE_ATOMIC_OPS
212 214
213#define cmpxchg(ptr, test, new) \ 215#define cmpxchg(ptr, test, new) \
diff --git a/arch/frv/include/asm/thread_info.h b/arch/frv/include/asm/thread_info.h
index e8a5ed7be021..e608e056bb53 100644
--- a/arch/frv/include/asm/thread_info.h
+++ b/arch/frv/include/asm/thread_info.h
@@ -56,8 +56,6 @@ struct thread_info {
56 56
57/* 57/*
58 * macros/functions for gaining access to the thread information structure 58 * macros/functions for gaining access to the thread information structure
59 *
60 * preempt_count needs to be 1 initially, until the scheduler is functional.
61 */ 59 */
62#ifndef __ASSEMBLY__ 60#ifndef __ASSEMBLY__
63 61
@@ -67,7 +65,7 @@ struct thread_info {
67 .exec_domain = &default_exec_domain, \ 65 .exec_domain = &default_exec_domain, \
68 .flags = 0, \ 66 .flags = 0, \
69 .cpu = 0, \ 67 .cpu = 0, \
70 .preempt_count = 1, \ 68 .preempt_count = INIT_PREEMPT_COUNT, \
71 .addr_limit = KERNEL_DS, \ 69 .addr_limit = KERNEL_DS, \
72 .restart_block = { \ 70 .restart_block = { \
73 .fn = do_no_restart_syscall, \ 71 .fn = do_no_restart_syscall, \
diff --git a/arch/frv/include/asm/unistd.h b/arch/frv/include/asm/unistd.h
index 96d78d5d2c41..4a8fb427ce0a 100644
--- a/arch/frv/include/asm/unistd.h
+++ b/arch/frv/include/asm/unistd.h
@@ -341,10 +341,12 @@
341#define __NR_inotify_init1 332 341#define __NR_inotify_init1 332
342#define __NR_preadv 333 342#define __NR_preadv 333
343#define __NR_pwritev 334 343#define __NR_pwritev 334
344#define __NR_rt_tgsigqueueinfo 335
345#define __NR_perf_counter_open 336
344 346
345#ifdef __KERNEL__ 347#ifdef __KERNEL__
346 348
347#define NR_syscalls 335 349#define NR_syscalls 337
348 350
349#define __ARCH_WANT_IPC_PARSE_VERSION 351#define __ARCH_WANT_IPC_PARSE_VERSION
350/* #define __ARCH_WANT_OLD_READDIR */ 352/* #define __ARCH_WANT_OLD_READDIR */
diff --git a/arch/frv/kernel/entry.S b/arch/frv/kernel/entry.S
index 356e0e327a89..fde1e446b440 100644
--- a/arch/frv/kernel/entry.S
+++ b/arch/frv/kernel/entry.S
@@ -1524,5 +1524,7 @@ sys_call_table:
1524 .long sys_inotify_init1 1524 .long sys_inotify_init1
1525 .long sys_preadv 1525 .long sys_preadv
1526 .long sys_pwritev 1526 .long sys_pwritev
1527 .long sys_rt_tgsigqueueinfo /* 335 */
1528 .long sys_perf_counter_open
1527 1529
1528syscall_table_size = (. - sys_call_table) 1530syscall_table_size = (. - sys_call_table)
diff --git a/arch/frv/kernel/frv_ksyms.c b/arch/frv/kernel/frv_ksyms.c
index 0316b3c50eff..a89803b58b9a 100644
--- a/arch/frv/kernel/frv_ksyms.c
+++ b/arch/frv/kernel/frv_ksyms.c
@@ -67,6 +67,10 @@ EXPORT_SYMBOL(atomic_sub_return);
67EXPORT_SYMBOL(__xchg_32); 67EXPORT_SYMBOL(__xchg_32);
68EXPORT_SYMBOL(__cmpxchg_32); 68EXPORT_SYMBOL(__cmpxchg_32);
69#endif 69#endif
70EXPORT_SYMBOL(atomic64_add_return);
71EXPORT_SYMBOL(atomic64_sub_return);
72EXPORT_SYMBOL(__xchg_64);
73EXPORT_SYMBOL(__cmpxchg_64);
70 74
71EXPORT_SYMBOL(__debug_bug_printk); 75EXPORT_SYMBOL(__debug_bug_printk);
72EXPORT_SYMBOL(__delay_loops_MHz); 76EXPORT_SYMBOL(__delay_loops_MHz);
diff --git a/arch/frv/lib/Makefile b/arch/frv/lib/Makefile
index 08be305c9f44..0a377210c89b 100644
--- a/arch/frv/lib/Makefile
+++ b/arch/frv/lib/Makefile
@@ -4,5 +4,5 @@
4 4
5lib-y := \ 5lib-y := \
6 __ashldi3.o __lshrdi3.o __muldi3.o __ashrdi3.o __negdi2.o __ucmpdi2.o \ 6 __ashldi3.o __lshrdi3.o __muldi3.o __ashrdi3.o __negdi2.o __ucmpdi2.o \
7 checksum.o memcpy.o memset.o atomic-ops.o \ 7 checksum.o memcpy.o memset.o atomic-ops.o atomic64-ops.o \
8 outsl_ns.o outsl_sw.o insl_ns.o insl_sw.o cache.o 8 outsl_ns.o outsl_sw.o insl_ns.o insl_sw.o cache.o perf_counter.o
diff --git a/arch/frv/lib/atomic-ops.S b/arch/frv/lib/atomic-ops.S
index ee0ac905fb08..5e9e6ab5dd0e 100644
--- a/arch/frv/lib/atomic-ops.S
+++ b/arch/frv/lib/atomic-ops.S
@@ -163,11 +163,10 @@ __cmpxchg_32:
163 ld.p @(gr11,gr0),gr8 163 ld.p @(gr11,gr0),gr8
164 orcr cc7,cc7,cc3 164 orcr cc7,cc7,cc3
165 subcc gr8,gr9,gr7,icc0 165 subcc gr8,gr9,gr7,icc0
166 bne icc0,#0,1f 166 bnelr icc0,#0
167 cst.p gr10,@(gr11,gr0) ,cc3,#1 167 cst.p gr10,@(gr11,gr0) ,cc3,#1
168 corcc gr29,gr29,gr0 ,cc3,#1 168 corcc gr29,gr29,gr0 ,cc3,#1
169 beq icc3,#0,0b 169 beq icc3,#0,0b
1701:
171 bralr 170 bralr
172 171
173 .size __cmpxchg_32, .-__cmpxchg_32 172 .size __cmpxchg_32, .-__cmpxchg_32
diff --git a/arch/frv/lib/atomic64-ops.S b/arch/frv/lib/atomic64-ops.S
new file mode 100644
index 000000000000..b6194eeac127
--- /dev/null
+++ b/arch/frv/lib/atomic64-ops.S
@@ -0,0 +1,162 @@
1/* kernel atomic64 operations
2 *
3 * For an explanation of how atomic ops work in this arch, see:
4 * Documentation/frv/atomic-ops.txt
5 *
6 * Copyright (C) 2009 Red Hat, Inc. All Rights Reserved.
7 * Written by David Howells (dhowells@redhat.com)
8 *
9 * This program is free software; you can redistribute it and/or
10 * modify it under the terms of the GNU General Public License
11 * as published by the Free Software Foundation; either version
12 * 2 of the License, or (at your option) any later version.
13 */
14
15#include <asm/spr-regs.h>
16
17 .text
18 .balign 4
19
20
21###############################################################################
22#
23# long long atomic64_inc_return(atomic64_t *v)
24#
25###############################################################################
26 .globl atomic64_inc_return
27 .type atomic64_inc_return,@function
28atomic64_inc_return:
29 or.p gr8,gr8,gr10
300:
31 orcc gr0,gr0,gr0,icc3 /* set ICC3.Z */
32 ckeq icc3,cc7
33 ldd.p @(gr10,gr0),gr8 /* LDD.P/ORCR must be atomic */
34 orcr cc7,cc7,cc3 /* set CC3 to true */
35 addicc gr9,#1,gr9,icc0
36 addxi gr8,#0,gr8,icc0
37 cstd.p gr8,@(gr10,gr0) ,cc3,#1
38 corcc gr29,gr29,gr0 ,cc3,#1 /* clear ICC3.Z if store happens */
39 beq icc3,#0,0b
40 bralr
41
42 .size atomic64_inc_return, .-atomic64_inc_return
43
44###############################################################################
45#
46# long long atomic64_dec_return(atomic64_t *v)
47#
48###############################################################################
49 .globl atomic64_dec_return
50 .type atomic64_dec_return,@function
51atomic64_dec_return:
52 or.p gr8,gr8,gr10
530:
54 orcc gr0,gr0,gr0,icc3 /* set ICC3.Z */
55 ckeq icc3,cc7
56 ldd.p @(gr10,gr0),gr8 /* LDD.P/ORCR must be atomic */
57 orcr cc7,cc7,cc3 /* set CC3 to true */
58 subicc gr9,#1,gr9,icc0
59 subxi gr8,#0,gr8,icc0
60 cstd.p gr8,@(gr10,gr0) ,cc3,#1
61 corcc gr29,gr29,gr0 ,cc3,#1 /* clear ICC3.Z if store happens */
62 beq icc3,#0,0b
63 bralr
64
65 .size atomic64_dec_return, .-atomic64_dec_return
66
67###############################################################################
68#
69# long long atomic64_add_return(long long i, atomic64_t *v)
70#
71###############################################################################
72 .globl atomic64_add_return
73 .type atomic64_add_return,@function
74atomic64_add_return:
75 or.p gr8,gr8,gr4
76 or gr9,gr9,gr5
770:
78 orcc gr0,gr0,gr0,icc3 /* set ICC3.Z */
79 ckeq icc3,cc7
80 ldd.p @(gr10,gr0),gr8 /* LDD.P/ORCR must be atomic */
81 orcr cc7,cc7,cc3 /* set CC3 to true */
82 addcc gr9,gr5,gr9,icc0
83 addx gr8,gr4,gr8,icc0
84 cstd.p gr8,@(gr10,gr0) ,cc3,#1
85 corcc gr29,gr29,gr0 ,cc3,#1 /* clear ICC3.Z if store happens */
86 beq icc3,#0,0b
87 bralr
88
89 .size atomic64_add_return, .-atomic64_add_return
90
91###############################################################################
92#
93# long long atomic64_sub_return(long long i, atomic64_t *v)
94#
95###############################################################################
96 .globl atomic64_sub_return
97 .type atomic64_sub_return,@function
98atomic64_sub_return:
99 or.p gr8,gr8,gr4
100 or gr9,gr9,gr5
1010:
102 orcc gr0,gr0,gr0,icc3 /* set ICC3.Z */
103 ckeq icc3,cc7
104 ldd.p @(gr10,gr0),gr8 /* LDD.P/ORCR must be atomic */
105 orcr cc7,cc7,cc3 /* set CC3 to true */
106 subcc gr9,gr5,gr9,icc0
107 subx gr8,gr4,gr8,icc0
108 cstd.p gr8,@(gr10,gr0) ,cc3,#1
109 corcc gr29,gr29,gr0 ,cc3,#1 /* clear ICC3.Z if store happens */
110 beq icc3,#0,0b
111 bralr
112
113 .size atomic64_sub_return, .-atomic64_sub_return
114
115###############################################################################
116#
117# uint64_t __xchg_64(uint64_t i, uint64_t *v)
118#
119###############################################################################
120 .globl __xchg_64
121 .type __xchg_64,@function
122__xchg_64:
123 or.p gr8,gr8,gr4
124 or gr9,gr9,gr5
1250:
126 orcc gr0,gr0,gr0,icc3 /* set ICC3.Z */
127 ckeq icc3,cc7
128 ldd.p @(gr10,gr0),gr8 /* LDD.P/ORCR must be atomic */
129 orcr cc7,cc7,cc3 /* set CC3 to true */
130 cstd.p gr4,@(gr10,gr0) ,cc3,#1
131 corcc gr29,gr29,gr0 ,cc3,#1 /* clear ICC3.Z if store happens */
132 beq icc3,#0,0b
133 bralr
134
135 .size __xchg_64, .-__xchg_64
136
137###############################################################################
138#
139# uint64_t __cmpxchg_64(uint64_t test, uint64_t new, uint64_t *v)
140#
141###############################################################################
142 .globl __cmpxchg_64
143 .type __cmpxchg_64,@function
144__cmpxchg_64:
145 or.p gr8,gr8,gr4
146 or gr9,gr9,gr5
1470:
148 orcc gr0,gr0,gr0,icc3 /* set ICC3.Z */
149 ckeq icc3,cc7
150 ldd.p @(gr12,gr0),gr8 /* LDD.P/ORCR must be atomic */
151 orcr cc7,cc7,cc3
152 subcc gr8,gr4,gr0,icc0
153 subcc.p gr9,gr5,gr0,icc1
154 bnelr icc0,#0
155 bnelr icc1,#0
156 cstd.p gr10,@(gr12,gr0) ,cc3,#1
157 corcc gr29,gr29,gr0 ,cc3,#1 /* clear ICC3.Z if store happens */
158 beq icc3,#0,0b
159 bralr
160
161 .size __cmpxchg_64, .-__cmpxchg_64
162
diff --git a/arch/frv/lib/perf_counter.c b/arch/frv/lib/perf_counter.c
new file mode 100644
index 000000000000..2000feecd571
--- /dev/null
+++ b/arch/frv/lib/perf_counter.c
@@ -0,0 +1,19 @@
1/* Performance counter handling
2 *
3 * Copyright (C) 2009 Red Hat, Inc. All Rights Reserved.
4 * Written by David Howells (dhowells@redhat.com)
5 *
6 * This program is free software; you can redistribute it and/or
7 * modify it under the terms of the GNU General Public Licence
8 * as published by the Free Software Foundation; either version
9 * 2 of the Licence, or (at your option) any later version.
10 */
11
12#include <linux/perf_counter.h>
13
14/*
15 * mark the performance counter as pending
16 */
17void set_perf_counter_pending(void)
18{
19}
diff --git a/arch/h8300/include/asm/thread_info.h b/arch/h8300/include/asm/thread_info.h
index 700014d2155f..8bbc8b0ee45d 100644
--- a/arch/h8300/include/asm/thread_info.h
+++ b/arch/h8300/include/asm/thread_info.h
@@ -36,7 +36,7 @@ struct thread_info {
36 .exec_domain = &default_exec_domain, \ 36 .exec_domain = &default_exec_domain, \
37 .flags = 0, \ 37 .flags = 0, \
38 .cpu = 0, \ 38 .cpu = 0, \
39 .preempt_count = 1, \ 39 .preempt_count = INIT_PREEMPT_COUNT, \
40 .restart_block = { \ 40 .restart_block = { \
41 .fn = do_no_restart_syscall, \ 41 .fn = do_no_restart_syscall, \
42 }, \ 42 }, \
diff --git a/arch/ia64/include/asm/fpu.h b/arch/ia64/include/asm/fpu.h
index 0c26157cffa5..b6395ad1500a 100644
--- a/arch/ia64/include/asm/fpu.h
+++ b/arch/ia64/include/asm/fpu.h
@@ -6,6 +6,8 @@
6 * David Mosberger-Tang <davidm@hpl.hp.com> 6 * David Mosberger-Tang <davidm@hpl.hp.com>
7 */ 7 */
8 8
9#include <linux/types.h>
10
9/* floating point status register: */ 11/* floating point status register: */
10#define FPSR_TRAP_VD (1 << 0) /* invalid op trap disabled */ 12#define FPSR_TRAP_VD (1 << 0) /* invalid op trap disabled */
11#define FPSR_TRAP_DD (1 << 1) /* denormal trap disabled */ 13#define FPSR_TRAP_DD (1 << 1) /* denormal trap disabled */
diff --git a/arch/ia64/include/asm/thread_info.h b/arch/ia64/include/asm/thread_info.h
index ae6922626bf4..8ce2e388e37c 100644
--- a/arch/ia64/include/asm/thread_info.h
+++ b/arch/ia64/include/asm/thread_info.h
@@ -48,7 +48,7 @@ struct thread_info {
48 .flags = 0, \ 48 .flags = 0, \
49 .cpu = 0, \ 49 .cpu = 0, \
50 .addr_limit = KERNEL_DS, \ 50 .addr_limit = KERNEL_DS, \
51 .preempt_count = 0, \ 51 .preempt_count = INIT_PREEMPT_COUNT, \
52 .restart_block = { \ 52 .restart_block = { \
53 .fn = do_no_restart_syscall, \ 53 .fn = do_no_restart_syscall, \
54 }, \ 54 }, \
diff --git a/arch/ia64/include/asm/xen/hypervisor.h b/arch/ia64/include/asm/xen/hypervisor.h
index e425227a418e..88afb54501e4 100644
--- a/arch/ia64/include/asm/xen/hypervisor.h
+++ b/arch/ia64/include/asm/xen/hypervisor.h
@@ -33,6 +33,7 @@
33#ifndef _ASM_IA64_XEN_HYPERVISOR_H 33#ifndef _ASM_IA64_XEN_HYPERVISOR_H
34#define _ASM_IA64_XEN_HYPERVISOR_H 34#define _ASM_IA64_XEN_HYPERVISOR_H
35 35
36#include <linux/err.h>
36#include <xen/interface/xen.h> 37#include <xen/interface/xen.h>
37#include <xen/interface/version.h> /* to compile feature.c */ 38#include <xen/interface/version.h> /* to compile feature.c */
38#include <xen/features.h> /* to comiple xen-netfront.c */ 39#include <xen/features.h> /* to comiple xen-netfront.c */
diff --git a/arch/ia64/kernel/dma-mapping.c b/arch/ia64/kernel/dma-mapping.c
index 086a2aeb0404..39a3cd0a4173 100644
--- a/arch/ia64/kernel/dma-mapping.c
+++ b/arch/ia64/kernel/dma-mapping.c
@@ -6,6 +6,14 @@ int iommu_detected __read_mostly;
6struct dma_map_ops *dma_ops; 6struct dma_map_ops *dma_ops;
7EXPORT_SYMBOL(dma_ops); 7EXPORT_SYMBOL(dma_ops);
8 8
9#define PREALLOC_DMA_DEBUG_ENTRIES (1 << 16)
10
11static int __init dma_init(void)
12{
13 dma_debug_init(PREALLOC_DMA_DEBUG_ENTRIES);
14}
15fs_initcall(dma_init);
16
9struct dma_map_ops *dma_get_ops(struct device *dev) 17struct dma_map_ops *dma_get_ops(struct device *dev)
10{ 18{
11 return dma_ops; 19 return dma_ops;
diff --git a/arch/ia64/kernel/esi.c b/arch/ia64/kernel/esi.c
index ebf4e988e78c..d5764a3d74af 100644
--- a/arch/ia64/kernel/esi.c
+++ b/arch/ia64/kernel/esi.c
@@ -65,7 +65,7 @@ static int __init esi_init (void)
65 } 65 }
66 66
67 if (!esi) 67 if (!esi)
68 return -ENODEV;; 68 return -ENODEV;
69 69
70 systab = __va(esi); 70 systab = __va(esi);
71 71
diff --git a/arch/ia64/kernel/perfmon.c b/arch/ia64/kernel/perfmon.c
index abce2468a40b..f1782705b1f7 100644
--- a/arch/ia64/kernel/perfmon.c
+++ b/arch/ia64/kernel/perfmon.c
@@ -5603,7 +5603,7 @@ pfm_interrupt_handler(int irq, void *arg)
5603 * /proc/perfmon interface, for debug only 5603 * /proc/perfmon interface, for debug only
5604 */ 5604 */
5605 5605
5606#define PFM_PROC_SHOW_HEADER ((void *)nr_cpu_ids+1) 5606#define PFM_PROC_SHOW_HEADER ((void *)(long)nr_cpu_ids+1)
5607 5607
5608static void * 5608static void *
5609pfm_proc_start(struct seq_file *m, loff_t *pos) 5609pfm_proc_start(struct seq_file *m, loff_t *pos)
diff --git a/arch/ia64/kernel/ptrace.c b/arch/ia64/kernel/ptrace.c
index 92c9689b7d97..9daa87fdb018 100644
--- a/arch/ia64/kernel/ptrace.c
+++ b/arch/ia64/kernel/ptrace.c
@@ -15,7 +15,6 @@
15#include <linux/mm.h> 15#include <linux/mm.h>
16#include <linux/errno.h> 16#include <linux/errno.h>
17#include <linux/ptrace.h> 17#include <linux/ptrace.h>
18#include <linux/smp_lock.h>
19#include <linux/user.h> 18#include <linux/user.h>
20#include <linux/security.h> 19#include <linux/security.h>
21#include <linux/audit.h> 20#include <linux/audit.h>
diff --git a/arch/ia64/kernel/salinfo.c b/arch/ia64/kernel/salinfo.c
index 7053c55b7649..e6676fca4828 100644
--- a/arch/ia64/kernel/salinfo.c
+++ b/arch/ia64/kernel/salinfo.c
@@ -192,7 +192,7 @@ struct salinfo_platform_oemdata_parms {
192static void 192static void
193salinfo_work_to_do(struct salinfo_data *data) 193salinfo_work_to_do(struct salinfo_data *data)
194{ 194{
195 down_trylock(&data->mutex); 195 (void)(down_trylock(&data->mutex) ?: 0);
196 up(&data->mutex); 196 up(&data->mutex);
197} 197}
198 198
diff --git a/arch/ia64/kvm/kvm_lib.c b/arch/ia64/kvm/kvm_lib.c
index a85cb611ecd7..f1268b8e6f9e 100644
--- a/arch/ia64/kvm/kvm_lib.c
+++ b/arch/ia64/kvm/kvm_lib.c
@@ -11,5 +11,11 @@
11 * 11 *
12 */ 12 */
13#undef CONFIG_MODULES 13#undef CONFIG_MODULES
14#include <linux/module.h>
15#undef CONFIG_KALLSYMS
16#undef EXPORT_SYMBOL
17#undef EXPORT_SYMBOL_GPL
18#define EXPORT_SYMBOL(sym)
19#define EXPORT_SYMBOL_GPL(sym)
14#include "../../../lib/vsprintf.c" 20#include "../../../lib/vsprintf.c"
15#include "../../../lib/ctype.c" 21#include "../../../lib/ctype.c"
diff --git a/arch/ia64/kvm/process.c b/arch/ia64/kvm/process.c
index a8f84da04b49..bb862fb224f2 100644
--- a/arch/ia64/kvm/process.c
+++ b/arch/ia64/kvm/process.c
@@ -130,7 +130,7 @@ static void collect_interruption(struct kvm_vcpu *vcpu)
130 if (vdcr & IA64_DCR_PP) { 130 if (vdcr & IA64_DCR_PP) {
131 vpsr |= IA64_PSR_PP; 131 vpsr |= IA64_PSR_PP;
132 } else { 132 } else {
133 vpsr &= ~IA64_PSR_PP;; 133 vpsr &= ~IA64_PSR_PP;
134 } 134 }
135 135
136 vcpu_set_psr(vcpu, vpsr); 136 vcpu_set_psr(vcpu, vpsr);
@@ -594,11 +594,11 @@ static void set_pal_call_data(struct kvm_vcpu *vcpu)
594 p->u.pal_data.gr30 = vcpu_get_gr(vcpu, 30); 594 p->u.pal_data.gr30 = vcpu_get_gr(vcpu, 30);
595 break; 595 break;
596 case PAL_BRAND_INFO: 596 case PAL_BRAND_INFO:
597 p->u.pal_data.gr29 = gr29;; 597 p->u.pal_data.gr29 = gr29;
598 p->u.pal_data.gr30 = kvm_trans_pal_call_args(vcpu, gr30); 598 p->u.pal_data.gr30 = kvm_trans_pal_call_args(vcpu, gr30);
599 break; 599 break;
600 default: 600 default:
601 p->u.pal_data.gr29 = gr29;; 601 p->u.pal_data.gr29 = gr29;
602 p->u.pal_data.gr30 = vcpu_get_gr(vcpu, 30); 602 p->u.pal_data.gr30 = vcpu_get_gr(vcpu, 30);
603 } 603 }
604 p->u.pal_data.gr28 = gr28; 604 p->u.pal_data.gr28 = gr28;
diff --git a/arch/ia64/kvm/vcpu.c b/arch/ia64/kvm/vcpu.c
index a2c6c15e4761..46b02cbcc874 100644
--- a/arch/ia64/kvm/vcpu.c
+++ b/arch/ia64/kvm/vcpu.c
@@ -406,7 +406,7 @@ void getreg(unsigned long regnum, unsigned long *val,
406 * Now look at registers in [0-31] range and init correct UNAT 406 * Now look at registers in [0-31] range and init correct UNAT
407 */ 407 */
408 addr = (unsigned long)regs; 408 addr = (unsigned long)regs;
409 unat = &regs->eml_unat;; 409 unat = &regs->eml_unat;
410 410
411 addr += gr_info[regnum]; 411 addr += gr_info[regnum];
412 412
diff --git a/arch/ia64/kvm/vtlb.c b/arch/ia64/kvm/vtlb.c
index 4290a429bf7c..20b3852f7a6e 100644
--- a/arch/ia64/kvm/vtlb.c
+++ b/arch/ia64/kvm/vtlb.c
@@ -135,7 +135,7 @@ struct thash_data *__vtr_lookup(struct kvm_vcpu *vcpu, u64 va, int type)
135 u64 rid; 135 u64 rid;
136 136
137 rid = vcpu_get_rr(vcpu, va); 137 rid = vcpu_get_rr(vcpu, va);
138 rid = rid & RR_RID_MASK;; 138 rid = rid & RR_RID_MASK;
139 if (type == D_TLB) { 139 if (type == D_TLB) {
140 if (vcpu_quick_region_check(vcpu->arch.dtr_regions, va)) { 140 if (vcpu_quick_region_check(vcpu->arch.dtr_regions, va)) {
141 for (trp = (struct thash_data *)&vcpu->arch.dtrs, i = 0; 141 for (trp = (struct thash_data *)&vcpu->arch.dtrs, i = 0;
@@ -518,7 +518,7 @@ struct thash_data *vtlb_lookup(struct kvm_vcpu *v, u64 va, int is_data)
518 518
519 struct thash_cb *hcb = &v->arch.vtlb; 519 struct thash_cb *hcb = &v->arch.vtlb;
520 520
521 cch = __vtr_lookup(v, va, is_data);; 521 cch = __vtr_lookup(v, va, is_data);
522 if (cch) 522 if (cch)
523 return cch; 523 return cch;
524 524
diff --git a/arch/ia64/pci/pci.c b/arch/ia64/pci/pci.c
index 729298f4b234..7de76dd352fe 100644
--- a/arch/ia64/pci/pci.c
+++ b/arch/ia64/pci/pci.c
@@ -537,7 +537,7 @@ pcibios_align_resource (void *data, struct resource *res,
537/* 537/*
538 * PCI BIOS setup, always defaults to SAL interface 538 * PCI BIOS setup, always defaults to SAL interface
539 */ 539 */
540char * __devinit 540char * __init
541pcibios_setup (char *str) 541pcibios_setup (char *str)
542{ 542{
543 return str; 543 return str;
diff --git a/arch/ia64/sn/kernel/io_common.c b/arch/ia64/sn/kernel/io_common.c
index 76645cf6ac5d..25831c47c579 100644
--- a/arch/ia64/sn/kernel/io_common.c
+++ b/arch/ia64/sn/kernel/io_common.c
@@ -435,7 +435,8 @@ void sn_generate_path(struct pci_bus *pci_bus, char *address)
435 bricktype = MODULE_GET_BTYPE(moduleid); 435 bricktype = MODULE_GET_BTYPE(moduleid);
436 if ((bricktype == L1_BRICKTYPE_191010) || 436 if ((bricktype == L1_BRICKTYPE_191010) ||
437 (bricktype == L1_BRICKTYPE_1932)) 437 (bricktype == L1_BRICKTYPE_1932))
438 sprintf(address, "%s^%d", address, geo_slot(geoid)); 438 sprintf(address + strlen(address), "^%d",
439 geo_slot(geoid));
439} 440}
440 441
441void __devinit 442void __devinit
diff --git a/arch/m32r/include/asm/thread_info.h b/arch/m32r/include/asm/thread_info.h
index 8589d462df27..07bb5bd00e2a 100644
--- a/arch/m32r/include/asm/thread_info.h
+++ b/arch/m32r/include/asm/thread_info.h
@@ -57,8 +57,6 @@ struct thread_info {
57 57
58/* 58/*
59 * macros/functions for gaining access to the thread information structure 59 * macros/functions for gaining access to the thread information structure
60 *
61 * preempt_count needs to be 1 initially, until the scheduler is functional.
62 */ 60 */
63#ifndef __ASSEMBLY__ 61#ifndef __ASSEMBLY__
64 62
@@ -68,7 +66,7 @@ struct thread_info {
68 .exec_domain = &default_exec_domain, \ 66 .exec_domain = &default_exec_domain, \
69 .flags = 0, \ 67 .flags = 0, \
70 .cpu = 0, \ 68 .cpu = 0, \
71 .preempt_count = 1, \ 69 .preempt_count = INIT_PREEMPT_COUNT, \
72 .addr_limit = KERNEL_DS, \ 70 .addr_limit = KERNEL_DS, \
73 .restart_block = { \ 71 .restart_block = { \
74 .fn = do_no_restart_syscall, \ 72 .fn = do_no_restart_syscall, \
diff --git a/arch/m32r/kernel/ptrace.c b/arch/m32r/kernel/ptrace.c
index bf0abe9e1f73..98b8feb12ed8 100644
--- a/arch/m32r/kernel/ptrace.c
+++ b/arch/m32r/kernel/ptrace.c
@@ -19,7 +19,6 @@
19#include <linux/mm.h> 19#include <linux/mm.h>
20#include <linux/err.h> 20#include <linux/err.h>
21#include <linux/smp.h> 21#include <linux/smp.h>
22#include <linux/smp_lock.h>
23#include <linux/errno.h> 22#include <linux/errno.h>
24#include <linux/ptrace.h> 23#include <linux/ptrace.h>
25#include <linux/user.h> 24#include <linux/user.h>
diff --git a/arch/m68k/include/asm/thread_info_mm.h b/arch/m68k/include/asm/thread_info_mm.h
index af0fda46e94b..6ea5c33b3c56 100644
--- a/arch/m68k/include/asm/thread_info_mm.h
+++ b/arch/m68k/include/asm/thread_info_mm.h
@@ -19,6 +19,7 @@ struct thread_info {
19{ \ 19{ \
20 .task = &tsk, \ 20 .task = &tsk, \
21 .exec_domain = &default_exec_domain, \ 21 .exec_domain = &default_exec_domain, \
22 .preempt_count = INIT_PREEMPT_COUNT, \
22 .restart_block = { \ 23 .restart_block = { \
23 .fn = do_no_restart_syscall, \ 24 .fn = do_no_restart_syscall, \
24 }, \ 25 }, \
diff --git a/arch/m68k/include/asm/thread_info_no.h b/arch/m68k/include/asm/thread_info_no.h
index 82529f424ea3..c2bde5e24b0b 100644
--- a/arch/m68k/include/asm/thread_info_no.h
+++ b/arch/m68k/include/asm/thread_info_no.h
@@ -49,6 +49,7 @@ struct thread_info {
49 .exec_domain = &default_exec_domain, \ 49 .exec_domain = &default_exec_domain, \
50 .flags = 0, \ 50 .flags = 0, \
51 .cpu = 0, \ 51 .cpu = 0, \
52 .preempt_count = INIT_PREEMPT_COUNT, \
52 .restart_block = { \ 53 .restart_block = { \
53 .fn = do_no_restart_syscall, \ 54 .fn = do_no_restart_syscall, \
54 }, \ 55 }, \
diff --git a/arch/m68knommu/kernel/process.c b/arch/m68knommu/kernel/process.c
index 1e96c6eb6312..8f8f4abab2ff 100644
--- a/arch/m68knommu/kernel/process.c
+++ b/arch/m68knommu/kernel/process.c
@@ -290,7 +290,7 @@ void dump(struct pt_regs *fp)
290 unsigned char *tp; 290 unsigned char *tp;
291 int i; 291 int i;
292 292
293 printk(KERN_EMERG "\n" KERN_EMERG "CURRENT PROCESS:\n" KERN_EMERG "\n"); 293 printk(KERN_EMERG "\nCURRENT PROCESS:\n\n");
294 printk(KERN_EMERG "COMM=%s PID=%d\n", current->comm, current->pid); 294 printk(KERN_EMERG "COMM=%s PID=%d\n", current->comm, current->pid);
295 295
296 if (current->mm) { 296 if (current->mm) {
@@ -301,8 +301,7 @@ void dump(struct pt_regs *fp)
301 (int) current->mm->end_data, 301 (int) current->mm->end_data,
302 (int) current->mm->end_data, 302 (int) current->mm->end_data,
303 (int) current->mm->brk); 303 (int) current->mm->brk);
304 printk(KERN_EMERG "USER-STACK=%08x KERNEL-STACK=%08x\n" 304 printk(KERN_EMERG "USER-STACK=%08x KERNEL-STACK=%08x\n\n",
305 KERN_EMERG "\n",
306 (int) current->mm->start_stack, 305 (int) current->mm->start_stack,
307 (int)(((unsigned long) current) + THREAD_SIZE)); 306 (int)(((unsigned long) current) + THREAD_SIZE));
308 } 307 }
@@ -313,35 +312,35 @@ void dump(struct pt_regs *fp)
313 fp->d0, fp->d1, fp->d2, fp->d3); 312 fp->d0, fp->d1, fp->d2, fp->d3);
314 printk(KERN_EMERG "d4: %08lx d5: %08lx a0: %08lx a1: %08lx\n", 313 printk(KERN_EMERG "d4: %08lx d5: %08lx a0: %08lx a1: %08lx\n",
315 fp->d4, fp->d5, fp->a0, fp->a1); 314 fp->d4, fp->d5, fp->a0, fp->a1);
316 printk(KERN_EMERG "\n" KERN_EMERG "USP: %08x TRAPFRAME: %08x\n", 315 printk(KERN_EMERG "\nUSP: %08x TRAPFRAME: %08x\n",
317 (unsigned int) rdusp(), (unsigned int) fp); 316 (unsigned int) rdusp(), (unsigned int) fp);
318 317
319 printk(KERN_EMERG "\n" KERN_EMERG "CODE:"); 318 printk(KERN_EMERG "\nCODE:");
320 tp = ((unsigned char *) fp->pc) - 0x20; 319 tp = ((unsigned char *) fp->pc) - 0x20;
321 for (sp = (unsigned long *) tp, i = 0; (i < 0x40); i += 4) { 320 for (sp = (unsigned long *) tp, i = 0; (i < 0x40); i += 4) {
322 if ((i % 0x10) == 0) 321 if ((i % 0x10) == 0)
323 printk("\n" KERN_EMERG "%08x: ", (int) (tp + i)); 322 printk(KERN_EMERG "%08x: ", (int) (tp + i));
324 printk("%08x ", (int) *sp++); 323 printk("%08x ", (int) *sp++);
325 } 324 }
326 printk("\n" KERN_EMERG "\n"); 325 printk(KERN_EMERG "\n");
327 326
328 printk(KERN_EMERG "KERNEL STACK:"); 327 printk(KERN_EMERG "KERNEL STACK:");
329 tp = ((unsigned char *) fp) - 0x40; 328 tp = ((unsigned char *) fp) - 0x40;
330 for (sp = (unsigned long *) tp, i = 0; (i < 0xc0); i += 4) { 329 for (sp = (unsigned long *) tp, i = 0; (i < 0xc0); i += 4) {
331 if ((i % 0x10) == 0) 330 if ((i % 0x10) == 0)
332 printk("\n" KERN_EMERG "%08x: ", (int) (tp + i)); 331 printk(KERN_EMERG "%08x: ", (int) (tp + i));
333 printk("%08x ", (int) *sp++); 332 printk("%08x ", (int) *sp++);
334 } 333 }
335 printk("\n" KERN_EMERG "\n"); 334 printk(KERN_EMERG "\n");
336 335
337 printk(KERN_EMERG "USER STACK:"); 336 printk(KERN_EMERG "USER STACK:");
338 tp = (unsigned char *) (rdusp() - 0x10); 337 tp = (unsigned char *) (rdusp() - 0x10);
339 for (sp = (unsigned long *) tp, i = 0; (i < 0x80); i += 4) { 338 for (sp = (unsigned long *) tp, i = 0; (i < 0x80); i += 4) {
340 if ((i % 0x10) == 0) 339 if ((i % 0x10) == 0)
341 printk("\n" KERN_EMERG "%08x: ", (int) (tp + i)); 340 printk(KERN_EMERG "%08x: ", (int) (tp + i));
342 printk("%08x ", (int) *sp++); 341 printk("%08x ", (int) *sp++);
343 } 342 }
344 printk("\n" KERN_EMERG "\n"); 343 printk(KERN_EMERG "\n");
345} 344}
346 345
347/* 346/*
diff --git a/arch/m68knommu/kernel/traps.c b/arch/m68knommu/kernel/traps.c
index 51d325343ab5..3739c8f657d7 100644
--- a/arch/m68knommu/kernel/traps.c
+++ b/arch/m68knommu/kernel/traps.c
@@ -111,7 +111,7 @@ static void print_this_address(unsigned long addr, int i)
111 if (i % 5) 111 if (i % 5)
112 printk(KERN_CONT " [%08lx] ", addr); 112 printk(KERN_CONT " [%08lx] ", addr);
113 else 113 else
114 printk(KERN_CONT "\n" KERN_EMERG " [%08lx] ", addr); 114 printk(KERN_EMERG " [%08lx] ", addr);
115 i++; 115 i++;
116#endif 116#endif
117} 117}
@@ -137,8 +137,8 @@ static void __show_stack(struct task_struct *task, unsigned long *stack)
137 if (stack + 1 + i > endstack) 137 if (stack + 1 + i > endstack)
138 break; 138 break;
139 if (i % 8 == 0) 139 if (i % 8 == 0)
140 printk("\n" KERN_EMERG " "); 140 printk(KERN_EMERG " ");
141 printk(" %08lx", *(stack + i)); 141 printk(KERN_CONT " %08lx", *(stack + i));
142 } 142 }
143 printk("\n"); 143 printk("\n");
144 i = 0; 144 i = 0;
diff --git a/arch/microblaze/Kconfig b/arch/microblaze/Kconfig
index b50b845fdd50..2db722d80d4d 100644
--- a/arch/microblaze/Kconfig
+++ b/arch/microblaze/Kconfig
@@ -53,6 +53,9 @@ config GENERIC_HARDIRQS_NO__DO_IRQ
53config GENERIC_GPIO 53config GENERIC_GPIO
54 def_bool y 54 def_bool y
55 55
56config GENERIC_CSUM
57 def_bool y
58
56config PCI 59config PCI
57 def_bool n 60 def_bool n
58 61
diff --git a/arch/microblaze/include/asm/atomic.h b/arch/microblaze/include/asm/atomic.h
index 0de612ad7cb2..6d2e1d418be7 100644
--- a/arch/microblaze/include/asm/atomic.h
+++ b/arch/microblaze/include/asm/atomic.h
@@ -1,95 +1,7 @@
1/*
2 * Copyright (C) 2006 Atmark Techno, Inc.
3 *
4 * This file is subject to the terms and conditions of the GNU General Public
5 * License. See the file "COPYING" in the main directory of this archive
6 * for more details.
7 */
8
9#ifndef _ASM_MICROBLAZE_ATOMIC_H 1#ifndef _ASM_MICROBLAZE_ATOMIC_H
10#define _ASM_MICROBLAZE_ATOMIC_H 2#define _ASM_MICROBLAZE_ATOMIC_H
11 3
12#include <linux/types.h> 4#include <asm-generic/atomic.h>
13#include <linux/compiler.h> /* likely */
14#include <asm/system.h> /* local_irq_XXX and friends */
15
16#define ATOMIC_INIT(i) { (i) }
17#define atomic_read(v) ((v)->counter)
18#define atomic_set(v, i) (((v)->counter) = (i))
19
20#define atomic_inc(v) (atomic_add_return(1, (v)))
21#define atomic_dec(v) (atomic_sub_return(1, (v)))
22
23#define atomic_add(i, v) (atomic_add_return(i, (v)))
24#define atomic_sub(i, v) (atomic_sub_return(i, (v)))
25
26#define atomic_inc_return(v) (atomic_add_return(1, (v)))
27#define atomic_dec_return(v) (atomic_sub_return(1, (v)))
28
29#define atomic_inc_and_test(v) (atomic_add_return(1, (v)) == 0)
30#define atomic_dec_and_test(v) (atomic_sub_return(1, (v)) == 0)
31
32#define atomic_inc_not_zero(v) (atomic_add_unless((v), 1, 0))
33
34#define atomic_sub_and_test(i, v) (atomic_sub_return((i), (v)) == 0)
35
36static inline int atomic_cmpxchg(atomic_t *v, int old, int new)
37{
38 int ret;
39 unsigned long flags;
40
41 local_irq_save(flags);
42 ret = v->counter;
43 if (likely(ret == old))
44 v->counter = new;
45 local_irq_restore(flags);
46
47 return ret;
48}
49
50static inline int atomic_add_unless(atomic_t *v, int a, int u)
51{
52 int c, old;
53
54 c = atomic_read(v);
55 while (c != u && (old = atomic_cmpxchg((v), c, c + a)) != c)
56 c = old;
57 return c != u;
58}
59
60static inline void atomic_clear_mask(unsigned long mask, unsigned long *addr)
61{
62 unsigned long flags;
63
64 local_irq_save(flags);
65 *addr &= ~mask;
66 local_irq_restore(flags);
67}
68
69/**
70 * atomic_add_return - add and return
71 * @i: integer value to add
72 * @v: pointer of type atomic_t
73 *
74 * Atomically adds @i to @v and returns @i + @v
75 */
76static inline int atomic_add_return(int i, atomic_t *v)
77{
78 unsigned long flags;
79 int val;
80
81 local_irq_save(flags);
82 val = v->counter;
83 v->counter = val += i;
84 local_irq_restore(flags);
85
86 return val;
87}
88
89static inline int atomic_sub_return(int i, atomic_t *v)
90{
91 return atomic_add_return(-i, v);
92}
93 5
94/* 6/*
95 * Atomically test *v and decrement if it is greater than 0. 7 * Atomically test *v and decrement if it is greater than 0.
@@ -109,15 +21,4 @@ static inline int atomic_dec_if_positive(atomic_t *v)
109 return res; 21 return res;
110} 22}
111 23
112#define atomic_add_negative(a, v) (atomic_add_return((a), (v)) < 0)
113#define atomic_xchg(v, new) (xchg(&((v)->counter), new))
114
115/* Atomic operations are already serializing */
116#define smp_mb__before_atomic_dec() barrier()
117#define smp_mb__after_atomic_dec() barrier()
118#define smp_mb__before_atomic_inc() barrier()
119#define smp_mb__after_atomic_inc() barrier()
120
121#include <asm-generic/atomic-long.h>
122
123#endif /* _ASM_MICROBLAZE_ATOMIC_H */ 24#endif /* _ASM_MICROBLAZE_ATOMIC_H */
diff --git a/arch/microblaze/include/asm/bitops.h b/arch/microblaze/include/asm/bitops.h
index d6df1fd4e1e8..a72468f15c8b 100644
--- a/arch/microblaze/include/asm/bitops.h
+++ b/arch/microblaze/include/asm/bitops.h
@@ -1,27 +1 @@
1/*
2 * Copyright (C) 2006 Atmark Techno, Inc.
3 *
4 * This file is subject to the terms and conditions of the GNU General Public
5 * License. See the file "COPYING" in the main directory of this archive
6 * for more details.
7 */
8
9#ifndef _ASM_MICROBLAZE_BITOPS_H
10#define _ASM_MICROBLAZE_BITOPS_H
11
12/*
13 * Copyright 1992, Linus Torvalds.
14 */
15
16#include <asm/byteorder.h> /* swab32 */
17#include <asm/system.h> /* save_flags */
18
19/*
20 * clear_bit() doesn't provide any barrier for the compiler.
21 */
22#define smp_mb__before_clear_bit() barrier()
23#define smp_mb__after_clear_bit() barrier()
24#include <asm-generic/bitops.h> #include <asm-generic/bitops.h>
25#include <asm-generic/bitops/__fls.h>
26
27#endif /* _ASM_MICROBLAZE_BITOPS_H */
diff --git a/arch/microblaze/include/asm/bug.h b/arch/microblaze/include/asm/bug.h
index 8eb2cdde11d7..b12fd89e42e9 100644
--- a/arch/microblaze/include/asm/bug.h
+++ b/arch/microblaze/include/asm/bug.h
@@ -1,15 +1 @@
1/*
2 * Copyright (C) 2006 Atmark Techno, Inc.
3 *
4 * This file is subject to the terms and conditions of the GNU General Public
5 * License. See the file "COPYING" in the main directory of this archive
6 * for more details.
7 */
8
9#ifndef _ASM_MICROBLAZE_BUG_H
10#define _ASM_MICROBLAZE_BUG_H
11
12#include <linux/kernel.h>
13#include <asm-generic/bug.h> #include <asm-generic/bug.h>
14
15#endif /* _ASM_MICROBLAZE_BUG_H */
diff --git a/arch/microblaze/include/asm/bugs.h b/arch/microblaze/include/asm/bugs.h
index f2c6593653fb..61791e1ad9f5 100644
--- a/arch/microblaze/include/asm/bugs.h
+++ b/arch/microblaze/include/asm/bugs.h
@@ -1,17 +1 @@
1/* #include <asm-generic/bugs.h>
2 * Copyright (C) 2006 Atmark Techno, Inc.
3 *
4 * This file is subject to the terms and conditions of the GNU General Public
5 * License. See the file "COPYING" in the main directory of this archive
6 * for more details.
7 */
8
9#ifndef _ASM_MICROBLAZE_BUGS_H
10#define _ASM_MICROBLAZE_BUGS_H
11
12static inline void check_bugs(void)
13{
14 /* nothing to do */
15}
16
17#endif /* _ASM_MICROBLAZE_BUGS_H */
diff --git a/arch/microblaze/include/asm/checksum.h b/arch/microblaze/include/asm/checksum.h
index 97ea46b5cf80..128bf03b54b7 100644
--- a/arch/microblaze/include/asm/checksum.h
+++ b/arch/microblaze/include/asm/checksum.h
@@ -10,12 +10,11 @@
10#ifndef _ASM_MICROBLAZE_CHECKSUM_H 10#ifndef _ASM_MICROBLAZE_CHECKSUM_H
11#define _ASM_MICROBLAZE_CHECKSUM_H 11#define _ASM_MICROBLAZE_CHECKSUM_H
12 12
13#include <linux/in6.h>
14
15/* 13/*
16 * computes the checksum of the TCP/UDP pseudo-header 14 * computes the checksum of the TCP/UDP pseudo-header
17 * returns a 16-bit checksum, already complemented 15 * returns a 16-bit checksum, already complemented
18 */ 16 */
17#define csum_tcpudp_nofold csum_tcpudp_nofold
19static inline __wsum 18static inline __wsum
20csum_tcpudp_nofold(__be32 saddr, __be32 daddr, unsigned short len, 19csum_tcpudp_nofold(__be32 saddr, __be32 daddr, unsigned short len,
21 unsigned short proto, __wsum sum) 20 unsigned short proto, __wsum sum)
@@ -30,71 +29,6 @@ csum_tcpudp_nofold(__be32 saddr, __be32 daddr, unsigned short len,
30 return sum; 29 return sum;
31} 30}
32 31
33/* 32#include <asm-generic/checksum.h>
34 * computes the checksum of a memory block at buff, length len,
35 * and adds in "sum" (32-bit)
36 *
37 * returns a 32-bit number suitable for feeding into itself
38 * or csum_tcpudp_magic
39 *
40 * this function must be called with even lengths, except
41 * for the last fragment, which may be odd
42 *
43 * it's best to have buff aligned on a 32-bit boundary
44 */
45extern __wsum csum_partial(const void *buff, int len, __wsum sum);
46
47/*
48 * the same as csum_partial, but copies from src while it
49 * checksums
50 *
51 * here even more important to align src and dst on a 32-bit (or even
52 * better 64-bit) boundary
53 */
54extern __wsum csum_partial_copy(const void *src, void *dst, int len,
55 __wsum sum);
56
57/*
58 * the same as csum_partial_copy, but copies from user space.
59 *
60 * here even more important to align src and dst on a 32-bit (or even
61 * better 64-bit) boundary
62 */
63extern __wsum csum_partial_copy_from_user(const void __user *src, void *dst,
64 int len, __wsum sum, int *csum_err);
65
66#define csum_partial_copy_nocheck(src, dst, len, sum) \
67 csum_partial_copy((src), (dst), (len), (sum))
68
69/*
70 * This is a version of ip_compute_csum() optimized for IP headers,
71 * which always checksum on 4 octet boundaries.
72 *
73 */
74extern __sum16 ip_fast_csum(const void *iph, unsigned int ihl);
75
76/*
77 * Fold a partial checksum
78 */
79static inline __sum16 csum_fold(__wsum csum)
80{
81 u32 sum = (__force u32)csum;
82 sum = (sum & 0xffff) + (sum >> 16);
83 sum = (sum & 0xffff) + (sum >> 16);
84 return (__force __sum16)~sum;
85}
86
87static inline __sum16
88csum_tcpudp_magic(__be32 saddr, __be32 daddr, unsigned short len,
89 unsigned short proto, __wsum sum)
90{
91 return csum_fold(csum_tcpudp_nofold(saddr, daddr, len, proto, sum));
92}
93
94/*
95 * this routine is used for miscellaneous IP-like checksums, mainly
96 * in icmp.c
97 */
98extern __sum16 ip_compute_csum(const void *buff, int len);
99 33
100#endif /* _ASM_MICROBLAZE_CHECKSUM_H */ 34#endif /* _ASM_MICROBLAZE_CHECKSUM_H */
diff --git a/arch/microblaze/include/asm/fb.h b/arch/microblaze/include/asm/fb.h
new file mode 100644
index 000000000000..3a4988e8df45
--- /dev/null
+++ b/arch/microblaze/include/asm/fb.h
@@ -0,0 +1 @@
#include <asm-generic/fb.h>
diff --git a/arch/microblaze/include/asm/hardirq.h b/arch/microblaze/include/asm/hardirq.h
index 0f2d6b013e11..41e1e1aa36ac 100644
--- a/arch/microblaze/include/asm/hardirq.h
+++ b/arch/microblaze/include/asm/hardirq.h
@@ -9,21 +9,11 @@
9#ifndef _ASM_MICROBLAZE_HARDIRQ_H 9#ifndef _ASM_MICROBLAZE_HARDIRQ_H
10#define _ASM_MICROBLAZE_HARDIRQ_H 10#define _ASM_MICROBLAZE_HARDIRQ_H
11 11
12#include <linux/cache.h>
13#include <linux/irq.h>
14#include <asm/irq.h>
15#include <asm/current.h>
16#include <linux/ptrace.h>
17
18/* should be defined in each interrupt controller driver */ 12/* should be defined in each interrupt controller driver */
19extern unsigned int get_irq(struct pt_regs *regs); 13extern unsigned int get_irq(struct pt_regs *regs);
20 14
21typedef struct { 15#define ack_bad_irq ack_bad_irq
22 unsigned int __softirq_pending;
23} ____cacheline_aligned irq_cpustat_t;
24
25void ack_bad_irq(unsigned int irq); 16void ack_bad_irq(unsigned int irq);
26 17#include <asm-generic/hardirq.h>
27#include <linux/irq_cpustat.h> /* Standard mappings for irq_cpustat_t above */
28 18
29#endif /* _ASM_MICROBLAZE_HARDIRQ_H */ 19#endif /* _ASM_MICROBLAZE_HARDIRQ_H */
diff --git a/arch/microblaze/include/asm/ioctls.h b/arch/microblaze/include/asm/ioctls.h
index 03582b249204..ec34c760665e 100644
--- a/arch/microblaze/include/asm/ioctls.h
+++ b/arch/microblaze/include/asm/ioctls.h
@@ -1,91 +1 @@
1/* #include <asm-generic/ioctls.h>
2 * Copyright (C) 2006 Atmark Techno, Inc.
3 *
4 * This file is subject to the terms and conditions of the GNU General Public
5 * License. See the file "COPYING" in the main directory of this archive
6 * for more details.
7 */
8
9#ifndef _ASM_MICROBLAZE_IOCTLS_H
10#define _ASM_MICROBLAZE_IOCTLS_H
11
12#include <linux/ioctl.h>
13
14/* 0x54 is just a magic number to make these relatively unique ('T') */
15
16#define TCGETS 0x5401
17#define TCSETS 0x5402
18#define TCSETSW 0x5403
19#define TCSETSF 0x5404
20#define TCGETA 0x5405
21#define TCSETA 0x5406
22#define TCSETAW 0x5407
23#define TCSETAF 0x5408
24#define TCSBRK 0x5409
25#define TCXONC 0x540A
26#define TCFLSH 0x540B
27#define TIOCEXCL 0x540C
28#define TIOCNXCL 0x540D
29#define TIOCSCTTY 0x540E
30#define TIOCGPGRP 0x540F
31#define TIOCSPGRP 0x5410
32#define TIOCOUTQ 0x5411
33#define TIOCSTI 0x5412
34#define TIOCGWINSZ 0x5413
35#define TIOCSWINSZ 0x5414
36#define TIOCMGET 0x5415
37#define TIOCMBIS 0x5416
38#define TIOCMBIC 0x5417
39#define TIOCMSET 0x5418
40#define TIOCGSOFTCAR 0x5419
41#define TIOCSSOFTCAR 0x541A
42#define FIONREAD 0x541B
43#define TIOCINQ FIONREAD
44#define TIOCLINUX 0x541C
45#define TIOCCONS 0x541D
46#define TIOCGSERIAL 0x541E
47#define TIOCSSERIAL 0x541F
48#define TIOCPKT 0x5420
49#define FIONBIO 0x5421
50#define TIOCNOTTY 0x5422
51#define TIOCSETD 0x5423
52#define TIOCGETD 0x5424
53#define TCSBRKP 0x5425 /* Needed for POSIX tcsendbreak() */
54#define TIOCTTYGSTRUCT 0x5426 /* For debugging only */
55#define TIOCSBRK 0x5427 /* BSD compatibility */
56#define TIOCCBRK 0x5428 /* BSD compatibility */
57#define TIOCGSID 0x5429 /* Return the session ID of FD */
58/* Get Pty Number (of pty-mux device) */
59#define TIOCGPTN _IOR('T', 0x30, unsigned int)
60#define TIOCSPTLCK _IOW('T', 0x31, int) /* Lock/unlock Pty */
61
62#define FIONCLEX 0x5450 /* these numbers need to be adjusted. */
63#define FIOCLEX 0x5451
64#define FIOASYNC 0x5452
65#define TIOCSERCONFIG 0x5453
66#define TIOCSERGWILD 0x5454
67#define TIOCSERSWILD 0x5455
68#define TIOCGLCKTRMIOS 0x5456
69#define TIOCSLCKTRMIOS 0x5457
70#define TIOCSERGSTRUCT 0x5458 /* For debugging only */
71#define TIOCSERGETLSR 0x5459 /* Get line status register */
72#define TIOCSERGETMULTI 0x545A /* Get multiport config */
73#define TIOCSERSETMULTI 0x545B /* Set multiport config */
74
75#define TIOCMIWAIT 0x545C /* wait for a change on serial input line(s) */
76#define TIOCGICOUNT 0x545D /* read serial port inline interrupt counts */
77
78#define FIOQSIZE 0x545E
79
80/* Used for packet mode */
81#define TIOCPKT_DATA 0
82#define TIOCPKT_FLUSHREAD 1
83#define TIOCPKT_FLUSHWRITE 2
84#define TIOCPKT_STOP 4
85#define TIOCPKT_START 8
86#define TIOCPKT_NOSTOP 16
87#define TIOCPKT_DOSTOP 32
88
89#define TIOCSER_TEMT 0x01 /* Transmitter physically empty */
90
91#endif /* _ASM_MICROBLAZE_IOCTLS_H */
diff --git a/arch/microblaze/include/asm/ipcbuf.h b/arch/microblaze/include/asm/ipcbuf.h
index b056fa420654..84c7e51cb6d0 100644
--- a/arch/microblaze/include/asm/ipcbuf.h
+++ b/arch/microblaze/include/asm/ipcbuf.h
@@ -1,36 +1 @@
1/* #include <asm-generic/ipcbuf.h>
2 * Copyright (C) 2006 Atmark Techno, Inc.
3 *
4 * This file is subject to the terms and conditions of the GNU General Public
5 * License. See the file "COPYING" in the main directory of this archive
6 * for more details.
7 */
8
9#ifndef _ASM_MICROBLAZE_IPCBUF_H
10#define _ASM_MICROBLAZE_IPCBUF_H
11
12/*
13 * The user_ipc_perm structure for microblaze architecture.
14 * Note extra padding because this structure is passed back and forth
15 * between kernel and user space.
16 *
17 * Pad space is left for:
18 * - 32-bit mode_t and seq
19 * - 2 miscellaneous 32-bit values
20 */
21
22struct ipc64_perm {
23 __kernel_key_t key;
24 __kernel_uid32_t uid;
25 __kernel_gid32_t gid;
26 __kernel_uid32_t cuid;
27 __kernel_gid32_t cgid;
28 __kernel_mode_t mode;
29 unsigned short __pad1;
30 unsigned short seq;
31 unsigned short __pad2;
32 unsigned long __unused1;
33 unsigned long __unused2;
34};
35
36#endif /* _ASM_MICROBLAZE_IPCBUF_H */
diff --git a/arch/microblaze/include/asm/irq.h b/arch/microblaze/include/asm/irq.h
index db515deaa720..90f050535ebe 100644
--- a/arch/microblaze/include/asm/irq.h
+++ b/arch/microblaze/include/asm/irq.h
@@ -10,6 +10,7 @@
10#define _ASM_MICROBLAZE_IRQ_H 10#define _ASM_MICROBLAZE_IRQ_H
11 11
12#define NR_IRQS 32 12#define NR_IRQS 32
13#include <asm-generic/irq.h>
13 14
14#include <linux/interrupt.h> 15#include <linux/interrupt.h>
15 16
@@ -17,11 +18,6 @@ extern unsigned int nr_irq;
17 18
18#define NO_IRQ (-1) 19#define NO_IRQ (-1)
19 20
20static inline int irq_canonicalize(int irq)
21{
22 return irq;
23}
24
25struct pt_regs; 21struct pt_regs;
26extern void do_IRQ(struct pt_regs *regs); 22extern void do_IRQ(struct pt_regs *regs);
27 23
diff --git a/arch/microblaze/include/asm/mman.h b/arch/microblaze/include/asm/mman.h
index 4914b1329445..8eebf89f5ab1 100644
--- a/arch/microblaze/include/asm/mman.h
+++ b/arch/microblaze/include/asm/mman.h
@@ -1,25 +1 @@
1/*
2 * Copyright (C) 2006 Atmark Techno, Inc.
3 *
4 * This file is subject to the terms and conditions of the GNU General Public
5 * License. See the file "COPYING" in the main directory of this archive
6 * for more details.
7 */
8
9#ifndef _ASM_MICROBLAZE_MMAN_H
10#define _ASM_MICROBLAZE_MMAN_H
11
12#include <asm-generic/mman.h> #include <asm-generic/mman.h>
13
14#define MAP_GROWSDOWN 0x0100 /* stack-like segment */
15#define MAP_DENYWRITE 0x0800 /* ETXTBSY */
16#define MAP_EXECUTABLE 0x1000 /* mark it as an executable */
17#define MAP_LOCKED 0x2000 /* pages are locked */
18#define MAP_NORESERVE 0x4000 /* don't check for reservations */
19#define MAP_POPULATE 0x8000 /* populate (prefault) pagetables */
20#define MAP_NONBLOCK 0x10000 /* do not block on IO */
21
22#define MCL_CURRENT 1 /* lock all current mappings */
23#define MCL_FUTURE 2 /* lock all future mappings */
24
25#endif /* _ASM_MICROBLAZE_MMAN_H */
diff --git a/arch/microblaze/include/asm/mmu.h b/arch/microblaze/include/asm/mmu.h
index 66cad6a99d77..8d6a654ceffb 100644
--- a/arch/microblaze/include/asm/mmu.h
+++ b/arch/microblaze/include/asm/mmu.h
@@ -12,12 +12,7 @@
12#define _ASM_MICROBLAZE_MMU_H 12#define _ASM_MICROBLAZE_MMU_H
13 13
14# ifndef CONFIG_MMU 14# ifndef CONFIG_MMU
15# ifndef __ASSEMBLY__ 15# include <asm-generic/mmu.h>
16typedef struct {
17 struct vm_list_struct *vmlist;
18 unsigned long end_brk;
19} mm_context_t;
20# endif /* __ASSEMBLY__ */
21# else /* CONFIG_MMU */ 16# else /* CONFIG_MMU */
22# ifdef __KERNEL__ 17# ifdef __KERNEL__
23# ifndef __ASSEMBLY__ 18# ifndef __ASSEMBLY__
diff --git a/arch/microblaze/include/asm/mmu_context.h b/arch/microblaze/include/asm/mmu_context.h
index 385fed16bbfb..24eab1674d3e 100644
--- a/arch/microblaze/include/asm/mmu_context.h
+++ b/arch/microblaze/include/asm/mmu_context.h
@@ -1,5 +1,5 @@
1#ifdef CONFIG_MMU 1#ifdef CONFIG_MMU
2# include "mmu_context_mm.h" 2# include "mmu_context_mm.h"
3#else 3#else
4# include "mmu_context_no.h" 4# include <asm-generic/mmu_context.h>
5#endif 5#endif
diff --git a/arch/microblaze/include/asm/mmu_context_no.h b/arch/microblaze/include/asm/mmu_context_no.h
deleted file mode 100644
index ba5567190154..000000000000
--- a/arch/microblaze/include/asm/mmu_context_no.h
+++ /dev/null
@@ -1,23 +0,0 @@
1/*
2 * Copyright (C) 2008-2009 Michal Simek <monstr@monstr.eu>
3 * Copyright (C) 2008-2009 PetaLogix
4 * Copyright (C) 2006 Atmark Techno, Inc.
5 *
6 * This file is subject to the terms and conditions of the GNU General Public
7 * License. See the file "COPYING" in the main directory of this archive
8 * for more details.
9 */
10
11#ifndef _ASM_MICROBLAZE_MMU_CONTEXT_H
12#define _ASM_MICROBLAZE_MMU_CONTEXT_H
13
14# define init_new_context(tsk, mm) ({ 0; })
15
16# define enter_lazy_tlb(mm, tsk) do {} while (0)
17# define change_mm_context(old, ctx, _pml4) do {} while (0)
18# define destroy_context(mm) do {} while (0)
19# define deactivate_mm(tsk, mm) do {} while (0)
20# define switch_mm(prev, next, tsk) do {} while (0)
21# define activate_mm(prev, next) do {} while (0)
22
23#endif /* _ASM_MICROBLAZE_MMU_CONTEXT_H */
diff --git a/arch/microblaze/include/asm/module.h b/arch/microblaze/include/asm/module.h
index 914565a90315..7be1347fce42 100644
--- a/arch/microblaze/include/asm/module.h
+++ b/arch/microblaze/include/asm/module.h
@@ -9,6 +9,8 @@
9#ifndef _ASM_MICROBLAZE_MODULE_H 9#ifndef _ASM_MICROBLAZE_MODULE_H
10#define _ASM_MICROBLAZE_MODULE_H 10#define _ASM_MICROBLAZE_MODULE_H
11 11
12#include <asm-generic/module.h>
13
12/* Microblaze Relocations */ 14/* Microblaze Relocations */
13#define R_MICROBLAZE_NONE 0 15#define R_MICROBLAZE_NONE 0
14#define R_MICROBLAZE_32 1 16#define R_MICROBLAZE_32 1
@@ -24,14 +26,6 @@
24/* Keep this the last entry. */ 26/* Keep this the last entry. */
25#define R_MICROBLAZE_NUM 11 27#define R_MICROBLAZE_NUM 11
26 28
27struct mod_arch_specific {
28 int foo;
29};
30
31#define Elf_Shdr Elf32_Shdr
32#define Elf_Sym Elf32_Sym
33#define Elf_Ehdr Elf32_Ehdr
34
35typedef struct { volatile int counter; } module_t; 29typedef struct { volatile int counter; } module_t;
36 30
37#endif /* _ASM_MICROBLAZE_MODULE_H */ 31#endif /* _ASM_MICROBLAZE_MODULE_H */
diff --git a/arch/microblaze/include/asm/msgbuf.h b/arch/microblaze/include/asm/msgbuf.h
index 09dd97097211..809134c644a6 100644
--- a/arch/microblaze/include/asm/msgbuf.h
+++ b/arch/microblaze/include/asm/msgbuf.h
@@ -1,31 +1 @@
1#ifndef _ASM_MICROBLAZE_MSGBUF_H #include <asm-generic/msgbuf.h>
2#define _ASM_MICROBLAZE_MSGBUF_H
3
4/*
5 * The msqid64_ds structure for microblaze architecture.
6 * Note extra padding because this structure is passed back and forth
7 * between kernel and user space.
8 *
9 * Pad space is left for:
10 * - 64-bit time_t to solve y2038 problem
11 * - 2 miscellaneous 32-bit values
12 */
13
14struct msqid64_ds {
15 struct ipc64_perm msg_perm;
16 __kernel_time_t msg_stime; /* last msgsnd time */
17 unsigned long __unused1;
18 __kernel_time_t msg_rtime; /* last msgrcv time */
19 unsigned long __unused2;
20 __kernel_time_t msg_ctime; /* last change time */
21 unsigned long __unused3;
22 unsigned long msg_cbytes; /* current number of bytes on queue */
23 unsigned long msg_qnum; /* number of messages in queue */
24 unsigned long msg_qbytes; /* max number of bytes on queue */
25 __kernel_pid_t msg_lspid; /* pid of last msgsnd */
26 __kernel_pid_t msg_lrpid; /* last receive pid */
27 unsigned long __unused4;
28 unsigned long __unused5;
29};
30
31#endif /* _ASM_MICROBLAZE_MSGBUF_H */
diff --git a/arch/microblaze/include/asm/param.h b/arch/microblaze/include/asm/param.h
index 8c538a49616d..965d45427975 100644
--- a/arch/microblaze/include/asm/param.h
+++ b/arch/microblaze/include/asm/param.h
@@ -1,30 +1 @@
1/* #include <asm-generic/param.h>
2 * Copyright (C) 2006 Atmark Techno, Inc.
3 *
4 * This file is subject to the terms and conditions of the GNU General Public
5 * License. See the file "COPYING" in the main directory of this archive
6 * for more details.
7 */
8
9#ifndef _ASM_MICROBLAZE_PARAM_H
10#define _ASM_MICROBLAZE_PARAM_H
11
12#ifdef __KERNEL__
13#define HZ CONFIG_HZ /* internal kernel timer frequency */
14#define USER_HZ 100 /* for user interfaces in "ticks" */
15#define CLOCKS_PER_SEC (USER_HZ) /* frequency at which times() counts */
16#endif /* __KERNEL__ */
17
18#ifndef HZ
19#define HZ 100
20#endif
21
22#define EXEC_PAGESIZE 4096
23
24#ifndef NOGROUP
25#define NOGROUP (-1)
26#endif
27
28#define MAXHOSTNAMELEN 64 /* max length of hostname */
29
30#endif /* _ASM_MICROBLAZE_PARAM_H */
diff --git a/arch/microblaze/include/asm/parport.h b/arch/microblaze/include/asm/parport.h
new file mode 100644
index 000000000000..cf252af64590
--- /dev/null
+++ b/arch/microblaze/include/asm/parport.h
@@ -0,0 +1 @@
#include <asm-generic/parport.h>
diff --git a/arch/microblaze/include/asm/pci.h b/arch/microblaze/include/asm/pci.h
index ca03794cf3f0..9f0df5faf2c8 100644
--- a/arch/microblaze/include/asm/pci.h
+++ b/arch/microblaze/include/asm/pci.h
@@ -1 +1 @@
#include <linux/io.h> #include <asm-generic/pci.h>
diff --git a/arch/microblaze/include/asm/posix_types.h b/arch/microblaze/include/asm/posix_types.h
index 8c758b231f37..0e15039673e3 100644
--- a/arch/microblaze/include/asm/posix_types.h
+++ b/arch/microblaze/include/asm/posix_types.h
@@ -1,73 +1,9 @@
1/*
2 * Copyright (C) 2006 Atmark Techno, Inc.
3 *
4 * This file is subject to the terms and conditions of the GNU General Public
5 * License. See the file "COPYING" in the main directory of this archive
6 * for more details.
7 */
8
9#ifndef _ASM_MICROBLAZE_POSIX_TYPES_H 1#ifndef _ASM_MICROBLAZE_POSIX_TYPES_H
10#define _ASM_MICROBLAZE_POSIX_TYPES_H 2#define _ASM_MICROBLAZE_POSIX_TYPES_H
11 3
12/*
13 * This file is generally used by user-level software, so you need to
14 * be a little careful about namespace pollution etc. Also, we cannot
15 * assume GCC is being used.
16 */
17
18typedef unsigned long __kernel_ino_t;
19typedef unsigned short __kernel_mode_t; 4typedef unsigned short __kernel_mode_t;
20typedef unsigned int __kernel_nlink_t; 5#define __kernel_mode_t __kernel_mode_t
21typedef long __kernel_off_t;
22typedef int __kernel_pid_t;
23typedef unsigned int __kernel_ipc_pid_t;
24typedef unsigned int __kernel_uid_t;
25typedef unsigned int __kernel_gid_t;
26typedef unsigned long __kernel_size_t;
27typedef long __kernel_ssize_t;
28typedef int __kernel_ptrdiff_t;
29typedef long __kernel_time_t;
30typedef long __kernel_suseconds_t;
31typedef long __kernel_clock_t;
32typedef int __kernel_timer_t;
33typedef int __kernel_clockid_t;
34typedef int __kernel_daddr_t;
35typedef char *__kernel_caddr_t;
36typedef unsigned short __kernel_uid16_t;
37typedef unsigned short __kernel_gid16_t;
38typedef unsigned int __kernel_uid32_t;
39typedef unsigned int __kernel_gid32_t;
40
41typedef unsigned int __kernel_old_uid_t;
42typedef unsigned int __kernel_old_gid_t;
43typedef unsigned int __kernel_old_dev_t;
44
45#ifdef __GNUC__
46typedef long long __kernel_loff_t;
47#endif
48
49typedef struct {
50#if defined(__KERNEL__) || defined(__USE_ALL)
51 int val[2];
52#else /* !defined(__KERNEL__) && !defined(__USE_ALL) */
53 int __val[2];
54#endif /* !defined(__KERNEL__) && !defined(__USE_ALL) */
55} __kernel_fsid_t;
56
57#if defined(__KERNEL__) || !defined(__GLIBC__) || (__GLIBC__ < 2)
58
59#undef __FD_SET
60#define __FD_SET(d, set) ((set)->fds_bits[__FDELT(d)] |= __FDMASK(d))
61
62#undef __FD_CLR
63#define __FD_CLR(d, set) ((set)->fds_bits[__FDELT(d)] &= ~__FDMASK(d))
64
65#undef __FD_ISSET
66#define __FD_ISSET(d, set) (!!((set)->fds_bits[__FDELT(d)] & __FDMASK(d)))
67
68#undef __FD_ZERO
69#define __FD_ZERO(fdsetp) (memset(fdsetp, 0, sizeof(*(fd_set *)fdsetp)))
70 6
71#endif /* defined(__KERNEL__) || !defined(__GLIBC__) || (__GLIBC__ < 2) */ 7#include <asm-generic/posix_types.h>
72 8
73#endif /* _ASM_MICROBLAZE_POSIX_TYPES_H */ 9#endif /* _ASM_MICROBLAZE_POSIX_TYPES_H */
diff --git a/arch/microblaze/include/asm/scatterlist.h b/arch/microblaze/include/asm/scatterlist.h
index 08ff1d049b42..35d786fe93ae 100644
--- a/arch/microblaze/include/asm/scatterlist.h
+++ b/arch/microblaze/include/asm/scatterlist.h
@@ -1,28 +1 @@
1/* #include <asm-generic/scatterlist.h>
2 * Copyright (C) 2008 Michal Simek <monstr@monstr.eu>
3 * Copyright (C) 2006 Atmark Techno, Inc.
4 *
5 * This file is subject to the terms and conditions of the GNU General Public
6 * License. See the file "COPYING" in the main directory of this archive
7 * for more details.
8 */
9
10#ifndef _ASM_MICROBLAZE_SCATTERLIST_H
11#define _ASM_MICROBLAZE_SCATTERLIST_H
12
13struct scatterlist {
14#ifdef CONFIG_DEBUG_SG
15 unsigned long sg_magic;
16#endif
17 unsigned long page_link;
18 dma_addr_t dma_address;
19 unsigned int offset;
20 unsigned int length;
21};
22
23#define sg_dma_address(sg) ((sg)->dma_address)
24#define sg_dma_len(sg) ((sg)->length)
25
26#define ISA_DMA_THRESHOLD (~0UL)
27
28#endif /* _ASM_MICROBLAZE_SCATTERLIST_H */
diff --git a/arch/microblaze/include/asm/sembuf.h b/arch/microblaze/include/asm/sembuf.h
index b804ed71a57e..7673b83cfef7 100644
--- a/arch/microblaze/include/asm/sembuf.h
+++ b/arch/microblaze/include/asm/sembuf.h
@@ -1,34 +1 @@
1/* #include <asm-generic/sembuf.h>
2 * Copyright (C) 2006 Atmark Techno, Inc.
3 *
4 * This file is subject to the terms and conditions of the GNU General Public
5 * License. See the file "COPYING" in the main directory of this archive
6 * for more details.
7 */
8
9#ifndef _ASM_MICROBLAZE_SEMBUF_H
10#define _ASM_MICROBLAZE_SEMBUF_H
11
12/*
13 * The semid64_ds structure for microblaze architecture.
14 * Note extra padding because this structure is passed back and forth
15 * between kernel and user space.
16 *
17 * Pad space is left for:
18 * - 64-bit time_t to solve y2038 problem
19 * - 2 miscellaneous 32-bit values
20 */
21
22struct semid64_ds {
23 struct ipc64_perm sem_perm; /* permissions .. see ipc.h */
24 __kernel_time_t sem_otime; /* last semop time */
25 unsigned long __unused1;
26 __kernel_time_t sem_ctime; /* last change time */
27 unsigned long __unused2;
28 unsigned long sem_nsems; /* no. of semaphores in array */
29 unsigned long __unused3;
30 unsigned long __unused4;
31};
32
33
34#endif /* _ASM_MICROBLAZE_SEMBUF_H */
diff --git a/arch/microblaze/include/asm/serial.h b/arch/microblaze/include/asm/serial.h
index 39bfc8ce6af5..a0cb0caff152 100644
--- a/arch/microblaze/include/asm/serial.h
+++ b/arch/microblaze/include/asm/serial.h
@@ -1,14 +1 @@
1/* #include <asm-generic/serial.h>
2 * Copyright (C) 2009 Michal Simek <monstr@monstr.eu>
3 *
4 * This file is subject to the terms and conditions of the GNU General Public
5 * License. See the file "COPYING" in the main directory of this archive
6 * for more details.
7 */
8
9#ifndef _ASM_MICROBLAZE_SERIAL_H
10#define _ASM_MICROBLAZE_SERIAL_H
11
12# define BASE_BAUD (1843200 / 16)
13
14#endif /* _ASM_MICROBLAZE_SERIAL_H */
diff --git a/arch/microblaze/include/asm/shmbuf.h b/arch/microblaze/include/asm/shmbuf.h
index f829c5843618..83c05fc2de38 100644
--- a/arch/microblaze/include/asm/shmbuf.h
+++ b/arch/microblaze/include/asm/shmbuf.h
@@ -1,42 +1 @@
1#ifndef _ASM_MICROBLAZE_SHMBUF_H #include <asm-generic/shmbuf.h>
2#define _ASM_MICROBLAZE_SHMBUF_H
3
4/*
5 * The shmid64_ds structure for microblaze architecture.
6 * Note extra padding because this structure is passed back and forth
7 * between kernel and user space.
8 *
9 * Pad space is left for:
10 * - 64-bit time_t to solve y2038 problem
11 * - 2 miscellaneous 32-bit values
12 */
13
14struct shmid64_ds {
15 struct ipc64_perm shm_perm; /* operation perms */
16 size_t shm_segsz; /* size of segment (bytes) */
17 __kernel_time_t shm_atime; /* last attach time */
18 unsigned long __unused1;
19 __kernel_time_t shm_dtime; /* last detach time */
20 unsigned long __unused2;
21 __kernel_time_t shm_ctime; /* last change time */
22 unsigned long __unused3;
23 __kernel_pid_t shm_cpid; /* pid of creator */
24 __kernel_pid_t shm_lpid; /* pid of last operator */
25 unsigned long shm_nattch; /* no. of current attaches */
26 unsigned long __unused4;
27 unsigned long __unused5;
28};
29
30struct shminfo64 {
31 unsigned long shmmax;
32 unsigned long shmmin;
33 unsigned long shmmni;
34 unsigned long shmseg;
35 unsigned long shmall;
36 unsigned long __unused1;
37 unsigned long __unused2;
38 unsigned long __unused3;
39 unsigned long __unused4;
40};
41
42#endif /* _ASM_MICROBLAZE_SHMBUF_H */
diff --git a/arch/microblaze/include/asm/shmparam.h b/arch/microblaze/include/asm/shmparam.h
index 9f5fc2b3b6a3..93f30deb95d0 100644
--- a/arch/microblaze/include/asm/shmparam.h
+++ b/arch/microblaze/include/asm/shmparam.h
@@ -1,6 +1 @@
1#ifndef _ASM_MICROBLAZE_SHMPARAM_H #include <asm-generic/shmparam.h>
2#define _ASM_MICROBLAZE_SHMPARAM_H
3
4#define SHMLBA PAGE_SIZE /* attach addr a multiple of this */
5
6#endif /* _ASM_MICROBLAZE_SHMPARAM_H */
diff --git a/arch/microblaze/include/asm/siginfo.h b/arch/microblaze/include/asm/siginfo.h
index f162911a8f50..0815d29d82e5 100644
--- a/arch/microblaze/include/asm/siginfo.h
+++ b/arch/microblaze/include/asm/siginfo.h
@@ -1,15 +1 @@
1/*
2 * Copyright (C) 2006 Atmark Techno, Inc.
3 *
4 * This file is subject to the terms and conditions of the GNU General Public
5 * License. See the file "COPYING" in the main directory of this archive
6 * for more details.
7 */
8
9#ifndef _ASM_MICROBLAZE_SIGINFO_H
10#define _ASM_MICROBLAZE_SIGINFO_H
11
12#include <linux/types.h>
13#include <asm-generic/siginfo.h> #include <asm-generic/siginfo.h>
14
15#endif /* _ASM_MICROBLAZE_SIGINFO_H */
diff --git a/arch/microblaze/include/asm/signal.h b/arch/microblaze/include/asm/signal.h
index 46bc2267d949..7b1573ce19de 100644
--- a/arch/microblaze/include/asm/signal.h
+++ b/arch/microblaze/include/asm/signal.h
@@ -1,165 +1 @@
1/* #include <asm-generic/signal.h>
2 * Copyright (C) 2006 Atmark Techno, Inc.
3 * Yasushi SHOJI <yashi@atmark-techno.com>
4 * Tetsuya OHKAWA <tetsuya@atmark-techno.com>
5 *
6 * This file is subject to the terms and conditions of the GNU General Public
7 * License. See the file "COPYING" in the main directory of this archive
8 * for more details.
9 */
10
11#ifndef _ASM_MICROBLAZE_SIGNAL_H
12#define _ASM_MICROBLAZE_SIGNAL_H
13
14#define SIGHUP 1
15#define SIGINT 2
16#define SIGQUIT 3
17#define SIGILL 4
18#define SIGTRAP 5
19#define SIGABRT 6
20#define SIGIOT 6
21#define SIGBUS 7
22#define SIGFPE 8
23#define SIGKILL 9
24#define SIGUSR1 10
25#define SIGSEGV 11
26#define SIGUSR2 12
27#define SIGPIPE 13
28#define SIGALRM 14
29#define SIGTERM 15
30#define SIGSTKFLT 16
31#define SIGCHLD 17
32#define SIGCONT 18
33#define SIGSTOP 19
34#define SIGTSTP 20
35#define SIGTTIN 21
36#define SIGTTOU 22
37#define SIGURG 23
38#define SIGXCPU 24
39#define SIGXFSZ 25
40#define SIGVTALRM 26
41#define SIGPROF 27
42#define SIGWINCH 28
43#define SIGIO 29
44#define SIGPOLL SIGIO
45/*
46#define SIGLOST 29
47*/
48#define SIGPWR 30
49#define SIGSYS 31
50#define SIGUNUSED 31
51
52/* These should not be considered constants from userland. */
53#define SIGRTMIN 32
54#define SIGRTMAX _NSIG
55
56/*
57 * SA_FLAGS values:
58 *
59 * SA_ONSTACK indicates that a registered stack_t will be used.
60 * SA_RESTART flag to get restarting signals (which were the default long ago)
61 * SA_NOCLDSTOP flag to turn off SIGCHLD when children stop.
62 * SA_RESETHAND clears the handler when the signal is delivered.
63 * SA_NOCLDWAIT flag on SIGCHLD to inhibit zombies.
64 * SA_NODEFER prevents the current signal from being masked in the handler.
65 *
66 * SA_ONESHOT and SA_NOMASK are the historical Linux names for the Single
67 * Unix names RESETHAND and NODEFER respectively.
68 */
69#define SA_NOCLDSTOP 0x00000001
70#define SA_NOCLDWAIT 0x00000002
71#define SA_SIGINFO 0x00000004
72#define SA_ONSTACK 0x08000000
73#define SA_RESTART 0x10000000
74#define SA_NODEFER 0x40000000
75#define SA_RESETHAND 0x80000000
76
77#define SA_NOMASK SA_NODEFER
78#define SA_ONESHOT SA_RESETHAND
79
80#define SA_RESTORER 0x04000000
81
82/*
83 * sigaltstack controls
84 */
85#define SS_ONSTACK 1
86#define SS_DISABLE 2
87
88#define MINSIGSTKSZ 2048
89#define SIGSTKSZ 8192
90
91# ifndef __ASSEMBLY__
92# include <linux/types.h>
93# include <asm-generic/signal-defs.h>
94
95/* Avoid too many header ordering problems. */
96struct siginfo;
97
98# ifdef __KERNEL__
99/*
100 * Most things should be clean enough to redefine this at will, if care
101 * is taken to make libc match.
102 */
103# define _NSIG 64
104# define _NSIG_BPW 32
105# define _NSIG_WORDS (_NSIG / _NSIG_BPW)
106
107typedef unsigned long old_sigset_t; /* at least 32 bits */
108
109typedef struct {
110 unsigned long sig[_NSIG_WORDS];
111} sigset_t;
112
113struct old_sigaction {
114 __sighandler_t sa_handler;
115 old_sigset_t sa_mask;
116 unsigned long sa_flags;
117 void (*sa_restorer)(void);
118};
119
120struct sigaction {
121 __sighandler_t sa_handler;
122 unsigned long sa_flags;
123 void (*sa_restorer)(void);
124 sigset_t sa_mask; /* mask last for extensibility */
125};
126
127struct k_sigaction {
128 struct sigaction sa;
129};
130
131# include <asm/sigcontext.h>
132# undef __HAVE_ARCH_SIG_BITOPS
133
134# define ptrace_signal_deliver(regs, cookie) do { } while (0)
135
136# else /* !__KERNEL__ */
137
138/* Here we must cater to libcs that poke about in kernel headers. */
139
140# define NSIG 32
141typedef unsigned long sigset_t;
142
143struct sigaction {
144 union {
145 __sighandler_t _sa_handler;
146 void (*_sa_sigaction)(int, struct siginfo *, void *);
147 } _u;
148 sigset_t sa_mask;
149 unsigned long sa_flags;
150 void (*sa_restorer)(void);
151};
152
153# define sa_handler _u._sa_handler
154# define sa_sigaction _u._sa_sigaction
155
156# endif /* __KERNEL__ */
157
158typedef struct sigaltstack {
159 void *ss_sp;
160 int ss_flags;
161 size_t ss_size;
162} stack_t;
163
164# endif /* __ASSEMBLY__ */
165#endif /* _ASM_MICROBLAZE_SIGNAL_H */
diff --git a/arch/microblaze/include/asm/socket.h b/arch/microblaze/include/asm/socket.h
index 825936860314..6b71384b9d8b 100644
--- a/arch/microblaze/include/asm/socket.h
+++ b/arch/microblaze/include/asm/socket.h
@@ -1,69 +1 @@
1/* #include <asm-generic/socket.h>
2 * Copyright (C) 2006 Atmark Techno, Inc.
3 *
4 * This file is subject to the terms and conditions of the GNU General Public
5 * License. See the file "COPYING" in the main directory of this archive
6 * for more details.
7 */
8
9#ifndef _ASM_MICROBLAZE_SOCKET_H
10#define _ASM_MICROBLAZE_SOCKET_H
11
12#include <asm/sockios.h>
13
14/* For setsockoptions(2) */
15#define SOL_SOCKET 1
16
17#define SO_DEBUG 1
18#define SO_REUSEADDR 2
19#define SO_TYPE 3
20#define SO_ERROR 4
21#define SO_DONTROUTE 5
22#define SO_BROADCAST 6
23#define SO_SNDBUF 7
24#define SO_RCVBUF 8
25#define SO_SNDBUFFORCE 32
26#define SO_RCVBUFFORCE 33
27#define SO_KEEPALIVE 9
28#define SO_OOBINLINE 10
29#define SO_NO_CHECK 11
30#define SO_PRIORITY 12
31#define SO_LINGER 13
32#define SO_BSDCOMPAT 14
33/* To add :#define SO_REUSEPORT 15 */
34#define SO_PASSCRED 16
35#define SO_PEERCRED 17
36#define SO_RCVLOWAT 18
37#define SO_SNDLOWAT 19
38#define SO_RCVTIMEO 20
39#define SO_SNDTIMEO 21
40
41/* Security levels - as per NRL IPv6 - don't actually do anything */
42#define SO_SECURITY_AUTHENTICATION 22
43#define SO_SECURITY_ENCRYPTION_TRANSPORT 23
44#define SO_SECURITY_ENCRYPTION_NETWORK 24
45
46#define SO_BINDTODEVICE 25
47
48/* Socket filtering */
49#define SO_ATTACH_FILTER 26
50#define SO_DETACH_FILTER 27
51
52#define SO_PEERNAME 28
53#define SO_TIMESTAMP 29
54#define SCM_TIMESTAMP SO_TIMESTAMP
55
56#define SO_ACCEPTCONN 30
57
58#define SO_PEERSEC 31
59#define SO_PASSSEC 34
60
61#define SO_TIMESTAMPNS 35
62#define SCM_TIMESTAMPNS SO_TIMESTAMPNS
63
64#define SO_MARK 36
65
66#define SO_TIMESTAMPING 37
67#define SCM_TIMESTAMPING SO_TIMESTAMPING
68
69#endif /* _ASM_MICROBLAZE_SOCKET_H */
diff --git a/arch/microblaze/include/asm/sockios.h b/arch/microblaze/include/asm/sockios.h
index 9fff57a701e1..def6d4746ee7 100644
--- a/arch/microblaze/include/asm/sockios.h
+++ b/arch/microblaze/include/asm/sockios.h
@@ -1,23 +1 @@
1/* #include <asm-generic/sockios.h>
2 * Copyright (C) 2006 Atmark Techno, Inc.
3 *
4 * This file is subject to the terms and conditions of the GNU General Public
5 * License. See the file "COPYING" in the main directory of this archive
6 * for more details.
7 */
8
9#ifndef _ASM_MICROBLAZE_SOCKIOS_H
10#define _ASM_MICROBLAZE_SOCKIOS_H
11
12#include <linux/ioctl.h>
13
14/* Socket-level I/O control calls. */
15#define FIOSETOWN 0x8901
16#define SIOCSPGRP 0x8902
17#define FIOGETOWN 0x8903
18#define SIOCGPGRP 0x8904
19#define SIOCATMARK 0x8905
20#define SIOCGSTAMP 0x8906 /* Get stamp (timeval) */
21#define SIOCGSTAMPNS 0x8907 /* Get stamp (timespec) */
22
23#endif /* _ASM_MICROBLAZE_SOCKIOS_H */
diff --git a/arch/microblaze/include/asm/stat.h b/arch/microblaze/include/asm/stat.h
index a15f77520bfd..3dc90fa92c70 100644
--- a/arch/microblaze/include/asm/stat.h
+++ b/arch/microblaze/include/asm/stat.h
@@ -1,68 +1 @@
1/* #include <asm-generic/stat.h>
2 * Microblaze stat structure
3 *
4 * Copyright (C) 2001,02,03 NEC Electronics Corporation
5 * Copyright (C) 2001,02,03 Miles Bader <miles@gnu.org>
6 *
7 * This file is subject to the terms and conditions of the GNU General
8 * Public License. See the file COPYING in the main directory of this
9 * archive for more details.
10 *
11 * Written by Miles Bader <miles@gnu.org>
12 */
13
14#ifndef _ASM_MICROBLAZE_STAT_H
15#define _ASM_MICROBLAZE_STAT_H
16
17#include <linux/posix_types.h>
18
19#define STAT_HAVE_NSEC 1
20
21struct stat {
22 unsigned long st_dev;
23 unsigned long st_ino;
24 unsigned int st_mode;
25 unsigned int st_nlink;
26 unsigned int st_uid;
27 unsigned int st_gid;
28 unsigned long st_rdev;
29 unsigned long __pad1;
30 long st_size;
31 int st_blksize;
32 int __pad2;
33 long st_blocks;
34 int st_atime;
35 unsigned int st_atime_nsec;
36 int st_mtime;
37 unsigned int st_mtime_nsec;
38 int st_ctime;
39 unsigned int st_ctime_nsec;
40 unsigned long __unused4;
41 unsigned long __unused5;
42};
43
44struct stat64 {
45 unsigned long long st_dev; /* Device. */
46 unsigned long long st_ino; /* File serial number. */
47 unsigned int st_mode; /* File mode. */
48 unsigned int st_nlink; /* Link count. */
49 unsigned int st_uid; /* User ID of the file's owner. */
50 unsigned int st_gid; /* Group ID of the file's group. */
51 unsigned long long st_rdev; /* Device number, if device. */
52 unsigned long long __pad1;
53 long long st_size; /* Size of file, in bytes. */
54 int st_blksize; /* Optimal block size for I/O. */
55 int __pad2;
56 long long st_blocks; /* Number 512-byte blocks allocated. */
57 int st_atime; /* Time of last access. */
58 unsigned int st_atime_nsec;
59 int st_mtime; /* Time of last modification. */
60 unsigned int st_mtime_nsec;
61 int st_ctime; /* Time of last status change. */
62 unsigned int st_ctime_nsec;
63 unsigned int __unused4;
64 unsigned int __unused5;
65};
66
67#endif /* _ASM_MICROBLAZE_STAT_H */
68
diff --git a/arch/microblaze/include/asm/swab.h b/arch/microblaze/include/asm/swab.h
index b375d7b65ad7..7847e563ab66 100644
--- a/arch/microblaze/include/asm/swab.h
+++ b/arch/microblaze/include/asm/swab.h
@@ -1,8 +1 @@
1#ifndef _ASM_MICROBLAZE_SWAB_H #include <asm-generic/swab.h>
2#define _ASM_MICROBLAZE_SWAB_H
3
4#if defined(__GNUC__) && !defined(__STRICT_ANSI__) || defined(__KERNEL__)
5#define __SWAB_64_THRU_32__
6#endif
7
8#endif /* _ASM_MICROBLAZE_SWAB_H */
diff --git a/arch/microblaze/include/asm/syscalls.h b/arch/microblaze/include/asm/syscalls.h
index ddea9eb31f8d..720761cc741f 100644
--- a/arch/microblaze/include/asm/syscalls.h
+++ b/arch/microblaze/include/asm/syscalls.h
@@ -1,48 +1,8 @@
1#ifndef __ASM_MICROBLAZE_SYSCALLS_H 1#ifndef __ASM_MICROBLAZE_SYSCALLS_H
2#define __ASM_MICROBLAZE_SYSCALLS_H
3#ifdef __KERNEL__
4 2
5#include <linux/compiler.h> 3asmlinkage long sys_clone(int flags, unsigned long stack, struct pt_regs *regs);
6#include <linux/linkage.h> 4#define sys_clone sys_clone
7#include <linux/types.h>
8#include <linux/signal.h>
9 5
10/* FIXME will be removed */ 6#include <asm-generic/syscalls.h>
11asmlinkage int sys_ipc(uint call, int first, int second,
12 int third, void *ptr, long fifth);
13 7
14struct pt_regs;
15asmlinkage int sys_vfork(struct pt_regs *regs);
16asmlinkage int sys_clone(int flags, unsigned long stack, struct pt_regs *regs);
17asmlinkage int sys_execve(char __user *filenamei, char __user *__user *argv,
18 char __user *__user *envp, struct pt_regs *regs);
19
20asmlinkage unsigned long sys_mmap2(unsigned long addr, size_t len,
21 unsigned long prot, unsigned long flags,
22 unsigned long fd, unsigned long pgoff);
23
24asmlinkage unsigned long sys_mmap(unsigned long addr, size_t len,
25 unsigned long prot, unsigned long flags,
26 unsigned long fd, off_t offset);
27
28/* from signal.c */
29asmlinkage int sys_sigsuspend(old_sigset_t mask, struct pt_regs *regs);
30
31asmlinkage int sys_rt_sigsuspend(sigset_t __user *unewset, size_t sigsetsize,
32 struct pt_regs *regs);
33
34asmlinkage int sys_sigaction(int sig, const struct old_sigaction *act,
35 struct old_sigaction *oact);
36
37asmlinkage long sys_rt_sigaction(int sig, const struct sigaction __user *act,
38 struct sigaction __user *oact, size_t sigsetsize);
39
40asmlinkage int sys_sigaltstack(const stack_t __user *uss, stack_t __user *uoss,
41 struct pt_regs *regs);
42
43asmlinkage int sys_sigreturn(struct pt_regs *regs);
44
45asmlinkage int sys_rt_sigreturn(struct pt_regs *regs);
46
47#endif /* __KERNEL__ */
48#endif /* __ASM_MICROBLAZE_SYSCALLS_H */ 8#endif /* __ASM_MICROBLAZE_SYSCALLS_H */
diff --git a/arch/microblaze/include/asm/system.h b/arch/microblaze/include/asm/system.h
index c4e308850b5d..b1ed61590660 100644
--- a/arch/microblaze/include/asm/system.h
+++ b/arch/microblaze/include/asm/system.h
@@ -13,6 +13,9 @@
13#include <asm/setup.h> 13#include <asm/setup.h>
14#include <asm/irqflags.h> 14#include <asm/irqflags.h>
15 15
16#include <asm-generic/cmpxchg.h>
17#include <asm-generic/cmpxchg-local.h>
18
16struct task_struct; 19struct task_struct;
17struct thread_info; 20struct thread_info;
18 21
diff --git a/arch/microblaze/include/asm/termbits.h b/arch/microblaze/include/asm/termbits.h
index a1b64bc4724a..3935b106de79 100644
--- a/arch/microblaze/include/asm/termbits.h
+++ b/arch/microblaze/include/asm/termbits.h
@@ -1,203 +1 @@
1/* #include <asm-generic/termbits.h>
2 * Copyright (C) 2006 Atmark Techno, Inc.
3 *
4 * This file is subject to the terms and conditions of the GNU General Public
5 * License. See the file "COPYING" in the main directory of this archive
6 * for more details.
7 */
8
9#ifndef _ASM_MICROBLAZE_TERMBITS_H
10#define _ASM_MICROBLAZE_TERMBITS_H
11
12#include <linux/posix_types.h>
13
14typedef unsigned char cc_t;
15typedef unsigned int speed_t;
16typedef unsigned int tcflag_t;
17
18#define NCCS 19
19struct termios {
20 tcflag_t c_iflag; /* input mode flags */
21 tcflag_t c_oflag; /* output mode flags */
22 tcflag_t c_cflag; /* control mode flags */
23 tcflag_t c_lflag; /* local mode flags */
24 cc_t c_line; /* line discipline */
25 cc_t c_cc[NCCS]; /* control characters */
26};
27
28struct ktermios {
29 tcflag_t c_iflag; /* input mode flags */
30 tcflag_t c_oflag; /* output mode flags */
31 tcflag_t c_cflag; /* control mode flags */
32 tcflag_t c_lflag; /* local mode flags */
33 cc_t c_line; /* line discipline */
34 cc_t c_cc[NCCS]; /* control characters */
35 speed_t c_ispeed; /* input speed */
36 speed_t c_ospeed; /* output speed */
37};
38
39/* c_cc characters */
40
41#define VINTR 0
42#define VQUIT 1
43#define VERASE 2
44#define VKILL 3
45#define VEOF 4
46#define VTIME 5
47#define VMIN 6
48#define VSWTC 7
49#define VSTART 8
50#define VSTOP 9
51#define VSUSP 10
52#define VEOL 11
53#define VREPRINT 12
54#define VDISCARD 13
55#define VWERASE 14
56#define VLNEXT 15
57#define VEOL2 16
58
59/* c_iflag bits */
60
61#define IGNBRK 0000001
62#define BRKINT 0000002
63#define IGNPAR 0000004
64#define PARMRK 0000010
65#define INPCK 0000020
66#define ISTRIP 0000040
67#define INLCR 0000100
68#define IGNCR 0000200
69#define ICRNL 0000400
70#define IUCLC 0001000
71#define IXON 0002000
72#define IXANY 0004000
73#define IXOFF 0010000
74#define IMAXBEL 0020000
75#define IUTF8 0040000
76
77/* c_oflag bits */
78
79#define OPOST 0000001
80#define OLCUC 0000002
81#define ONLCR 0000004
82#define OCRNL 0000010
83#define ONOCR 0000020
84#define ONLRET 0000040
85#define OFILL 0000100
86#define OFDEL 0000200
87#define NLDLY 0000400
88#define NL0 0000000
89#define NL1 0000400
90#define CRDLY 0003000
91#define CR0 0000000
92#define CR1 0001000
93#define CR2 0002000
94#define CR3 0003000
95#define TABDLY 0014000
96#define TAB0 0000000
97#define TAB1 0004000
98#define TAB2 0010000
99#define TAB3 0014000
100#define XTABS 0014000
101#define BSDLY 0020000
102#define BS0 0000000
103#define BS1 0020000
104#define VTDLY 0040000
105#define VT0 0000000
106#define VT1 0040000
107#define FFDLY 0100000
108#define FF0 0000000
109#define FF1 0100000
110
111/* c_cflag bit meaning */
112
113#define CBAUD 0010017
114#define B0 0000000 /* hang up */
115#define B50 0000001
116#define B75 0000002
117#define B110 0000003
118#define B134 0000004
119#define B150 0000005
120#define B200 0000006
121#define B300 0000007
122#define B600 0000010
123#define B1200 0000011
124#define B1800 0000012
125#define B2400 0000013
126#define B4800 0000014
127#define B9600 0000015
128#define B19200 0000016
129#define B38400 0000017
130#define EXTA B19200
131#define EXTB B38400
132#define CSIZE 0000060
133#define CS5 0000000
134#define CS6 0000020
135#define CS7 0000040
136#define CS8 0000060
137#define CSTOPB 0000100
138#define CREAD 0000200
139#define PARENB 0000400
140#define PARODD 0001000
141#define HUPCL 0002000
142#define CLOCAL 0004000
143#define CBAUDEX 0010000
144#define B57600 0010001
145#define B115200 0010002
146#define B230400 0010003
147#define B460800 0010004
148#define B500000 0010005
149#define B576000 0010006
150#define B921600 0010007
151#define BOTHER 0010000
152#define B1000000 0010010
153#define B1152000 0010011
154#define B1500000 0010012
155#define B2000000 0010013
156#define B2500000 0010014
157#define B3000000 0010015
158#define B3500000 0010016
159#define B4000000 0010017
160#define CIBAUD 002003600000 /* input baud rate (not used) */
161#define CMSPAR 010000000000 /* mark or space (stick) parity */
162#define CRTSCTS 020000000000 /* flow control */
163
164#define IBSHIFT 16 /* Shift from CBAUD to CIBAUD */
165
166/* c_lflag bits */
167
168#define ISIG 0000001
169#define ICANON 0000002
170#define XCASE 0000004
171#define ECHO 0000010
172#define ECHOE 0000020
173#define ECHOK 0000040
174#define ECHONL 0000100
175#define NOFLSH 0000200
176#define TOSTOP 0000400
177#define ECHOCTL 0001000
178#define ECHOPRT 0002000
179#define ECHOKE 0004000
180#define FLUSHO 0010000
181#define PENDIN 0040000
182#define IEXTEN 0100000
183
184/* tcflow() and TCXONC use these */
185
186#define TCOOFF 0
187#define TCOON 1
188#define TCIOFF 2
189#define TCION 3
190
191/* tcflush() and TCFLSH use these */
192
193#define TCIFLUSH 0
194#define TCOFLUSH 1
195#define TCIOFLUSH 2
196
197/* tcsetattr uses these */
198
199#define TCSANOW 0
200#define TCSADRAIN 1
201#define TCSAFLUSH 2
202
203#endif /* _ASM_MICROBLAZE_TERMBITS_H */
diff --git a/arch/microblaze/include/asm/termios.h b/arch/microblaze/include/asm/termios.h
index 47a46d1fbe26..280d78a9d966 100644
--- a/arch/microblaze/include/asm/termios.h
+++ b/arch/microblaze/include/asm/termios.h
@@ -1,88 +1 @@
1/* #include <asm-generic/termios.h>
2 * Copyright (C) 2006 Atmark Techno, Inc.
3 *
4 * This file is subject to the terms and conditions of the GNU General Public
5 * License. See the file "COPYING" in the main directory of this archive
6 * for more details.
7 */
8
9#ifndef _ASM_MICROBLAZE_TERMIOS_H
10#define _ASM_MICROBLAZE_TERMIOS_H
11
12#include <linux/string.h>
13#include <asm/termbits.h>
14#include <asm/ioctls.h>
15
16struct winsize {
17 unsigned short ws_row;
18 unsigned short ws_col;
19 unsigned short ws_xpixel;
20 unsigned short ws_ypixel;
21};
22
23#define NCC 8
24struct termio {
25 unsigned short c_iflag; /* input mode flags */
26 unsigned short c_oflag; /* output mode flags */
27 unsigned short c_cflag; /* control mode flags */
28 unsigned short c_lflag; /* local mode flags */
29 unsigned char c_line; /* line discipline */
30 unsigned char c_cc[NCC]; /* control characters */
31};
32
33#ifdef __KERNEL__
34/* intr=^C quit=^| erase=del kill=^U
35 eof=^D vtime=\0 vmin=\1 sxtc=\0
36 start=^Q stop=^S susp=^Z eol=\0
37 reprint=^R discard=^U werase=^W lnext=^V
38 eol2=\0
39*/
40#define INIT_C_CC "\003\034\177\025\004\0\1\0\021\023\032\0\022\017\027\026\0"
41#endif
42
43/* Modem lines */
44
45#define TIOCM_LE 0x001
46#define TIOCM_DTR 0x002
47#define TIOCM_RTS 0x004
48#define TIOCM_ST 0x008
49#define TIOCM_SR 0x010
50#define TIOCM_CTS 0x020
51#define TIOCM_CAR 0x040
52#define TIOCM_RNG 0x080
53#define TIOCM_DSR 0x100
54#define TIOCM_CD TIOCM_CAR
55#define TIOCM_RI TIOCM_RNG
56#define TIOCM_OUT1 0x2000
57#define TIOCM_OUT2 0x4000
58#define TIOCM_LOOP 0x8000
59
60/* ioctl (fd, TIOCSERGETLSR, &result) where result may be as below */
61
62/* Line disciplines */
63
64#define N_TTY 0
65#define N_SLIP 1
66#define N_MOUSE 2
67#define N_PPP 3
68#define N_STRIP 4
69#define N_AX25 5
70#define N_X25 6 /* X.25 async */
71#define N_6PACK 7
72#define N_MASC 8 /* Reserved for Mobitex module <kaz@cafe.net> */
73#define N_R3964 9 /* Reserved for Simatic R3964 module */
74#define N_PROFIBUS_FDL 10 /* Reserved for Profibus <Dave@mvhi.com> */
75#define N_IRDA 11 /* Linux IR - http://irda.sourceforge.net/ */
76#define N_SMSBLOCK 12 /* SMS block mode - for talking to GSM data cards
77 about SMS messages */
78#define N_HDLC 13 /* synchronous HDLC */
79#define N_SYNC_PPP 14
80#define N_HCI 15 /* Bluetooth HCI UART */
81
82#ifdef __KERNEL__
83
84#include <asm-generic/termios-base.h>
85
86#endif /* __KERNEL__ */
87
88#endif /* _ASM_MICROBLAZE_TERMIOS_H */
diff --git a/arch/microblaze/include/asm/thread_info.h b/arch/microblaze/include/asm/thread_info.h
index 7fac44498445..6e92885d381a 100644
--- a/arch/microblaze/include/asm/thread_info.h
+++ b/arch/microblaze/include/asm/thread_info.h
@@ -75,8 +75,6 @@ struct thread_info {
75 75
76/* 76/*
77 * macros/functions for gaining access to the thread information structure 77 * macros/functions for gaining access to the thread information structure
78 *
79 * preempt_count needs to be 1 initially, until the scheduler is functional.
80 */ 78 */
81#define INIT_THREAD_INFO(tsk) \ 79#define INIT_THREAD_INFO(tsk) \
82{ \ 80{ \
@@ -84,7 +82,7 @@ struct thread_info {
84 .exec_domain = &default_exec_domain, \ 82 .exec_domain = &default_exec_domain, \
85 .flags = 0, \ 83 .flags = 0, \
86 .cpu = 0, \ 84 .cpu = 0, \
87 .preempt_count = 1, \ 85 .preempt_count = INIT_PREEMPT_COUNT, \
88 .addr_limit = KERNEL_DS, \ 86 .addr_limit = KERNEL_DS, \
89 .restart_block = { \ 87 .restart_block = { \
90 .fn = do_no_restart_syscall, \ 88 .fn = do_no_restart_syscall, \
diff --git a/arch/microblaze/include/asm/timex.h b/arch/microblaze/include/asm/timex.h
index 678525dc6d0b..befcf3de5532 100644
--- a/arch/microblaze/include/asm/timex.h
+++ b/arch/microblaze/include/asm/timex.h
@@ -9,10 +9,8 @@
9#ifndef _ASM_MICROBLAZE_TIMEX_H 9#ifndef _ASM_MICROBLAZE_TIMEX_H
10#define _ASM_MICROBLAZE_TIMEX_H 10#define _ASM_MICROBLAZE_TIMEX_H
11 11
12#define CLOCK_TICK_RATE 1000 /* Timer input freq. */ 12#include <asm-generic/timex.h>
13
14typedef unsigned long cycles_t;
15 13
16#define get_cycles() (0) 14#define CLOCK_TICK_RATE 1000 /* Timer input freq. */
17 15
18#endif /* _ASM_TIMEX_H */ 16#endif /* _ASM_TIMEX_H */
diff --git a/arch/microblaze/include/asm/types.h b/arch/microblaze/include/asm/types.h
index bebc018318f5..b9e79bc580dd 100644
--- a/arch/microblaze/include/asm/types.h
+++ b/arch/microblaze/include/asm/types.h
@@ -1,38 +1 @@
1/* #include <asm-generic/types.h>
2 * Copyright (C) Atmark Techno, Inc.
3 *
4 * This file is subject to the terms and conditions of the GNU General Public
5 * License. See the file "COPYING" in the main directory of this archive
6 * for more details.
7 */
8
9#ifndef _ASM_MICROBLAZE_TYPES_H
10#define _ASM_MICROBLAZE_TYPES_H
11
12/*
13 * This file is never included by application software unless
14 * explicitly requested (e.g., via linux/types.h) in which case the
15 * application is Linux specific so (user-) name space pollution is
16 * not a major issue. However, for interoperability, libraries still
17 * need to be careful to avoid a name clashes.
18 */
19
20#include <asm-generic/int-ll64.h>
21
22# ifndef __ASSEMBLY__
23
24typedef unsigned short umode_t;
25
26/*
27 * These aren't exported outside the kernel to avoid name space clashes
28 */
29# ifdef __KERNEL__
30# define BITS_PER_LONG 32
31
32/* Dma addresses are 32-bits wide. */
33
34typedef u32 dma_addr_t;
35
36# endif/* __KERNEL__ */
37# endif /* __ASSEMBLY__ */
38#endif /* _ASM_MICROBLAZE_TYPES_H */
diff --git a/arch/microblaze/include/asm/ucontext.h b/arch/microblaze/include/asm/ucontext.h
index 11f6bb3ae3a4..9bc07b9f30fb 100644
--- a/arch/microblaze/include/asm/ucontext.h
+++ b/arch/microblaze/include/asm/ucontext.h
@@ -1,22 +1 @@
1/* #include <asm-generic/ucontext.h>
2 * Copyright (C) 2006 Atmark Techno, Inc.
3 *
4 * This file is subject to the terms and conditions of the GNU General Public
5 * License. See the file "COPYING" in the main directory of this archive
6 * for more details.
7 */
8
9#ifndef _ASM_MICROBLAZE_UCONTEXT_H
10#define _ASM_MICROBLAZE_UCONTEXT_H
11
12#include <asm/sigcontext.h>
13
14struct ucontext {
15 unsigned long uc_flags;
16 struct ucontext *uc_link;
17 stack_t uc_stack;
18 struct sigcontext uc_mcontext;
19 sigset_t uc_sigmask; /* mask last for extensibility */
20};
21
22#endif /* _ASM_MICROBLAZE_UCONTEXT_H */
diff --git a/arch/microblaze/include/asm/unistd.h b/arch/microblaze/include/asm/unistd.h
index b5e2f5fa5c53..0b852327c0e7 100644
--- a/arch/microblaze/include/asm/unistd.h
+++ b/arch/microblaze/include/asm/unistd.h
@@ -380,8 +380,10 @@
380#define __NR_accept04 362 /* new */ 380#define __NR_accept04 362 /* new */
381#define __NR_preadv 363 /* new */ 381#define __NR_preadv 363 /* new */
382#define __NR_pwritev 364 /* new */ 382#define __NR_pwritev 364 /* new */
383#define __NR_rt_tgsigqueueinfo 365 /* new */
384#define __NR_perf_counter_open 366 /* new */
383 385
384#define __NR_syscalls 365 386#define __NR_syscalls 367
385 387
386#ifdef __KERNEL__ 388#ifdef __KERNEL__
387#ifndef __ASSEMBLY__ 389#ifndef __ASSEMBLY__
@@ -408,7 +410,7 @@
408#define __ARCH_WANT_SYS_SIGPENDING 410#define __ARCH_WANT_SYS_SIGPENDING
409#define __ARCH_WANT_SYS_SIGPROCMASK 411#define __ARCH_WANT_SYS_SIGPROCMASK
410#define __ARCH_WANT_SYS_RT_SIGACTION 412#define __ARCH_WANT_SYS_RT_SIGACTION
411/* #define __ARCH_WANT_SYS_RT_SIGSUSPEND */ 413#define __ARCH_WANT_SYS_RT_SIGSUSPEND
412 414
413/* 415/*
414 * "Conditional" syscalls 416 * "Conditional" syscalls
diff --git a/arch/microblaze/include/asm/vga.h b/arch/microblaze/include/asm/vga.h
index 8b137891791f..89d82fd8fcf1 100644
--- a/arch/microblaze/include/asm/vga.h
+++ b/arch/microblaze/include/asm/vga.h
@@ -1 +1 @@
#include <asm-generic/vga.h>
diff --git a/arch/microblaze/kernel/entry-nommu.S b/arch/microblaze/kernel/entry-nommu.S
index 1fce6b803f54..9083d85376a4 100644
--- a/arch/microblaze/kernel/entry-nommu.S
+++ b/arch/microblaze/kernel/entry-nommu.S
@@ -551,30 +551,22 @@ no_work_pending:
551 rtid r14, 0 551 rtid r14, 0
552 nop 552 nop
553 553
554sys_vfork_wrapper: 554sys_vfork:
555 brid sys_vfork 555 brid microblaze_vfork
556 addk r5, r1, r0 556 addk r5, r1, r0
557 557
558sys_clone_wrapper: 558sys_clone:
559 brid sys_clone 559 brid microblaze_clone
560 addk r7, r1, r0 560 addk r7, r1, r0
561 561
562sys_execve_wrapper: 562sys_execve:
563 brid sys_execve 563 brid microblaze_execve
564 addk r8, r1, r0 564 addk r8, r1, r0
565 565
566sys_sigreturn_wrapper:
567 brid sys_sigreturn
568 addk r5, r1, r0
569
570sys_rt_sigreturn_wrapper: 566sys_rt_sigreturn_wrapper:
571 brid sys_rt_sigreturn 567 brid sys_rt_sigreturn
572 addk r5, r1, r0 568 addk r5, r1, r0
573 569
574sys_sigsuspend_wrapper:
575 brid sys_rt_sigsuspend
576 addk r6, r1, r0
577
578sys_rt_sigsuspend_wrapper: 570sys_rt_sigsuspend_wrapper:
579 brid sys_rt_sigsuspend 571 brid sys_rt_sigsuspend
580 addk r7, r1, r0 572 addk r7, r1, r0
diff --git a/arch/microblaze/kernel/entry.S b/arch/microblaze/kernel/entry.S
index 91a0e7b185dd..c7353e79f4a2 100644
--- a/arch/microblaze/kernel/entry.S
+++ b/arch/microblaze/kernel/entry.S
@@ -429,12 +429,11 @@ C_ENTRY(ret_from_fork):
429 brid ret_from_trap; /* Do normal trap return */ 429 brid ret_from_trap; /* Do normal trap return */
430 nop; 430 nop;
431 431
432C_ENTRY(sys_vfork_wrapper): 432C_ENTRY(sys_vfork):
433 brid microblaze_vfork /* Do real work (tail-call) */
433 la r5, r1, PTO 434 la r5, r1, PTO
434 brid sys_vfork /* Do real work (tail-call) */
435 nop
436 435
437C_ENTRY(sys_clone_wrapper): 436C_ENTRY(sys_clone):
438 bnei r6, 1f; /* See if child SP arg (arg 1) is 0. */ 437 bnei r6, 1f; /* See if child SP arg (arg 1) is 0. */
439 lwi r6, r1, PTO+PT_R1; /* If so, use paret's stack ptr */ 438 lwi r6, r1, PTO+PT_R1; /* If so, use paret's stack ptr */
4401: la r7, r1, PTO; /* Arg 2: parent context */ 4391: la r7, r1, PTO; /* Arg 2: parent context */
@@ -444,20 +443,9 @@ C_ENTRY(sys_clone_wrapper):
444 brid do_fork /* Do real work (tail-call) */ 443 brid do_fork /* Do real work (tail-call) */
445 nop; 444 nop;
446 445
447C_ENTRY(sys_execve_wrapper): 446C_ENTRY(sys_execve):
448 la r8, r1, PTO; /* add user context as 4th arg */ 447 la r8, r1, PTO; /* add user context as 4th arg */
449 brid sys_execve; /* Do real work (tail-call).*/ 448 brid microblaze_execve; /* Do real work (tail-call).*/
450 nop;
451
452C_ENTRY(sys_sigsuspend_wrapper):
453 swi r3, r1, PTO+PT_R3; /* restore saved r3, r4 registers */
454 swi r4, r1, PTO+PT_R4;
455 la r6, r1, PTO; /* add user context as 2nd arg */
456 bralid r15, sys_sigsuspend; /* Do real work.*/
457 nop;
458 lwi r3, r1, PTO+PT_R3; /* restore saved r3, r4 registers */
459 lwi r4, r1, PTO+PT_R4;
460 bri ret_from_trap /* fall through will not work here due to align */
461 nop; 449 nop;
462 450
463C_ENTRY(sys_rt_sigsuspend_wrapper): 451C_ENTRY(sys_rt_sigsuspend_wrapper):
@@ -471,18 +459,6 @@ C_ENTRY(sys_rt_sigsuspend_wrapper):
471 bri ret_from_trap /* fall through will not work here due to align */ 459 bri ret_from_trap /* fall through will not work here due to align */
472 nop; 460 nop;
473 461
474
475C_ENTRY(sys_sigreturn_wrapper):
476 swi r3, r1, PTO+PT_R3; /* restore saved r3, r4 registers */
477 swi r4, r1, PTO+PT_R4;
478 la r5, r1, PTO; /* add user context as 1st arg */
479 brlid r15, sys_sigreturn; /* Do real work.*/
480 nop;
481 lwi r3, r1, PTO+PT_R3; /* restore saved r3, r4 registers */
482 lwi r4, r1, PTO+PT_R4;
483 bri ret_from_trap /* fall through will not work here due to align */
484 nop;
485
486C_ENTRY(sys_rt_sigreturn_wrapper): 462C_ENTRY(sys_rt_sigreturn_wrapper):
487 swi r3, r1, PTO+PT_R3; /* restore saved r3, r4 registers */ 463 swi r3, r1, PTO+PT_R3; /* restore saved r3, r4 registers */
488 swi r4, r1, PTO+PT_R4; 464 swi r4, r1, PTO+PT_R4;
diff --git a/arch/microblaze/kernel/ptrace.c b/arch/microblaze/kernel/ptrace.c
index b86aa623e36d..53ff39af6a5c 100644
--- a/arch/microblaze/kernel/ptrace.c
+++ b/arch/microblaze/kernel/ptrace.c
@@ -27,7 +27,6 @@
27#include <linux/kernel.h> 27#include <linux/kernel.h>
28#include <linux/mm.h> 28#include <linux/mm.h>
29#include <linux/sched.h> 29#include <linux/sched.h>
30#include <linux/smp_lock.h>
31#include <linux/ptrace.h> 30#include <linux/ptrace.h>
32#include <linux/signal.h> 31#include <linux/signal.h>
33 32
diff --git a/arch/microblaze/kernel/signal.c b/arch/microblaze/kernel/signal.c
index 4c0e6521b114..1c80e4fc40ce 100644
--- a/arch/microblaze/kernel/signal.c
+++ b/arch/microblaze/kernel/signal.c
@@ -21,7 +21,6 @@
21#include <linux/sched.h> 21#include <linux/sched.h>
22#include <linux/mm.h> 22#include <linux/mm.h>
23#include <linux/smp.h> 23#include <linux/smp.h>
24#include <linux/smp_lock.h>
25#include <linux/kernel.h> 24#include <linux/kernel.h>
26#include <linux/signal.h> 25#include <linux/signal.h>
27#include <linux/errno.h> 26#include <linux/errno.h>
@@ -45,91 +44,8 @@
45 44
46asmlinkage int do_signal(struct pt_regs *regs, sigset_t *oldset, int in_sycall); 45asmlinkage int do_signal(struct pt_regs *regs, sigset_t *oldset, int in_sycall);
47 46
48/*
49 * Atomically swap in the new signal mask, and wait for a signal.
50 */
51asmlinkage int
52sys_sigsuspend(old_sigset_t mask, struct pt_regs *regs)
53{
54 sigset_t saveset;
55
56 mask &= _BLOCKABLE;
57 spin_lock_irq(&current->sighand->siglock);
58 saveset = current->blocked;
59 siginitset(&current->blocked, mask);
60 recalc_sigpending();
61 spin_unlock_irq(&current->sighand->siglock);
62
63 regs->r3 = -EINTR;
64 while (1) {
65 current->state = TASK_INTERRUPTIBLE;
66 schedule();
67 if (do_signal(regs, &saveset, 1))
68 return -EINTR;
69 }
70}
71
72asmlinkage int
73sys_rt_sigsuspend(sigset_t __user *unewset, size_t sigsetsize,
74 struct pt_regs *regs)
75{
76 sigset_t saveset, newset;
77
78 /* XXX: Don't preclude handling different sized sigset_t's. */
79 if (sigsetsize != sizeof(sigset_t))
80 return -EINVAL;
81
82 if (copy_from_user(&newset, unewset, sizeof(newset)))
83 return -EFAULT;
84 sigdelsetmask(&newset, ~_BLOCKABLE);
85 spin_lock_irq(&current->sighand->siglock);
86 saveset = current->blocked;
87 current->blocked = newset;
88 recalc_sigpending();
89 spin_unlock_irq(&current->sighand->siglock);
90
91 regs->r3 = -EINTR;
92 while (1) {
93 current->state = TASK_INTERRUPTIBLE;
94 schedule();
95 if (do_signal(regs, &saveset, 1))
96 return -EINTR;
97 }
98}
99
100asmlinkage int
101sys_sigaction(int sig, const struct old_sigaction *act,
102 struct old_sigaction *oact)
103{
104 struct k_sigaction new_ka, old_ka;
105 int ret;
106
107 if (act) {
108 old_sigset_t mask;
109 if (!access_ok(VERIFY_READ, act, sizeof(*act)) ||
110 __get_user(new_ka.sa.sa_handler, &act->sa_handler) ||
111 __get_user(new_ka.sa.sa_restorer, &act->sa_restorer))
112 return -EFAULT;
113 __get_user(new_ka.sa.sa_flags, &act->sa_flags);
114 __get_user(mask, &act->sa_mask);
115 siginitset(&new_ka.sa.sa_mask, mask);
116 }
117 47
118 ret = do_sigaction(sig, act ? &new_ka : NULL, oact ? &old_ka : NULL); 48asmlinkage long
119
120 if (!ret && oact) {
121 if (!access_ok(VERIFY_WRITE, oact, sizeof(*oact)) ||
122 __put_user(old_ka.sa.sa_handler, &oact->sa_handler) ||
123 __put_user(old_ka.sa.sa_restorer, &oact->sa_restorer))
124 return -EFAULT;
125 __put_user(old_ka.sa.sa_flags, &oact->sa_flags);
126 __put_user(old_ka.sa.sa_mask.sig[0], &oact->sa_mask);
127 }
128
129 return ret;
130}
131
132asmlinkage int
133sys_sigaltstack(const stack_t __user *uss, stack_t __user *uoss, 49sys_sigaltstack(const stack_t __user *uss, stack_t __user *uoss,
134 struct pt_regs *regs) 50 struct pt_regs *regs)
135{ 51{
@@ -139,7 +55,6 @@ sys_sigaltstack(const stack_t __user *uss, stack_t __user *uoss,
139/* 55/*
140 * Do a signal return; undo the signal stack. 56 * Do a signal return; undo the signal stack.
141 */ 57 */
142
143struct sigframe { 58struct sigframe {
144 struct sigcontext sc; 59 struct sigcontext sc;
145 unsigned long extramask[_NSIG_WORDS-1]; 60 unsigned long extramask[_NSIG_WORDS-1];
@@ -176,40 +91,7 @@ static int restore_sigcontext(struct pt_regs *regs,
176 return err; 91 return err;
177} 92}
178 93
179asmlinkage int sys_sigreturn(struct pt_regs *regs) 94asmlinkage long sys_rt_sigreturn(struct pt_regs *regs)
180{
181 struct sigframe *frame =
182 (struct sigframe *)(regs->r1 + STATE_SAVE_ARG_SPACE);
183
184 sigset_t set;
185 int rval;
186
187 if (!access_ok(VERIFY_READ, frame, sizeof(*frame)))
188 goto badframe;
189
190 if (__get_user(set.sig[0], &frame->sc.oldmask)
191 || (_NSIG_WORDS > 1
192 && __copy_from_user(&set.sig[1], &frame->extramask,
193 sizeof(frame->extramask))))
194 goto badframe;
195
196 sigdelsetmask(&set, ~_BLOCKABLE);
197
198 spin_lock_irq(&current->sighand->siglock);
199 current->blocked = set;
200 recalc_sigpending();
201 spin_unlock_irq(&current->sighand->siglock);
202
203 if (restore_sigcontext(regs, &frame->sc, &rval))
204 goto badframe;
205 return rval;
206
207badframe:
208 force_sig(SIGSEGV, current);
209 return 0;
210}
211
212asmlinkage int sys_rt_sigreturn(struct pt_regs *regs)
213{ 95{
214 struct rt_sigframe __user *frame = 96 struct rt_sigframe __user *frame =
215 (struct rt_sigframe __user *)(regs->r1 + STATE_SAVE_ARG_SPACE); 97 (struct rt_sigframe __user *)(regs->r1 + STATE_SAVE_ARG_SPACE);
@@ -324,21 +206,17 @@ static void setup_rt_frame(int sig, struct k_sigaction *ka, siginfo_t *info,
324 /* Set up to return from userspace. If provided, use a stub 206 /* Set up to return from userspace. If provided, use a stub
325 already in userspace. */ 207 already in userspace. */
326 /* minus 8 is offset to cater for "rtsd r15,8" */ 208 /* minus 8 is offset to cater for "rtsd r15,8" */
327 if (ka->sa.sa_flags & SA_RESTORER) { 209 /* addi r12, r0, __NR_sigreturn */
328 regs->r15 = ((unsigned long)ka->sa.sa_restorer)-8; 210 err |= __put_user(0x31800000 | __NR_rt_sigreturn ,
329 } else { 211 frame->tramp + 0);
330 /* addi r12, r0, __NR_sigreturn */ 212 /* brki r14, 0x8 */
331 err |= __put_user(0x31800000 | __NR_rt_sigreturn , 213 err |= __put_user(0xb9cc0008, frame->tramp + 1);
332 frame->tramp + 0); 214
333 /* brki r14, 0x8 */ 215 /* Return from sighandler will jump to the tramp.
334 err |= __put_user(0xb9cc0008, frame->tramp + 1); 216 Negative 8 offset because return is rtsd r15, 8 */
335 217 regs->r15 = ((unsigned long)frame->tramp)-8;
336 /* Return from sighandler will jump to the tramp. 218
337 Negative 8 offset because return is rtsd r15, 8 */ 219 __invalidate_cache_sigtramp((unsigned long)frame->tramp);
338 regs->r15 = ((unsigned long)frame->tramp)-8;
339
340 __invalidate_cache_sigtramp((unsigned long)frame->tramp);
341 }
342 220
343 if (err) 221 if (err)
344 goto give_sigsegv; 222 goto give_sigsegv;
@@ -405,7 +283,7 @@ do_restart:
405 * OK, we're invoking a handler 283 * OK, we're invoking a handler
406 */ 284 */
407 285
408static void 286static int
409handle_signal(unsigned long sig, struct k_sigaction *ka, 287handle_signal(unsigned long sig, struct k_sigaction *ka,
410 siginfo_t *info, sigset_t *oldset, struct pt_regs *regs) 288 siginfo_t *info, sigset_t *oldset, struct pt_regs *regs)
411{ 289{
@@ -426,6 +304,7 @@ handle_signal(unsigned long sig, struct k_sigaction *ka,
426 recalc_sigpending(); 304 recalc_sigpending();
427 spin_unlock_irq(&current->sighand->siglock); 305 spin_unlock_irq(&current->sighand->siglock);
428 } 306 }
307 return 1;
429} 308}
430 309
431/* 310/*
@@ -456,7 +335,9 @@ int do_signal(struct pt_regs *regs, sigset_t *oldset, int in_syscall)
456 if (kernel_mode(regs)) 335 if (kernel_mode(regs))
457 return 1; 336 return 1;
458 337
459 if (!oldset) 338 if (current_thread_info()->status & TS_RESTORE_SIGMASK)
339 oldset = &current->saved_sigmask;
340 else
460 oldset = &current->blocked; 341 oldset = &current->blocked;
461 342
462 signr = get_signal_to_deliver(&info, &ka, regs, NULL); 343 signr = get_signal_to_deliver(&info, &ka, regs, NULL);
@@ -464,13 +345,31 @@ int do_signal(struct pt_regs *regs, sigset_t *oldset, int in_syscall)
464 /* Whee! Actually deliver the signal. */ 345 /* Whee! Actually deliver the signal. */
465 if (in_syscall) 346 if (in_syscall)
466 handle_restart(regs, &ka, 1); 347 handle_restart(regs, &ka, 1);
467 handle_signal(signr, &ka, &info, oldset, regs); 348 if (handle_signal(signr, &ka, &info, oldset, regs)) {
349 /*
350 * A signal was successfully delivered; the saved
351 * sigmask will have been stored in the signal frame,
352 * and will be restored by sigreturn, so we can simply
353 * clear the TS_RESTORE_SIGMASK flag.
354 */
355 current_thread_info()->status &=
356 ~TS_RESTORE_SIGMASK;
357 }
468 return 1; 358 return 1;
469 } 359 }
470 360
471 if (in_syscall) 361 if (in_syscall)
472 handle_restart(regs, NULL, 0); 362 handle_restart(regs, NULL, 0);
473 363
364 /*
365 * If there's no signal to deliver, we just put the saved sigmask
366 * back.
367 */
368 if (current_thread_info()->status & TS_RESTORE_SIGMASK) {
369 current_thread_info()->status &= ~TS_RESTORE_SIGMASK;
370 sigprocmask(SIG_SETMASK, &current->saved_sigmask, NULL);
371 }
372
474 /* Did we come from a system call? */ 373 /* Did we come from a system call? */
475 return 0; 374 return 0;
476} 375}
diff --git a/arch/microblaze/kernel/sys_microblaze.c b/arch/microblaze/kernel/sys_microblaze.c
index 31905ff590b7..e000bce09b2b 100644
--- a/arch/microblaze/kernel/sys_microblaze.c
+++ b/arch/microblaze/kernel/sys_microblaze.c
@@ -15,7 +15,6 @@
15#include <linux/errno.h> 15#include <linux/errno.h>
16#include <linux/mm.h> 16#include <linux/mm.h>
17#include <linux/smp.h> 17#include <linux/smp.h>
18#include <linux/smp_lock.h>
19#include <linux/syscalls.h> 18#include <linux/syscalls.h>
20#include <linux/sem.h> 19#include <linux/sem.h>
21#include <linux/msg.h> 20#include <linux/msg.h>
@@ -39,7 +38,7 @@
39 * 38 *
40 * This is really horribly ugly. This will be remove with new toolchain. 39 * This is really horribly ugly. This will be remove with new toolchain.
41 */ 40 */
42asmlinkage int 41asmlinkage long
43sys_ipc(uint call, int first, int second, int third, void *ptr, long fifth) 42sys_ipc(uint call, int first, int second, int third, void *ptr, long fifth)
44{ 43{
45 int version, ret; 44 int version, ret;
@@ -134,20 +133,20 @@ sys_ipc(uint call, int first, int second, int third, void *ptr, long fifth)
134 return ret; 133 return ret;
135} 134}
136 135
137asmlinkage int sys_vfork(struct pt_regs *regs) 136asmlinkage long microblaze_vfork(struct pt_regs *regs)
138{ 137{
139 return do_fork(CLONE_VFORK | CLONE_VM | SIGCHLD, regs->r1, 138 return do_fork(CLONE_VFORK | CLONE_VM | SIGCHLD, regs->r1,
140 regs, 0, NULL, NULL); 139 regs, 0, NULL, NULL);
141} 140}
142 141
143asmlinkage int sys_clone(int flags, unsigned long stack, struct pt_regs *regs) 142asmlinkage long microblaze_clone(int flags, unsigned long stack, struct pt_regs *regs)
144{ 143{
145 if (!stack) 144 if (!stack)
146 stack = regs->r1; 145 stack = regs->r1;
147 return do_fork(flags, stack, regs, 0, NULL, NULL); 146 return do_fork(flags, stack, regs, 0, NULL, NULL);
148} 147}
149 148
150asmlinkage int sys_execve(char __user *filenamei, char __user *__user *argv, 149asmlinkage long microblaze_execve(char __user *filenamei, char __user *__user *argv,
151 char __user *__user *envp, struct pt_regs *regs) 150 char __user *__user *envp, struct pt_regs *regs)
152{ 151{
153 int error; 152 int error;
@@ -163,8 +162,8 @@ out:
163 return error; 162 return error;
164} 163}
165 164
166asmlinkage unsigned long 165asmlinkage long
167sys_mmap2(unsigned long addr, size_t len, 166sys_mmap2(unsigned long addr, unsigned long len,
168 unsigned long prot, unsigned long flags, 167 unsigned long prot, unsigned long flags,
169 unsigned long fd, unsigned long pgoff) 168 unsigned long fd, unsigned long pgoff)
170{ 169{
@@ -189,18 +188,18 @@ out:
189 return ret; 188 return ret;
190} 189}
191 190
192asmlinkage unsigned long sys_mmap(unsigned long addr, size_t len, 191asmlinkage long sys_mmap(unsigned long addr, unsigned long len,
193 unsigned long prot, unsigned long flags, 192 unsigned long prot, unsigned long flags,
194 unsigned long fd, off_t offset) 193 unsigned long fd, off_t pgoff)
195{ 194{
196 int err = -EINVAL; 195 int err = -EINVAL;
197 196
198 if (offset & ~PAGE_MASK) { 197 if (pgoff & ~PAGE_MASK) {
199 printk(KERN_INFO "no pagemask in mmap\r\n"); 198 printk(KERN_INFO "no pagemask in mmap\r\n");
200 goto out; 199 goto out;
201 } 200 }
202 201
203 err = sys_mmap2(addr, len, prot, flags, fd, offset >> PAGE_SHIFT); 202 err = sys_mmap2(addr, len, prot, flags, fd, pgoff >> PAGE_SHIFT);
204out: 203out:
205 return err; 204 return err;
206} 205}
diff --git a/arch/microblaze/kernel/syscall_table.S b/arch/microblaze/kernel/syscall_table.S
index 376d1789f7c0..31b32a6c5f4e 100644
--- a/arch/microblaze/kernel/syscall_table.S
+++ b/arch/microblaze/kernel/syscall_table.S
@@ -15,7 +15,7 @@ ENTRY(sys_call_table)
15 .long sys_creat 15 .long sys_creat
16 .long sys_link 16 .long sys_link
17 .long sys_unlink /* 10 */ 17 .long sys_unlink /* 10 */
18 .long sys_execve_wrapper 18 .long sys_execve
19 .long sys_chdir 19 .long sys_chdir
20 .long sys_time 20 .long sys_time
21 .long sys_mknod 21 .long sys_mknod
@@ -71,12 +71,12 @@ ENTRY(sys_call_table)
71 .long sys_getppid 71 .long sys_getppid
72 .long sys_getpgrp /* 65 */ 72 .long sys_getpgrp /* 65 */
73 .long sys_setsid 73 .long sys_setsid
74 .long sys_sigaction 74 .long sys_ni_syscall /* sys_sigaction */
75 .long sys_sgetmask 75 .long sys_sgetmask
76 .long sys_ssetmask 76 .long sys_ssetmask
77 .long sys_setreuid /* 70 */ 77 .long sys_setreuid /* 70 */
78 .long sys_setregid 78 .long sys_setregid
79 .long sys_sigsuspend_wrapper 79 .long sys_ni_syscall /* sys_sigsuspend_wrapper */
80 .long sys_sigpending 80 .long sys_sigpending
81 .long sys_sethostname 81 .long sys_sethostname
82 .long sys_setrlimit /* 75 */ 82 .long sys_setrlimit /* 75 */
@@ -123,8 +123,8 @@ ENTRY(sys_call_table)
123 .long sys_sysinfo 123 .long sys_sysinfo
124 .long sys_ipc 124 .long sys_ipc
125 .long sys_fsync 125 .long sys_fsync
126 .long sys_sigreturn_wrapper 126 .long sys_ni_syscall /* sys_sigreturn_wrapper */
127 .long sys_clone_wrapper /* 120 */ 127 .long sys_clone /* 120 */
128 .long sys_setdomainname 128 .long sys_setdomainname
129 .long sys_newuname 129 .long sys_newuname
130 .long sys_ni_syscall /* modify_ldt */ 130 .long sys_ni_syscall /* modify_ldt */
@@ -194,7 +194,7 @@ ENTRY(sys_call_table)
194 .long sys_sendfile 194 .long sys_sendfile
195 .long sys_ni_syscall /* reserved for streams1 */ 195 .long sys_ni_syscall /* reserved for streams1 */
196 .long sys_ni_syscall /* reserved for streams2 */ 196 .long sys_ni_syscall /* reserved for streams2 */
197 .long sys_vfork_wrapper /* 190 */ 197 .long sys_vfork /* 190 */
198 .long sys_getrlimit 198 .long sys_getrlimit
199 .long sys_mmap2 /* mmap2 */ 199 .long sys_mmap2 /* mmap2 */
200 .long sys_truncate64 200 .long sys_truncate64
@@ -369,3 +369,5 @@ ENTRY(sys_call_table)
369 .long sys_ni_syscall 369 .long sys_ni_syscall
370 .long sys_ni_syscall 370 .long sys_ni_syscall
371 .long sys_ni_syscall 371 .long sys_ni_syscall
372 .long sys_rt_tgsigqueueinfo /* 365 */
373 .long sys_perf_counter_open
diff --git a/arch/microblaze/lib/Makefile b/arch/microblaze/lib/Makefile
index 71c8cb6c9e43..b579db068c06 100644
--- a/arch/microblaze/lib/Makefile
+++ b/arch/microblaze/lib/Makefile
@@ -2,7 +2,7 @@
2# Makefile 2# Makefile
3# 3#
4 4
5lib-y := memset.o checksum.o 5lib-y := memset.o
6 6
7ifeq ($(CONFIG_OPT_LIB_ASM),y) 7ifeq ($(CONFIG_OPT_LIB_ASM),y)
8lib-y += fastcopy.o 8lib-y += fastcopy.o
diff --git a/arch/microblaze/lib/checksum.c b/arch/microblaze/lib/checksum.c
deleted file mode 100644
index f08e74591418..000000000000
--- a/arch/microblaze/lib/checksum.c
+++ /dev/null
@@ -1,172 +0,0 @@
1/*
2 *
3 * INET An implementation of the TCP/IP protocol suite for the LINUX
4 * operating system. INET is implemented using the BSD Socket
5 * interface as the means of communication with the user level.
6 *
7 * IP/TCP/UDP checksumming routines
8 *
9 * Authors: Jorge Cwik, <jorge@laser.satlink.net>
10 * Arnt Gulbrandsen, <agulbra@nvg.unit.no>
11 * Tom May, <ftom@netcom.com>
12 * Andreas Schwab, <schwab@issan.informatik.uni-dortmund.de>
13 * Lots of code moved from tcp.c and ip.c; see those files
14 * for more names.
15 *
16 * 03/02/96 Jes Sorensen, Andreas Schwab, Roman Hodek:
17 * Fixed some nasty bugs, causing some horrible crashes.
18 * A: At some points, the sum (%0) was used as
19 * length-counter instead of the length counter
20 * (%1). Thanks to Roman Hodek for pointing this out.
21 * B: GCC seems to mess up if one uses too many
22 * data-registers to hold input values and one tries to
23 * specify d0 and d1 as scratch registers. Letting gcc
24 * choose these registers itself solves the problem.
25 *
26 * This program is free software; you can redistribute it and/or
27 * modify it under the terms of the GNU General Public License
28 * as published by the Free Software Foundation; either version
29 * 2 of the License, or (at your option) any later version.
30 */
31
32/* Revised by Kenneth Albanowski for m68knommu. Basic problem: unaligned access
33 kills, so most of the assembly has to go. */
34
35#include <linux/module.h>
36#include <net/checksum.h>
37
38#include <asm/byteorder.h>
39
40static inline unsigned short from32to16(unsigned long x)
41{
42 /* add up 16-bit and 16-bit for 16+c bit */
43 x = (x & 0xffff) + (x >> 16);
44 /* add up carry.. */
45 x = (x & 0xffff) + (x >> 16);
46 return x;
47}
48
49static unsigned int do_csum(const unsigned char *buff, int len)
50{
51 int odd, count;
52 unsigned long result = 0;
53
54 if (len <= 0)
55 goto out;
56 odd = 1 & (unsigned long) buff;
57 if (odd) {
58 result = *buff;
59 len--;
60 buff++;
61 }
62 count = len >> 1; /* nr of 16-bit words.. */
63 if (count) {
64 if (2 & (unsigned long) buff) {
65 result += *(unsigned short *) buff;
66 count--;
67 len -= 2;
68 buff += 2;
69 }
70 count >>= 1; /* nr of 32-bit words.. */
71 if (count) {
72 unsigned long carry = 0;
73 do {
74 unsigned long w = *(unsigned long *) buff;
75 count--;
76 buff += 4;
77 result += carry;
78 result += w;
79 carry = (w > result);
80 } while (count);
81 result += carry;
82 result = (result & 0xffff) + (result >> 16);
83 }
84 if (len & 2) {
85 result += *(unsigned short *) buff;
86 buff += 2;
87 }
88 }
89 if (len & 1)
90 result += (*buff << 8);
91 result = from32to16(result);
92 if (odd)
93 result = ((result >> 8) & 0xff) | ((result & 0xff) << 8);
94out:
95 return result;
96}
97
98/*
99 * This is a version of ip_compute_csum() optimized for IP headers,
100 * which always checksum on 4 octet boundaries.
101 */
102__sum16 ip_fast_csum(const void *iph, unsigned int ihl)
103{
104 return (__force __sum16)~do_csum(iph, ihl*4);
105}
106EXPORT_SYMBOL(ip_fast_csum);
107
108/*
109 * computes the checksum of a memory block at buff, length len,
110 * and adds in "sum" (32-bit)
111 *
112 * returns a 32-bit number suitable for feeding into itself
113 * or csum_tcpudp_magic
114 *
115 * this function must be called with even lengths, except
116 * for the last fragment, which may be odd
117 *
118 * it's best to have buff aligned on a 32-bit boundary
119 */
120__wsum csum_partial(const void *buff, int len, __wsum wsum)
121{
122 unsigned int sum = (__force unsigned int)wsum;
123 unsigned int result = do_csum(buff, len);
124
125 /* add in old sum, and carry.. */
126 result += sum;
127 if (sum > result)
128 result += 1;
129 return (__force __wsum)result;
130}
131EXPORT_SYMBOL(csum_partial);
132
133/*
134 * this routine is used for miscellaneous IP-like checksums, mainly
135 * in icmp.c
136 */
137__sum16 ip_compute_csum(const void *buff, int len)
138{
139 return (__force __sum16)~do_csum(buff, len);
140}
141EXPORT_SYMBOL(ip_compute_csum);
142
143/*
144 * copy from fs while checksumming, otherwise like csum_partial
145 */
146__wsum
147csum_partial_copy_from_user(const void __user *src, void *dst, int len,
148 __wsum sum, int *csum_err)
149{
150 int missing;
151
152 missing = __copy_from_user(dst, src, len);
153 if (missing) {
154 memset(dst + len - missing, 0, missing);
155 *csum_err = -EFAULT;
156 } else
157 *csum_err = 0;
158
159 return csum_partial(dst, len, sum);
160}
161EXPORT_SYMBOL(csum_partial_copy_from_user);
162
163/*
164 * copy from ds while checksumming, otherwise like csum_partial
165 */
166__wsum
167csum_partial_copy(const void *src, void *dst, int len, __wsum sum)
168{
169 memcpy(dst, src, len);
170 return csum_partial(dst, len, sum);
171}
172EXPORT_SYMBOL(csum_partial_copy);
diff --git a/arch/microblaze/mm/init.c b/arch/microblaze/mm/init.c
index b5a701cd71e0..8d92c4efe9a4 100644
--- a/arch/microblaze/mm/init.c
+++ b/arch/microblaze/mm/init.c
@@ -80,15 +80,15 @@ void __init setup_memory(void)
80 memory_size = memory_end - memory_start; 80 memory_size = memory_end - memory_start;
81 PAGE_OFFSET = memory_start; 81 PAGE_OFFSET = memory_start;
82 printk(KERN_INFO "%s: Main mem: 0x%x-0x%x, " 82 printk(KERN_INFO "%s: Main mem: 0x%x-0x%x, "
83 "size 0x%08x\n", __func__, memory_start, 83 "size 0x%08x\n", __func__, (u32) memory_start,
84 memory_end, memory_size); 84 (u32) memory_end, (u32) memory_size);
85 break; 85 break;
86 } 86 }
87 } 87 }
88 88
89 if (!memory_start || !memory_end) { 89 if (!memory_start || !memory_end) {
90 panic("%s: Missing memory setting 0x%08x-0x%08x\n", 90 panic("%s: Missing memory setting 0x%08x-0x%08x\n",
91 __func__, memory_start, memory_end); 91 __func__, (u32) memory_start, (u32) memory_end);
92 } 92 }
93 93
94 /* reservation of region where is the kernel */ 94 /* reservation of region where is the kernel */
diff --git a/arch/mips/Kconfig b/arch/mips/Kconfig
index 8c4be1f301cf..3ca0fe1a9123 100644
--- a/arch/mips/Kconfig
+++ b/arch/mips/Kconfig
@@ -22,6 +22,26 @@ choice
22config MACH_ALCHEMY 22config MACH_ALCHEMY
23 bool "Alchemy processor based machines" 23 bool "Alchemy processor based machines"
24 24
25config AR7
26 bool "Texas Instruments AR7"
27 select BOOT_ELF32
28 select DMA_NONCOHERENT
29 select CEVT_R4K
30 select CSRC_R4K
31 select IRQ_CPU
32 select NO_EXCEPT_FILL
33 select SWAP_IO_SPACE
34 select SYS_HAS_CPU_MIPS32_R1
35 select SYS_HAS_EARLY_PRINTK
36 select SYS_SUPPORTS_32BIT_KERNEL
37 select SYS_SUPPORTS_LITTLE_ENDIAN
38 select GENERIC_GPIO
39 select GCD
40 select VLYNQ
41 help
42 Support for the Texas Instruments AR7 System-on-a-Chip
43 family: TNETD7100, 7200 and 7300.
44
25config BASLER_EXCITE 45config BASLER_EXCITE
26 bool "Basler eXcite smart camera" 46 bool "Basler eXcite smart camera"
27 select CEVT_R4K 47 select CEVT_R4K
@@ -209,7 +229,7 @@ config MIPS_MALTA
209 select SYS_SUPPORTS_64BIT_KERNEL 229 select SYS_SUPPORTS_64BIT_KERNEL
210 select SYS_SUPPORTS_BIG_ENDIAN 230 select SYS_SUPPORTS_BIG_ENDIAN
211 select SYS_SUPPORTS_LITTLE_ENDIAN 231 select SYS_SUPPORTS_LITTLE_ENDIAN
212 select SYS_SUPPORTS_MIPS_CMP if BROKEN # because SYNC_R4K is broken 232 select SYS_SUPPORTS_MIPS_CMP
213 select SYS_SUPPORTS_MULTITHREADING 233 select SYS_SUPPORTS_MULTITHREADING
214 select SYS_SUPPORTS_SMARTMIPS 234 select SYS_SUPPORTS_SMARTMIPS
215 help 235 help
@@ -247,6 +267,7 @@ config MACH_VR41XX
247 select CEVT_R4K 267 select CEVT_R4K
248 select CSRC_R4K 268 select CSRC_R4K
249 select SYS_HAS_CPU_VR41XX 269 select SYS_HAS_CPU_VR41XX
270 select ARCH_REQUIRE_GPIOLIB
250 271
251config NXP_STB220 272config NXP_STB220
252 bool "NXP STB220 board" 273 bool "NXP STB220 board"
@@ -1635,7 +1656,7 @@ config MIPS_APSP_KSPD
1635config MIPS_CMP 1656config MIPS_CMP
1636 bool "MIPS CMP framework support" 1657 bool "MIPS CMP framework support"
1637 depends on SYS_SUPPORTS_MIPS_CMP 1658 depends on SYS_SUPPORTS_MIPS_CMP
1638 select SYNC_R4K if BROKEN 1659 select SYNC_R4K
1639 select SYS_SUPPORTS_SMP 1660 select SYS_SUPPORTS_SMP
1640 select SYS_SUPPORTS_SCHED_SMT if SMP 1661 select SYS_SUPPORTS_SCHED_SMT if SMP
1641 select WEAK_ORDERING 1662 select WEAK_ORDERING
@@ -2147,11 +2168,11 @@ menu "Power management options"
2147 2168
2148config ARCH_HIBERNATION_POSSIBLE 2169config ARCH_HIBERNATION_POSSIBLE
2149 def_bool y 2170 def_bool y
2150 depends on SYS_SUPPORTS_HOTPLUG_CPU 2171 depends on SYS_SUPPORTS_HOTPLUG_CPU || !SMP
2151 2172
2152config ARCH_SUSPEND_POSSIBLE 2173config ARCH_SUSPEND_POSSIBLE
2153 def_bool y 2174 def_bool y
2154 depends on SYS_SUPPORTS_HOTPLUG_CPU 2175 depends on SYS_SUPPORTS_HOTPLUG_CPU || !SMP
2155 2176
2156source "kernel/power/Kconfig" 2177source "kernel/power/Kconfig"
2157 2178
diff --git a/arch/mips/Makefile b/arch/mips/Makefile
index 807572a6a4d2..861da514a468 100644
--- a/arch/mips/Makefile
+++ b/arch/mips/Makefile
@@ -173,6 +173,13 @@ libs-y += arch/mips/fw/lib/
173# 173#
174 174
175# 175#
176# Texas Instruments AR7
177#
178core-$(CONFIG_AR7) += arch/mips/ar7/
179cflags-$(CONFIG_AR7) += -I$(srctree)/arch/mips/include/asm/mach-ar7
180load-$(CONFIG_AR7) += 0xffffffff94100000
181
182#
176# Acer PICA 61, Mips Magnum 4000 and Olivetti M700. 183# Acer PICA 61, Mips Magnum 4000 and Olivetti M700.
177# 184#
178core-$(CONFIG_MACH_JAZZ) += arch/mips/jazz/ 185core-$(CONFIG_MACH_JAZZ) += arch/mips/jazz/
diff --git a/arch/mips/ar7/Makefile b/arch/mips/ar7/Makefile
new file mode 100644
index 000000000000..7435e44b3964
--- /dev/null
+++ b/arch/mips/ar7/Makefile
@@ -0,0 +1,10 @@
1
2obj-y := \
3 prom.o \
4 setup.o \
5 memory.o \
6 irq.o \
7 time.o \
8 platform.o \
9 gpio.o \
10 clock.o
diff --git a/arch/mips/ar7/clock.c b/arch/mips/ar7/clock.c
new file mode 100644
index 000000000000..27dc6663f2fa
--- /dev/null
+++ b/arch/mips/ar7/clock.c
@@ -0,0 +1,440 @@
1/*
2 * Copyright (C) 2007 Felix Fietkau <nbd@openwrt.org>
3 * Copyright (C) 2007 Eugene Konev <ejka@openwrt.org>
4 *
5 * This program is free software; you can redistribute it and/or modify
6 * it under the terms of the GNU General Public License as published by
7 * the Free Software Foundation; either version 2 of the License, or
8 * (at your option) any later version.
9 *
10 * This program is distributed in the hope that it will be useful,
11 * but WITHOUT ANY WARRANTY; without even the implied warranty of
12 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13 * GNU General Public License for more details.
14 *
15 * You should have received a copy of the GNU General Public License
16 * along with this program; if not, write to the Free Software
17 * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
18 */
19
20#include <linux/kernel.h>
21#include <linux/init.h>
22#include <linux/types.h>
23#include <linux/module.h>
24#include <linux/delay.h>
25#include <linux/gcd.h>
26#include <linux/io.h>
27
28#include <asm/addrspace.h>
29#include <asm/mach-ar7/ar7.h>
30
31#define BOOT_PLL_SOURCE_MASK 0x3
32#define CPU_PLL_SOURCE_SHIFT 16
33#define BUS_PLL_SOURCE_SHIFT 14
34#define USB_PLL_SOURCE_SHIFT 18
35#define DSP_PLL_SOURCE_SHIFT 22
36#define BOOT_PLL_SOURCE_AFE 0
37#define BOOT_PLL_SOURCE_BUS 0
38#define BOOT_PLL_SOURCE_REF 1
39#define BOOT_PLL_SOURCE_XTAL 2
40#define BOOT_PLL_SOURCE_CPU 3
41#define BOOT_PLL_BYPASS 0x00000020
42#define BOOT_PLL_ASYNC_MODE 0x02000000
43#define BOOT_PLL_2TO1_MODE 0x00008000
44
45#define TNETD7200_CLOCK_ID_CPU 0
46#define TNETD7200_CLOCK_ID_DSP 1
47#define TNETD7200_CLOCK_ID_USB 2
48
49#define TNETD7200_DEF_CPU_CLK 211000000
50#define TNETD7200_DEF_DSP_CLK 125000000
51#define TNETD7200_DEF_USB_CLK 48000000
52
53struct tnetd7300_clock {
54 u32 ctrl;
55#define PREDIV_MASK 0x001f0000
56#define PREDIV_SHIFT 16
57#define POSTDIV_MASK 0x0000001f
58 u32 unused1[3];
59 u32 pll;
60#define MUL_MASK 0x0000f000
61#define MUL_SHIFT 12
62#define PLL_MODE_MASK 0x00000001
63#define PLL_NDIV 0x00000800
64#define PLL_DIV 0x00000002
65#define PLL_STATUS 0x00000001
66 u32 unused2[3];
67};
68
69struct tnetd7300_clocks {
70 struct tnetd7300_clock bus;
71 struct tnetd7300_clock cpu;
72 struct tnetd7300_clock usb;
73 struct tnetd7300_clock dsp;
74};
75
76struct tnetd7200_clock {
77 u32 ctrl;
78 u32 unused1[3];
79#define DIVISOR_ENABLE_MASK 0x00008000
80 u32 mul;
81 u32 prediv;
82 u32 postdiv;
83 u32 postdiv2;
84 u32 unused2[6];
85 u32 cmd;
86 u32 status;
87 u32 cmden;
88 u32 padding[15];
89};
90
91struct tnetd7200_clocks {
92 struct tnetd7200_clock cpu;
93 struct tnetd7200_clock dsp;
94 struct tnetd7200_clock usb;
95};
96
97int ar7_cpu_clock = 150000000;
98EXPORT_SYMBOL(ar7_cpu_clock);
99int ar7_bus_clock = 125000000;
100EXPORT_SYMBOL(ar7_bus_clock);
101int ar7_dsp_clock;
102EXPORT_SYMBOL(ar7_dsp_clock);
103
104static void approximate(int base, int target, int *prediv,
105 int *postdiv, int *mul)
106{
107 int i, j, k, freq, res = target;
108 for (i = 1; i <= 16; i++)
109 for (j = 1; j <= 32; j++)
110 for (k = 1; k <= 32; k++) {
111 freq = abs(base / j * i / k - target);
112 if (freq < res) {
113 res = freq;
114 *mul = i;
115 *prediv = j;
116 *postdiv = k;
117 }
118 }
119}
120
121static void calculate(int base, int target, int *prediv, int *postdiv,
122 int *mul)
123{
124 int tmp_gcd, tmp_base, tmp_freq;
125
126 for (*prediv = 1; *prediv <= 32; (*prediv)++) {
127 tmp_base = base / *prediv;
128 tmp_gcd = gcd(target, tmp_base);
129 *mul = target / tmp_gcd;
130 *postdiv = tmp_base / tmp_gcd;
131 if ((*mul < 1) || (*mul >= 16))
132 continue;
133 if ((*postdiv > 0) & (*postdiv <= 32))
134 break;
135 }
136
137 if (base / *prediv * *mul / *postdiv != target) {
138 approximate(base, target, prediv, postdiv, mul);
139 tmp_freq = base / *prediv * *mul / *postdiv;
140 printk(KERN_WARNING
141 "Adjusted requested frequency %d to %d\n",
142 target, tmp_freq);
143 }
144
145 printk(KERN_DEBUG "Clocks: prediv: %d, postdiv: %d, mul: %d\n",
146 *prediv, *postdiv, *mul);
147}
148
149static int tnetd7300_dsp_clock(void)
150{
151 u32 didr1, didr2;
152 u8 rev = ar7_chip_rev();
153 didr1 = readl((void *)KSEG1ADDR(AR7_REGS_GPIO + 0x18));
154 didr2 = readl((void *)KSEG1ADDR(AR7_REGS_GPIO + 0x1c));
155 if (didr2 & (1 << 23))
156 return 0;
157 if ((rev >= 0x23) && (rev != 0x57))
158 return 250000000;
159 if ((((didr2 & 0x1fff) << 10) | ((didr1 & 0xffc00000) >> 22))
160 > 4208000)
161 return 250000000;
162 return 0;
163}
164
165static int tnetd7300_get_clock(u32 shift, struct tnetd7300_clock *clock,
166 u32 *bootcr, u32 bus_clock)
167{
168 int product;
169 int base_clock = AR7_REF_CLOCK;
170 u32 ctrl = readl(&clock->ctrl);
171 u32 pll = readl(&clock->pll);
172 int prediv = ((ctrl & PREDIV_MASK) >> PREDIV_SHIFT) + 1;
173 int postdiv = (ctrl & POSTDIV_MASK) + 1;
174 int divisor = prediv * postdiv;
175 int mul = ((pll & MUL_MASK) >> MUL_SHIFT) + 1;
176
177 switch ((*bootcr & (BOOT_PLL_SOURCE_MASK << shift)) >> shift) {
178 case BOOT_PLL_SOURCE_BUS:
179 base_clock = bus_clock;
180 break;
181 case BOOT_PLL_SOURCE_REF:
182 base_clock = AR7_REF_CLOCK;
183 break;
184 case BOOT_PLL_SOURCE_XTAL:
185 base_clock = AR7_XTAL_CLOCK;
186 break;
187 case BOOT_PLL_SOURCE_CPU:
188 base_clock = ar7_cpu_clock;
189 break;
190 }
191
192 if (*bootcr & BOOT_PLL_BYPASS)
193 return base_clock / divisor;
194
195 if ((pll & PLL_MODE_MASK) == 0)
196 return (base_clock >> (mul / 16 + 1)) / divisor;
197
198 if ((pll & (PLL_NDIV | PLL_DIV)) == (PLL_NDIV | PLL_DIV)) {
199 product = (mul & 1) ?
200 (base_clock * mul) >> 1 :
201 (base_clock * (mul - 1)) >> 2;
202 return product / divisor;
203 }
204
205 if (mul == 16)
206 return base_clock / divisor;
207
208 return base_clock * mul / divisor;
209}
210
211static void tnetd7300_set_clock(u32 shift, struct tnetd7300_clock *clock,
212 u32 *bootcr, u32 frequency)
213{
214 int prediv, postdiv, mul;
215 int base_clock = ar7_bus_clock;
216
217 switch ((*bootcr & (BOOT_PLL_SOURCE_MASK << shift)) >> shift) {
218 case BOOT_PLL_SOURCE_BUS:
219 base_clock = ar7_bus_clock;
220 break;
221 case BOOT_PLL_SOURCE_REF:
222 base_clock = AR7_REF_CLOCK;
223 break;
224 case BOOT_PLL_SOURCE_XTAL:
225 base_clock = AR7_XTAL_CLOCK;
226 break;
227 case BOOT_PLL_SOURCE_CPU:
228 base_clock = ar7_cpu_clock;
229 break;
230 }
231
232 calculate(base_clock, frequency, &prediv, &postdiv, &mul);
233
234 writel(((prediv - 1) << PREDIV_SHIFT) | (postdiv - 1), &clock->ctrl);
235 msleep(1);
236 writel(4, &clock->pll);
237 while (readl(&clock->pll) & PLL_STATUS)
238 ;
239 writel(((mul - 1) << MUL_SHIFT) | (0xff << 3) | 0x0e, &clock->pll);
240 msleep(75);
241}
242
243static void __init tnetd7300_init_clocks(void)
244{
245 u32 *bootcr = (u32 *)ioremap_nocache(AR7_REGS_DCL, 4);
246 struct tnetd7300_clocks *clocks =
247 ioremap_nocache(UR8_REGS_CLOCKS,
248 sizeof(struct tnetd7300_clocks));
249
250 ar7_bus_clock = tnetd7300_get_clock(BUS_PLL_SOURCE_SHIFT,
251 &clocks->bus, bootcr, AR7_AFE_CLOCK);
252
253 if (*bootcr & BOOT_PLL_ASYNC_MODE)
254 ar7_cpu_clock = tnetd7300_get_clock(CPU_PLL_SOURCE_SHIFT,
255 &clocks->cpu, bootcr, AR7_AFE_CLOCK);
256 else
257 ar7_cpu_clock = ar7_bus_clock;
258
259 if (ar7_dsp_clock == 250000000)
260 tnetd7300_set_clock(DSP_PLL_SOURCE_SHIFT, &clocks->dsp,
261 bootcr, ar7_dsp_clock);
262
263 iounmap(clocks);
264 iounmap(bootcr);
265}
266
267static int tnetd7200_get_clock(int base, struct tnetd7200_clock *clock,
268 u32 *bootcr, u32 bus_clock)
269{
270 int divisor = ((readl(&clock->prediv) & 0x1f) + 1) *
271 ((readl(&clock->postdiv) & 0x1f) + 1);
272
273 if (*bootcr & BOOT_PLL_BYPASS)
274 return base / divisor;
275
276 return base * ((readl(&clock->mul) & 0xf) + 1) / divisor;
277}
278
279
280static void tnetd7200_set_clock(int base, struct tnetd7200_clock *clock,
281 int prediv, int postdiv, int postdiv2, int mul, u32 frequency)
282{
283 printk(KERN_INFO
284 "Clocks: base = %d, frequency = %u, prediv = %d, "
285 "postdiv = %d, postdiv2 = %d, mul = %d\n",
286 base, frequency, prediv, postdiv, postdiv2, mul);
287
288 writel(0, &clock->ctrl);
289 writel(DIVISOR_ENABLE_MASK | ((prediv - 1) & 0x1F), &clock->prediv);
290 writel((mul - 1) & 0xF, &clock->mul);
291
292 while (readl(&clock->status) & 0x1)
293 ; /* nop */
294
295 writel(DIVISOR_ENABLE_MASK | ((postdiv - 1) & 0x1F), &clock->postdiv);
296
297 writel(readl(&clock->cmden) | 1, &clock->cmden);
298 writel(readl(&clock->cmd) | 1, &clock->cmd);
299
300 while (readl(&clock->status) & 0x1)
301 ; /* nop */
302
303 writel(DIVISOR_ENABLE_MASK | ((postdiv2 - 1) & 0x1F), &clock->postdiv2);
304
305 writel(readl(&clock->cmden) | 1, &clock->cmden);
306 writel(readl(&clock->cmd) | 1, &clock->cmd);
307
308 while (readl(&clock->status) & 0x1)
309 ; /* nop */
310
311 writel(readl(&clock->ctrl) | 1, &clock->ctrl);
312}
313
314static int tnetd7200_get_clock_base(int clock_id, u32 *bootcr)
315{
316 if (*bootcr & BOOT_PLL_ASYNC_MODE)
317 /* Async */
318 switch (clock_id) {
319 case TNETD7200_CLOCK_ID_DSP:
320 return AR7_REF_CLOCK;
321 default:
322 return AR7_AFE_CLOCK;
323 }
324 else
325 /* Sync */
326 if (*bootcr & BOOT_PLL_2TO1_MODE)
327 /* 2:1 */
328 switch (clock_id) {
329 case TNETD7200_CLOCK_ID_DSP:
330 return AR7_REF_CLOCK;
331 default:
332 return AR7_AFE_CLOCK;
333 }
334 else
335 /* 1:1 */
336 return AR7_REF_CLOCK;
337}
338
339
340static void __init tnetd7200_init_clocks(void)
341{
342 u32 *bootcr = (u32 *)ioremap_nocache(AR7_REGS_DCL, 4);
343 struct tnetd7200_clocks *clocks =
344 ioremap_nocache(AR7_REGS_CLOCKS,
345 sizeof(struct tnetd7200_clocks));
346 int cpu_base, cpu_mul, cpu_prediv, cpu_postdiv;
347 int dsp_base, dsp_mul, dsp_prediv, dsp_postdiv;
348 int usb_base, usb_mul, usb_prediv, usb_postdiv;
349
350 cpu_base = tnetd7200_get_clock_base(TNETD7200_CLOCK_ID_CPU, bootcr);
351 dsp_base = tnetd7200_get_clock_base(TNETD7200_CLOCK_ID_DSP, bootcr);
352
353 if (*bootcr & BOOT_PLL_ASYNC_MODE) {
354 printk(KERN_INFO "Clocks: Async mode\n");
355
356 printk(KERN_INFO "Clocks: Setting DSP clock\n");
357 calculate(dsp_base, TNETD7200_DEF_DSP_CLK,
358 &dsp_prediv, &dsp_postdiv, &dsp_mul);
359 ar7_bus_clock =
360 ((dsp_base / dsp_prediv) * dsp_mul) / dsp_postdiv;
361 tnetd7200_set_clock(dsp_base, &clocks->dsp,
362 dsp_prediv, dsp_postdiv * 2, dsp_postdiv, dsp_mul * 2,
363 ar7_bus_clock);
364
365 printk(KERN_INFO "Clocks: Setting CPU clock\n");
366 calculate(cpu_base, TNETD7200_DEF_CPU_CLK, &cpu_prediv,
367 &cpu_postdiv, &cpu_mul);
368 ar7_cpu_clock =
369 ((cpu_base / cpu_prediv) * cpu_mul) / cpu_postdiv;
370 tnetd7200_set_clock(cpu_base, &clocks->cpu,
371 cpu_prediv, cpu_postdiv, -1, cpu_mul,
372 ar7_cpu_clock);
373
374 } else
375 if (*bootcr & BOOT_PLL_2TO1_MODE) {
376 printk(KERN_INFO "Clocks: Sync 2:1 mode\n");
377
378 printk(KERN_INFO "Clocks: Setting CPU clock\n");
379 calculate(cpu_base, TNETD7200_DEF_CPU_CLK, &cpu_prediv,
380 &cpu_postdiv, &cpu_mul);
381 ar7_cpu_clock = ((cpu_base / cpu_prediv) * cpu_mul)
382 / cpu_postdiv;
383 tnetd7200_set_clock(cpu_base, &clocks->cpu,
384 cpu_prediv, cpu_postdiv, -1, cpu_mul,
385 ar7_cpu_clock);
386
387 printk(KERN_INFO "Clocks: Setting DSP clock\n");
388 calculate(dsp_base, TNETD7200_DEF_DSP_CLK, &dsp_prediv,
389 &dsp_postdiv, &dsp_mul);
390 ar7_bus_clock = ar7_cpu_clock / 2;
391 tnetd7200_set_clock(dsp_base, &clocks->dsp,
392 dsp_prediv, dsp_postdiv * 2, dsp_postdiv,
393 dsp_mul * 2, ar7_bus_clock);
394 } else {
395 printk(KERN_INFO "Clocks: Sync 1:1 mode\n");
396
397 printk(KERN_INFO "Clocks: Setting DSP clock\n");
398 calculate(dsp_base, TNETD7200_DEF_DSP_CLK, &dsp_prediv,
399 &dsp_postdiv, &dsp_mul);
400 ar7_bus_clock = ((dsp_base / dsp_prediv) * dsp_mul)
401 / dsp_postdiv;
402 tnetd7200_set_clock(dsp_base, &clocks->dsp,
403 dsp_prediv, dsp_postdiv * 2, dsp_postdiv,
404 dsp_mul * 2, ar7_bus_clock);
405
406 ar7_cpu_clock = ar7_bus_clock;
407 }
408
409 printk(KERN_INFO "Clocks: Setting USB clock\n");
410 usb_base = ar7_bus_clock;
411 calculate(usb_base, TNETD7200_DEF_USB_CLK, &usb_prediv,
412 &usb_postdiv, &usb_mul);
413 tnetd7200_set_clock(usb_base, &clocks->usb,
414 usb_prediv, usb_postdiv, -1, usb_mul,
415 TNETD7200_DEF_USB_CLK);
416
417 ar7_dsp_clock = ar7_cpu_clock;
418
419 iounmap(clocks);
420 iounmap(bootcr);
421}
422
423int __init ar7_init_clocks(void)
424{
425 switch (ar7_chip_id()) {
426 case AR7_CHIP_7100:
427 case AR7_CHIP_7200:
428 tnetd7200_init_clocks();
429 break;
430 case AR7_CHIP_7300:
431 ar7_dsp_clock = tnetd7300_dsp_clock();
432 tnetd7300_init_clocks();
433 break;
434 default:
435 break;
436 }
437
438 return 0;
439}
440arch_initcall(ar7_init_clocks);
diff --git a/arch/mips/ar7/gpio.c b/arch/mips/ar7/gpio.c
new file mode 100644
index 000000000000..74e14a3dbf4a
--- /dev/null
+++ b/arch/mips/ar7/gpio.c
@@ -0,0 +1,48 @@
1/*
2 * Copyright (C) 2007 Felix Fietkau <nbd@openwrt.org>
3 * Copyright (C) 2007 Eugene Konev <ejka@openwrt.org>
4 *
5 * This program is free software; you can redistribute it and/or modify
6 * it under the terms of the GNU General Public License as published by
7 * the Free Software Foundation; either version 2 of the License, or
8 * (at your option) any later version.
9 *
10 * This program is distributed in the hope that it will be useful,
11 * but WITHOUT ANY WARRANTY; without even the implied warranty of
12 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13 * GNU General Public License for more details.
14 *
15 * You should have received a copy of the GNU General Public License
16 * along with this program; if not, write to the Free Software
17 * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
18 */
19
20#include <linux/module.h>
21
22#include <asm/mach-ar7/gpio.h>
23
24static const char *ar7_gpio_list[AR7_GPIO_MAX];
25
26int gpio_request(unsigned gpio, const char *label)
27{
28 if (gpio >= AR7_GPIO_MAX)
29 return -EINVAL;
30
31 if (ar7_gpio_list[gpio])
32 return -EBUSY;
33
34 if (label)
35 ar7_gpio_list[gpio] = label;
36 else
37 ar7_gpio_list[gpio] = "busy";
38
39 return 0;
40}
41EXPORT_SYMBOL(gpio_request);
42
43void gpio_free(unsigned gpio)
44{
45 BUG_ON(!ar7_gpio_list[gpio]);
46 ar7_gpio_list[gpio] = NULL;
47}
48EXPORT_SYMBOL(gpio_free);
diff --git a/arch/mips/ar7/irq.c b/arch/mips/ar7/irq.c
new file mode 100644
index 000000000000..c781556c44e4
--- /dev/null
+++ b/arch/mips/ar7/irq.c
@@ -0,0 +1,176 @@
1/*
2 * Copyright (C) 2006,2007 Felix Fietkau <nbd@openwrt.org>
3 * Copyright (C) 2006,2007 Eugene Konev <ejka@openwrt.org>
4 *
5 * This program is free software; you can redistribute it and/or modify
6 * it under the terms of the GNU General Public License as published by
7 * the Free Software Foundation; either version 2 of the License, or
8 * (at your option) any later version.
9 *
10 * This program is distributed in the hope that it will be useful,
11 * but WITHOUT ANY WARRANTY; without even the implied warranty of
12 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13 * GNU General Public License for more details.
14 *
15 * You should have received a copy of the GNU General Public License
16 * along with this program; if not, write to the Free Software
17 * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
18 */
19
20#include <linux/interrupt.h>
21#include <linux/io.h>
22
23#include <asm/irq_cpu.h>
24#include <asm/mipsregs.h>
25#include <asm/mach-ar7/ar7.h>
26
27#define EXCEPT_OFFSET 0x80
28#define PACE_OFFSET 0xA0
29#define CHNLS_OFFSET 0x200
30
31#define REG_OFFSET(irq, reg) ((irq) / 32 * 0x4 + reg * 0x10)
32#define SEC_REG_OFFSET(reg) (EXCEPT_OFFSET + reg * 0x8)
33#define SEC_SR_OFFSET (SEC_REG_OFFSET(0)) /* 0x80 */
34#define CR_OFFSET(irq) (REG_OFFSET(irq, 1)) /* 0x10 */
35#define SEC_CR_OFFSET (SEC_REG_OFFSET(1)) /* 0x88 */
36#define ESR_OFFSET(irq) (REG_OFFSET(irq, 2)) /* 0x20 */
37#define SEC_ESR_OFFSET (SEC_REG_OFFSET(2)) /* 0x90 */
38#define ECR_OFFSET(irq) (REG_OFFSET(irq, 3)) /* 0x30 */
39#define SEC_ECR_OFFSET (SEC_REG_OFFSET(3)) /* 0x98 */
40#define PIR_OFFSET (0x40)
41#define MSR_OFFSET (0x44)
42#define PM_OFFSET(irq) (REG_OFFSET(irq, 5)) /* 0x50 */
43#define TM_OFFSET(irq) (REG_OFFSET(irq, 6)) /* 0x60 */
44
45#define REG(addr) ((u32 *)(KSEG1ADDR(AR7_REGS_IRQ) + addr))
46
47#define CHNL_OFFSET(chnl) (CHNLS_OFFSET + (chnl * 4))
48
49static int ar7_irq_base;
50
51static void ar7_unmask_irq(unsigned int irq)
52{
53 writel(1 << ((irq - ar7_irq_base) % 32),
54 REG(ESR_OFFSET(irq - ar7_irq_base)));
55}
56
57static void ar7_mask_irq(unsigned int irq)
58{
59 writel(1 << ((irq - ar7_irq_base) % 32),
60 REG(ECR_OFFSET(irq - ar7_irq_base)));
61}
62
63static void ar7_ack_irq(unsigned int irq)
64{
65 writel(1 << ((irq - ar7_irq_base) % 32),
66 REG(CR_OFFSET(irq - ar7_irq_base)));
67}
68
69static void ar7_unmask_sec_irq(unsigned int irq)
70{
71 writel(1 << (irq - ar7_irq_base - 40), REG(SEC_ESR_OFFSET));
72}
73
74static void ar7_mask_sec_irq(unsigned int irq)
75{
76 writel(1 << (irq - ar7_irq_base - 40), REG(SEC_ECR_OFFSET));
77}
78
79static void ar7_ack_sec_irq(unsigned int irq)
80{
81 writel(1 << (irq - ar7_irq_base - 40), REG(SEC_CR_OFFSET));
82}
83
84static struct irq_chip ar7_irq_type = {
85 .name = "AR7",
86 .unmask = ar7_unmask_irq,
87 .mask = ar7_mask_irq,
88 .ack = ar7_ack_irq
89};
90
91static struct irq_chip ar7_sec_irq_type = {
92 .name = "AR7",
93 .unmask = ar7_unmask_sec_irq,
94 .mask = ar7_mask_sec_irq,
95 .ack = ar7_ack_sec_irq,
96};
97
98static struct irqaction ar7_cascade_action = {
99 .handler = no_action,
100 .name = "AR7 cascade interrupt"
101};
102
103static void __init ar7_irq_init(int base)
104{
105 int i;
106 /*
107 * Disable interrupts and clear pending
108 */
109 writel(0xffffffff, REG(ECR_OFFSET(0)));
110 writel(0xff, REG(ECR_OFFSET(32)));
111 writel(0xffffffff, REG(SEC_ECR_OFFSET));
112 writel(0xffffffff, REG(CR_OFFSET(0)));
113 writel(0xff, REG(CR_OFFSET(32)));
114 writel(0xffffffff, REG(SEC_CR_OFFSET));
115
116 ar7_irq_base = base;
117
118 for (i = 0; i < 40; i++) {
119 writel(i, REG(CHNL_OFFSET(i)));
120 /* Primary IRQ's */
121 set_irq_chip_and_handler(base + i, &ar7_irq_type,
122 handle_level_irq);
123 /* Secondary IRQ's */
124 if (i < 32)
125 set_irq_chip_and_handler(base + i + 40,
126 &ar7_sec_irq_type,
127 handle_level_irq);
128 }
129
130 setup_irq(2, &ar7_cascade_action);
131 setup_irq(ar7_irq_base, &ar7_cascade_action);
132 set_c0_status(IE_IRQ0);
133}
134
135void __init arch_init_irq(void)
136{
137 mips_cpu_irq_init();
138 ar7_irq_init(8);
139}
140
141static void ar7_cascade(void)
142{
143 u32 status;
144 int i, irq;
145
146 /* Primary IRQ's */
147 irq = readl(REG(PIR_OFFSET)) & 0x3f;
148 if (irq) {
149 do_IRQ(ar7_irq_base + irq);
150 return;
151 }
152
153 /* Secondary IRQ's are cascaded through primary '0' */
154 writel(1, REG(CR_OFFSET(irq)));
155 status = readl(REG(SEC_SR_OFFSET));
156 for (i = 0; i < 32; i++) {
157 if (status & 1) {
158 do_IRQ(ar7_irq_base + i + 40);
159 return;
160 }
161 status >>= 1;
162 }
163
164 spurious_interrupt();
165}
166
167asmlinkage void plat_irq_dispatch(void)
168{
169 unsigned int pending = read_c0_status() & read_c0_cause() & ST0_IM;
170 if (pending & STATUSF_IP7) /* cpu timer */
171 do_IRQ(7);
172 else if (pending & STATUSF_IP2) /* int0 hardware line */
173 ar7_cascade();
174 else
175 spurious_interrupt();
176}
diff --git a/arch/mips/ar7/memory.c b/arch/mips/ar7/memory.c
new file mode 100644
index 000000000000..46fed44825a6
--- /dev/null
+++ b/arch/mips/ar7/memory.c
@@ -0,0 +1,72 @@
1/*
2 * Copyright (C) 2007 Felix Fietkau <nbd@openwrt.org>
3 * Copyright (C) 2007 Eugene Konev <ejka@openwrt.org>
4 *
5 * This program is free software; you can redistribute it and/or modify
6 * it under the terms of the GNU General Public License as published by
7 * the Free Software Foundation; either version 2 of the License, or
8 * (at your option) any later version.
9 *
10 * This program is distributed in the hope that it will be useful,
11 * but WITHOUT ANY WARRANTY; without even the implied warranty of
12 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13 * GNU General Public License for more details.
14 *
15 * You should have received a copy of the GNU General Public License
16 * along with this program; if not, write to the Free Software
17 * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
18 */
19#include <linux/bootmem.h>
20#include <linux/init.h>
21#include <linux/mm.h>
22#include <linux/module.h>
23#include <linux/pfn.h>
24#include <linux/proc_fs.h>
25#include <linux/string.h>
26#include <linux/swap.h>
27
28#include <asm/bootinfo.h>
29#include <asm/page.h>
30#include <asm/sections.h>
31
32#include <asm/mach-ar7/ar7.h>
33#include <asm/mips-boards/prom.h>
34
35static int __init memsize(void)
36{
37 u32 size = (64 << 20);
38 u32 *addr = (u32 *)KSEG1ADDR(AR7_SDRAM_BASE + size - 4);
39 u32 *kernel_end = (u32 *)KSEG1ADDR(CPHYSADDR((u32)&_end));
40 u32 *tmpaddr = addr;
41
42 while (tmpaddr > kernel_end) {
43 *tmpaddr = (u32)tmpaddr;
44 size >>= 1;
45 tmpaddr -= size >> 2;
46 }
47
48 do {
49 tmpaddr += size >> 2;
50 if (*tmpaddr != (u32)tmpaddr)
51 break;
52 size <<= 1;
53 } while (size < (64 << 20));
54
55 writel(tmpaddr, &addr);
56
57 return size;
58}
59
60void __init prom_meminit(void)
61{
62 unsigned long pages;
63
64 pages = memsize() >> PAGE_SHIFT;
65 add_memory_region(PHYS_OFFSET, pages << PAGE_SHIFT,
66 BOOT_MEM_RAM);
67}
68
69void __init prom_free_prom_memory(void)
70{
71 /* Nothing to free */
72}
diff --git a/arch/mips/ar7/platform.c b/arch/mips/ar7/platform.c
new file mode 100644
index 000000000000..542244961780
--- /dev/null
+++ b/arch/mips/ar7/platform.c
@@ -0,0 +1,555 @@
1/*
2 * Copyright (C) 2006,2007 Felix Fietkau <nbd@openwrt.org>
3 * Copyright (C) 2006,2007 Eugene Konev <ejka@openwrt.org>
4 *
5 * This program is free software; you can redistribute it and/or modify
6 * it under the terms of the GNU General Public License as published by
7 * the Free Software Foundation; either version 2 of the License, or
8 * (at your option) any later version.
9 *
10 * This program is distributed in the hope that it will be useful,
11 * but WITHOUT ANY WARRANTY; without even the implied warranty of
12 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13 * GNU General Public License for more details.
14 *
15 * You should have received a copy of the GNU General Public License
16 * along with this program; if not, write to the Free Software
17 * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
18 */
19
20#include <linux/init.h>
21#include <linux/types.h>
22#include <linux/module.h>
23#include <linux/delay.h>
24#include <linux/dma-mapping.h>
25#include <linux/platform_device.h>
26#include <linux/mtd/physmap.h>
27#include <linux/serial.h>
28#include <linux/serial_8250.h>
29#include <linux/ioport.h>
30#include <linux/io.h>
31#include <linux/version.h>
32#include <linux/vlynq.h>
33#include <linux/leds.h>
34#include <linux/string.h>
35#include <linux/etherdevice.h>
36
37#include <asm/addrspace.h>
38#include <asm/mach-ar7/ar7.h>
39#include <asm/mach-ar7/gpio.h>
40#include <asm/mach-ar7/prom.h>
41
42struct plat_vlynq_data {
43 struct plat_vlynq_ops ops;
44 int gpio_bit;
45 int reset_bit;
46};
47
48
49static int vlynq_on(struct vlynq_device *dev)
50{
51 int result;
52 struct plat_vlynq_data *pdata = dev->dev.platform_data;
53
54 result = gpio_request(pdata->gpio_bit, "vlynq");
55 if (result)
56 goto out;
57
58 ar7_device_reset(pdata->reset_bit);
59
60 result = ar7_gpio_disable(pdata->gpio_bit);
61 if (result)
62 goto out_enabled;
63
64 result = ar7_gpio_enable(pdata->gpio_bit);
65 if (result)
66 goto out_enabled;
67
68 result = gpio_direction_output(pdata->gpio_bit, 0);
69 if (result)
70 goto out_gpio_enabled;
71
72 msleep(50);
73
74 gpio_set_value(pdata->gpio_bit, 1);
75 msleep(50);
76
77 return 0;
78
79out_gpio_enabled:
80 ar7_gpio_disable(pdata->gpio_bit);
81out_enabled:
82 ar7_device_disable(pdata->reset_bit);
83 gpio_free(pdata->gpio_bit);
84out:
85 return result;
86}
87
88static void vlynq_off(struct vlynq_device *dev)
89{
90 struct plat_vlynq_data *pdata = dev->dev.platform_data;
91 ar7_gpio_disable(pdata->gpio_bit);
92 gpio_free(pdata->gpio_bit);
93 ar7_device_disable(pdata->reset_bit);
94}
95
96static struct resource physmap_flash_resource = {
97 .name = "mem",
98 .flags = IORESOURCE_MEM,
99 .start = 0x10000000,
100 .end = 0x107fffff,
101};
102
103static struct resource cpmac_low_res[] = {
104 {
105 .name = "regs",
106 .flags = IORESOURCE_MEM,
107 .start = AR7_REGS_MAC0,
108 .end = AR7_REGS_MAC0 + 0x7ff,
109 },
110 {
111 .name = "irq",
112 .flags = IORESOURCE_IRQ,
113 .start = 27,
114 .end = 27,
115 },
116};
117
118static struct resource cpmac_high_res[] = {
119 {
120 .name = "regs",
121 .flags = IORESOURCE_MEM,
122 .start = AR7_REGS_MAC1,
123 .end = AR7_REGS_MAC1 + 0x7ff,
124 },
125 {
126 .name = "irq",
127 .flags = IORESOURCE_IRQ,
128 .start = 41,
129 .end = 41,
130 },
131};
132
133static struct resource vlynq_low_res[] = {
134 {
135 .name = "regs",
136 .flags = IORESOURCE_MEM,
137 .start = AR7_REGS_VLYNQ0,
138 .end = AR7_REGS_VLYNQ0 + 0xff,
139 },
140 {
141 .name = "irq",
142 .flags = IORESOURCE_IRQ,
143 .start = 29,
144 .end = 29,
145 },
146 {
147 .name = "mem",
148 .flags = IORESOURCE_MEM,
149 .start = 0x04000000,
150 .end = 0x04ffffff,
151 },
152 {
153 .name = "devirq",
154 .flags = IORESOURCE_IRQ,
155 .start = 80,
156 .end = 111,
157 },
158};
159
160static struct resource vlynq_high_res[] = {
161 {
162 .name = "regs",
163 .flags = IORESOURCE_MEM,
164 .start = AR7_REGS_VLYNQ1,
165 .end = AR7_REGS_VLYNQ1 + 0xff,
166 },
167 {
168 .name = "irq",
169 .flags = IORESOURCE_IRQ,
170 .start = 33,
171 .end = 33,
172 },
173 {
174 .name = "mem",
175 .flags = IORESOURCE_MEM,
176 .start = 0x0c000000,
177 .end = 0x0cffffff,
178 },
179 {
180 .name = "devirq",
181 .flags = IORESOURCE_IRQ,
182 .start = 112,
183 .end = 143,
184 },
185};
186
187static struct resource usb_res[] = {
188 {
189 .name = "regs",
190 .flags = IORESOURCE_MEM,
191 .start = AR7_REGS_USB,
192 .end = AR7_REGS_USB + 0xff,
193 },
194 {
195 .name = "irq",
196 .flags = IORESOURCE_IRQ,
197 .start = 32,
198 .end = 32,
199 },
200 {
201 .name = "mem",
202 .flags = IORESOURCE_MEM,
203 .start = 0x03400000,
204 .end = 0x034001fff,
205 },
206};
207
208static struct physmap_flash_data physmap_flash_data = {
209 .width = 2,
210};
211
212static struct plat_cpmac_data cpmac_low_data = {
213 .reset_bit = 17,
214 .power_bit = 20,
215 .phy_mask = 0x80000000,
216};
217
218static struct plat_cpmac_data cpmac_high_data = {
219 .reset_bit = 21,
220 .power_bit = 22,
221 .phy_mask = 0x7fffffff,
222};
223
224static struct plat_vlynq_data vlynq_low_data = {
225 .ops.on = vlynq_on,
226 .ops.off = vlynq_off,
227 .reset_bit = 20,
228 .gpio_bit = 18,
229};
230
231static struct plat_vlynq_data vlynq_high_data = {
232 .ops.on = vlynq_on,
233 .ops.off = vlynq_off,
234 .reset_bit = 16,
235 .gpio_bit = 19,
236};
237
238static struct platform_device physmap_flash = {
239 .id = 0,
240 .name = "physmap-flash",
241 .dev.platform_data = &physmap_flash_data,
242 .resource = &physmap_flash_resource,
243 .num_resources = 1,
244};
245
246static u64 cpmac_dma_mask = DMA_32BIT_MASK;
247static struct platform_device cpmac_low = {
248 .id = 0,
249 .name = "cpmac",
250 .dev = {
251 .dma_mask = &cpmac_dma_mask,
252 .coherent_dma_mask = DMA_32BIT_MASK,
253 .platform_data = &cpmac_low_data,
254 },
255 .resource = cpmac_low_res,
256 .num_resources = ARRAY_SIZE(cpmac_low_res),
257};
258
259static struct platform_device cpmac_high = {
260 .id = 1,
261 .name = "cpmac",
262 .dev = {
263 .dma_mask = &cpmac_dma_mask,
264 .coherent_dma_mask = DMA_32BIT_MASK,
265 .platform_data = &cpmac_high_data,
266 },
267 .resource = cpmac_high_res,
268 .num_resources = ARRAY_SIZE(cpmac_high_res),
269};
270
271static struct platform_device vlynq_low = {
272 .id = 0,
273 .name = "vlynq",
274 .dev.platform_data = &vlynq_low_data,
275 .resource = vlynq_low_res,
276 .num_resources = ARRAY_SIZE(vlynq_low_res),
277};
278
279static struct platform_device vlynq_high = {
280 .id = 1,
281 .name = "vlynq",
282 .dev.platform_data = &vlynq_high_data,
283 .resource = vlynq_high_res,
284 .num_resources = ARRAY_SIZE(vlynq_high_res),
285};
286
287
288static struct gpio_led default_leds[] = {
289 {
290 .name = "status",
291 .gpio = 8,
292 .active_low = 1,
293 },
294};
295
296static struct gpio_led dsl502t_leds[] = {
297 {
298 .name = "status",
299 .gpio = 9,
300 .active_low = 1,
301 },
302 {
303 .name = "ethernet",
304 .gpio = 7,
305 .active_low = 1,
306 },
307 {
308 .name = "usb",
309 .gpio = 12,
310 .active_low = 1,
311 },
312};
313
314static struct gpio_led dg834g_leds[] = {
315 {
316 .name = "ppp",
317 .gpio = 6,
318 .active_low = 1,
319 },
320 {
321 .name = "status",
322 .gpio = 7,
323 .active_low = 1,
324 },
325 {
326 .name = "adsl",
327 .gpio = 8,
328 .active_low = 1,
329 },
330 {
331 .name = "wifi",
332 .gpio = 12,
333 .active_low = 1,
334 },
335 {
336 .name = "power",
337 .gpio = 14,
338 .active_low = 1,
339 .default_trigger = "default-on",
340 },
341};
342
343static struct gpio_led fb_sl_leds[] = {
344 {
345 .name = "1",
346 .gpio = 7,
347 },
348 {
349 .name = "2",
350 .gpio = 13,
351 .active_low = 1,
352 },
353 {
354 .name = "3",
355 .gpio = 10,
356 .active_low = 1,
357 },
358 {
359 .name = "4",
360 .gpio = 12,
361 .active_low = 1,
362 },
363 {
364 .name = "5",
365 .gpio = 9,
366 .active_low = 1,
367 },
368};
369
370static struct gpio_led fb_fon_leds[] = {
371 {
372 .name = "1",
373 .gpio = 8,
374 },
375 {
376 .name = "2",
377 .gpio = 3,
378 .active_low = 1,
379 },
380 {
381 .name = "3",
382 .gpio = 5,
383 },
384 {
385 .name = "4",
386 .gpio = 4,
387 .active_low = 1,
388 },
389 {
390 .name = "5",
391 .gpio = 11,
392 .active_low = 1,
393 },
394};
395
396static struct gpio_led_platform_data ar7_led_data;
397
398static struct platform_device ar7_gpio_leds = {
399 .name = "leds-gpio",
400 .id = -1,
401 .dev = {
402 .platform_data = &ar7_led_data,
403 }
404};
405
406static struct platform_device ar7_udc = {
407 .id = -1,
408 .name = "ar7_udc",
409 .resource = usb_res,
410 .num_resources = ARRAY_SIZE(usb_res),
411};
412
413static inline unsigned char char2hex(char h)
414{
415 switch (h) {
416 case '0': case '1': case '2': case '3': case '4':
417 case '5': case '6': case '7': case '8': case '9':
418 return h - '0';
419 case 'A': case 'B': case 'C': case 'D': case 'E': case 'F':
420 return h - 'A' + 10;
421 case 'a': case 'b': case 'c': case 'd': case 'e': case 'f':
422 return h - 'a' + 10;
423 default:
424 return 0;
425 }
426}
427
428static void cpmac_get_mac(int instance, unsigned char *dev_addr)
429{
430 int i;
431 char name[5], default_mac[ETH_ALEN], *mac;
432
433 mac = NULL;
434 sprintf(name, "mac%c", 'a' + instance);
435 mac = prom_getenv(name);
436 if (!mac) {
437 sprintf(name, "mac%c", 'a');
438 mac = prom_getenv(name);
439 }
440 if (!mac) {
441 random_ether_addr(default_mac);
442 mac = default_mac;
443 }
444 for (i = 0; i < 6; i++)
445 dev_addr[i] = (char2hex(mac[i * 3]) << 4) +
446 char2hex(mac[i * 3 + 1]);
447}
448
449static void __init detect_leds(void)
450{
451 char *prid, *usb_prod;
452
453 /* Default LEDs */
454 ar7_led_data.num_leds = ARRAY_SIZE(default_leds);
455 ar7_led_data.leds = default_leds;
456
457 /* FIXME: the whole thing is unreliable */
458 prid = prom_getenv("ProductID");
459 usb_prod = prom_getenv("usb_prod");
460
461 /* If we can't get the product id from PROM, use the default LEDs */
462 if (!prid)
463 return;
464
465 if (strstr(prid, "Fritz_Box_FON")) {
466 ar7_led_data.num_leds = ARRAY_SIZE(fb_fon_leds);
467 ar7_led_data.leds = fb_fon_leds;
468 } else if (strstr(prid, "Fritz_Box_")) {
469 ar7_led_data.num_leds = ARRAY_SIZE(fb_sl_leds);
470 ar7_led_data.leds = fb_sl_leds;
471 } else if ((!strcmp(prid, "AR7RD") || !strcmp(prid, "AR7DB"))
472 && usb_prod != NULL && strstr(usb_prod, "DSL-502T")) {
473 ar7_led_data.num_leds = ARRAY_SIZE(dsl502t_leds);
474 ar7_led_data.leds = dsl502t_leds;
475 } else if (strstr(prid, "DG834")) {
476 ar7_led_data.num_leds = ARRAY_SIZE(dg834g_leds);
477 ar7_led_data.leds = dg834g_leds;
478 }
479}
480
481static int __init ar7_register_devices(void)
482{
483 int res;
484 static struct uart_port uart_port[2];
485
486 memset(uart_port, 0, sizeof(struct uart_port) * 2);
487
488 uart_port[0].type = PORT_16550A;
489 uart_port[0].line = 0;
490 uart_port[0].irq = AR7_IRQ_UART0;
491 uart_port[0].uartclk = ar7_bus_freq() / 2;
492 uart_port[0].iotype = UPIO_MEM32;
493 uart_port[0].mapbase = AR7_REGS_UART0;
494 uart_port[0].membase = ioremap(uart_port[0].mapbase, 256);
495 uart_port[0].regshift = 2;
496 res = early_serial_setup(&uart_port[0]);
497 if (res)
498 return res;
499
500
501 /* Only TNETD73xx have a second serial port */
502 if (ar7_has_second_uart()) {
503 uart_port[1].type = PORT_16550A;
504 uart_port[1].line = 1;
505 uart_port[1].irq = AR7_IRQ_UART1;
506 uart_port[1].uartclk = ar7_bus_freq() / 2;
507 uart_port[1].iotype = UPIO_MEM32;
508 uart_port[1].mapbase = UR8_REGS_UART1;
509 uart_port[1].membase = ioremap(uart_port[1].mapbase, 256);
510 uart_port[1].regshift = 2;
511 res = early_serial_setup(&uart_port[1]);
512 if (res)
513 return res;
514 }
515
516 res = platform_device_register(&physmap_flash);
517 if (res)
518 return res;
519
520 ar7_device_disable(vlynq_low_data.reset_bit);
521 res = platform_device_register(&vlynq_low);
522 if (res)
523 return res;
524
525 if (ar7_has_high_vlynq()) {
526 ar7_device_disable(vlynq_high_data.reset_bit);
527 res = platform_device_register(&vlynq_high);
528 if (res)
529 return res;
530 }
531
532 if (ar7_has_high_cpmac()) {
533 cpmac_get_mac(1, cpmac_high_data.dev_addr);
534 res = platform_device_register(&cpmac_high);
535 if (res)
536 return res;
537 } else {
538 cpmac_low_data.phy_mask = 0xffffffff;
539 }
540
541 cpmac_get_mac(0, cpmac_low_data.dev_addr);
542 res = platform_device_register(&cpmac_low);
543 if (res)
544 return res;
545
546 detect_leds();
547 res = platform_device_register(&ar7_gpio_leds);
548 if (res)
549 return res;
550
551 res = platform_device_register(&ar7_udc);
552
553 return res;
554}
555arch_initcall(ar7_register_devices);
diff --git a/arch/mips/ar7/prom.c b/arch/mips/ar7/prom.c
new file mode 100644
index 000000000000..a320bceb2f9d
--- /dev/null
+++ b/arch/mips/ar7/prom.c
@@ -0,0 +1,297 @@
1/*
2 * Carsten Langgaard, carstenl@mips.com
3 * Copyright (C) 1999,2000 MIPS Technologies, Inc. All rights reserved.
4 *
5 * This program is free software; you can distribute it and/or modify it
6 * under the terms of the GNU General Public License (Version 2) as
7 * published by the Free Software Foundation.
8 *
9 * This program is distributed in the hope it will be useful, but WITHOUT
10 * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
11 * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
12 * for more details.
13 *
14 * You should have received a copy of the GNU General Public License along
15 * with this program; if not, write to the Free Software Foundation, Inc.,
16 * 59 Temple Place - Suite 330, Boston MA 02111-1307, USA.
17 *
18 * Putting things on the screen/serial line using YAMONs facilities.
19 */
20#include <linux/init.h>
21#include <linux/kernel.h>
22#include <linux/serial_reg.h>
23#include <linux/spinlock.h>
24#include <linux/module.h>
25#include <linux/string.h>
26#include <linux/io.h>
27#include <asm/bootinfo.h>
28
29#include <asm/mach-ar7/ar7.h>
30#include <asm/mach-ar7/prom.h>
31
32#define MAX_ENTRY 80
33
34struct env_var {
35 char *name;
36 char *value;
37};
38
39static struct env_var adam2_env[MAX_ENTRY];
40
41char *prom_getenv(const char *name)
42{
43 int i;
44 for (i = 0; (i < MAX_ENTRY) && adam2_env[i].name; i++)
45 if (!strcmp(name, adam2_env[i].name))
46 return adam2_env[i].value;
47
48 return NULL;
49}
50EXPORT_SYMBOL(prom_getenv);
51
52char * __init prom_getcmdline(void)
53{
54 return &(arcs_cmdline[0]);
55}
56
57static void __init ar7_init_cmdline(int argc, char *argv[])
58{
59 char *cp;
60 int actr;
61
62 actr = 1; /* Always ignore argv[0] */
63
64 cp = &(arcs_cmdline[0]);
65 while (actr < argc) {
66 strcpy(cp, argv[actr]);
67 cp += strlen(argv[actr]);
68 *cp++ = ' ';
69 actr++;
70 }
71 if (cp != &(arcs_cmdline[0])) {
72 /* get rid of trailing space */
73 --cp;
74 *cp = '\0';
75 }
76}
77
78struct psbl_rec {
79 u32 psbl_size;
80 u32 env_base;
81 u32 env_size;
82 u32 ffs_base;
83 u32 ffs_size;
84};
85
86static __initdata char psp_env_version[] = "TIENV0.8";
87
88struct psp_env_chunk {
89 u8 num;
90 u8 ctrl;
91 u16 csum;
92 u8 len;
93 char data[11];
94} __attribute__ ((packed));
95
96struct psp_var_map_entry {
97 u8 num;
98 char *value;
99};
100
101static struct psp_var_map_entry psp_var_map[] = {
102 { 1, "cpufrequency" },
103 { 2, "memsize" },
104 { 3, "flashsize" },
105 { 4, "modetty0" },
106 { 5, "modetty1" },
107 { 8, "maca" },
108 { 9, "macb" },
109 { 28, "sysfrequency" },
110 { 38, "mipsfrequency" },
111};
112
113/*
114
115Well-known variable (num is looked up in table above for matching variable name)
116Example: cpufrequency=211968000
117+----+----+----+----+----+----+----+----+----+----+----+----+----+----+----+---
118| 01 |CTRL|CHECKSUM | 01 | _2 | _1 | _1 | _9 | _6 | _8 | _0 | _0 | _0 | \0 | FF
119+----+----+----+----+----+----+----+----+----+----+----+----+----+----+----+---
120
121Name=Value pair in a single chunk
122Example: NAME=VALUE
123+----+----+----+----+----+----+----+----+----+----+----+----+----+----+----+---
124| 00 |CTRL|CHECKSUM | 01 | _N | _A | _M | _E | _0 | _V | _A | _L | _U | _E | \0
125+----+----+----+----+----+----+----+----+----+----+----+----+----+----+----+---
126
127Name=Value pair in 2 chunks (len is the number of chunks)
128Example: bootloaderVersion=1.3.7.15
129+----+----+----+----+----+----+----+----+----+----+----+----+----+----+----+---
130| 00 |CTRL|CHECKSUM | 02 | _b | _o | _o | _t | _l | _o | _a | _d | _e | _r | _V
131+----+----+----+----+----+----+----+----+----+----+----+----+----+----+----+---
132| _e | _r | _s | _i | _o | _n | \0 | _1 | _. | _3 | _. | _7 | _. | _1 | _5 | \0
133+----+----+----+----+----+----+----+----+----+----+----+----+----+----+----+---
134
135Data is padded with 0xFF
136
137*/
138
139#define PSP_ENV_SIZE 4096
140
141static char psp_env_data[PSP_ENV_SIZE] = { 0, };
142
143static char * __init lookup_psp_var_map(u8 num)
144{
145 int i;
146
147 for (i = 0; i < sizeof(psp_var_map); i++)
148 if (psp_var_map[i].num == num)
149 return psp_var_map[i].value;
150
151 return NULL;
152}
153
154static void __init add_adam2_var(char *name, char *value)
155{
156 int i;
157 for (i = 0; i < MAX_ENTRY; i++) {
158 if (!adam2_env[i].name) {
159 adam2_env[i].name = name;
160 adam2_env[i].value = value;
161 return;
162 } else if (!strcmp(adam2_env[i].name, name)) {
163 adam2_env[i].value = value;
164 return;
165 }
166 }
167}
168
169static int __init parse_psp_env(void *psp_env_base)
170{
171 int i, n;
172 char *name, *value;
173 struct psp_env_chunk *chunks = (struct psp_env_chunk *)psp_env_data;
174
175 memcpy_fromio(chunks, psp_env_base, PSP_ENV_SIZE);
176
177 i = 1;
178 n = PSP_ENV_SIZE / sizeof(struct psp_env_chunk);
179 while (i < n) {
180 if ((chunks[i].num == 0xff) || ((i + chunks[i].len) > n))
181 break;
182 value = chunks[i].data;
183 if (chunks[i].num) {
184 name = lookup_psp_var_map(chunks[i].num);
185 } else {
186 name = value;
187 value += strlen(name) + 1;
188 }
189 if (name)
190 add_adam2_var(name, value);
191 i += chunks[i].len;
192 }
193 return 0;
194}
195
196static void __init ar7_init_env(struct env_var *env)
197{
198 int i;
199 struct psbl_rec *psbl = (struct psbl_rec *)(KSEG1ADDR(0x14000300));
200 void *psp_env = (void *)KSEG1ADDR(psbl->env_base);
201
202 if (strcmp(psp_env, psp_env_version) == 0) {
203 parse_psp_env(psp_env);
204 } else {
205 for (i = 0; i < MAX_ENTRY; i++, env++)
206 if (env->name)
207 add_adam2_var(env->name, env->value);
208 }
209}
210
211static void __init console_config(void)
212{
213#ifdef CONFIG_SERIAL_8250_CONSOLE
214 char console_string[40];
215 int baud = 0;
216 char parity = '\0', bits = '\0', flow = '\0';
217 char *s, *p;
218
219 if (strstr(prom_getcmdline(), "console="))
220 return;
221
222#ifdef CONFIG_KGDB
223 if (!strstr(prom_getcmdline(), "nokgdb")) {
224 strcat(prom_getcmdline(), " console=kgdb");
225 kgdb_enabled = 1;
226 return;
227 }
228#endif
229
230 s = prom_getenv("modetty0");
231 if (s) {
232 baud = simple_strtoul(s, &p, 10);
233 s = p;
234 if (*s == ',')
235 s++;
236 if (*s)
237 parity = *s++;
238 if (*s == ',')
239 s++;
240 if (*s)
241 bits = *s++;
242 if (*s == ',')
243 s++;
244 if (*s == 'h')
245 flow = 'r';
246 }
247
248 if (baud == 0)
249 baud = 38400;
250 if (parity != 'n' && parity != 'o' && parity != 'e')
251 parity = 'n';
252 if (bits != '7' && bits != '8')
253 bits = '8';
254
255 if (flow == 'r')
256 sprintf(console_string, " console=ttyS0,%d%c%c%c", baud,
257 parity, bits, flow);
258 else
259 sprintf(console_string, " console=ttyS0,%d%c%c", baud, parity,
260 bits);
261 strcat(prom_getcmdline(), console_string);
262#endif
263}
264
265void __init prom_init(void)
266{
267 ar7_init_cmdline(fw_arg0, (char **)fw_arg1);
268 ar7_init_env((struct env_var *)fw_arg2);
269 console_config();
270}
271
272#define PORT(offset) (KSEG1ADDR(AR7_REGS_UART0 + (offset * 4)))
273static inline unsigned int serial_in(int offset)
274{
275 return readl((void *)PORT(offset));
276}
277
278static inline void serial_out(int offset, int value)
279{
280 writel(value, (void *)PORT(offset));
281}
282
283char prom_getchar(void)
284{
285 while (!(serial_in(UART_LSR) & UART_LSR_DR))
286 ;
287 return serial_in(UART_RX);
288}
289
290int prom_putchar(char c)
291{
292 while ((serial_in(UART_LSR) & UART_LSR_TEMT) == 0)
293 ;
294 serial_out(UART_TX, c);
295 return 1;
296}
297
diff --git a/arch/mips/ar7/setup.c b/arch/mips/ar7/setup.c
new file mode 100644
index 000000000000..6ebb5f16d967
--- /dev/null
+++ b/arch/mips/ar7/setup.c
@@ -0,0 +1,94 @@
1/*
2 * Carsten Langgaard, carstenl@mips.com
3 * Copyright (C) 2000 MIPS Technologies, Inc. All rights reserved.
4 *
5 * This program is free software; you can distribute it and/or modify it
6 * under the terms of the GNU General Public License (Version 2) as
7 * published by the Free Software Foundation.
8 *
9 * This program is distributed in the hope it will be useful, but WITHOUT
10 * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
11 * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
12 * for more details.
13 *
14 * You should have received a copy of the GNU General Public License along
15 * with this program; if not, write to the Free Software Foundation, Inc.,
16 * 59 Temple Place - Suite 330, Boston MA 02111-1307, USA.
17 */
18#include <linux/version.h>
19#include <linux/init.h>
20#include <linux/ioport.h>
21#include <linux/pm.h>
22#include <linux/time.h>
23
24#include <asm/reboot.h>
25#include <asm/mach-ar7/ar7.h>
26#include <asm/mach-ar7/prom.h>
27
28static void ar7_machine_restart(char *command)
29{
30 u32 *softres_reg = ioremap(AR7_REGS_RESET +
31 AR7_RESET_SOFTWARE, 1);
32 writel(1, softres_reg);
33}
34
35static void ar7_machine_halt(void)
36{
37 while (1)
38 ;
39}
40
41static void ar7_machine_power_off(void)
42{
43 u32 *power_reg = (u32 *)ioremap(AR7_REGS_POWER, 1);
44 u32 power_state = readl(power_reg) | (3 << 30);
45 writel(power_state, power_reg);
46 ar7_machine_halt();
47}
48
49const char *get_system_type(void)
50{
51 u16 chip_id = ar7_chip_id();
52 switch (chip_id) {
53 case AR7_CHIP_7300:
54 return "TI AR7 (TNETD7300)";
55 case AR7_CHIP_7100:
56 return "TI AR7 (TNETD7100)";
57 case AR7_CHIP_7200:
58 return "TI AR7 (TNETD7200)";
59 default:
60 return "TI AR7 (Unknown)";
61 }
62}
63
64static int __init ar7_init_console(void)
65{
66 return 0;
67}
68console_initcall(ar7_init_console);
69
70/*
71 * Initializes basic routines and structures pointers, memory size (as
72 * given by the bios and saves the command line.
73 */
74
75void __init plat_mem_setup(void)
76{
77 unsigned long io_base;
78
79 _machine_restart = ar7_machine_restart;
80 _machine_halt = ar7_machine_halt;
81 pm_power_off = ar7_machine_power_off;
82 panic_timeout = 3;
83
84 io_base = (unsigned long)ioremap(AR7_REGS_BASE, 0x10000);
85 if (!io_base)
86 panic("Can't remap IO base!\n");
87 set_io_port_base(io_base);
88
89 prom_meminit();
90
91 printk(KERN_INFO "%s, ID: 0x%04x, Revision: 0x%02x\n",
92 get_system_type(),
93 ar7_chip_id(), ar7_chip_rev());
94}
diff --git a/arch/mips/ar7/time.c b/arch/mips/ar7/time.c
new file mode 100644
index 000000000000..a1fba894daa2
--- /dev/null
+++ b/arch/mips/ar7/time.c
@@ -0,0 +1,30 @@
1/*
2 * Carsten Langgaard, carstenl@mips.com
3 * Copyright (C) 1999,2000 MIPS Technologies, Inc. All rights reserved.
4 *
5 * This program is free software; you can distribute it and/or modify it
6 * under the terms of the GNU General Public License (Version 2) as
7 * published by the Free Software Foundation.
8 *
9 * This program is distributed in the hope it will be useful, but WITHOUT
10 * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
11 * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
12 * for more details.
13 *
14 * You should have received a copy of the GNU General Public License along
15 * with this program; if not, write to the Free Software Foundation, Inc.,
16 * 59 Temple Place - Suite 330, Boston MA 02111-1307, USA.
17 *
18 * Setting up the clock on the MIPS boards.
19 */
20
21#include <linux/init.h>
22#include <linux/time.h>
23
24#include <asm/time.h>
25#include <asm/mach-ar7/ar7.h>
26
27void __init plat_time_init(void)
28{
29 mips_hpt_frequency = ar7_cpu_freq() / 2;
30}
diff --git a/arch/mips/cavium-octeon/Makefile b/arch/mips/cavium-octeon/Makefile
index 7c0528b0e34c..d6903c3f3d51 100644
--- a/arch/mips/cavium-octeon/Makefile
+++ b/arch/mips/cavium-octeon/Makefile
@@ -14,9 +14,5 @@ obj-y += dma-octeon.o flash_setup.o
14obj-y += octeon-memcpy.o 14obj-y += octeon-memcpy.o
15 15
16obj-$(CONFIG_SMP) += smp.o 16obj-$(CONFIG_SMP) += smp.o
17obj-$(CONFIG_PCI) += pci-common.o
18obj-$(CONFIG_PCI) += pci.o
19obj-$(CONFIG_PCI) += pcie.o
20obj-$(CONFIG_PCI_MSI) += msi.o
21 17
22EXTRA_CFLAGS += -Werror 18EXTRA_CFLAGS += -Werror
diff --git a/arch/mips/cavium-octeon/dma-octeon.c b/arch/mips/cavium-octeon/dma-octeon.c
index 627c162a6159..4b92bfc662db 100644
--- a/arch/mips/cavium-octeon/dma-octeon.c
+++ b/arch/mips/cavium-octeon/dma-octeon.c
@@ -29,7 +29,7 @@
29#include <dma-coherence.h> 29#include <dma-coherence.h>
30 30
31#ifdef CONFIG_PCI 31#ifdef CONFIG_PCI
32#include "pci-common.h" 32#include <asm/octeon/pci-octeon.h>
33#endif 33#endif
34 34
35#define BAR2_PCI_ADDRESS 0x8000000000ul 35#define BAR2_PCI_ADDRESS 0x8000000000ul
diff --git a/arch/mips/cavium-octeon/pci-common.c b/arch/mips/cavium-octeon/pci-common.c
deleted file mode 100644
index cd029f88da7f..000000000000
--- a/arch/mips/cavium-octeon/pci-common.c
+++ /dev/null
@@ -1,137 +0,0 @@
1/*
2 * This file is subject to the terms and conditions of the GNU General Public
3 * License. See the file "COPYING" in the main directory of this archive
4 * for more details.
5 *
6 * Copyright (C) 2005-2007 Cavium Networks
7 */
8#include <linux/kernel.h>
9#include <linux/init.h>
10#include <linux/pci.h>
11#include <linux/interrupt.h>
12#include <linux/time.h>
13#include <linux/delay.h>
14#include "pci-common.h"
15
16typeof(pcibios_map_irq) *octeon_pcibios_map_irq;
17enum octeon_dma_bar_type octeon_dma_bar_type = OCTEON_DMA_BAR_TYPE_INVALID;
18
19/**
20 * Map a PCI device to the appropriate interrupt line
21 *
22 * @param dev The Linux PCI device structure for the device to map
23 * @param slot The slot number for this device on __BUS 0__. Linux
24 * enumerates through all the bridges and figures out the
25 * slot on Bus 0 where this device eventually hooks to.
26 * @param pin The PCI interrupt pin read from the device, then swizzled
27 * as it goes through each bridge.
28 * @return Interrupt number for the device
29 */
30int __init pcibios_map_irq(const struct pci_dev *dev, u8 slot, u8 pin)
31{
32 if (octeon_pcibios_map_irq)
33 return octeon_pcibios_map_irq(dev, slot, pin);
34 else
35 panic("octeon_pcibios_map_irq doesn't point to a "
36 "pcibios_map_irq() function");
37}
38
39
40/**
41 * Called to perform platform specific PCI setup
42 *
43 * @param dev
44 * @return
45 */
46int pcibios_plat_dev_init(struct pci_dev *dev)
47{
48 uint16_t config;
49 uint32_t dconfig;
50 int pos;
51 /*
52 * Force the Cache line setting to 64 bytes. The standard
53 * Linux bus scan doesn't seem to set it. Octeon really has
54 * 128 byte lines, but Intel bridges get really upset if you
55 * try and set values above 64 bytes. Value is specified in
56 * 32bit words.
57 */
58 pci_write_config_byte(dev, PCI_CACHE_LINE_SIZE, 64 / 4);
59 /* Set latency timers for all devices */
60 pci_write_config_byte(dev, PCI_LATENCY_TIMER, 48);
61
62 /* Enable reporting System errors and parity errors on all devices */
63 /* Enable parity checking and error reporting */
64 pci_read_config_word(dev, PCI_COMMAND, &config);
65 config |= PCI_COMMAND_PARITY | PCI_COMMAND_SERR;
66 pci_write_config_word(dev, PCI_COMMAND, config);
67
68 if (dev->subordinate) {
69 /* Set latency timers on sub bridges */
70 pci_write_config_byte(dev, PCI_SEC_LATENCY_TIMER, 48);
71 /* More bridge error detection */
72 pci_read_config_word(dev, PCI_BRIDGE_CONTROL, &config);
73 config |= PCI_BRIDGE_CTL_PARITY | PCI_BRIDGE_CTL_SERR;
74 pci_write_config_word(dev, PCI_BRIDGE_CONTROL, config);
75 }
76
77 /* Enable the PCIe normal error reporting */
78 pos = pci_find_capability(dev, PCI_CAP_ID_EXP);
79 if (pos) {
80 /* Update Device Control */
81 pci_read_config_word(dev, pos + PCI_EXP_DEVCTL, &config);
82 /* Correctable Error Reporting */
83 config |= PCI_EXP_DEVCTL_CERE;
84 /* Non-Fatal Error Reporting */
85 config |= PCI_EXP_DEVCTL_NFERE;
86 /* Fatal Error Reporting */
87 config |= PCI_EXP_DEVCTL_FERE;
88 /* Unsupported Request */
89 config |= PCI_EXP_DEVCTL_URRE;
90 pci_write_config_word(dev, pos + PCI_EXP_DEVCTL, config);
91 }
92
93 /* Find the Advanced Error Reporting capability */
94 pos = pci_find_ext_capability(dev, PCI_EXT_CAP_ID_ERR);
95 if (pos) {
96 /* Clear Uncorrectable Error Status */
97 pci_read_config_dword(dev, pos + PCI_ERR_UNCOR_STATUS,
98 &dconfig);
99 pci_write_config_dword(dev, pos + PCI_ERR_UNCOR_STATUS,
100 dconfig);
101 /* Enable reporting of all uncorrectable errors */
102 /* Uncorrectable Error Mask - turned on bits disable errors */
103 pci_write_config_dword(dev, pos + PCI_ERR_UNCOR_MASK, 0);
104 /*
105 * Leave severity at HW default. This only controls if
106 * errors are reported as uncorrectable or
107 * correctable, not if the error is reported.
108 */
109 /* PCI_ERR_UNCOR_SEVER - Uncorrectable Error Severity */
110 /* Clear Correctable Error Status */
111 pci_read_config_dword(dev, pos + PCI_ERR_COR_STATUS, &dconfig);
112 pci_write_config_dword(dev, pos + PCI_ERR_COR_STATUS, dconfig);
113 /* Enable reporting of all correctable errors */
114 /* Correctable Error Mask - turned on bits disable errors */
115 pci_write_config_dword(dev, pos + PCI_ERR_COR_MASK, 0);
116 /* Advanced Error Capabilities */
117 pci_read_config_dword(dev, pos + PCI_ERR_CAP, &dconfig);
118 /* ECRC Generation Enable */
119 if (config & PCI_ERR_CAP_ECRC_GENC)
120 config |= PCI_ERR_CAP_ECRC_GENE;
121 /* ECRC Check Enable */
122 if (config & PCI_ERR_CAP_ECRC_CHKC)
123 config |= PCI_ERR_CAP_ECRC_CHKE;
124 pci_write_config_dword(dev, pos + PCI_ERR_CAP, dconfig);
125 /* PCI_ERR_HEADER_LOG - Header Log Register (16 bytes) */
126 /* Report all errors to the root complex */
127 pci_write_config_dword(dev, pos + PCI_ERR_ROOT_COMMAND,
128 PCI_ERR_ROOT_CMD_COR_EN |
129 PCI_ERR_ROOT_CMD_NONFATAL_EN |
130 PCI_ERR_ROOT_CMD_FATAL_EN);
131 /* Clear the Root status register */
132 pci_read_config_dword(dev, pos + PCI_ERR_ROOT_STATUS, &dconfig);
133 pci_write_config_dword(dev, pos + PCI_ERR_ROOT_STATUS, dconfig);
134 }
135
136 return 0;
137}
diff --git a/arch/mips/cobalt/buttons.c b/arch/mips/cobalt/buttons.c
index 9e143989c7b8..4eaec8b46e0c 100644
--- a/arch/mips/cobalt/buttons.c
+++ b/arch/mips/cobalt/buttons.c
@@ -1,7 +1,7 @@
1/* 1/*
2 * Cobalt buttons platform device. 2 * Cobalt buttons platform device.
3 * 3 *
4 * Copyright (C) 2007 Yoichi Yuasa <yoichi_yuasa@tripeaks.co.jp> 4 * Copyright (C) 2007 Yoichi Yuasa <yuasa@linux-mips.org>
5 * 5 *
6 * This program is free software; you can redistribute it and/or modify 6 * This program is free software; you can redistribute it and/or modify
7 * it under the terms of the GNU General Public License as published by 7 * it under the terms of the GNU General Public License as published by
diff --git a/arch/mips/cobalt/lcd.c b/arch/mips/cobalt/lcd.c
index 0720e4fae311..0f1cd90f37ed 100644
--- a/arch/mips/cobalt/lcd.c
+++ b/arch/mips/cobalt/lcd.c
@@ -1,7 +1,7 @@
1/* 1/*
2 * Registration of Cobalt LCD platform device. 2 * Registration of Cobalt LCD platform device.
3 * 3 *
4 * Copyright (C) 2008 Yoichi Yuasa <yoichi_yuasa@tripeaks.co.jp> 4 * Copyright (C) 2008 Yoichi Yuasa <yuasa@linux-mips.org>
5 * 5 *
6 * This program is free software; you can redistribute it and/or modify 6 * This program is free software; you can redistribute it and/or modify
7 * it under the terms of the GNU General Public License as published by 7 * it under the terms of the GNU General Public License as published by
diff --git a/arch/mips/cobalt/led.c b/arch/mips/cobalt/led.c
index 1c6ebd468b07..d3ce6fa1dc74 100644
--- a/arch/mips/cobalt/led.c
+++ b/arch/mips/cobalt/led.c
@@ -1,7 +1,7 @@
1/* 1/*
2 * Registration of Cobalt LED platform device. 2 * Registration of Cobalt LED platform device.
3 * 3 *
4 * Copyright (C) 2007 Yoichi Yuasa <yoichi_yuasa@tripeaks.co.jp> 4 * Copyright (C) 2007 Yoichi Yuasa <yuasa@linux-mips.org>
5 * 5 *
6 * This program is free software; you can redistribute it and/or modify 6 * This program is free software; you can redistribute it and/or modify
7 * it under the terms of the GNU General Public License as published by 7 * it under the terms of the GNU General Public License as published by
diff --git a/arch/mips/cobalt/mtd.c b/arch/mips/cobalt/mtd.c
index 2b088ef3839a..691d620b6766 100644
--- a/arch/mips/cobalt/mtd.c
+++ b/arch/mips/cobalt/mtd.c
@@ -1,7 +1,7 @@
1/* 1/*
2 * Registration of Cobalt MTD device. 2 * Registration of Cobalt MTD device.
3 * 3 *
4 * Copyright (C) 2006 Yoichi Yuasa <yoichi_yuasa@tripeaks.co.jp> 4 * Copyright (C) 2006 Yoichi Yuasa <yuasa@linux-mips.org>
5 * 5 *
6 * This program is free software; you can redistribute it and/or modify 6 * This program is free software; you can redistribute it and/or modify
7 * it under the terms of the GNU General Public License as published by 7 * it under the terms of the GNU General Public License as published by
diff --git a/arch/mips/cobalt/rtc.c b/arch/mips/cobalt/rtc.c
index e70794b8bcba..3ab39898b4e4 100644
--- a/arch/mips/cobalt/rtc.c
+++ b/arch/mips/cobalt/rtc.c
@@ -1,7 +1,7 @@
1/* 1/*
2 * Registration of Cobalt RTC platform device. 2 * Registration of Cobalt RTC platform device.
3 * 3 *
4 * Copyright (C) 2007 Yoichi Yuasa <yoichi_yuasa@tripeaks.co.jp> 4 * Copyright (C) 2007 Yoichi Yuasa <yuasa@linux-mips.org>
5 * 5 *
6 * This program is free software; you can redistribute it and/or modify 6 * This program is free software; you can redistribute it and/or modify
7 * it under the terms of the GNU General Public License as published by 7 * it under the terms of the GNU General Public License as published by
diff --git a/arch/mips/cobalt/serial.c b/arch/mips/cobalt/serial.c
index 53b8d0d6da90..7cb51f57275e 100644
--- a/arch/mips/cobalt/serial.c
+++ b/arch/mips/cobalt/serial.c
@@ -1,7 +1,7 @@
1/* 1/*
2 * Registration of Cobalt UART platform device. 2 * Registration of Cobalt UART platform device.
3 * 3 *
4 * Copyright (C) 2007 Yoichi Yuasa <yoichi_yuasa@tripeaks.co.jp> 4 * Copyright (C) 2007 Yoichi Yuasa <yuasa@linux-mips.org>
5 * 5 *
6 * This program is free software; you can redistribute it and/or modify 6 * This program is free software; you can redistribute it and/or modify
7 * it under the terms of the GNU General Public License as published by 7 * it under the terms of the GNU General Public License as published by
diff --git a/arch/mips/cobalt/time.c b/arch/mips/cobalt/time.c
index 4a570e7145fe..0162f9edc693 100644
--- a/arch/mips/cobalt/time.c
+++ b/arch/mips/cobalt/time.c
@@ -1,7 +1,7 @@
1/* 1/*
2 * Cobalt time initialization. 2 * Cobalt time initialization.
3 * 3 *
4 * Copyright (C) 2007 Yoichi Yuasa <yoichi_yuasa@tripeaks.co.jp> 4 * Copyright (C) 2007 Yoichi Yuasa <yuasa@linux-mips.org>
5 * 5 *
6 * This program is free software; you can redistribute it and/or modify 6 * This program is free software; you can redistribute it and/or modify
7 * it under the terms of the GNU General Public License as published by 7 * it under the terms of the GNU General Public License as published by
diff --git a/arch/mips/configs/ar7_defconfig b/arch/mips/configs/ar7_defconfig
new file mode 100644
index 000000000000..dad5b6769d74
--- /dev/null
+++ b/arch/mips/configs/ar7_defconfig
@@ -0,0 +1,1182 @@
1#
2# Automatically generated make config: don't edit
3# Linux kernel version: 2.6.30
4# Wed Jun 24 14:08:59 2009
5#
6CONFIG_MIPS=y
7
8#
9# Machine selection
10#
11# CONFIG_MACH_ALCHEMY is not set
12CONFIG_AR7=y
13# CONFIG_BASLER_EXCITE is not set
14# CONFIG_BCM47XX is not set
15# CONFIG_MIPS_COBALT is not set
16# CONFIG_MACH_DECSTATION is not set
17# CONFIG_MACH_JAZZ is not set
18# CONFIG_LASAT is not set
19# CONFIG_LEMOTE_FULONG is not set
20# CONFIG_MIPS_MALTA is not set
21# CONFIG_MIPS_SIM is not set
22# CONFIG_NEC_MARKEINS is not set
23# CONFIG_MACH_VR41XX is not set
24# CONFIG_NXP_STB220 is not set
25# CONFIG_NXP_STB225 is not set
26# CONFIG_PNX8550_JBS is not set
27# CONFIG_PNX8550_STB810 is not set
28# CONFIG_PMC_MSP is not set
29# CONFIG_PMC_YOSEMITE is not set
30# CONFIG_SGI_IP22 is not set
31# CONFIG_SGI_IP27 is not set
32# CONFIG_SGI_IP28 is not set
33# CONFIG_SGI_IP32 is not set
34# CONFIG_SIBYTE_CRHINE is not set
35# CONFIG_SIBYTE_CARMEL is not set
36# CONFIG_SIBYTE_CRHONE is not set
37# CONFIG_SIBYTE_RHONE is not set
38# CONFIG_SIBYTE_SWARM is not set
39# CONFIG_SIBYTE_LITTLESUR is not set
40# CONFIG_SIBYTE_SENTOSA is not set
41# CONFIG_SIBYTE_BIGSUR is not set
42# CONFIG_SNI_RM is not set
43# CONFIG_MACH_TX39XX is not set
44# CONFIG_MACH_TX49XX is not set
45# CONFIG_MIKROTIK_RB532 is not set
46# CONFIG_WR_PPMC is not set
47# CONFIG_CAVIUM_OCTEON_SIMULATOR is not set
48# CONFIG_CAVIUM_OCTEON_REFERENCE_BOARD is not set
49# CONFIG_ALCHEMY_GPIO_INDIRECT is not set
50CONFIG_RWSEM_GENERIC_SPINLOCK=y
51# CONFIG_ARCH_HAS_ILOG2_U32 is not set
52# CONFIG_ARCH_HAS_ILOG2_U64 is not set
53CONFIG_ARCH_SUPPORTS_OPROFILE=y
54CONFIG_GENERIC_FIND_NEXT_BIT=y
55CONFIG_GENERIC_HWEIGHT=y
56CONFIG_GENERIC_CALIBRATE_DELAY=y
57CONFIG_GENERIC_CLOCKEVENTS=y
58CONFIG_GENERIC_TIME=y
59CONFIG_GENERIC_CMOS_UPDATE=y
60CONFIG_SCHED_OMIT_FRAME_POINTER=y
61CONFIG_GENERIC_HARDIRQS_NO__DO_IRQ=y
62CONFIG_CEVT_R4K_LIB=y
63CONFIG_CEVT_R4K=y
64CONFIG_CSRC_R4K_LIB=y
65CONFIG_CSRC_R4K=y
66CONFIG_DMA_NONCOHERENT=y
67CONFIG_DMA_NEED_PCI_MAP_STATE=y
68CONFIG_EARLY_PRINTK=y
69CONFIG_SYS_HAS_EARLY_PRINTK=y
70# CONFIG_HOTPLUG_CPU is not set
71# CONFIG_NO_IOPORT is not set
72CONFIG_GENERIC_GPIO=y
73# CONFIG_CPU_BIG_ENDIAN is not set
74CONFIG_CPU_LITTLE_ENDIAN=y
75CONFIG_SYS_SUPPORTS_LITTLE_ENDIAN=y
76CONFIG_IRQ_CPU=y
77CONFIG_NO_EXCEPT_FILL=y
78CONFIG_SWAP_IO_SPACE=y
79CONFIG_BOOT_ELF32=y
80CONFIG_MIPS_L1_CACHE_SHIFT=5
81
82#
83# CPU selection
84#
85# CONFIG_CPU_LOONGSON2 is not set
86CONFIG_CPU_MIPS32_R1=y
87# CONFIG_CPU_MIPS32_R2 is not set
88# CONFIG_CPU_MIPS64_R1 is not set
89# CONFIG_CPU_MIPS64_R2 is not set
90# CONFIG_CPU_R3000 is not set
91# CONFIG_CPU_TX39XX is not set
92# CONFIG_CPU_VR41XX is not set
93# CONFIG_CPU_R4300 is not set
94# CONFIG_CPU_R4X00 is not set
95# CONFIG_CPU_TX49XX is not set
96# CONFIG_CPU_R5000 is not set
97# CONFIG_CPU_R5432 is not set
98# CONFIG_CPU_R5500 is not set
99# CONFIG_CPU_R6000 is not set
100# CONFIG_CPU_NEVADA is not set
101# CONFIG_CPU_R8000 is not set
102# CONFIG_CPU_R10000 is not set
103# CONFIG_CPU_RM7000 is not set
104# CONFIG_CPU_RM9000 is not set
105# CONFIG_CPU_SB1 is not set
106# CONFIG_CPU_CAVIUM_OCTEON is not set
107CONFIG_SYS_HAS_CPU_MIPS32_R1=y
108CONFIG_CPU_MIPS32=y
109CONFIG_CPU_MIPSR1=y
110CONFIG_SYS_SUPPORTS_32BIT_KERNEL=y
111CONFIG_CPU_SUPPORTS_32BIT_KERNEL=y
112CONFIG_HARDWARE_WATCHPOINTS=y
113
114#
115# Kernel type
116#
117CONFIG_32BIT=y
118# CONFIG_64BIT is not set
119CONFIG_PAGE_SIZE_4KB=y
120# CONFIG_PAGE_SIZE_8KB is not set
121# CONFIG_PAGE_SIZE_16KB is not set
122# CONFIG_PAGE_SIZE_32KB is not set
123# CONFIG_PAGE_SIZE_64KB is not set
124CONFIG_CPU_HAS_PREFETCH=y
125CONFIG_MIPS_MT_DISABLED=y
126# CONFIG_MIPS_MT_SMP is not set
127# CONFIG_MIPS_MT_SMTC is not set
128CONFIG_CPU_HAS_LLSC=y
129CONFIG_CPU_HAS_SYNC=y
130CONFIG_GENERIC_HARDIRQS=y
131CONFIG_GENERIC_IRQ_PROBE=y
132CONFIG_CPU_SUPPORTS_HIGHMEM=y
133CONFIG_ARCH_FLATMEM_ENABLE=y
134CONFIG_ARCH_POPULATES_NODE_MAP=y
135CONFIG_SELECT_MEMORY_MODEL=y
136CONFIG_FLATMEM_MANUAL=y
137# CONFIG_DISCONTIGMEM_MANUAL is not set
138# CONFIG_SPARSEMEM_MANUAL is not set
139CONFIG_FLATMEM=y
140CONFIG_FLAT_NODE_MEM_MAP=y
141CONFIG_PAGEFLAGS_EXTENDED=y
142CONFIG_SPLIT_PTLOCK_CPUS=4
143# CONFIG_PHYS_ADDR_T_64BIT is not set
144CONFIG_ZONE_DMA_FLAG=0
145CONFIG_VIRT_TO_BUS=y
146CONFIG_HAVE_MLOCK=y
147CONFIG_HAVE_MLOCKED_PAGE_BIT=y
148CONFIG_DEFAULT_MMAP_MIN_ADDR=4096
149CONFIG_TICK_ONESHOT=y
150# CONFIG_NO_HZ is not set
151CONFIG_HIGH_RES_TIMERS=y
152CONFIG_GENERIC_CLOCKEVENTS_BUILD=y
153# CONFIG_HZ_48 is not set
154CONFIG_HZ_100=y
155# CONFIG_HZ_128 is not set
156# CONFIG_HZ_250 is not set
157# CONFIG_HZ_256 is not set
158# CONFIG_HZ_1000 is not set
159# CONFIG_HZ_1024 is not set
160CONFIG_SYS_SUPPORTS_ARBIT_HZ=y
161CONFIG_HZ=100
162CONFIG_PREEMPT_NONE=y
163# CONFIG_PREEMPT_VOLUNTARY is not set
164# CONFIG_PREEMPT is not set
165CONFIG_KEXEC=y
166# CONFIG_SECCOMP is not set
167CONFIG_LOCKDEP_SUPPORT=y
168CONFIG_STACKTRACE_SUPPORT=y
169CONFIG_DEFCONFIG_LIST="/lib/modules/$UNAME_RELEASE/.config"
170
171#
172# General setup
173#
174CONFIG_EXPERIMENTAL=y
175CONFIG_BROKEN_ON_SMP=y
176CONFIG_INIT_ENV_ARG_LIMIT=32
177CONFIG_LOCALVERSION=""
178# CONFIG_LOCALVERSION_AUTO is not set
179CONFIG_SWAP=y
180CONFIG_SYSVIPC=y
181CONFIG_SYSVIPC_SYSCTL=y
182# CONFIG_POSIX_MQUEUE is not set
183CONFIG_BSD_PROCESS_ACCT=y
184# CONFIG_BSD_PROCESS_ACCT_V3 is not set
185# CONFIG_TASKSTATS is not set
186# CONFIG_AUDIT is not set
187
188#
189# RCU Subsystem
190#
191CONFIG_CLASSIC_RCU=y
192# CONFIG_TREE_RCU is not set
193# CONFIG_PREEMPT_RCU is not set
194# CONFIG_TREE_RCU_TRACE is not set
195# CONFIG_PREEMPT_RCU_TRACE is not set
196# CONFIG_IKCONFIG is not set
197CONFIG_LOG_BUF_SHIFT=14
198# CONFIG_GROUP_SCHED is not set
199# CONFIG_CGROUPS is not set
200CONFIG_SYSFS_DEPRECATED=y
201CONFIG_SYSFS_DEPRECATED_V2=y
202CONFIG_RELAY=y
203# CONFIG_NAMESPACES is not set
204CONFIG_BLK_DEV_INITRD=y
205CONFIG_INITRAMFS_SOURCE=""
206CONFIG_RD_GZIP=y
207# CONFIG_RD_BZIP2 is not set
208CONFIG_RD_LZMA=y
209CONFIG_CC_OPTIMIZE_FOR_SIZE=y
210CONFIG_SYSCTL=y
211CONFIG_ANON_INODES=y
212CONFIG_EMBEDDED=y
213CONFIG_SYSCTL_SYSCALL=y
214# CONFIG_KALLSYMS is not set
215CONFIG_HOTPLUG=y
216CONFIG_PRINTK=y
217CONFIG_BUG=y
218# CONFIG_ELF_CORE is not set
219# CONFIG_PCSPKR_PLATFORM is not set
220CONFIG_BASE_FULL=y
221CONFIG_FUTEX=y
222CONFIG_EPOLL=y
223CONFIG_SIGNALFD=y
224CONFIG_TIMERFD=y
225CONFIG_EVENTFD=y
226CONFIG_SHMEM=y
227CONFIG_AIO=y
228
229#
230# Performance Counters
231#
232# CONFIG_VM_EVENT_COUNTERS is not set
233CONFIG_STRIP_ASM_SYMS=y
234# CONFIG_COMPAT_BRK is not set
235CONFIG_SLAB=y
236# CONFIG_SLUB is not set
237# CONFIG_SLOB is not set
238# CONFIG_PROFILING is not set
239# CONFIG_MARKERS is not set
240CONFIG_HAVE_OPROFILE=y
241# CONFIG_SLOW_WORK is not set
242# CONFIG_HAVE_GENERIC_DMA_COHERENT is not set
243CONFIG_SLABINFO=y
244CONFIG_RT_MUTEXES=y
245CONFIG_BASE_SMALL=0
246CONFIG_MODULES=y
247# CONFIG_MODULE_FORCE_LOAD is not set
248CONFIG_MODULE_UNLOAD=y
249# CONFIG_MODULE_FORCE_UNLOAD is not set
250# CONFIG_MODVERSIONS is not set
251# CONFIG_MODULE_SRCVERSION_ALL is not set
252CONFIG_BLOCK=y
253# CONFIG_LBD is not set
254# CONFIG_BLK_DEV_BSG is not set
255# CONFIG_BLK_DEV_INTEGRITY is not set
256
257#
258# IO Schedulers
259#
260CONFIG_IOSCHED_NOOP=y
261# CONFIG_IOSCHED_AS is not set
262CONFIG_IOSCHED_DEADLINE=y
263# CONFIG_IOSCHED_CFQ is not set
264# CONFIG_DEFAULT_AS is not set
265CONFIG_DEFAULT_DEADLINE=y
266# CONFIG_DEFAULT_CFQ is not set
267# CONFIG_DEFAULT_NOOP is not set
268CONFIG_DEFAULT_IOSCHED="deadline"
269CONFIG_PROBE_INITRD_HEADER=y
270# CONFIG_FREEZER is not set
271
272#
273# Bus options (PCI, PCMCIA, EISA, ISA, TC)
274#
275# CONFIG_ARCH_SUPPORTS_MSI is not set
276CONFIG_MMU=y
277# CONFIG_PCCARD is not set
278
279#
280# Executable file formats
281#
282CONFIG_BINFMT_ELF=y
283# CONFIG_HAVE_AOUT is not set
284# CONFIG_BINFMT_MISC is not set
285CONFIG_TRAD_SIGNALS=y
286
287#
288# Power management options
289#
290CONFIG_ARCH_HIBERNATION_POSSIBLE=y
291CONFIG_ARCH_SUSPEND_POSSIBLE=y
292# CONFIG_PM is not set
293CONFIG_NET=y
294
295#
296# Networking options
297#
298CONFIG_PACKET=y
299CONFIG_PACKET_MMAP=y
300CONFIG_UNIX=y
301# CONFIG_NET_KEY is not set
302CONFIG_INET=y
303CONFIG_IP_MULTICAST=y
304CONFIG_IP_ADVANCED_ROUTER=y
305CONFIG_ASK_IP_FIB_HASH=y
306# CONFIG_IP_FIB_TRIE is not set
307CONFIG_IP_FIB_HASH=y
308CONFIG_IP_MULTIPLE_TABLES=y
309CONFIG_IP_ROUTE_MULTIPATH=y
310CONFIG_IP_ROUTE_VERBOSE=y
311# CONFIG_IP_PNP is not set
312# CONFIG_NET_IPIP is not set
313# CONFIG_NET_IPGRE is not set
314CONFIG_IP_MROUTE=y
315# CONFIG_IP_PIMSM_V1 is not set
316# CONFIG_IP_PIMSM_V2 is not set
317CONFIG_ARPD=y
318CONFIG_SYN_COOKIES=y
319# CONFIG_INET_AH is not set
320# CONFIG_INET_ESP is not set
321# CONFIG_INET_IPCOMP is not set
322# CONFIG_INET_XFRM_TUNNEL is not set
323# CONFIG_INET_TUNNEL is not set
324# CONFIG_INET_XFRM_MODE_TRANSPORT is not set
325# CONFIG_INET_XFRM_MODE_TUNNEL is not set
326# CONFIG_INET_XFRM_MODE_BEET is not set
327# CONFIG_INET_LRO is not set
328# CONFIG_INET_DIAG is not set
329CONFIG_TCP_CONG_ADVANCED=y
330# CONFIG_TCP_CONG_BIC is not set
331# CONFIG_TCP_CONG_CUBIC is not set
332CONFIG_TCP_CONG_WESTWOOD=y
333# CONFIG_TCP_CONG_HTCP is not set
334# CONFIG_TCP_CONG_HSTCP is not set
335# CONFIG_TCP_CONG_HYBLA is not set
336# CONFIG_TCP_CONG_VEGAS is not set
337# CONFIG_TCP_CONG_SCALABLE is not set
338# CONFIG_TCP_CONG_LP is not set
339# CONFIG_TCP_CONG_VENO is not set
340# CONFIG_TCP_CONG_YEAH is not set
341# CONFIG_TCP_CONG_ILLINOIS is not set
342# CONFIG_DEFAULT_BIC is not set
343# CONFIG_DEFAULT_CUBIC is not set
344# CONFIG_DEFAULT_HTCP is not set
345# CONFIG_DEFAULT_VEGAS is not set
346CONFIG_DEFAULT_WESTWOOD=y
347# CONFIG_DEFAULT_RENO is not set
348CONFIG_DEFAULT_TCP_CONG="westwood"
349# CONFIG_TCP_MD5SIG is not set
350# CONFIG_IPV6 is not set
351# CONFIG_NETWORK_SECMARK is not set
352CONFIG_NETFILTER=y
353# CONFIG_NETFILTER_DEBUG is not set
354CONFIG_NETFILTER_ADVANCED=y
355# CONFIG_BRIDGE_NETFILTER is not set
356
357#
358# Core Netfilter Configuration
359#
360# CONFIG_NETFILTER_NETLINK_QUEUE is not set
361# CONFIG_NETFILTER_NETLINK_LOG is not set
362CONFIG_NF_CONNTRACK=m
363# CONFIG_NF_CT_ACCT is not set
364CONFIG_NF_CONNTRACK_MARK=y
365# CONFIG_NF_CONNTRACK_EVENTS is not set
366# CONFIG_NF_CT_PROTO_DCCP is not set
367# CONFIG_NF_CT_PROTO_SCTP is not set
368# CONFIG_NF_CT_PROTO_UDPLITE is not set
369# CONFIG_NF_CONNTRACK_AMANDA is not set
370CONFIG_NF_CONNTRACK_FTP=m
371# CONFIG_NF_CONNTRACK_H323 is not set
372CONFIG_NF_CONNTRACK_IRC=m
373# CONFIG_NF_CONNTRACK_NETBIOS_NS is not set
374# CONFIG_NF_CONNTRACK_PPTP is not set
375# CONFIG_NF_CONNTRACK_SANE is not set
376# CONFIG_NF_CONNTRACK_SIP is not set
377CONFIG_NF_CONNTRACK_TFTP=m
378# CONFIG_NF_CT_NETLINK is not set
379# CONFIG_NETFILTER_TPROXY is not set
380CONFIG_NETFILTER_XTABLES=m
381# CONFIG_NETFILTER_XT_TARGET_CLASSIFY is not set
382# CONFIG_NETFILTER_XT_TARGET_CONNMARK is not set
383# CONFIG_NETFILTER_XT_TARGET_DSCP is not set
384# CONFIG_NETFILTER_XT_TARGET_HL is not set
385# CONFIG_NETFILTER_XT_TARGET_LED is not set
386# CONFIG_NETFILTER_XT_TARGET_MARK is not set
387# CONFIG_NETFILTER_XT_TARGET_NFLOG is not set
388# CONFIG_NETFILTER_XT_TARGET_NFQUEUE is not set
389CONFIG_NETFILTER_XT_TARGET_NOTRACK=m
390# CONFIG_NETFILTER_XT_TARGET_RATEEST is not set
391# CONFIG_NETFILTER_XT_TARGET_TRACE is not set
392CONFIG_NETFILTER_XT_TARGET_TCPMSS=m
393# CONFIG_NETFILTER_XT_TARGET_TCPOPTSTRIP is not set
394# CONFIG_NETFILTER_XT_MATCH_CLUSTER is not set
395# CONFIG_NETFILTER_XT_MATCH_COMMENT is not set
396# CONFIG_NETFILTER_XT_MATCH_CONNBYTES is not set
397# CONFIG_NETFILTER_XT_MATCH_CONNLIMIT is not set
398# CONFIG_NETFILTER_XT_MATCH_CONNMARK is not set
399# CONFIG_NETFILTER_XT_MATCH_CONNTRACK is not set
400# CONFIG_NETFILTER_XT_MATCH_DCCP is not set
401# CONFIG_NETFILTER_XT_MATCH_DSCP is not set
402# CONFIG_NETFILTER_XT_MATCH_ESP is not set
403# CONFIG_NETFILTER_XT_MATCH_HASHLIMIT is not set
404# CONFIG_NETFILTER_XT_MATCH_HELPER is not set
405# CONFIG_NETFILTER_XT_MATCH_HL is not set
406# CONFIG_NETFILTER_XT_MATCH_IPRANGE is not set
407# CONFIG_NETFILTER_XT_MATCH_LENGTH is not set
408CONFIG_NETFILTER_XT_MATCH_LIMIT=m
409CONFIG_NETFILTER_XT_MATCH_MAC=m
410# CONFIG_NETFILTER_XT_MATCH_MARK is not set
411CONFIG_NETFILTER_XT_MATCH_MULTIPORT=m
412# CONFIG_NETFILTER_XT_MATCH_OWNER is not set
413# CONFIG_NETFILTER_XT_MATCH_PKTTYPE is not set
414# CONFIG_NETFILTER_XT_MATCH_QUOTA is not set
415# CONFIG_NETFILTER_XT_MATCH_RATEEST is not set
416# CONFIG_NETFILTER_XT_MATCH_REALM is not set
417# CONFIG_NETFILTER_XT_MATCH_RECENT is not set
418# CONFIG_NETFILTER_XT_MATCH_SCTP is not set
419CONFIG_NETFILTER_XT_MATCH_STATE=m
420# CONFIG_NETFILTER_XT_MATCH_STATISTIC is not set
421# CONFIG_NETFILTER_XT_MATCH_STRING is not set
422# CONFIG_NETFILTER_XT_MATCH_TCPMSS is not set
423# CONFIG_NETFILTER_XT_MATCH_TIME is not set
424# CONFIG_NETFILTER_XT_MATCH_U32 is not set
425# CONFIG_IP_VS is not set
426
427#
428# IP: Netfilter Configuration
429#
430CONFIG_NF_DEFRAG_IPV4=m
431CONFIG_NF_CONNTRACK_IPV4=m
432CONFIG_NF_CONNTRACK_PROC_COMPAT=y
433# CONFIG_IP_NF_QUEUE is not set
434CONFIG_IP_NF_IPTABLES=m
435# CONFIG_IP_NF_MATCH_ADDRTYPE is not set
436# CONFIG_IP_NF_MATCH_AH is not set
437# CONFIG_IP_NF_MATCH_ECN is not set
438# CONFIG_IP_NF_MATCH_TTL is not set
439CONFIG_IP_NF_FILTER=m
440CONFIG_IP_NF_TARGET_REJECT=m
441CONFIG_IP_NF_TARGET_LOG=m
442# CONFIG_IP_NF_TARGET_ULOG is not set
443CONFIG_NF_NAT=m
444CONFIG_NF_NAT_NEEDED=y
445CONFIG_IP_NF_TARGET_MASQUERADE=m
446# CONFIG_IP_NF_TARGET_NETMAP is not set
447# CONFIG_IP_NF_TARGET_REDIRECT is not set
448# CONFIG_NF_NAT_SNMP_BASIC is not set
449CONFIG_NF_NAT_FTP=m
450CONFIG_NF_NAT_IRC=m
451CONFIG_NF_NAT_TFTP=m
452# CONFIG_NF_NAT_AMANDA is not set
453# CONFIG_NF_NAT_PPTP is not set
454# CONFIG_NF_NAT_H323 is not set
455# CONFIG_NF_NAT_SIP is not set
456CONFIG_IP_NF_MANGLE=m
457# CONFIG_IP_NF_TARGET_CLUSTERIP is not set
458# CONFIG_IP_NF_TARGET_ECN is not set
459# CONFIG_IP_NF_TARGET_TTL is not set
460CONFIG_IP_NF_RAW=m
461# CONFIG_IP_NF_ARPTABLES is not set
462# CONFIG_IP_DCCP is not set
463# CONFIG_IP_SCTP is not set
464# CONFIG_TIPC is not set
465CONFIG_ATM=m
466# CONFIG_ATM_CLIP is not set
467# CONFIG_ATM_LANE is not set
468CONFIG_ATM_BR2684=m
469CONFIG_ATM_BR2684_IPFILTER=y
470CONFIG_STP=y
471CONFIG_BRIDGE=y
472# CONFIG_NET_DSA is not set
473CONFIG_VLAN_8021Q=y
474# CONFIG_VLAN_8021Q_GVRP is not set
475# CONFIG_DECNET is not set
476CONFIG_LLC=y
477# CONFIG_LLC2 is not set
478# CONFIG_IPX is not set
479# CONFIG_ATALK is not set
480# CONFIG_X25 is not set
481# CONFIG_LAPB is not set
482# CONFIG_ECONET is not set
483# CONFIG_WAN_ROUTER is not set
484# CONFIG_PHONET is not set
485# CONFIG_IEEE802154 is not set
486CONFIG_NET_SCHED=y
487
488#
489# Queueing/Scheduling
490#
491# CONFIG_NET_SCH_CBQ is not set
492# CONFIG_NET_SCH_HTB is not set
493# CONFIG_NET_SCH_HFSC is not set
494# CONFIG_NET_SCH_ATM is not set
495# CONFIG_NET_SCH_PRIO is not set
496# CONFIG_NET_SCH_MULTIQ is not set
497# CONFIG_NET_SCH_RED is not set
498# CONFIG_NET_SCH_SFQ is not set
499# CONFIG_NET_SCH_TEQL is not set
500# CONFIG_NET_SCH_TBF is not set
501# CONFIG_NET_SCH_GRED is not set
502# CONFIG_NET_SCH_DSMARK is not set
503# CONFIG_NET_SCH_NETEM is not set
504# CONFIG_NET_SCH_DRR is not set
505# CONFIG_NET_SCH_INGRESS is not set
506
507#
508# Classification
509#
510# CONFIG_NET_CLS_BASIC is not set
511# CONFIG_NET_CLS_TCINDEX is not set
512# CONFIG_NET_CLS_ROUTE4 is not set
513# CONFIG_NET_CLS_FW is not set
514# CONFIG_NET_CLS_U32 is not set
515# CONFIG_NET_CLS_RSVP is not set
516# CONFIG_NET_CLS_RSVP6 is not set
517# CONFIG_NET_CLS_FLOW is not set
518# CONFIG_NET_EMATCH is not set
519CONFIG_NET_CLS_ACT=y
520CONFIG_NET_ACT_POLICE=y
521# CONFIG_NET_ACT_GACT is not set
522# CONFIG_NET_ACT_MIRRED is not set
523# CONFIG_NET_ACT_IPT is not set
524# CONFIG_NET_ACT_NAT is not set
525# CONFIG_NET_ACT_PEDIT is not set
526# CONFIG_NET_ACT_SIMP is not set
527# CONFIG_NET_ACT_SKBEDIT is not set
528CONFIG_NET_SCH_FIFO=y
529# CONFIG_DCB is not set
530
531#
532# Network testing
533#
534# CONFIG_NET_PKTGEN is not set
535CONFIG_HAMRADIO=y
536
537#
538# Packet Radio protocols
539#
540# CONFIG_AX25 is not set
541# CONFIG_CAN is not set
542# CONFIG_IRDA is not set
543# CONFIG_BT is not set
544# CONFIG_AF_RXRPC is not set
545CONFIG_FIB_RULES=y
546CONFIG_WIRELESS=y
547CONFIG_CFG80211=m
548# CONFIG_CFG80211_REG_DEBUG is not set
549# CONFIG_CFG80211_DEBUGFS is not set
550# CONFIG_WIRELESS_OLD_REGULATORY is not set
551CONFIG_WIRELESS_EXT=y
552CONFIG_WIRELESS_EXT_SYSFS=y
553# CONFIG_LIB80211 is not set
554CONFIG_MAC80211=m
555CONFIG_MAC80211_DEFAULT_PS=y
556CONFIG_MAC80211_DEFAULT_PS_VALUE=1
557
558#
559# Rate control algorithm selection
560#
561CONFIG_MAC80211_RC_PID=y
562CONFIG_MAC80211_RC_MINSTREL=y
563CONFIG_MAC80211_RC_DEFAULT_PID=y
564# CONFIG_MAC80211_RC_DEFAULT_MINSTREL is not set
565CONFIG_MAC80211_RC_DEFAULT="pid"
566# CONFIG_MAC80211_MESH is not set
567# CONFIG_MAC80211_LEDS is not set
568# CONFIG_MAC80211_DEBUGFS is not set
569# CONFIG_MAC80211_DEBUG_MENU is not set
570# CONFIG_WIMAX is not set
571# CONFIG_RFKILL is not set
572# CONFIG_NET_9P is not set
573
574#
575# Device Drivers
576#
577
578#
579# Generic Driver Options
580#
581CONFIG_UEVENT_HELPER_PATH="/sbin/hotplug"
582CONFIG_STANDALONE=y
583CONFIG_PREVENT_FIRMWARE_BUILD=y
584CONFIG_FW_LOADER=y
585# CONFIG_FIRMWARE_IN_KERNEL is not set
586CONFIG_EXTRA_FIRMWARE=""
587# CONFIG_SYS_HYPERVISOR is not set
588# CONFIG_CONNECTOR is not set
589CONFIG_MTD=y
590# CONFIG_MTD_DEBUG is not set
591# CONFIG_MTD_CONCAT is not set
592CONFIG_MTD_PARTITIONS=y
593# CONFIG_MTD_TESTS is not set
594# CONFIG_MTD_REDBOOT_PARTS is not set
595# CONFIG_MTD_CMDLINE_PARTS is not set
596# CONFIG_MTD_AR7_PARTS is not set
597
598#
599# User Modules And Translation Layers
600#
601CONFIG_MTD_CHAR=y
602CONFIG_MTD_BLKDEVS=y
603CONFIG_MTD_BLOCK=y
604# CONFIG_FTL is not set
605# CONFIG_NFTL is not set
606# CONFIG_INFTL is not set
607# CONFIG_RFD_FTL is not set
608# CONFIG_SSFDC is not set
609# CONFIG_MTD_OOPS is not set
610
611#
612# RAM/ROM/Flash chip drivers
613#
614CONFIG_MTD_CFI=y
615# CONFIG_MTD_JEDECPROBE is not set
616CONFIG_MTD_GEN_PROBE=y
617# CONFIG_MTD_CFI_ADV_OPTIONS is not set
618CONFIG_MTD_MAP_BANK_WIDTH_1=y
619CONFIG_MTD_MAP_BANK_WIDTH_2=y
620CONFIG_MTD_MAP_BANK_WIDTH_4=y
621# CONFIG_MTD_MAP_BANK_WIDTH_8 is not set
622# CONFIG_MTD_MAP_BANK_WIDTH_16 is not set
623# CONFIG_MTD_MAP_BANK_WIDTH_32 is not set
624CONFIG_MTD_CFI_I1=y
625CONFIG_MTD_CFI_I2=y
626# CONFIG_MTD_CFI_I4 is not set
627# CONFIG_MTD_CFI_I8 is not set
628CONFIG_MTD_CFI_INTELEXT=y
629CONFIG_MTD_CFI_AMDSTD=y
630CONFIG_MTD_CFI_STAA=y
631CONFIG_MTD_CFI_UTIL=y
632# CONFIG_MTD_RAM is not set
633# CONFIG_MTD_ROM is not set
634# CONFIG_MTD_ABSENT is not set
635
636#
637# Mapping drivers for chip access
638#
639CONFIG_MTD_COMPLEX_MAPPINGS=y
640CONFIG_MTD_PHYSMAP=y
641# CONFIG_MTD_PHYSMAP_COMPAT is not set
642# CONFIG_MTD_PLATRAM is not set
643
644#
645# Self-contained MTD device drivers
646#
647# CONFIG_MTD_SLRAM is not set
648# CONFIG_MTD_PHRAM is not set
649# CONFIG_MTD_MTDRAM is not set
650# CONFIG_MTD_BLOCK2MTD is not set
651
652#
653# Disk-On-Chip Device Drivers
654#
655# CONFIG_MTD_DOC2000 is not set
656# CONFIG_MTD_DOC2001 is not set
657# CONFIG_MTD_DOC2001PLUS is not set
658# CONFIG_MTD_NAND is not set
659# CONFIG_MTD_ONENAND is not set
660
661#
662# LPDDR flash memory drivers
663#
664# CONFIG_MTD_LPDDR is not set
665
666#
667# UBI - Unsorted block images
668#
669# CONFIG_MTD_UBI is not set
670# CONFIG_PARPORT is not set
671CONFIG_BLK_DEV=y
672# CONFIG_BLK_DEV_COW_COMMON is not set
673# CONFIG_BLK_DEV_LOOP is not set
674# CONFIG_BLK_DEV_NBD is not set
675# CONFIG_BLK_DEV_RAM is not set
676# CONFIG_CDROM_PKTCDVD is not set
677# CONFIG_ATA_OVER_ETH is not set
678# CONFIG_BLK_DEV_HD is not set
679CONFIG_MISC_DEVICES=y
680# CONFIG_ENCLOSURE_SERVICES is not set
681# CONFIG_C2PORT is not set
682
683#
684# EEPROM support
685#
686# CONFIG_EEPROM_93CX6 is not set
687CONFIG_HAVE_IDE=y
688# CONFIG_IDE is not set
689
690#
691# SCSI device support
692#
693# CONFIG_RAID_ATTRS is not set
694# CONFIG_SCSI is not set
695# CONFIG_SCSI_DMA is not set
696# CONFIG_SCSI_NETLINK is not set
697# CONFIG_ATA is not set
698# CONFIG_MD is not set
699CONFIG_NETDEVICES=y
700# CONFIG_IFB is not set
701# CONFIG_DUMMY is not set
702# CONFIG_BONDING is not set
703# CONFIG_MACVLAN is not set
704# CONFIG_EQUALIZER is not set
705# CONFIG_TUN is not set
706# CONFIG_VETH is not set
707CONFIG_PHYLIB=y
708
709#
710# MII PHY device drivers
711#
712# CONFIG_MARVELL_PHY is not set
713# CONFIG_DAVICOM_PHY is not set
714# CONFIG_QSEMI_PHY is not set
715# CONFIG_LXT_PHY is not set
716# CONFIG_CICADA_PHY is not set
717# CONFIG_VITESSE_PHY is not set
718# CONFIG_SMSC_PHY is not set
719# CONFIG_BROADCOM_PHY is not set
720# CONFIG_ICPLUS_PHY is not set
721# CONFIG_REALTEK_PHY is not set
722# CONFIG_NATIONAL_PHY is not set
723# CONFIG_STE10XP is not set
724# CONFIG_LSI_ET1011C_PHY is not set
725CONFIG_FIXED_PHY=y
726# CONFIG_MDIO_BITBANG is not set
727CONFIG_NET_ETHERNET=y
728CONFIG_MII=y
729# CONFIG_AX88796 is not set
730# CONFIG_SMC91X is not set
731# CONFIG_DM9000 is not set
732# CONFIG_ETHOC is not set
733# CONFIG_DNET is not set
734# CONFIG_IBM_NEW_EMAC_ZMII is not set
735# CONFIG_IBM_NEW_EMAC_RGMII is not set
736# CONFIG_IBM_NEW_EMAC_TAH is not set
737# CONFIG_IBM_NEW_EMAC_EMAC4 is not set
738# CONFIG_IBM_NEW_EMAC_NO_FLOW_CTRL is not set
739# CONFIG_IBM_NEW_EMAC_MAL_CLR_ICINTSTAT is not set
740# CONFIG_IBM_NEW_EMAC_MAL_COMMON_ERR is not set
741# CONFIG_B44 is not set
742# CONFIG_KS8842 is not set
743CONFIG_CPMAC=y
744# CONFIG_NETDEV_1000 is not set
745# CONFIG_NETDEV_10000 is not set
746
747#
748# Wireless LAN
749#
750# CONFIG_WLAN_PRE80211 is not set
751CONFIG_WLAN_80211=y
752# CONFIG_LIBERTAS is not set
753# CONFIG_LIBERTAS_THINFIRM is not set
754# CONFIG_MAC80211_HWSIM is not set
755# CONFIG_P54_COMMON is not set
756# CONFIG_HOSTAP is not set
757# CONFIG_B43 is not set
758# CONFIG_B43LEGACY is not set
759# CONFIG_RT2X00 is not set
760
761#
762# Enable WiMAX (Networking options) to see the WiMAX drivers
763#
764# CONFIG_WAN is not set
765CONFIG_ATM_DRIVERS=y
766# CONFIG_ATM_DUMMY is not set
767# CONFIG_ATM_TCP is not set
768CONFIG_PPP=m
769CONFIG_PPP_MULTILINK=y
770CONFIG_PPP_FILTER=y
771CONFIG_PPP_ASYNC=m
772# CONFIG_PPP_SYNC_TTY is not set
773# CONFIG_PPP_DEFLATE is not set
774# CONFIG_PPP_BSDCOMP is not set
775# CONFIG_PPP_MPPE is not set
776CONFIG_PPPOE=m
777CONFIG_PPPOATM=m
778# CONFIG_PPPOL2TP is not set
779# CONFIG_SLIP is not set
780CONFIG_SLHC=m
781# CONFIG_NETCONSOLE is not set
782# CONFIG_NETPOLL is not set
783# CONFIG_NET_POLL_CONTROLLER is not set
784# CONFIG_ISDN is not set
785# CONFIG_PHONE is not set
786
787#
788# Input device support
789#
790# CONFIG_INPUT is not set
791
792#
793# Hardware I/O ports
794#
795# CONFIG_SERIO is not set
796# CONFIG_GAMEPORT is not set
797
798#
799# Character devices
800#
801# CONFIG_VT is not set
802# CONFIG_DEVKMEM is not set
803# CONFIG_SERIAL_NONSTANDARD is not set
804
805#
806# Serial drivers
807#
808CONFIG_SERIAL_8250=y
809CONFIG_SERIAL_8250_CONSOLE=y
810CONFIG_SERIAL_8250_NR_UARTS=2
811CONFIG_SERIAL_8250_RUNTIME_UARTS=2
812# CONFIG_SERIAL_8250_EXTENDED is not set
813
814#
815# Non-8250 serial port support
816#
817CONFIG_SERIAL_CORE=y
818CONFIG_SERIAL_CORE_CONSOLE=y
819CONFIG_UNIX98_PTYS=y
820# CONFIG_DEVPTS_MULTIPLE_INSTANCES is not set
821# CONFIG_LEGACY_PTYS is not set
822# CONFIG_IPMI_HANDLER is not set
823CONFIG_HW_RANDOM=y
824# CONFIG_HW_RANDOM_TIMERIOMEM is not set
825# CONFIG_R3964 is not set
826# CONFIG_RAW_DRIVER is not set
827# CONFIG_TCG_TPM is not set
828# CONFIG_I2C is not set
829# CONFIG_SPI is not set
830# CONFIG_W1 is not set
831# CONFIG_POWER_SUPPLY is not set
832# CONFIG_HWMON is not set
833# CONFIG_THERMAL is not set
834# CONFIG_THERMAL_HWMON is not set
835CONFIG_WATCHDOG=y
836# CONFIG_WATCHDOG_NOWAYOUT is not set
837
838#
839# Watchdog Device Drivers
840#
841# CONFIG_SOFT_WATCHDOG is not set
842CONFIG_AR7_WDT=y
843CONFIG_SSB_POSSIBLE=y
844
845#
846# Sonics Silicon Backplane
847#
848CONFIG_SSB=y
849# CONFIG_SSB_SILENT is not set
850# CONFIG_SSB_DEBUG is not set
851CONFIG_SSB_SERIAL=y
852CONFIG_SSB_DRIVER_MIPS=y
853CONFIG_SSB_EMBEDDED=y
854CONFIG_SSB_DRIVER_EXTIF=y
855
856#
857# Multifunction device drivers
858#
859# CONFIG_MFD_CORE is not set
860# CONFIG_MFD_SM501 is not set
861# CONFIG_HTC_PASIC3 is not set
862# CONFIG_MFD_TMIO is not set
863# CONFIG_REGULATOR is not set
864# CONFIG_MEDIA_SUPPORT is not set
865
866#
867# Graphics support
868#
869# CONFIG_VGASTATE is not set
870# CONFIG_VIDEO_OUTPUT_CONTROL is not set
871# CONFIG_FB is not set
872# CONFIG_BACKLIGHT_LCD_SUPPORT is not set
873
874#
875# Display device support
876#
877# CONFIG_DISPLAY_SUPPORT is not set
878# CONFIG_SOUND is not set
879# CONFIG_USB_SUPPORT is not set
880# CONFIG_MMC is not set
881# CONFIG_MEMSTICK is not set
882CONFIG_NEW_LEDS=y
883CONFIG_LEDS_CLASS=y
884
885#
886# LED drivers
887#
888# CONFIG_LEDS_GPIO is not set
889
890#
891# LED Triggers
892#
893CONFIG_LEDS_TRIGGERS=y
894CONFIG_LEDS_TRIGGER_TIMER=y
895CONFIG_LEDS_TRIGGER_HEARTBEAT=y
896# CONFIG_LEDS_TRIGGER_BACKLIGHT is not set
897CONFIG_LEDS_TRIGGER_DEFAULT_ON=y
898
899#
900# iptables trigger is under Netfilter config (LED target)
901#
902# CONFIG_ACCESSIBILITY is not set
903CONFIG_RTC_LIB=y
904# CONFIG_RTC_CLASS is not set
905# CONFIG_DMADEVICES is not set
906# CONFIG_AUXDISPLAY is not set
907# CONFIG_UIO is not set
908
909#
910# TI VLYNQ
911#
912CONFIG_VLYNQ=y
913# CONFIG_STAGING is not set
914
915#
916# File systems
917#
918# CONFIG_EXT2_FS is not set
919# CONFIG_EXT3_FS is not set
920# CONFIG_EXT4_FS is not set
921# CONFIG_REISERFS_FS is not set
922# CONFIG_JFS_FS is not set
923# CONFIG_FS_POSIX_ACL is not set
924# CONFIG_XFS_FS is not set
925# CONFIG_OCFS2_FS is not set
926# CONFIG_BTRFS_FS is not set
927CONFIG_FILE_LOCKING=y
928CONFIG_FSNOTIFY=y
929# CONFIG_DNOTIFY is not set
930# CONFIG_INOTIFY is not set
931CONFIG_INOTIFY_USER=y
932# CONFIG_QUOTA is not set
933# CONFIG_AUTOFS_FS is not set
934# CONFIG_AUTOFS4_FS is not set
935# CONFIG_FUSE_FS is not set
936
937#
938# Caches
939#
940# CONFIG_FSCACHE is not set
941
942#
943# CD-ROM/DVD Filesystems
944#
945# CONFIG_ISO9660_FS is not set
946# CONFIG_UDF_FS is not set
947
948#
949# DOS/FAT/NT Filesystems
950#
951# CONFIG_MSDOS_FS is not set
952# CONFIG_VFAT_FS is not set
953# CONFIG_NTFS_FS is not set
954
955#
956# Pseudo filesystems
957#
958CONFIG_PROC_FS=y
959CONFIG_PROC_KCORE=y
960CONFIG_PROC_SYSCTL=y
961# CONFIG_PROC_PAGE_MONITOR is not set
962CONFIG_SYSFS=y
963CONFIG_TMPFS=y
964# CONFIG_TMPFS_POSIX_ACL is not set
965# CONFIG_HUGETLB_PAGE is not set
966# CONFIG_CONFIGFS_FS is not set
967CONFIG_MISC_FILESYSTEMS=y
968# CONFIG_ADFS_FS is not set
969# CONFIG_AFFS_FS is not set
970# CONFIG_HFS_FS is not set
971# CONFIG_HFSPLUS_FS is not set
972# CONFIG_BEFS_FS is not set
973# CONFIG_BFS_FS is not set
974# CONFIG_EFS_FS is not set
975CONFIG_JFFS2_FS=y
976CONFIG_JFFS2_FS_DEBUG=0
977CONFIG_JFFS2_FS_WRITEBUFFER=y
978# CONFIG_JFFS2_FS_WBUF_VERIFY is not set
979CONFIG_JFFS2_SUMMARY=y
980# CONFIG_JFFS2_FS_XATTR is not set
981CONFIG_JFFS2_COMPRESSION_OPTIONS=y
982CONFIG_JFFS2_ZLIB=y
983# CONFIG_JFFS2_LZO is not set
984CONFIG_JFFS2_RTIME=y
985# CONFIG_JFFS2_RUBIN is not set
986# CONFIG_JFFS2_CMODE_NONE is not set
987CONFIG_JFFS2_CMODE_PRIORITY=y
988# CONFIG_JFFS2_CMODE_SIZE is not set
989# CONFIG_JFFS2_CMODE_FAVOURLZO is not set
990# CONFIG_CRAMFS is not set
991CONFIG_SQUASHFS=y
992# CONFIG_SQUASHFS_EMBEDDED is not set
993CONFIG_SQUASHFS_FRAGMENT_CACHE_SIZE=3
994# CONFIG_VXFS_FS is not set
995# CONFIG_MINIX_FS is not set
996# CONFIG_OMFS_FS is not set
997# CONFIG_HPFS_FS is not set
998# CONFIG_QNX4FS_FS is not set
999# CONFIG_ROMFS_FS is not set
1000# CONFIG_SYSV_FS is not set
1001# CONFIG_UFS_FS is not set
1002# CONFIG_NILFS2_FS is not set
1003CONFIG_NETWORK_FILESYSTEMS=y
1004# CONFIG_NFS_FS is not set
1005# CONFIG_NFSD is not set
1006# CONFIG_SMB_FS is not set
1007# CONFIG_CIFS is not set
1008# CONFIG_NCP_FS is not set
1009# CONFIG_CODA_FS is not set
1010# CONFIG_AFS_FS is not set
1011
1012#
1013# Partition Types
1014#
1015CONFIG_PARTITION_ADVANCED=y
1016# CONFIG_ACORN_PARTITION is not set
1017# CONFIG_OSF_PARTITION is not set
1018# CONFIG_AMIGA_PARTITION is not set
1019# CONFIG_ATARI_PARTITION is not set
1020# CONFIG_MAC_PARTITION is not set
1021CONFIG_MSDOS_PARTITION=y
1022CONFIG_BSD_DISKLABEL=y
1023# CONFIG_MINIX_SUBPARTITION is not set
1024# CONFIG_SOLARIS_X86_PARTITION is not set
1025# CONFIG_UNIXWARE_DISKLABEL is not set
1026# CONFIG_LDM_PARTITION is not set
1027# CONFIG_SGI_PARTITION is not set
1028# CONFIG_ULTRIX_PARTITION is not set
1029# CONFIG_SUN_PARTITION is not set
1030# CONFIG_KARMA_PARTITION is not set
1031# CONFIG_EFI_PARTITION is not set
1032# CONFIG_SYSV68_PARTITION is not set
1033# CONFIG_NLS is not set
1034# CONFIG_DLM is not set
1035
1036#
1037# Kernel hacking
1038#
1039CONFIG_TRACE_IRQFLAGS_SUPPORT=y
1040# CONFIG_PRINTK_TIME is not set
1041CONFIG_ENABLE_WARN_DEPRECATED=y
1042# CONFIG_ENABLE_MUST_CHECK is not set
1043CONFIG_FRAME_WARN=1024
1044# CONFIG_MAGIC_SYSRQ is not set
1045# CONFIG_UNUSED_SYMBOLS is not set
1046CONFIG_DEBUG_FS=y
1047# CONFIG_HEADERS_CHECK is not set
1048# CONFIG_DEBUG_KERNEL is not set
1049# CONFIG_DEBUG_MEMORY_INIT is not set
1050# CONFIG_RCU_CPU_STALL_DETECTOR is not set
1051CONFIG_SYSCTL_SYSCALL_CHECK=y
1052CONFIG_TRACING_SUPPORT=y
1053# CONFIG_FTRACE is not set
1054# CONFIG_DYNAMIC_DEBUG is not set
1055# CONFIG_SAMPLES is not set
1056CONFIG_HAVE_ARCH_KGDB=y
1057CONFIG_CMDLINE="rootfstype=squashfs,jffs2"
1058
1059#
1060# Security options
1061#
1062# CONFIG_KEYS is not set
1063# CONFIG_SECURITY is not set
1064# CONFIG_SECURITYFS is not set
1065# CONFIG_SECURITY_FILE_CAPABILITIES is not set
1066CONFIG_CRYPTO=y
1067
1068#
1069# Crypto core or helper
1070#
1071# CONFIG_CRYPTO_FIPS is not set
1072CONFIG_CRYPTO_ALGAPI=m
1073CONFIG_CRYPTO_ALGAPI2=m
1074CONFIG_CRYPTO_AEAD2=m
1075CONFIG_CRYPTO_BLKCIPHER=m
1076CONFIG_CRYPTO_BLKCIPHER2=m
1077CONFIG_CRYPTO_HASH2=m
1078CONFIG_CRYPTO_RNG2=m
1079CONFIG_CRYPTO_PCOMP=m
1080CONFIG_CRYPTO_MANAGER=m
1081CONFIG_CRYPTO_MANAGER2=m
1082# CONFIG_CRYPTO_GF128MUL is not set
1083# CONFIG_CRYPTO_NULL is not set
1084CONFIG_CRYPTO_WORKQUEUE=m
1085# CONFIG_CRYPTO_CRYPTD is not set
1086# CONFIG_CRYPTO_AUTHENC is not set
1087# CONFIG_CRYPTO_TEST is not set
1088
1089#
1090# Authenticated Encryption with Associated Data
1091#
1092# CONFIG_CRYPTO_CCM is not set
1093# CONFIG_CRYPTO_GCM is not set
1094# CONFIG_CRYPTO_SEQIV is not set
1095
1096#
1097# Block modes
1098#
1099# CONFIG_CRYPTO_CBC is not set
1100# CONFIG_CRYPTO_CTR is not set
1101# CONFIG_CRYPTO_CTS is not set
1102CONFIG_CRYPTO_ECB=m
1103# CONFIG_CRYPTO_LRW is not set
1104# CONFIG_CRYPTO_PCBC is not set
1105# CONFIG_CRYPTO_XTS is not set
1106
1107#
1108# Hash modes
1109#
1110# CONFIG_CRYPTO_HMAC is not set
1111# CONFIG_CRYPTO_XCBC is not set
1112
1113#
1114# Digest
1115#
1116# CONFIG_CRYPTO_CRC32C is not set
1117# CONFIG_CRYPTO_MD4 is not set
1118# CONFIG_CRYPTO_MD5 is not set
1119# CONFIG_CRYPTO_MICHAEL_MIC is not set
1120# CONFIG_CRYPTO_RMD128 is not set
1121# CONFIG_CRYPTO_RMD160 is not set
1122# CONFIG_CRYPTO_RMD256 is not set
1123# CONFIG_CRYPTO_RMD320 is not set
1124# CONFIG_CRYPTO_SHA1 is not set
1125# CONFIG_CRYPTO_SHA256 is not set
1126# CONFIG_CRYPTO_SHA512 is not set
1127# CONFIG_CRYPTO_TGR192 is not set
1128# CONFIG_CRYPTO_WP512 is not set
1129
1130#
1131# Ciphers
1132#
1133CONFIG_CRYPTO_AES=m
1134# CONFIG_CRYPTO_ANUBIS is not set
1135CONFIG_CRYPTO_ARC4=m
1136# CONFIG_CRYPTO_BLOWFISH is not set
1137# CONFIG_CRYPTO_CAMELLIA is not set
1138# CONFIG_CRYPTO_CAST5 is not set
1139# CONFIG_CRYPTO_CAST6 is not set
1140# CONFIG_CRYPTO_DES is not set
1141# CONFIG_CRYPTO_FCRYPT is not set
1142# CONFIG_CRYPTO_KHAZAD is not set
1143# CONFIG_CRYPTO_SALSA20 is not set
1144# CONFIG_CRYPTO_SEED is not set
1145# CONFIG_CRYPTO_SERPENT is not set
1146# CONFIG_CRYPTO_TEA is not set
1147# CONFIG_CRYPTO_TWOFISH is not set
1148
1149#
1150# Compression
1151#
1152# CONFIG_CRYPTO_DEFLATE is not set
1153# CONFIG_CRYPTO_ZLIB is not set
1154# CONFIG_CRYPTO_LZO is not set
1155
1156#
1157# Random Number Generation
1158#
1159# CONFIG_CRYPTO_ANSI_CPRNG is not set
1160# CONFIG_CRYPTO_HW is not set
1161# CONFIG_BINARY_PRINTF is not set
1162
1163#
1164# Library routines
1165#
1166CONFIG_BITREVERSE=y
1167CONFIG_GENERIC_FIND_LAST_BIT=y
1168CONFIG_CRC_CCITT=m
1169# CONFIG_CRC16 is not set
1170# CONFIG_CRC_T10DIF is not set
1171# CONFIG_CRC_ITU_T is not set
1172CONFIG_CRC32=y
1173# CONFIG_CRC7 is not set
1174# CONFIG_LIBCRC32C is not set
1175CONFIG_ZLIB_INFLATE=y
1176CONFIG_ZLIB_DEFLATE=y
1177CONFIG_DECOMPRESS_GZIP=y
1178CONFIG_DECOMPRESS_LZMA=y
1179CONFIG_HAS_IOMEM=y
1180CONFIG_HAS_IOPORT=y
1181CONFIG_HAS_DMA=y
1182CONFIG_NLATTR=y
diff --git a/arch/mips/gt64120/wrppmc/serial.c b/arch/mips/gt64120/wrppmc/serial.c
index 5ec1c2ffd3a5..6f9d0858f596 100644
--- a/arch/mips/gt64120/wrppmc/serial.c
+++ b/arch/mips/gt64120/wrppmc/serial.c
@@ -1,7 +1,7 @@
1/* 1/*
2 * Registration of WRPPMC UART platform device. 2 * Registration of WRPPMC UART platform device.
3 * 3 *
4 * Copyright (C) 2007 Yoichi Yuasa <yoichi_yuasa@tripeaks.co.jp> 4 * Copyright (C) 2007 Yoichi Yuasa <yuasa@linux-mips.org>
5 * 5 *
6 * This program is free software; you can redistribute it and/or modify 6 * This program is free software; you can redistribute it and/or modify
7 * it under the terms of the GNU General Public License as published by 7 * it under the terms of the GNU General Public License as published by
diff --git a/arch/mips/include/asm/amon.h b/arch/mips/include/asm/amon.h
new file mode 100644
index 000000000000..c3dc1a68dd8d
--- /dev/null
+++ b/arch/mips/include/asm/amon.h
@@ -0,0 +1,7 @@
1/*
2 * Amon support
3 */
4
5int amon_cpu_avail(int);
6void amon_cpu_start(int, unsigned long, unsigned long,
7 unsigned long, unsigned long);
diff --git a/arch/mips/include/asm/ds1287.h b/arch/mips/include/asm/ds1287.h
index ba1702e86931..3af0b8fb3b8c 100644
--- a/arch/mips/include/asm/ds1287.h
+++ b/arch/mips/include/asm/ds1287.h
@@ -1,7 +1,7 @@
1/* 1/*
2 * DS1287 timer functions. 2 * DS1287 timer functions.
3 * 3 *
4 * Copyright (C) 2008 Yoichi Yuasa <yoichi_yuasa@tripeaks.co.jp> 4 * Copyright (C) 2008 Yoichi Yuasa <yuasa@linux-mips.org>
5 * 5 *
6 * This program is free software; you can redistribute it and/or modify 6 * This program is free software; you can redistribute it and/or modify
7 * it under the terms of the GNU General Public License as published by 7 * it under the terms of the GNU General Public License as published by
diff --git a/arch/mips/include/asm/elf.h b/arch/mips/include/asm/elf.h
index d58f128aa747..7990694cda22 100644
--- a/arch/mips/include/asm/elf.h
+++ b/arch/mips/include/asm/elf.h
@@ -316,9 +316,13 @@ extern void elf_dump_regs(elf_greg_t *, struct pt_regs *regs);
316extern int dump_task_regs(struct task_struct *, elf_gregset_t *); 316extern int dump_task_regs(struct task_struct *, elf_gregset_t *);
317extern int dump_task_fpu(struct task_struct *, elf_fpregset_t *); 317extern int dump_task_fpu(struct task_struct *, elf_fpregset_t *);
318 318
319#ifndef ELF_CORE_COPY_REGS
319#define ELF_CORE_COPY_REGS(elf_regs, regs) \ 320#define ELF_CORE_COPY_REGS(elf_regs, regs) \
320 elf_dump_regs((elf_greg_t *)&(elf_regs), regs); 321 elf_dump_regs((elf_greg_t *)&(elf_regs), regs);
322#endif
323#ifndef ELF_CORE_COPY_TASK_REGS
321#define ELF_CORE_COPY_TASK_REGS(tsk, elf_regs) dump_task_regs(tsk, elf_regs) 324#define ELF_CORE_COPY_TASK_REGS(tsk, elf_regs) dump_task_regs(tsk, elf_regs)
325#endif
322#define ELF_CORE_COPY_FPREGS(tsk, elf_fpregs) \ 326#define ELF_CORE_COPY_FPREGS(tsk, elf_fpregs) \
323 dump_task_fpu(tsk, elf_fpregs) 327 dump_task_fpu(tsk, elf_fpregs)
324 328
diff --git a/arch/mips/include/asm/gcmpregs.h b/arch/mips/include/asm/gcmpregs.h
index d74a8a4ca861..36fd969d64d6 100644
--- a/arch/mips/include/asm/gcmpregs.h
+++ b/arch/mips/include/asm/gcmpregs.h
@@ -114,4 +114,6 @@
114#define GCMP_CCB_DINTGROUP_OFS 0x0030 /* DINT Group Participate */ 114#define GCMP_CCB_DINTGROUP_OFS 0x0030 /* DINT Group Participate */
115#define GCMP_CCB_DBGGROUP_OFS 0x0100 /* DebugBreak Group */ 115#define GCMP_CCB_DBGGROUP_OFS 0x0100 /* DebugBreak Group */
116 116
117extern int __init gcmp_probe(unsigned long, unsigned long);
118
117#endif /* _ASM_GCMPREGS_H */ 119#endif /* _ASM_GCMPREGS_H */
diff --git a/arch/mips/include/asm/gic.h b/arch/mips/include/asm/gic.h
index 954807d9d66a..10292e37c1f7 100644
--- a/arch/mips/include/asm/gic.h
+++ b/arch/mips/include/asm/gic.h
@@ -20,7 +20,11 @@
20#define GIC_TRIG_EDGE 1 20#define GIC_TRIG_EDGE 1
21#define GIC_TRIG_LEVEL 0 21#define GIC_TRIG_LEVEL 0
22 22
23#if CONFIG_SMP
24#define GIC_NUM_INTRS (24 + NR_CPUS * 2)
25#else
23#define GIC_NUM_INTRS 32 26#define GIC_NUM_INTRS 32
27#endif
24 28
25#define MSK(n) ((1 << (n)) - 1) 29#define MSK(n) ((1 << (n)) - 1)
26#define REG32(addr) (*(volatile unsigned int *) (addr)) 30#define REG32(addr) (*(volatile unsigned int *) (addr))
@@ -483,5 +487,7 @@ extern void gic_init(unsigned long gic_base_addr,
483 487
484extern unsigned int gic_get_int(void); 488extern unsigned int gic_get_int(void);
485extern void gic_send_ipi(unsigned int intr); 489extern void gic_send_ipi(unsigned int intr);
490extern unsigned int plat_ipi_call_int_xlate(unsigned int);
491extern unsigned int plat_ipi_resched_int_xlate(unsigned int);
486 492
487#endif /* _ASM_GICREGS_H */ 493#endif /* _ASM_GICREGS_H */
diff --git a/arch/mips/include/asm/irq_gt641xx.h b/arch/mips/include/asm/irq_gt641xx.h
index f9a7c3ac2e66..250a2407b599 100644
--- a/arch/mips/include/asm/irq_gt641xx.h
+++ b/arch/mips/include/asm/irq_gt641xx.h
@@ -1,7 +1,7 @@
1/* 1/*
2 * Galileo/Marvell GT641xx IRQ definitions. 2 * Galileo/Marvell GT641xx IRQ definitions.
3 * 3 *
4 * Copyright (C) 2007 Yoichi Yuasa <yoichi_yuasa@tripeaks.co.jp> 4 * Copyright (C) 2007 Yoichi Yuasa <yuasa@linux-mips.org>
5 * 5 *
6 * This program is free software; you can redistribute it and/or modify 6 * This program is free software; you can redistribute it and/or modify
7 * it under the terms of the GNU General Public License as published by 7 * it under the terms of the GNU General Public License as published by
diff --git a/arch/mips/include/asm/mach-ar7/ar7.h b/arch/mips/include/asm/mach-ar7/ar7.h
new file mode 100644
index 000000000000..de71694614de
--- /dev/null
+++ b/arch/mips/include/asm/mach-ar7/ar7.h
@@ -0,0 +1,178 @@
1/*
2 * Copyright (C) 2006,2007 Felix Fietkau <nbd@openwrt.org>
3 * Copyright (C) 2006,2007 Eugene Konev <ejka@openwrt.org>
4 *
5 * This program is free software; you can redistribute it and/or modify
6 * it under the terms of the GNU General Public License as published by
7 * the Free Software Foundation; either version 2 of the License, or
8 * (at your option) any later version.
9 *
10 * This program is distributed in the hope that it will be useful,
11 * but WITHOUT ANY WARRANTY; without even the implied warranty of
12 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13 * GNU General Public License for more details.
14 *
15 * You should have received a copy of the GNU General Public License
16 * along with this program; if not, write to the Free Software
17 * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
18 */
19
20#ifndef __AR7_H__
21#define __AR7_H__
22
23#include <linux/delay.h>
24#include <linux/io.h>
25#include <linux/errno.h>
26
27#include <asm/addrspace.h>
28
29#define AR7_SDRAM_BASE 0x14000000
30
31#define AR7_REGS_BASE 0x08610000
32
33#define AR7_REGS_MAC0 (AR7_REGS_BASE + 0x0000)
34#define AR7_REGS_GPIO (AR7_REGS_BASE + 0x0900)
35/* 0x08610A00 - 0x08610BFF (512 bytes, 128 bytes / clock) */
36#define AR7_REGS_POWER (AR7_REGS_BASE + 0x0a00)
37#define AR7_REGS_CLOCKS (AR7_REGS_POWER + 0x80)
38#define UR8_REGS_CLOCKS (AR7_REGS_POWER + 0x20)
39#define AR7_REGS_UART0 (AR7_REGS_BASE + 0x0e00)
40#define AR7_REGS_USB (AR7_REGS_BASE + 0x1200)
41#define AR7_REGS_RESET (AR7_REGS_BASE + 0x1600)
42#define AR7_REGS_VLYNQ0 (AR7_REGS_BASE + 0x1800)
43#define AR7_REGS_DCL (AR7_REGS_BASE + 0x1a00)
44#define AR7_REGS_VLYNQ1 (AR7_REGS_BASE + 0x1c00)
45#define AR7_REGS_MDIO (AR7_REGS_BASE + 0x1e00)
46#define AR7_REGS_IRQ (AR7_REGS_BASE + 0x2400)
47#define AR7_REGS_MAC1 (AR7_REGS_BASE + 0x2800)
48
49#define AR7_REGS_WDT (AR7_REGS_BASE + 0x1f00)
50#define UR8_REGS_WDT (AR7_REGS_BASE + 0x0b00)
51#define UR8_REGS_UART1 (AR7_REGS_BASE + 0x0f00)
52
53#define AR7_RESET_PEREPHERIAL 0x0
54#define AR7_RESET_SOFTWARE 0x4
55#define AR7_RESET_STATUS 0x8
56
57#define AR7_RESET_BIT_CPMAC_LO 17
58#define AR7_RESET_BIT_CPMAC_HI 21
59#define AR7_RESET_BIT_MDIO 22
60#define AR7_RESET_BIT_EPHY 26
61
62/* GPIO control registers */
63#define AR7_GPIO_INPUT 0x0
64#define AR7_GPIO_OUTPUT 0x4
65#define AR7_GPIO_DIR 0x8
66#define AR7_GPIO_ENABLE 0xc
67
68#define AR7_CHIP_7100 0x18
69#define AR7_CHIP_7200 0x2b
70#define AR7_CHIP_7300 0x05
71
72/* Interrupts */
73#define AR7_IRQ_UART0 15
74#define AR7_IRQ_UART1 16
75
76/* Clocks */
77#define AR7_AFE_CLOCK 35328000
78#define AR7_REF_CLOCK 25000000
79#define AR7_XTAL_CLOCK 24000000
80
81struct plat_cpmac_data {
82 int reset_bit;
83 int power_bit;
84 u32 phy_mask;
85 char dev_addr[6];
86};
87
88struct plat_dsl_data {
89 int reset_bit_dsl;
90 int reset_bit_sar;
91};
92
93extern int ar7_cpu_clock, ar7_bus_clock, ar7_dsp_clock;
94
95static inline u16 ar7_chip_id(void)
96{
97 return readl((void *)KSEG1ADDR(AR7_REGS_GPIO + 0x14)) & 0xffff;
98}
99
100static inline u8 ar7_chip_rev(void)
101{
102 return (readl((void *)KSEG1ADDR(AR7_REGS_GPIO + 0x14)) >> 16) & 0xff;
103}
104
105static inline int ar7_cpu_freq(void)
106{
107 return ar7_cpu_clock;
108}
109
110static inline int ar7_bus_freq(void)
111{
112 return ar7_bus_clock;
113}
114
115static inline int ar7_vbus_freq(void)
116{
117 return ar7_bus_clock / 2;
118}
119#define ar7_cpmac_freq ar7_vbus_freq
120
121static inline int ar7_dsp_freq(void)
122{
123 return ar7_dsp_clock;
124}
125
126static inline int ar7_has_high_cpmac(void)
127{
128 u16 chip_id = ar7_chip_id();
129 switch (chip_id) {
130 case AR7_CHIP_7100:
131 case AR7_CHIP_7200:
132 return 0;
133 case AR7_CHIP_7300:
134 return 1;
135 default:
136 return -ENXIO;
137 }
138}
139#define ar7_has_high_vlynq ar7_has_high_cpmac
140#define ar7_has_second_uart ar7_has_high_cpmac
141
142static inline void ar7_device_enable(u32 bit)
143{
144 void *reset_reg =
145 (void *)KSEG1ADDR(AR7_REGS_RESET + AR7_RESET_PEREPHERIAL);
146 writel(readl(reset_reg) | (1 << bit), reset_reg);
147 msleep(20);
148}
149
150static inline void ar7_device_disable(u32 bit)
151{
152 void *reset_reg =
153 (void *)KSEG1ADDR(AR7_REGS_RESET + AR7_RESET_PEREPHERIAL);
154 writel(readl(reset_reg) & ~(1 << bit), reset_reg);
155 msleep(20);
156}
157
158static inline void ar7_device_reset(u32 bit)
159{
160 ar7_device_disable(bit);
161 ar7_device_enable(bit);
162}
163
164static inline void ar7_device_on(u32 bit)
165{
166 void *power_reg = (void *)KSEG1ADDR(AR7_REGS_POWER);
167 writel(readl(power_reg) | (1 << bit), power_reg);
168 msleep(20);
169}
170
171static inline void ar7_device_off(u32 bit)
172{
173 void *power_reg = (void *)KSEG1ADDR(AR7_REGS_POWER);
174 writel(readl(power_reg) & ~(1 << bit), power_reg);
175 msleep(20);
176}
177
178#endif /* __AR7_H__ */
diff --git a/arch/mips/include/asm/mach-ar7/gpio.h b/arch/mips/include/asm/mach-ar7/gpio.h
new file mode 100644
index 000000000000..cbe9c4f126df
--- /dev/null
+++ b/arch/mips/include/asm/mach-ar7/gpio.h
@@ -0,0 +1,110 @@
1/*
2 * Copyright (C) 2007 Florian Fainelli <florian@openwrt.org>
3 *
4 * This program is free software; you can redistribute it and/or modify
5 * it under the terms of the GNU General Public License as published by
6 * the Free Software Foundation; either version 2 of the License, or
7 * (at your option) any later version.
8 *
9 * This program is distributed in the hope that it will be useful,
10 * but WITHOUT ANY WARRANTY; without even the implied warranty of
11 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12 * GNU General Public License for more details.
13 *
14 * You should have received a copy of the GNU General Public License
15 * along with this program; if not, write to the Free Software
16 * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
17 */
18
19#ifndef __AR7_GPIO_H__
20#define __AR7_GPIO_H__
21
22#include <asm/mach-ar7/ar7.h>
23
24#define AR7_GPIO_MAX 32
25
26extern int gpio_request(unsigned gpio, const char *label);
27extern void gpio_free(unsigned gpio);
28
29/* Common GPIO layer */
30static inline int gpio_get_value(unsigned gpio)
31{
32 void __iomem *gpio_in =
33 (void __iomem *)KSEG1ADDR(AR7_REGS_GPIO + AR7_GPIO_INPUT);
34
35 return readl(gpio_in) & (1 << gpio);
36}
37
38static inline void gpio_set_value(unsigned gpio, int value)
39{
40 void __iomem *gpio_out =
41 (void __iomem *)KSEG1ADDR(AR7_REGS_GPIO + AR7_GPIO_OUTPUT);
42 unsigned tmp;
43
44 tmp = readl(gpio_out) & ~(1 << gpio);
45 if (value)
46 tmp |= 1 << gpio;
47 writel(tmp, gpio_out);
48}
49
50static inline int gpio_direction_input(unsigned gpio)
51{
52 void __iomem *gpio_dir =
53 (void __iomem *)KSEG1ADDR(AR7_REGS_GPIO + AR7_GPIO_DIR);
54
55 if (gpio >= AR7_GPIO_MAX)
56 return -EINVAL;
57
58 writel(readl(gpio_dir) | (1 << gpio), gpio_dir);
59
60 return 0;
61}
62
63static inline int gpio_direction_output(unsigned gpio, int value)
64{
65 void __iomem *gpio_dir =
66 (void __iomem *)KSEG1ADDR(AR7_REGS_GPIO + AR7_GPIO_DIR);
67
68 if (gpio >= AR7_GPIO_MAX)
69 return -EINVAL;
70
71 gpio_set_value(gpio, value);
72 writel(readl(gpio_dir) & ~(1 << gpio), gpio_dir);
73
74 return 0;
75}
76
77static inline int gpio_to_irq(unsigned gpio)
78{
79 return -EINVAL;
80}
81
82static inline int irq_to_gpio(unsigned irq)
83{
84 return -EINVAL;
85}
86
87/* Board specific GPIO functions */
88static inline int ar7_gpio_enable(unsigned gpio)
89{
90 void __iomem *gpio_en =
91 (void __iomem *)KSEG1ADDR(AR7_REGS_GPIO + AR7_GPIO_ENABLE);
92
93 writel(readl(gpio_en) | (1 << gpio), gpio_en);
94
95 return 0;
96}
97
98static inline int ar7_gpio_disable(unsigned gpio)
99{
100 void __iomem *gpio_en =
101 (void __iomem *)KSEG1ADDR(AR7_REGS_GPIO + AR7_GPIO_ENABLE);
102
103 writel(readl(gpio_en) & ~(1 << gpio), gpio_en);
104
105 return 0;
106}
107
108#include <asm-generic/gpio.h>
109
110#endif
diff --git a/arch/mips/include/asm/mach-ar7/irq.h b/arch/mips/include/asm/mach-ar7/irq.h
new file mode 100644
index 000000000000..39e9757e3d93
--- /dev/null
+++ b/arch/mips/include/asm/mach-ar7/irq.h
@@ -0,0 +1,16 @@
1/*
2 * This file is subject to the terms and conditions of the GNU General Public
3 * License. See the file "COPYING" in the main directory of this archive
4 * for more details.
5 *
6 * Shamelessly copied from asm-mips/mach-emma2rh/
7 * Copyright (C) 2003 by Ralf Baechle
8 */
9#ifndef __ASM_AR7_IRQ_H
10#define __ASM_AR7_IRQ_H
11
12#define NR_IRQS 256
13
14#include_next <irq.h>
15
16#endif /* __ASM_AR7_IRQ_H */
diff --git a/arch/mips/include/asm/mach-ar7/prom.h b/arch/mips/include/asm/mach-ar7/prom.h
new file mode 100644
index 000000000000..088f61fe85ea
--- /dev/null
+++ b/arch/mips/include/asm/mach-ar7/prom.h
@@ -0,0 +1,25 @@
1/*
2 * Copyright (C) 2006, 2007 Florian Fainelli <florian@openwrt.org>
3 *
4 * This program is free software; you can redistribute it and/or modify
5 * it under the terms of the GNU General Public License as published by
6 * the Free Software Foundation; either version 2 of the License, or
7 * (at your option) any later version.
8 *
9 * This program is distributed in the hope that it will be useful,
10 * but WITHOUT ANY WARRANTY; without even the implied warranty of
11 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12 * GNU General Public License for more details.
13 *
14 * You should have received a copy of the GNU General Public License
15 * along with this program; if not, write to the Free Software
16 * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
17 */
18
19#ifndef __PROM_H__
20#define __PROM_H__
21
22extern char *prom_getenv(const char *name);
23extern void prom_meminit(void);
24
25#endif /* __PROM_H__ */
diff --git a/arch/mips/include/asm/mach-ar7/spaces.h b/arch/mips/include/asm/mach-ar7/spaces.h
new file mode 100644
index 000000000000..ac28f273449c
--- /dev/null
+++ b/arch/mips/include/asm/mach-ar7/spaces.h
@@ -0,0 +1,22 @@
1/*
2 * This file is subject to the terms and conditions of the GNU General Public
3 * License. See the file "COPYING" in the main directory of this archive
4 * for more details.
5 *
6 * Copyright (C) 1994 - 1999, 2000, 03, 04 Ralf Baechle
7 * Copyright (C) 2000, 2002 Maciej W. Rozycki
8 * Copyright (C) 1990, 1999, 2000 Silicon Graphics, Inc.
9 */
10#ifndef _ASM_AR7_SPACES_H
11#define _ASM_AR7_SPACES_H
12
13/*
14 * This handles the memory map.
15 * We handle pages at KSEG0 for kernels with 32 bit address space.
16 */
17#define PAGE_OFFSET 0x94000000UL
18#define PHYS_OFFSET 0x14000000UL
19
20#include <asm/mach-generic/spaces.h>
21
22#endif /* __ASM_AR7_SPACES_H */
diff --git a/arch/mips/include/asm/mach-ar7/war.h b/arch/mips/include/asm/mach-ar7/war.h
new file mode 100644
index 000000000000..f4862b563080
--- /dev/null
+++ b/arch/mips/include/asm/mach-ar7/war.h
@@ -0,0 +1,25 @@
1/*
2 * This file is subject to the terms and conditions of the GNU General Public
3 * License. See the file "COPYING" in the main directory of this archive
4 * for more details.
5 *
6 * Copyright (C) 2002, 2004, 2007 by Ralf Baechle <ralf@linux-mips.org>
7 */
8#ifndef __ASM_MIPS_MACH_AR7_WAR_H
9#define __ASM_MIPS_MACH_AR7_WAR_H
10
11#define R4600_V1_INDEX_ICACHEOP_WAR 0
12#define R4600_V1_HIT_CACHEOP_WAR 0
13#define R4600_V2_HIT_CACHEOP_WAR 0
14#define R5432_CP0_INTERRUPT_WAR 0
15#define BCM1250_M3_WAR 0
16#define SIBYTE_1956_WAR 0
17#define MIPS4K_ICACHE_REFILL_WAR 0
18#define MIPS_CACHE_SYNC_WAR 0
19#define TX49XX_ICACHE_INDEX_INV_WAR 0
20#define RM9000_CDEX_SMP_WAR 0
21#define ICACHE_REFILLS_WORKAROUND_WAR 0
22#define R10000_LLSC_WAR 0
23#define MIPS34K_MISSED_ITLB_WAR 0
24
25#endif /* __ASM_MIPS_MACH_AR7_WAR_H */
diff --git a/arch/mips/include/asm/mach-cobalt/irq.h b/arch/mips/include/asm/mach-cobalt/irq.h
index 57c8c9ac5851..9da9acf5dcba 100644
--- a/arch/mips/include/asm/mach-cobalt/irq.h
+++ b/arch/mips/include/asm/mach-cobalt/irq.h
@@ -8,7 +8,7 @@
8 * Copyright (C) 1997 Cobalt Microserver 8 * Copyright (C) 1997 Cobalt Microserver
9 * Copyright (C) 1997, 2003 Ralf Baechle 9 * Copyright (C) 1997, 2003 Ralf Baechle
10 * Copyright (C) 2001-2003 Liam Davies (ldavies@agile.tv) 10 * Copyright (C) 2001-2003 Liam Davies (ldavies@agile.tv)
11 * Copyright (C) 2007 Yoichi Yuasa <yoichi_yuasa@tripeaks.co.jp> 11 * Copyright (C) 2007 Yoichi Yuasa <yuasa@linux-mips.org>
12 */ 12 */
13#ifndef _ASM_COBALT_IRQ_H 13#ifndef _ASM_COBALT_IRQ_H
14#define _ASM_COBALT_IRQ_H 14#define _ASM_COBALT_IRQ_H
diff --git a/arch/mips/include/asm/mach-cobalt/mach-gt64120.h b/arch/mips/include/asm/mach-cobalt/mach-gt64120.h
index ae9c5523c7ef..f8afec3f2943 100644
--- a/arch/mips/include/asm/mach-cobalt/mach-gt64120.h
+++ b/arch/mips/include/asm/mach-cobalt/mach-gt64120.h
@@ -1,5 +1,5 @@
1/* 1/*
2 * Copyright (C) 2006 Yoichi Yuasa <yoichi_yuasa@tripeaks.co.jp> 2 * Copyright (C) 2006 Yoichi Yuasa <yuasa@linux-mips.org>
3 * 3 *
4 * This program is free software; you can redistribute it and/or modify 4 * This program is free software; you can redistribute it and/or modify
5 * it under the terms of the GNU General Public License as published by 5 * it under the terms of the GNU General Public License as published by
diff --git a/arch/mips/cavium-octeon/pci-common.h b/arch/mips/include/asm/octeon/pci-octeon.h
index 74ae79991e45..6ac5d3e3398e 100644
--- a/arch/mips/cavium-octeon/pci-common.h
+++ b/arch/mips/include/asm/octeon/pci-octeon.h
@@ -3,23 +3,29 @@
3 * License. See the file "COPYING" in the main directory of this archive 3 * License. See the file "COPYING" in the main directory of this archive
4 * for more details. 4 * for more details.
5 * 5 *
6 * Copyright (C) 2005-2007 Cavium Networks 6 * Copyright (C) 2005-2009 Cavium Networks
7 */ 7 */
8#ifndef __OCTEON_PCI_COMMON_H__ 8
9#define __OCTEON_PCI_COMMON_H__ 9#ifndef __PCI_OCTEON_H__
10#define __PCI_OCTEON_H__
10 11
11#include <linux/pci.h> 12#include <linux/pci.h>
12 13
13/* Some PCI cards require delays when accessing config space. */ 14/* Some PCI cards require delays when accessing config space. */
14#define PCI_CONFIG_SPACE_DELAY 10000 15#define PCI_CONFIG_SPACE_DELAY 10000
15 16
16/* pcibios_map_irq() is defined inside pci-common.c. All it does is call the 17/*
17 Octeon specific version pointed to by this variable. This function needs to 18 * pcibios_map_irq() is defined inside pci-octeon.c. All it does is
18 change for PCI or PCIe based hosts */ 19 * call the Octeon specific version pointed to by this variable. This
19extern typeof(pcibios_map_irq) *octeon_pcibios_map_irq; 20 * function needs to change for PCI or PCIe based hosts.
21 */
22extern int (*octeon_pcibios_map_irq)(const struct pci_dev *dev,
23 u8 slot, u8 pin);
20 24
21/* The following defines are only used when octeon_dma_bar_type = 25/*
22 OCTEON_DMA_BAR_TYPE_BIG */ 26 * The following defines are used when octeon_dma_bar_type =
27 * OCTEON_DMA_BAR_TYPE_BIG
28 */
23#define OCTEON_PCI_BAR1_HOLE_BITS 5 29#define OCTEON_PCI_BAR1_HOLE_BITS 5
24#define OCTEON_PCI_BAR1_HOLE_SIZE (1ul<<(OCTEON_PCI_BAR1_HOLE_BITS+3)) 30#define OCTEON_PCI_BAR1_HOLE_SIZE (1ul<<(OCTEON_PCI_BAR1_HOLE_BITS+3))
25 31
@@ -30,9 +36,9 @@ enum octeon_dma_bar_type {
30 OCTEON_DMA_BAR_TYPE_PCIE 36 OCTEON_DMA_BAR_TYPE_PCIE
31}; 37};
32 38
33/** 39/*
34 * This is a variable to tell the DMA mapping system in dma-octeon.c 40 * This tells the DMA mapping system in dma-octeon.c how to map PCI
35 * how to map PCI DMA addresses. 41 * DMA addresses.
36 */ 42 */
37extern enum octeon_dma_bar_type octeon_dma_bar_type; 43extern enum octeon_dma_bar_type octeon_dma_bar_type;
38 44
diff --git a/arch/mips/include/asm/page.h b/arch/mips/include/asm/page.h
index dc0eaa731281..96a14a426a7c 100644
--- a/arch/mips/include/asm/page.h
+++ b/arch/mips/include/asm/page.h
@@ -165,7 +165,14 @@ typedef struct { unsigned long pgprot; } pgprot_t;
165 165
166#ifdef CONFIG_FLATMEM 166#ifdef CONFIG_FLATMEM
167 167
168#define pfn_valid(pfn) ((pfn) >= ARCH_PFN_OFFSET && (pfn) < max_mapnr) 168#define pfn_valid(pfn) \
169({ \
170 unsigned long __pfn = (pfn); \
171 /* avoid <linux/bootmem.h> include hell */ \
172 extern unsigned long min_low_pfn; \
173 \
174 __pfn >= min_low_pfn && __pfn < max_mapnr; \
175})
169 176
170#elif defined(CONFIG_SPARSEMEM) 177#elif defined(CONFIG_SPARSEMEM)
171 178
diff --git a/arch/mips/include/asm/reg.h b/arch/mips/include/asm/reg.h
index 634b55d7e7f6..910e71a12466 100644
--- a/arch/mips/include/asm/reg.h
+++ b/arch/mips/include/asm/reg.h
@@ -69,7 +69,7 @@
69 69
70#endif 70#endif
71 71
72#ifdef CONFIG_64BIT 72#if defined(CONFIG_64BIT) && !defined(WANT_COMPAT_REG_H)
73 73
74#define EF_R0 0 74#define EF_R0 0
75#define EF_R1 1 75#define EF_R1 1
diff --git a/arch/mips/include/asm/swab.h b/arch/mips/include/asm/swab.h
index 99993c0d6c12..97c2f81b4b43 100644
--- a/arch/mips/include/asm/swab.h
+++ b/arch/mips/include/asm/swab.h
@@ -38,7 +38,11 @@ static inline __attribute_const__ __u32 __arch_swab32(__u32 x)
38} 38}
39#define __arch_swab32 __arch_swab32 39#define __arch_swab32 __arch_swab32
40 40
41#ifdef CONFIG_CPU_MIPS64_R2 41/*
42 * Having already checked for CONFIG_CPU_MIPSR2, enable the
43 * optimized version for 64-bit kernel on r2 CPUs.
44 */
45#ifdef CONFIG_64BIT
42static inline __attribute_const__ __u64 __arch_swab64(__u64 x) 46static inline __attribute_const__ __u64 __arch_swab64(__u64 x)
43{ 47{
44 __asm__( 48 __asm__(
@@ -50,6 +54,6 @@ static inline __attribute_const__ __u64 __arch_swab64(__u64 x)
50 return x; 54 return x;
51} 55}
52#define __arch_swab64 __arch_swab64 56#define __arch_swab64 __arch_swab64
53#endif /* CONFIG_CPU_MIPS64_R2 */ 57#endif /* CONFIG_64BIT */
54#endif /* CONFIG_CPU_MIPSR2 */ 58#endif /* CONFIG_CPU_MIPSR2 */
55#endif /* _ASM_SWAB_H */ 59#endif /* _ASM_SWAB_H */
diff --git a/arch/mips/include/asm/thread_info.h b/arch/mips/include/asm/thread_info.h
index 143a48136a4b..f9df720d2e40 100644
--- a/arch/mips/include/asm/thread_info.h
+++ b/arch/mips/include/asm/thread_info.h
@@ -39,8 +39,6 @@ struct thread_info {
39 39
40/* 40/*
41 * macros/functions for gaining access to the thread information structure 41 * macros/functions for gaining access to the thread information structure
42 *
43 * preempt_count needs to be 1 initially, until the scheduler is functional.
44 */ 42 */
45#define INIT_THREAD_INFO(tsk) \ 43#define INIT_THREAD_INFO(tsk) \
46{ \ 44{ \
@@ -48,7 +46,7 @@ struct thread_info {
48 .exec_domain = &default_exec_domain, \ 46 .exec_domain = &default_exec_domain, \
49 .flags = _TIF_FIXADE, \ 47 .flags = _TIF_FIXADE, \
50 .cpu = 0, \ 48 .cpu = 0, \
51 .preempt_count = 1, \ 49 .preempt_count = INIT_PREEMPT_COUNT, \
52 .addr_limit = KERNEL_DS, \ 50 .addr_limit = KERNEL_DS, \
53 .restart_block = { \ 51 .restart_block = { \
54 .fn = do_no_restart_syscall, \ 52 .fn = do_no_restart_syscall, \
diff --git a/arch/mips/include/asm/unistd.h b/arch/mips/include/asm/unistd.h
index 40005010827c..b70c49fdda26 100644
--- a/arch/mips/include/asm/unistd.h
+++ b/arch/mips/include/asm/unistd.h
@@ -352,16 +352,18 @@
352#define __NR_inotify_init1 (__NR_Linux + 329) 352#define __NR_inotify_init1 (__NR_Linux + 329)
353#define __NR_preadv (__NR_Linux + 330) 353#define __NR_preadv (__NR_Linux + 330)
354#define __NR_pwritev (__NR_Linux + 331) 354#define __NR_pwritev (__NR_Linux + 331)
355#define __NR_rt_tgsigqueueinfo (__NR_Linux + 332)
356#define __NR_perf_counter_open (__NR_Linux + 333)
355 357
356/* 358/*
357 * Offset of the last Linux o32 flavoured syscall 359 * Offset of the last Linux o32 flavoured syscall
358 */ 360 */
359#define __NR_Linux_syscalls 331 361#define __NR_Linux_syscalls 333
360 362
361#endif /* _MIPS_SIM == _MIPS_SIM_ABI32 */ 363#endif /* _MIPS_SIM == _MIPS_SIM_ABI32 */
362 364
363#define __NR_O32_Linux 4000 365#define __NR_O32_Linux 4000
364#define __NR_O32_Linux_syscalls 331 366#define __NR_O32_Linux_syscalls 333
365 367
366#if _MIPS_SIM == _MIPS_SIM_ABI64 368#if _MIPS_SIM == _MIPS_SIM_ABI64
367 369
@@ -660,16 +662,18 @@
660#define __NR_inotify_init1 (__NR_Linux + 288) 662#define __NR_inotify_init1 (__NR_Linux + 288)
661#define __NR_preadv (__NR_Linux + 289) 663#define __NR_preadv (__NR_Linux + 289)
662#define __NR_pwritev (__NR_Linux + 290) 664#define __NR_pwritev (__NR_Linux + 290)
665#define __NR_rt_tgsigqueueinfo (__NR_Linux + 291)
666#define __NR_perf_counter_open (__NR_Linux + 292)
663 667
664/* 668/*
665 * Offset of the last Linux 64-bit flavoured syscall 669 * Offset of the last Linux 64-bit flavoured syscall
666 */ 670 */
667#define __NR_Linux_syscalls 290 671#define __NR_Linux_syscalls 292
668 672
669#endif /* _MIPS_SIM == _MIPS_SIM_ABI64 */ 673#endif /* _MIPS_SIM == _MIPS_SIM_ABI64 */
670 674
671#define __NR_64_Linux 5000 675#define __NR_64_Linux 5000
672#define __NR_64_Linux_syscalls 290 676#define __NR_64_Linux_syscalls 292
673 677
674#if _MIPS_SIM == _MIPS_SIM_NABI32 678#if _MIPS_SIM == _MIPS_SIM_NABI32
675 679
@@ -972,16 +976,18 @@
972#define __NR_inotify_init1 (__NR_Linux + 292) 976#define __NR_inotify_init1 (__NR_Linux + 292)
973#define __NR_preadv (__NR_Linux + 293) 977#define __NR_preadv (__NR_Linux + 293)
974#define __NR_pwritev (__NR_Linux + 294) 978#define __NR_pwritev (__NR_Linux + 294)
979#define __NR_rt_tgsigqueueinfo (__NR_Linux + 295)
980#define __NR_perf_counter_open (__NR_Linux + 296)
975 981
976/* 982/*
977 * Offset of the last N32 flavoured syscall 983 * Offset of the last N32 flavoured syscall
978 */ 984 */
979#define __NR_Linux_syscalls 294 985#define __NR_Linux_syscalls 296
980 986
981#endif /* _MIPS_SIM == _MIPS_SIM_NABI32 */ 987#endif /* _MIPS_SIM == _MIPS_SIM_NABI32 */
982 988
983#define __NR_N32_Linux 6000 989#define __NR_N32_Linux 6000
984#define __NR_N32_Linux_syscalls 294 990#define __NR_N32_Linux_syscalls 296
985 991
986#ifdef __KERNEL__ 992#ifdef __KERNEL__
987 993
diff --git a/arch/mips/include/asm/vr41xx/capcella.h b/arch/mips/include/asm/vr41xx/capcella.h
index e0ee05a3dfcc..fcc6569414fa 100644
--- a/arch/mips/include/asm/vr41xx/capcella.h
+++ b/arch/mips/include/asm/vr41xx/capcella.h
@@ -1,7 +1,7 @@
1/* 1/*
2 * capcella.h, Include file for ZAO Networks Capcella. 2 * capcella.h, Include file for ZAO Networks Capcella.
3 * 3 *
4 * Copyright (C) 2002-2004 Yoichi Yuasa <yoichi_yuasa@tripeaks.co.jp> 4 * Copyright (C) 2002-2004 Yoichi Yuasa <yuasa@linux-mips.org>
5 * 5 *
6 * This program is free software; you can redistribute it and/or modify 6 * This program is free software; you can redistribute it and/or modify
7 * it under the terms of the GNU General Public License as published by 7 * it under the terms of the GNU General Public License as published by
diff --git a/arch/mips/include/asm/vr41xx/giu.h b/arch/mips/include/asm/vr41xx/giu.h
index 0bcdd3a5c256..6a90bc1d916b 100644
--- a/arch/mips/include/asm/vr41xx/giu.h
+++ b/arch/mips/include/asm/vr41xx/giu.h
@@ -1,7 +1,7 @@
1/* 1/*
2 * Include file for NEC VR4100 series General-purpose I/O Unit. 2 * Include file for NEC VR4100 series General-purpose I/O Unit.
3 * 3 *
4 * Copyright (C) 2005 Yoichi Yuasa <yoichi_yuasa@tripeaks.co.jp> 4 * Copyright (C) 2005-2009 Yoichi Yuasa <yuasa@linux-mips.org>
5 * 5 *
6 * This program is free software; you can redistribute it and/or modify 6 * This program is free software; you can redistribute it and/or modify
7 * it under the terms of the GNU General Public License as published by 7 * it under the terms of the GNU General Public License as published by
@@ -41,7 +41,8 @@ typedef enum {
41 IRQ_SIGNAL_HOLD, 41 IRQ_SIGNAL_HOLD,
42} irq_signal_t; 42} irq_signal_t;
43 43
44extern void vr41xx_set_irq_trigger(unsigned int pin, irq_trigger_t trigger, irq_signal_t signal); 44extern void vr41xx_set_irq_trigger(unsigned int pin, irq_trigger_t trigger,
45 irq_signal_t signal);
45 46
46typedef enum { 47typedef enum {
47 IRQ_LEVEL_LOW, 48 IRQ_LEVEL_LOW,
@@ -51,23 +52,6 @@ typedef enum {
51extern void vr41xx_set_irq_level(unsigned int pin, irq_level_t level); 52extern void vr41xx_set_irq_level(unsigned int pin, irq_level_t level);
52 53
53typedef enum { 54typedef enum {
54 GPIO_DATA_LOW,
55 GPIO_DATA_HIGH,
56 GPIO_DATA_INVAL,
57} gpio_data_t;
58
59extern gpio_data_t vr41xx_gpio_get_pin(unsigned int pin);
60extern int vr41xx_gpio_set_pin(unsigned int pin, gpio_data_t data);
61
62typedef enum {
63 GPIO_INPUT,
64 GPIO_OUTPUT,
65 GPIO_OUTPUT_DISABLE,
66} gpio_direction_t;
67
68extern int vr41xx_gpio_set_direction(unsigned int pin, gpio_direction_t dir);
69
70typedef enum {
71 GPIO_PULL_DOWN, 55 GPIO_PULL_DOWN,
72 GPIO_PULL_UP, 56 GPIO_PULL_UP,
73 GPIO_PULL_DISABLE, 57 GPIO_PULL_DISABLE,
diff --git a/arch/mips/include/asm/vr41xx/irq.h b/arch/mips/include/asm/vr41xx/irq.h
index d315dfbc08f2..b07f7321751d 100644
--- a/arch/mips/include/asm/vr41xx/irq.h
+++ b/arch/mips/include/asm/vr41xx/irq.h
@@ -7,7 +7,7 @@
7 * Copyright (C) 2001, 2002 Paul Mundt 7 * Copyright (C) 2001, 2002 Paul Mundt
8 * Copyright (C) 2002 MontaVista Software, Inc. 8 * Copyright (C) 2002 MontaVista Software, Inc.
9 * Copyright (C) 2002 TimeSys Corp. 9 * Copyright (C) 2002 TimeSys Corp.
10 * Copyright (C) 2003-2006 Yoichi Yuasa <yoichi_yuasa@tripeaks.co.jp> 10 * Copyright (C) 2003-2006 Yoichi Yuasa <yuasa@linux-mips.org>
11 * 11 *
12 * This program is free software; you can redistribute it and/or modify it 12 * This program is free software; you can redistribute it and/or modify it
13 * under the terms of the GNU General Public License as published by the 13 * under the terms of the GNU General Public License as published by the
diff --git a/arch/mips/include/asm/vr41xx/mpc30x.h b/arch/mips/include/asm/vr41xx/mpc30x.h
index 1d67df843dc3..130d09d8c8cb 100644
--- a/arch/mips/include/asm/vr41xx/mpc30x.h
+++ b/arch/mips/include/asm/vr41xx/mpc30x.h
@@ -1,7 +1,7 @@
1/* 1/*
2 * mpc30x.h, Include file for Victor MP-C303/304. 2 * mpc30x.h, Include file for Victor MP-C303/304.
3 * 3 *
4 * Copyright (C) 2002-2004 Yoichi Yuasa <yoichi_yuasa@tripeaks.co.jp> 4 * Copyright (C) 2002-2004 Yoichi Yuasa <yuasa@linux-mips.org>
5 * 5 *
6 * This program is free software; you can redistribute it and/or modify 6 * This program is free software; you can redistribute it and/or modify
7 * it under the terms of the GNU General Public License as published by 7 * it under the terms of the GNU General Public License as published by
diff --git a/arch/mips/include/asm/vr41xx/pci.h b/arch/mips/include/asm/vr41xx/pci.h
index 6fc01ce19777..c231a3d6cfd8 100644
--- a/arch/mips/include/asm/vr41xx/pci.h
+++ b/arch/mips/include/asm/vr41xx/pci.h
@@ -1,7 +1,7 @@
1/* 1/*
2 * Include file for NEC VR4100 series PCI Control Unit. 2 * Include file for NEC VR4100 series PCI Control Unit.
3 * 3 *
4 * Copyright (C) 2004-2005 Yoichi Yuasa <yoichi_yuasa@tripeaks.co.jp> 4 * Copyright (C) 2004-2005 Yoichi Yuasa <yuasa@linux-mips.org>
5 * 5 *
6 * This program is free software; you can redistribute it and/or modify 6 * This program is free software; you can redistribute it and/or modify
7 * it under the terms of the GNU General Public License as published by 7 * it under the terms of the GNU General Public License as published by
diff --git a/arch/mips/include/asm/vr41xx/siu.h b/arch/mips/include/asm/vr41xx/siu.h
index da9f6e373409..ca806bc4ddc8 100644
--- a/arch/mips/include/asm/vr41xx/siu.h
+++ b/arch/mips/include/asm/vr41xx/siu.h
@@ -1,7 +1,7 @@
1/* 1/*
2 * Include file for NEC VR4100 series Serial Interface Unit. 2 * Include file for NEC VR4100 series Serial Interface Unit.
3 * 3 *
4 * Copyright (C) 2005-2008 Yoichi Yuasa <yoichi_yuasa@tripeaks.co.jp> 4 * Copyright (C) 2005-2008 Yoichi Yuasa <yuasa@linux-mips.org>
5 * 5 *
6 * This program is free software; you can redistribute it and/or modify 6 * This program is free software; you can redistribute it and/or modify
7 * it under the terms of the GNU General Public License as published by 7 * it under the terms of the GNU General Public License as published by
diff --git a/arch/mips/include/asm/vr41xx/tb0219.h b/arch/mips/include/asm/vr41xx/tb0219.h
index dc981b4be0a4..c78e8243b447 100644
--- a/arch/mips/include/asm/vr41xx/tb0219.h
+++ b/arch/mips/include/asm/vr41xx/tb0219.h
@@ -1,7 +1,7 @@
1/* 1/*
2 * tb0219.h, Include file for TANBAC TB0219. 2 * tb0219.h, Include file for TANBAC TB0219.
3 * 3 *
4 * Copyright (C) 2002-2004 Yoichi Yuasa <yoichi_yuasa@tripeaks.co.jp> 4 * Copyright (C) 2002-2004 Yoichi Yuasa <yuasa@linux-mips.org>
5 * 5 *
6 * Modified for TANBAC TB0219: 6 * Modified for TANBAC TB0219:
7 * Copyright (C) 2003 Megasolution Inc. <matsu@megasolution.jp> 7 * Copyright (C) 2003 Megasolution Inc. <matsu@megasolution.jp>
diff --git a/arch/mips/include/asm/vr41xx/tb0226.h b/arch/mips/include/asm/vr41xx/tb0226.h
index de527dcfa5f3..36f5f798e416 100644
--- a/arch/mips/include/asm/vr41xx/tb0226.h
+++ b/arch/mips/include/asm/vr41xx/tb0226.h
@@ -1,7 +1,7 @@
1/* 1/*
2 * tb0226.h, Include file for TANBAC TB0226. 2 * tb0226.h, Include file for TANBAC TB0226.
3 * 3 *
4 * Copyright (C) 2002-2004 Yoichi Yuasa <yoichi_yuasa@tripeaks.co.jp> 4 * Copyright (C) 2002-2004 Yoichi Yuasa <yuasa@linux-mips.org>
5 * 5 *
6 * This program is free software; you can redistribute it and/or modify 6 * This program is free software; you can redistribute it and/or modify
7 * it under the terms of the GNU General Public License as published by 7 * it under the terms of the GNU General Public License as published by
diff --git a/arch/mips/include/asm/vr41xx/vr41xx.h b/arch/mips/include/asm/vr41xx/vr41xx.h
index 22be64971cc6..7b96a43b72ba 100644
--- a/arch/mips/include/asm/vr41xx/vr41xx.h
+++ b/arch/mips/include/asm/vr41xx/vr41xx.h
@@ -7,7 +7,7 @@
7 * Copyright (C) 2001, 2002 Paul Mundt 7 * Copyright (C) 2001, 2002 Paul Mundt
8 * Copyright (C) 2002 MontaVista Software, Inc. 8 * Copyright (C) 2002 MontaVista Software, Inc.
9 * Copyright (C) 2002 TimeSys Corp. 9 * Copyright (C) 2002 TimeSys Corp.
10 * Copyright (C) 2003-2008 Yoichi Yuasa <yoichi_yuasa@tripeaks.co.jp> 10 * Copyright (C) 2003-2008 Yoichi Yuasa <yuasa@linux-mips.org>
11 * 11 *
12 * This program is free software; you can redistribute it and/or modify it 12 * This program is free software; you can redistribute it and/or modify it
13 * under the terms of the GNU General Public License as published by the 13 * under the terms of the GNU General Public License as published by the
diff --git a/arch/mips/kernel/binfmt_elfo32.c b/arch/mips/kernel/binfmt_elfo32.c
index e1333d7319e2..ff448233dab5 100644
--- a/arch/mips/kernel/binfmt_elfo32.c
+++ b/arch/mips/kernel/binfmt_elfo32.c
@@ -53,6 +53,23 @@ typedef elf_fpreg_t elf_fpregset_t[ELF_NFPREG];
53#define ELF_ET_DYN_BASE (TASK32_SIZE / 3 * 2) 53#define ELF_ET_DYN_BASE (TASK32_SIZE / 3 * 2)
54 54
55#include <asm/processor.h> 55#include <asm/processor.h>
56
57/*
58 * When this file is selected, we are definitely running a 64bit kernel.
59 * So using the right regs define in asm/reg.h
60 */
61#define WANT_COMPAT_REG_H
62
63/* These MUST be defined before elf.h gets included */
64extern void elf32_core_copy_regs(elf_gregset_t grp, struct pt_regs *regs);
65#define ELF_CORE_COPY_REGS(_dest, _regs) elf32_core_copy_regs(_dest, _regs);
66#define ELF_CORE_COPY_TASK_REGS(_tsk, _dest) \
67({ \
68 int __res = 1; \
69 elf32_core_copy_regs(*(_dest), task_pt_regs(_tsk)); \
70 __res; \
71})
72
56#include <linux/module.h> 73#include <linux/module.h>
57#include <linux/elfcore.h> 74#include <linux/elfcore.h>
58#include <linux/compat.h> 75#include <linux/compat.h>
@@ -110,9 +127,6 @@ jiffies_to_compat_timeval(unsigned long jiffies, struct compat_timeval *value)
110 value->tv_usec = rem / NSEC_PER_USEC; 127 value->tv_usec = rem / NSEC_PER_USEC;
111} 128}
112 129
113#undef ELF_CORE_COPY_REGS
114#define ELF_CORE_COPY_REGS(_dest, _regs) elf32_core_copy_regs(_dest, _regs);
115
116void elf32_core_copy_regs(elf_gregset_t grp, struct pt_regs *regs) 130void elf32_core_copy_regs(elf_gregset_t grp, struct pt_regs *regs)
117{ 131{
118 int i; 132 int i;
diff --git a/arch/mips/kernel/cevt-ds1287.c b/arch/mips/kernel/cevt-ds1287.c
index 1ada45ea0700..6996da4d74a2 100644
--- a/arch/mips/kernel/cevt-ds1287.c
+++ b/arch/mips/kernel/cevt-ds1287.c
@@ -1,7 +1,7 @@
1/* 1/*
2 * DS1287 clockevent driver 2 * DS1287 clockevent driver
3 * 3 *
4 * Copyright (C) 2008 Yoichi Yuasa <yoichi_yuasa@tripeaks.co.jp> 4 * Copyright (C) 2008 Yoichi Yuasa <yuasa@linux-mips.org>
5 * 5 *
6 * This program is free software; you can redistribute it and/or modify 6 * This program is free software; you can redistribute it and/or modify
7 * it under the terms of the GNU General Public License as published by 7 * it under the terms of the GNU General Public License as published by
diff --git a/arch/mips/kernel/cevt-gt641xx.c b/arch/mips/kernel/cevt-gt641xx.c
index e9b787feedcb..92351e00ae0e 100644
--- a/arch/mips/kernel/cevt-gt641xx.c
+++ b/arch/mips/kernel/cevt-gt641xx.c
@@ -1,7 +1,7 @@
1/* 1/*
2 * GT641xx clockevent routines. 2 * GT641xx clockevent routines.
3 * 3 *
4 * Copyright (C) 2007 Yoichi Yuasa <yoichi_yuasa@tripeaks.co.jp> 4 * Copyright (C) 2007 Yoichi Yuasa <yuasa@linux-mips.org>
5 * 5 *
6 * This program is free software; you can redistribute it and/or modify 6 * This program is free software; you can redistribute it and/or modify
7 * it under the terms of the GNU General Public License as published by 7 * it under the terms of the GNU General Public License as published by
diff --git a/arch/mips/kernel/csrc-ioasic.c b/arch/mips/kernel/csrc-ioasic.c
index b551f48d3a07..23da108506b0 100644
--- a/arch/mips/kernel/csrc-ioasic.c
+++ b/arch/mips/kernel/csrc-ioasic.c
@@ -1,7 +1,7 @@
1/* 1/*
2 * DEC I/O ASIC's counter clocksource 2 * DEC I/O ASIC's counter clocksource
3 * 3 *
4 * Copyright (C) 2008 Yoichi Yuasa <yoichi_yuasa@tripeaks.co.jp> 4 * Copyright (C) 2008 Yoichi Yuasa <yuasa@linux-mips.org>
5 * 5 *
6 * This program is free software; you can redistribute it and/or modify 6 * This program is free software; you can redistribute it and/or modify
7 * it under the terms of the GNU General Public License as published by 7 * it under the terms of the GNU General Public License as published by
diff --git a/arch/mips/kernel/irq-gic.c b/arch/mips/kernel/irq-gic.c
index 39000f103f2c..d2072cd38592 100644
--- a/arch/mips/kernel/irq-gic.c
+++ b/arch/mips/kernel/irq-gic.c
@@ -107,9 +107,7 @@ static unsigned int gic_irq_startup(unsigned int irq)
107{ 107{
108 pr_debug("CPU%d: %s: irq%d\n", smp_processor_id(), __func__, irq); 108 pr_debug("CPU%d: %s: irq%d\n", smp_processor_id(), __func__, irq);
109 irq -= _irqbase; 109 irq -= _irqbase;
110 /* FIXME: this is wrong for !GICISWORDLITTLEENDIAN */ 110 GIC_SET_INTR_MASK(irq, 1);
111 GICWRITE(GIC_REG_ADDR(SHARED, (GIC_SH_SMASK_31_0_OFS + (irq / 32))),
112 1 << (irq % 32));
113 return 0; 111 return 0;
114} 112}
115 113
@@ -120,8 +118,7 @@ static void gic_irq_ack(unsigned int irq)
120#endif 118#endif
121 pr_debug("CPU%d: %s: irq%d\n", smp_processor_id(), __func__, irq); 119 pr_debug("CPU%d: %s: irq%d\n", smp_processor_id(), __func__, irq);
122 irq -= _irqbase; 120 irq -= _irqbase;
123 GICWRITE(GIC_REG_ADDR(SHARED, (GIC_SH_RMASK_31_0_OFS + (irq / 32))), 121 GIC_CLR_INTR_MASK(irq, 1);
124 1 << (irq % 32));
125 122
126 if (_intrmap[irq].trigtype == GIC_TRIG_EDGE) { 123 if (_intrmap[irq].trigtype == GIC_TRIG_EDGE) {
127 if (!gic_wedgeb2bok) 124 if (!gic_wedgeb2bok)
@@ -138,18 +135,14 @@ static void gic_mask_irq(unsigned int irq)
138{ 135{
139 pr_debug("CPU%d: %s: irq%d\n", smp_processor_id(), __func__, irq); 136 pr_debug("CPU%d: %s: irq%d\n", smp_processor_id(), __func__, irq);
140 irq -= _irqbase; 137 irq -= _irqbase;
141 /* FIXME: this is wrong for !GICISWORDLITTLEENDIAN */ 138 GIC_CLR_INTR_MASK(irq, 1);
142 GICWRITE(GIC_REG_ADDR(SHARED, (GIC_SH_RMASK_31_0_OFS + (irq / 32))),
143 1 << (irq % 32));
144} 139}
145 140
146static void gic_unmask_irq(unsigned int irq) 141static void gic_unmask_irq(unsigned int irq)
147{ 142{
148 pr_debug("CPU%d: %s: irq%d\n", smp_processor_id(), __func__, irq); 143 pr_debug("CPU%d: %s: irq%d\n", smp_processor_id(), __func__, irq);
149 irq -= _irqbase; 144 irq -= _irqbase;
150 /* FIXME: this is wrong for !GICISWORDLITTLEENDIAN */ 145 GIC_SET_INTR_MASK(irq, 1);
151 GICWRITE(GIC_REG_ADDR(SHARED, (GIC_SH_SMASK_31_0_OFS + (irq / 32))),
152 1 << (irq % 32));
153} 146}
154 147
155#ifdef CONFIG_SMP 148#ifdef CONFIG_SMP
@@ -254,6 +247,10 @@ static void __init gic_basic_init(void)
254 if (cpu == X) 247 if (cpu == X)
255 continue; 248 continue;
256 249
250 if (cpu == 0 && i != 0 && _intrmap[i].intrnum == 0 &&
251 _intrmap[i].ipiflag == 0)
252 continue;
253
257 setup_intr(_intrmap[i].intrnum, 254 setup_intr(_intrmap[i].intrnum,
258 _intrmap[i].cpunum, 255 _intrmap[i].cpunum,
259 _intrmap[i].pin, 256 _intrmap[i].pin,
diff --git a/arch/mips/kernel/irq-gt641xx.c b/arch/mips/kernel/irq-gt641xx.c
index 1b81b131f43c..ebcc5f7ad9c2 100644
--- a/arch/mips/kernel/irq-gt641xx.c
+++ b/arch/mips/kernel/irq-gt641xx.c
@@ -1,7 +1,7 @@
1/* 1/*
2 * GT641xx IRQ routines. 2 * GT641xx IRQ routines.
3 * 3 *
4 * Copyright (C) 2007 Yoichi Yuasa <yoichi_yuasa@tripeaks.co.jp> 4 * Copyright (C) 2007 Yoichi Yuasa <yuasa@linux-mips.org>
5 * 5 *
6 * This program is free software; you can redistribute it and/or modify 6 * This program is free software; you can redistribute it and/or modify
7 * it under the terms of the GNU General Public License as published by 7 * it under the terms of the GNU General Public License as published by
diff --git a/arch/mips/kernel/ptrace32.c b/arch/mips/kernel/ptrace32.c
index c4f9ac17474a..32644b4a0714 100644
--- a/arch/mips/kernel/ptrace32.c
+++ b/arch/mips/kernel/ptrace32.c
@@ -22,7 +22,6 @@
22#include <linux/errno.h> 22#include <linux/errno.h>
23#include <linux/ptrace.h> 23#include <linux/ptrace.h>
24#include <linux/smp.h> 24#include <linux/smp.h>
25#include <linux/smp_lock.h>
26#include <linux/user.h> 25#include <linux/user.h>
27#include <linux/security.h> 26#include <linux/security.h>
28 27
diff --git a/arch/mips/kernel/scall32-o32.S b/arch/mips/kernel/scall32-o32.S
index 0b31b9bda048..20a86e08fd58 100644
--- a/arch/mips/kernel/scall32-o32.S
+++ b/arch/mips/kernel/scall32-o32.S
@@ -652,6 +652,8 @@ einval: li v0, -ENOSYS
652 sys sys_inotify_init1 1 652 sys sys_inotify_init1 1
653 sys sys_preadv 6 /* 4330 */ 653 sys sys_preadv 6 /* 4330 */
654 sys sys_pwritev 6 654 sys sys_pwritev 6
655 sys sys_rt_tgsigqueueinfo 4
656 sys sys_perf_counter_open 5
655 .endm 657 .endm
656 658
657 /* We pre-compute the number of _instruction_ bytes needed to 659 /* We pre-compute the number of _instruction_ bytes needed to
diff --git a/arch/mips/kernel/scall64-64.S b/arch/mips/kernel/scall64-64.S
index c647fd6e722f..b046130d4c5d 100644
--- a/arch/mips/kernel/scall64-64.S
+++ b/arch/mips/kernel/scall64-64.S
@@ -489,4 +489,6 @@ sys_call_table:
489 PTR sys_inotify_init1 489 PTR sys_inotify_init1
490 PTR sys_preadv 490 PTR sys_preadv
491 PTR sys_pwritev /* 5390 */ 491 PTR sys_pwritev /* 5390 */
492 PTR sys_rt_tgsigqueueinfo
493 PTR sys_perf_counter_open
492 .size sys_call_table,.-sys_call_table 494 .size sys_call_table,.-sys_call_table
diff --git a/arch/mips/kernel/scall64-n32.S b/arch/mips/kernel/scall64-n32.S
index 93cc672f4522..15874f9812cc 100644
--- a/arch/mips/kernel/scall64-n32.S
+++ b/arch/mips/kernel/scall64-n32.S
@@ -415,4 +415,6 @@ EXPORT(sysn32_call_table)
415 PTR sys_inotify_init1 415 PTR sys_inotify_init1
416 PTR sys_preadv 416 PTR sys_preadv
417 PTR sys_pwritev 417 PTR sys_pwritev
418 PTR compat_sys_rt_tgsigqueueinfo /* 5295 */
419 PTR sys_perf_counter_open
418 .size sysn32_call_table,.-sysn32_call_table 420 .size sysn32_call_table,.-sysn32_call_table
diff --git a/arch/mips/kernel/scall64-o32.S b/arch/mips/kernel/scall64-o32.S
index a5598b2339dd..781e0f1e9533 100644
--- a/arch/mips/kernel/scall64-o32.S
+++ b/arch/mips/kernel/scall64-o32.S
@@ -535,4 +535,6 @@ sys_call_table:
535 PTR sys_inotify_init1 535 PTR sys_inotify_init1
536 PTR compat_sys_preadv /* 4330 */ 536 PTR compat_sys_preadv /* 4330 */
537 PTR compat_sys_pwritev 537 PTR compat_sys_pwritev
538 PTR compat_sys_rt_tgsigqueueinfo
539 PTR sys_perf_counter_open
538 .size sys_call_table,.-sys_call_table 540 .size sys_call_table,.-sys_call_table
diff --git a/arch/mips/kernel/smp-cmp.c b/arch/mips/kernel/smp-cmp.c
index 653be061b9ec..ad0ff5dc4d59 100644
--- a/arch/mips/kernel/smp-cmp.c
+++ b/arch/mips/kernel/smp-cmp.c
@@ -37,80 +37,24 @@
37#include <asm/mipsregs.h> 37#include <asm/mipsregs.h>
38#include <asm/mipsmtregs.h> 38#include <asm/mipsmtregs.h>
39#include <asm/mips_mt.h> 39#include <asm/mips_mt.h>
40 40#include <asm/amon.h>
41/* 41#include <asm/gic.h>
42 * Crude manipulation of the CPU masks to control which
43 * which CPU's are brought online during initialisation
44 *
45 * Beware... this needs to be called after CPU discovery
46 * but before CPU bringup
47 */
48static int __init allowcpus(char *str)
49{
50 cpumask_t cpu_allow_map;
51 char buf[256];
52 int len;
53
54 cpus_clear(cpu_allow_map);
55 if (cpulist_parse(str, &cpu_allow_map) == 0) {
56 cpu_set(0, cpu_allow_map);
57 cpus_and(cpu_possible_map, cpu_possible_map, cpu_allow_map);
58 len = cpulist_scnprintf(buf, sizeof(buf)-1, &cpu_possible_map);
59 buf[len] = '\0';
60 pr_debug("Allowable CPUs: %s\n", buf);
61 return 1;
62 } else
63 return 0;
64}
65__setup("allowcpus=", allowcpus);
66 42
67static void ipi_call_function(unsigned int cpu) 43static void ipi_call_function(unsigned int cpu)
68{ 44{
69 unsigned int action = 0;
70
71 pr_debug("CPU%d: %s cpu %d status %08x\n", 45 pr_debug("CPU%d: %s cpu %d status %08x\n",
72 smp_processor_id(), __func__, cpu, read_c0_status()); 46 smp_processor_id(), __func__, cpu, read_c0_status());
73 47
74 switch (cpu) { 48 gic_send_ipi(plat_ipi_call_int_xlate(cpu));
75 case 0:
76 action = GIC_IPI_EXT_INTR_CALLFNC_VPE0;
77 break;
78 case 1:
79 action = GIC_IPI_EXT_INTR_CALLFNC_VPE1;
80 break;
81 case 2:
82 action = GIC_IPI_EXT_INTR_CALLFNC_VPE2;
83 break;
84 case 3:
85 action = GIC_IPI_EXT_INTR_CALLFNC_VPE3;
86 break;
87 }
88 gic_send_ipi(action);
89} 49}
90 50
91 51
92static void ipi_resched(unsigned int cpu) 52static void ipi_resched(unsigned int cpu)
93{ 53{
94 unsigned int action = 0;
95
96 pr_debug("CPU%d: %s cpu %d status %08x\n", 54 pr_debug("CPU%d: %s cpu %d status %08x\n",
97 smp_processor_id(), __func__, cpu, read_c0_status()); 55 smp_processor_id(), __func__, cpu, read_c0_status());
98 56
99 switch (cpu) { 57 gic_send_ipi(plat_ipi_resched_int_xlate(cpu));
100 case 0:
101 action = GIC_IPI_EXT_INTR_RESCHED_VPE0;
102 break;
103 case 1:
104 action = GIC_IPI_EXT_INTR_RESCHED_VPE1;
105 break;
106 case 2:
107 action = GIC_IPI_EXT_INTR_RESCHED_VPE2;
108 break;
109 case 3:
110 action = GIC_IPI_EXT_INTR_RESCHED_VPE3;
111 break;
112 }
113 gic_send_ipi(action);
114} 58}
115 59
116/* 60/*
@@ -206,7 +150,7 @@ static void cmp_boot_secondary(int cpu, struct task_struct *idle)
206 (unsigned long)(gp + sizeof(struct thread_info))); 150 (unsigned long)(gp + sizeof(struct thread_info)));
207#endif 151#endif
208 152
209 amon_cpu_start(cpu, pc, sp, gp, a0); 153 amon_cpu_start(cpu, pc, sp, (unsigned long)gp, a0);
210} 154}
211 155
212/* 156/*
diff --git a/arch/mips/kernel/sync-r4k.c b/arch/mips/kernel/sync-r4k.c
index 9021108eb9c1..05dd170a83f7 100644
--- a/arch/mips/kernel/sync-r4k.c
+++ b/arch/mips/kernel/sync-r4k.c
@@ -1,7 +1,7 @@
1/* 1/*
2 * Count register synchronisation. 2 * Count register synchronisation.
3 * 3 *
4 * All CPUs will have their count registers synchronised to the CPU0 expirelo 4 * All CPUs will have their count registers synchronised to the CPU0 next time
5 * value. This can cause a small timewarp for CPU0. All other CPU's should 5 * value. This can cause a small timewarp for CPU0. All other CPU's should
6 * not have done anything significant (but they may have had interrupts 6 * not have done anything significant (but they may have had interrupts
7 * enabled briefly - prom_smp_finish() should not be responsible for enabling 7 * enabled briefly - prom_smp_finish() should not be responsible for enabling
@@ -13,21 +13,22 @@
13#include <linux/kernel.h> 13#include <linux/kernel.h>
14#include <linux/init.h> 14#include <linux/init.h>
15#include <linux/irqflags.h> 15#include <linux/irqflags.h>
16#include <linux/r4k-timer.h> 16#include <linux/cpumask.h>
17 17
18#include <asm/r4k-timer.h>
18#include <asm/atomic.h> 19#include <asm/atomic.h>
19#include <asm/barrier.h> 20#include <asm/barrier.h>
20#include <asm/cpumask.h>
21#include <asm/mipsregs.h> 21#include <asm/mipsregs.h>
22 22
23static atomic_t __initdata count_start_flag = ATOMIC_INIT(0); 23static atomic_t __cpuinitdata count_start_flag = ATOMIC_INIT(0);
24static atomic_t __initdata count_count_start = ATOMIC_INIT(0); 24static atomic_t __cpuinitdata count_count_start = ATOMIC_INIT(0);
25static atomic_t __initdata count_count_stop = ATOMIC_INIT(0); 25static atomic_t __cpuinitdata count_count_stop = ATOMIC_INIT(0);
26static atomic_t __cpuinitdata count_reference = ATOMIC_INIT(0);
26 27
27#define COUNTON 100 28#define COUNTON 100
28#define NR_LOOPS 5 29#define NR_LOOPS 5
29 30
30void __init synchronise_count_master(void) 31void __cpuinit synchronise_count_master(void)
31{ 32{
32 int i; 33 int i;
33 unsigned long flags; 34 unsigned long flags;
@@ -42,19 +43,20 @@ void __init synchronise_count_master(void)
42 return; 43 return;
43#endif 44#endif
44 45
45 pr_info("Checking COUNT synchronization across %u CPUs: ", 46 printk(KERN_INFO "Synchronize counters across %u CPUs: ",
46 num_online_cpus()); 47 num_online_cpus());
47 48
48 local_irq_save(flags); 49 local_irq_save(flags);
49 50
50 /* 51 /*
51 * Notify the slaves that it's time to start 52 * Notify the slaves that it's time to start
52 */ 53 */
54 atomic_set(&count_reference, read_c0_count());
53 atomic_set(&count_start_flag, 1); 55 atomic_set(&count_start_flag, 1);
54 smp_wmb(); 56 smp_wmb();
55 57
56 /* Count will be initialised to expirelo for all CPU's */ 58 /* Count will be initialised to current timer for all CPU's */
57 initcount = expirelo; 59 initcount = read_c0_count();
58 60
59 /* 61 /*
60 * We loop a few times to get a primed instruction cache, 62 * We loop a few times to get a primed instruction cache,
@@ -106,7 +108,7 @@ void __init synchronise_count_master(void)
106 printk("done.\n"); 108 printk("done.\n");
107} 109}
108 110
109void __init synchronise_count_slave(void) 111void __cpuinit synchronise_count_slave(void)
110{ 112{
111 int i; 113 int i;
112 unsigned long flags; 114 unsigned long flags;
@@ -131,8 +133,8 @@ void __init synchronise_count_slave(void)
131 while (!atomic_read(&count_start_flag)) 133 while (!atomic_read(&count_start_flag))
132 mb(); 134 mb();
133 135
134 /* Count will be initialised to expirelo for all CPU's */ 136 /* Count will be initialised to next expire for all CPU's */
135 initcount = expirelo; 137 initcount = atomic_read(&count_reference);
136 138
137 ncpus = num_online_cpus(); 139 ncpus = num_online_cpus();
138 for (i = 0; i < NR_LOOPS; i++) { 140 for (i = 0; i < NR_LOOPS; i++) {
@@ -156,4 +158,3 @@ void __init synchronise_count_slave(void)
156 local_irq_restore(flags); 158 local_irq_restore(flags);
157} 159}
158#undef NR_LOOPS 160#undef NR_LOOPS
159#endif
diff --git a/arch/mips/kernel/vpe.c b/arch/mips/kernel/vpe.c
index 3ca5f42e819d..07b9ec2c6e3d 100644
--- a/arch/mips/kernel/vpe.c
+++ b/arch/mips/kernel/vpe.c
@@ -1387,7 +1387,7 @@ static ssize_t store_ntcs(struct device *dev, struct device_attribute *attr,
1387 return len; 1387 return len;
1388 1388
1389out_einval: 1389out_einval:
1390 return -EINVAL;; 1390 return -EINVAL;
1391} 1391}
1392 1392
1393static struct device_attribute vpe_class_attributes[] = { 1393static struct device_attribute vpe_class_attributes[] = {
diff --git a/arch/mips/mm/hugetlbpage.c b/arch/mips/mm/hugetlbpage.c
index 471c09aa1614..8c2834f5919d 100644
--- a/arch/mips/mm/hugetlbpage.c
+++ b/arch/mips/mm/hugetlbpage.c
@@ -16,7 +16,6 @@
16#include <linux/mm.h> 16#include <linux/mm.h>
17#include <linux/hugetlb.h> 17#include <linux/hugetlb.h>
18#include <linux/pagemap.h> 18#include <linux/pagemap.h>
19#include <linux/smp_lock.h>
20#include <linux/slab.h> 19#include <linux/slab.h>
21#include <linux/err.h> 20#include <linux/err.h>
22#include <linux/sysctl.h> 21#include <linux/sysctl.h>
diff --git a/arch/mips/mti-malta/malta-init.c b/arch/mips/mti-malta/malta-init.c
index 475038a141a6..27c807b67fea 100644
--- a/arch/mips/mti-malta/malta-init.c
+++ b/arch/mips/mti-malta/malta-init.c
@@ -30,6 +30,7 @@
30#include <asm/cacheflush.h> 30#include <asm/cacheflush.h>
31#include <asm/traps.h> 31#include <asm/traps.h>
32 32
33#include <asm/gcmpregs.h>
33#include <asm/mips-boards/prom.h> 34#include <asm/mips-boards/prom.h>
34#include <asm/mips-boards/generic.h> 35#include <asm/mips-boards/generic.h>
35#include <asm/mips-boards/bonito64.h> 36#include <asm/mips-boards/bonito64.h>
@@ -192,6 +193,8 @@ extern struct plat_smp_ops msmtc_smp_ops;
192 193
193void __init prom_init(void) 194void __init prom_init(void)
194{ 195{
196 int result;
197
195 prom_argc = fw_arg0; 198 prom_argc = fw_arg0;
196 _prom_argv = (int *) fw_arg1; 199 _prom_argv = (int *) fw_arg1;
197 _prom_envp = (int *) fw_arg2; 200 _prom_envp = (int *) fw_arg2;
@@ -358,12 +361,21 @@ void __init prom_init(void)
358#ifdef CONFIG_SERIAL_8250_CONSOLE 361#ifdef CONFIG_SERIAL_8250_CONSOLE
359 console_config(); 362 console_config();
360#endif 363#endif
364 /* Early detection of CMP support */
365 result = gcmp_probe(GCMP_BASE_ADDR, GCMP_ADDRSPACE_SZ);
366
361#ifdef CONFIG_MIPS_CMP 367#ifdef CONFIG_MIPS_CMP
362 register_smp_ops(&cmp_smp_ops); 368 if (result)
369 register_smp_ops(&cmp_smp_ops);
363#endif 370#endif
364#ifdef CONFIG_MIPS_MT_SMP 371#ifdef CONFIG_MIPS_MT_SMP
372#ifdef CONFIG_MIPS_CMP
373 if (!result)
374 register_smp_ops(&vsmp_smp_ops);
375#else
365 register_smp_ops(&vsmp_smp_ops); 376 register_smp_ops(&vsmp_smp_ops);
366#endif 377#endif
378#endif
367#ifdef CONFIG_MIPS_MT_SMTC 379#ifdef CONFIG_MIPS_MT_SMTC
368 register_smp_ops(&msmtc_smp_ops); 380 register_smp_ops(&msmtc_smp_ops);
369#endif 381#endif
diff --git a/arch/mips/mti-malta/malta-int.c b/arch/mips/mti-malta/malta-int.c
index b4eaf137e4a7..a8756f82c31b 100644
--- a/arch/mips/mti-malta/malta-int.c
+++ b/arch/mips/mti-malta/malta-int.c
@@ -331,6 +331,21 @@ static struct irqaction irq_call = {
331 .flags = IRQF_DISABLED|IRQF_PERCPU, 331 .flags = IRQF_DISABLED|IRQF_PERCPU,
332 .name = "IPI_call" 332 .name = "IPI_call"
333}; 333};
334
335static int gic_resched_int_base;
336static int gic_call_int_base;
337#define GIC_RESCHED_INT(cpu) (gic_resched_int_base+(cpu))
338#define GIC_CALL_INT(cpu) (gic_call_int_base+(cpu))
339
340unsigned int plat_ipi_call_int_xlate(unsigned int cpu)
341{
342 return GIC_CALL_INT(cpu);
343}
344
345unsigned int plat_ipi_resched_int_xlate(unsigned int cpu)
346{
347 return GIC_RESCHED_INT(cpu);
348}
334#endif /* CONFIG_MIPS_MT_SMP */ 349#endif /* CONFIG_MIPS_MT_SMP */
335 350
336static struct irqaction i8259irq = { 351static struct irqaction i8259irq = {
@@ -370,7 +385,7 @@ static int __initdata msc_nr_eicirqs = ARRAY_SIZE(msc_eicirqmap);
370 * Interrupts and CPUs/Core Interrupts. The nature of the External 385 * Interrupts and CPUs/Core Interrupts. The nature of the External
371 * Interrupts is also defined here - polarity/trigger. 386 * Interrupts is also defined here - polarity/trigger.
372 */ 387 */
373static struct gic_intr_map gic_intr_map[] = { 388static struct gic_intr_map gic_intr_map[GIC_NUM_INTRS] = {
374 { GIC_EXT_INTR(0), X, X, X, X, 0 }, 389 { GIC_EXT_INTR(0), X, X, X, X, 0 },
375 { GIC_EXT_INTR(1), X, X, X, X, 0 }, 390 { GIC_EXT_INTR(1), X, X, X, X, 0 },
376 { GIC_EXT_INTR(2), X, X, X, X, 0 }, 391 { GIC_EXT_INTR(2), X, X, X, X, 0 },
@@ -387,21 +402,14 @@ static struct gic_intr_map gic_intr_map[] = {
387 { GIC_EXT_INTR(13), 0, GIC_MAP_TO_NMI_MSK, GIC_POL_POS, GIC_TRIG_LEVEL, 0 }, 402 { GIC_EXT_INTR(13), 0, GIC_MAP_TO_NMI_MSK, GIC_POL_POS, GIC_TRIG_LEVEL, 0 },
388 { GIC_EXT_INTR(14), 0, GIC_MAP_TO_NMI_MSK, GIC_POL_POS, GIC_TRIG_LEVEL, 0 }, 403 { GIC_EXT_INTR(14), 0, GIC_MAP_TO_NMI_MSK, GIC_POL_POS, GIC_TRIG_LEVEL, 0 },
389 { GIC_EXT_INTR(15), X, X, X, X, 0 }, 404 { GIC_EXT_INTR(15), X, X, X, X, 0 },
390 { GIC_EXT_INTR(16), 0, GIC_CPU_INT1, GIC_POL_POS, GIC_TRIG_EDGE, 1 }, 405/* This is the end of the general interrupts now we do IPI ones */
391 { GIC_EXT_INTR(17), 0, GIC_CPU_INT2, GIC_POL_POS, GIC_TRIG_EDGE, 1 },
392 { GIC_EXT_INTR(18), 1, GIC_CPU_INT1, GIC_POL_POS, GIC_TRIG_EDGE, 1 },
393 { GIC_EXT_INTR(19), 1, GIC_CPU_INT2, GIC_POL_POS, GIC_TRIG_EDGE, 1 },
394 { GIC_EXT_INTR(20), 2, GIC_CPU_INT1, GIC_POL_POS, GIC_TRIG_EDGE, 1 },
395 { GIC_EXT_INTR(21), 2, GIC_CPU_INT2, GIC_POL_POS, GIC_TRIG_EDGE, 1 },
396 { GIC_EXT_INTR(22), 3, GIC_CPU_INT1, GIC_POL_POS, GIC_TRIG_EDGE, 1 },
397 { GIC_EXT_INTR(23), 3, GIC_CPU_INT2, GIC_POL_POS, GIC_TRIG_EDGE, 1 },
398}; 406};
399#endif 407#endif
400 408
401/* 409/*
402 * GCMP needs to be detected before any SMP initialisation 410 * GCMP needs to be detected before any SMP initialisation
403 */ 411 */
404static int __init gcmp_probe(unsigned long addr, unsigned long size) 412int __init gcmp_probe(unsigned long addr, unsigned long size)
405{ 413{
406 if (gcmp_present >= 0) 414 if (gcmp_present >= 0)
407 return gcmp_present; 415 return gcmp_present;
@@ -416,28 +424,36 @@ static int __init gcmp_probe(unsigned long addr, unsigned long size)
416} 424}
417 425
418#if defined(CONFIG_MIPS_MT_SMP) 426#if defined(CONFIG_MIPS_MT_SMP)
427static void __init fill_ipi_map1(int baseintr, int cpu, int cpupin)
428{
429 int intr = baseintr + cpu;
430 gic_intr_map[intr].intrnum = GIC_EXT_INTR(intr);
431 gic_intr_map[intr].cpunum = cpu;
432 gic_intr_map[intr].pin = cpupin;
433 gic_intr_map[intr].polarity = GIC_POL_POS;
434 gic_intr_map[intr].trigtype = GIC_TRIG_EDGE;
435 gic_intr_map[intr].ipiflag = 1;
436 ipi_map[cpu] |= (1 << (cpupin + 2));
437}
438
419static void __init fill_ipi_map(void) 439static void __init fill_ipi_map(void)
420{ 440{
421 int i; 441 int cpu;
422 442
423 for (i = 0; i < ARRAY_SIZE(gic_intr_map); i++) { 443 for (cpu = 0; cpu < NR_CPUS; cpu++) {
424 if (gic_intr_map[i].ipiflag && (gic_intr_map[i].cpunum != X)) 444 fill_ipi_map1(gic_resched_int_base, cpu, GIC_CPU_INT1);
425 ipi_map[gic_intr_map[i].cpunum] |= 445 fill_ipi_map1(gic_call_int_base, cpu, GIC_CPU_INT2);
426 (1 << (gic_intr_map[i].pin + 2));
427 } 446 }
428} 447}
429#endif 448#endif
430 449
431void __init arch_init_irq(void) 450void __init arch_init_irq(void)
432{ 451{
433 int gic_present, gcmp_present;
434
435 init_i8259_irqs(); 452 init_i8259_irqs();
436 453
437 if (!cpu_has_veic) 454 if (!cpu_has_veic)
438 mips_cpu_irq_init(); 455 mips_cpu_irq_init();
439 456
440 gcmp_present = gcmp_probe(GCMP_BASE_ADDR, GCMP_ADDRSPACE_SZ);
441 if (gcmp_present) { 457 if (gcmp_present) {
442 GCMPGCB(GICBA) = GIC_BASE_ADDR | GCMP_GCB_GICBA_EN_MSK; 458 GCMPGCB(GICBA) = GIC_BASE_ADDR | GCMP_GCB_GICBA_EN_MSK;
443 gic_present = 1; 459 gic_present = 1;
@@ -514,24 +530,10 @@ void __init arch_init_irq(void)
514 if (gic_present) { 530 if (gic_present) {
515 /* FIXME */ 531 /* FIXME */
516 int i; 532 int i;
517 struct { 533
518 unsigned int resched; 534 gic_call_int_base = GIC_NUM_INTRS - NR_CPUS;
519 unsigned int call; 535 gic_resched_int_base = gic_call_int_base - NR_CPUS;
520 } ipiirq[] = { 536
521 {
522 .resched = GIC_IPI_EXT_INTR_RESCHED_VPE0,
523 .call = GIC_IPI_EXT_INTR_CALLFNC_VPE0},
524 {
525 .resched = GIC_IPI_EXT_INTR_RESCHED_VPE1,
526 .call = GIC_IPI_EXT_INTR_CALLFNC_VPE1
527 }, {
528 .resched = GIC_IPI_EXT_INTR_RESCHED_VPE2,
529 .call = GIC_IPI_EXT_INTR_CALLFNC_VPE2
530 }, {
531 .resched = GIC_IPI_EXT_INTR_RESCHED_VPE3,
532 .call = GIC_IPI_EXT_INTR_CALLFNC_VPE3
533 }
534 };
535 fill_ipi_map(); 537 fill_ipi_map();
536 gic_init(GIC_BASE_ADDR, GIC_ADDRSPACE_SZ, gic_intr_map, ARRAY_SIZE(gic_intr_map), MIPS_GIC_IRQ_BASE); 538 gic_init(GIC_BASE_ADDR, GIC_ADDRSPACE_SZ, gic_intr_map, ARRAY_SIZE(gic_intr_map), MIPS_GIC_IRQ_BASE);
537 if (!gcmp_present) { 539 if (!gcmp_present) {
@@ -553,12 +555,15 @@ void __init arch_init_irq(void)
553 printk("CPU%d: status register now %08x\n", smp_processor_id(), read_c0_status()); 555 printk("CPU%d: status register now %08x\n", smp_processor_id(), read_c0_status());
554 write_c0_status(0x1100dc00); 556 write_c0_status(0x1100dc00);
555 printk("CPU%d: status register frc %08x\n", smp_processor_id(), read_c0_status()); 557 printk("CPU%d: status register frc %08x\n", smp_processor_id(), read_c0_status());
556 for (i = 0; i < ARRAY_SIZE(ipiirq); i++) { 558 for (i = 0; i < NR_CPUS; i++) {
557 setup_irq(MIPS_GIC_IRQ_BASE + ipiirq[i].resched, &irq_resched); 559 setup_irq(MIPS_GIC_IRQ_BASE +
558 setup_irq(MIPS_GIC_IRQ_BASE + ipiirq[i].call, &irq_call); 560 GIC_RESCHED_INT(i), &irq_resched);
559 561 setup_irq(MIPS_GIC_IRQ_BASE +
560 set_irq_handler(MIPS_GIC_IRQ_BASE + ipiirq[i].resched, handle_percpu_irq); 562 GIC_CALL_INT(i), &irq_call);
561 set_irq_handler(MIPS_GIC_IRQ_BASE + ipiirq[i].call, handle_percpu_irq); 563 set_irq_handler(MIPS_GIC_IRQ_BASE +
564 GIC_RESCHED_INT(i), handle_percpu_irq);
565 set_irq_handler(MIPS_GIC_IRQ_BASE +
566 GIC_CALL_INT(i), handle_percpu_irq);
562 } 567 }
563 } else { 568 } else {
564 /* set up ipi interrupts */ 569 /* set up ipi interrupts */
diff --git a/arch/mips/mti-malta/malta-reset.c b/arch/mips/mti-malta/malta-reset.c
index 42dee4da37ba..f48d60e84290 100644
--- a/arch/mips/mti-malta/malta-reset.c
+++ b/arch/mips/mti-malta/malta-reset.c
@@ -28,9 +28,6 @@
28#include <asm/reboot.h> 28#include <asm/reboot.h>
29#include <asm/mips-boards/generic.h> 29#include <asm/mips-boards/generic.h>
30 30
31static void mips_machine_restart(char *command);
32static void mips_machine_halt(void);
33
34static void mips_machine_restart(char *command) 31static void mips_machine_restart(char *command)
35{ 32{
36 unsigned int __iomem *softres_reg = 33 unsigned int __iomem *softres_reg =
diff --git a/arch/mips/pci/Makefile b/arch/mips/pci/Makefile
index e8a97f59e066..63d8a297c58d 100644
--- a/arch/mips/pci/Makefile
+++ b/arch/mips/pci/Makefile
@@ -52,3 +52,8 @@ obj-$(CONFIG_VICTOR_MPC30X) += fixup-mpc30x.o
52obj-$(CONFIG_ZAO_CAPCELLA) += fixup-capcella.o 52obj-$(CONFIG_ZAO_CAPCELLA) += fixup-capcella.o
53obj-$(CONFIG_WR_PPMC) += fixup-wrppmc.o 53obj-$(CONFIG_WR_PPMC) += fixup-wrppmc.o
54obj-$(CONFIG_MIKROTIK_RB532) += pci-rc32434.o ops-rc32434.o fixup-rc32434.o 54obj-$(CONFIG_MIKROTIK_RB532) += pci-rc32434.o ops-rc32434.o fixup-rc32434.o
55obj-$(CONFIG_CPU_CAVIUM_OCTEON) += pci-octeon.o pcie-octeon.o
56
57ifdef CONFIG_PCI_MSI
58obj-$(CONFIG_CPU_CAVIUM_OCTEON) += msi-octeon.o
59endif
diff --git a/arch/mips/pci/fixup-capcella.c b/arch/mips/pci/fixup-capcella.c
index 1416bca6d1a3..1c02f5737367 100644
--- a/arch/mips/pci/fixup-capcella.c
+++ b/arch/mips/pci/fixup-capcella.c
@@ -1,7 +1,7 @@
1/* 1/*
2 * fixup-cappcela.c, The ZAO Networks Capcella specific PCI fixups. 2 * fixup-cappcela.c, The ZAO Networks Capcella specific PCI fixups.
3 * 3 *
4 * Copyright (C) 2002,2004 Yoichi Yuasa <yoichi_yuasa@tripeaks.co.jp> 4 * Copyright (C) 2002,2004 Yoichi Yuasa <yuasa@linux-mips.org>
5 * 5 *
6 * This program is free software; you can redistribute it and/or modify 6 * This program is free software; you can redistribute it and/or modify
7 * it under the terms of the GNU General Public License as published by 7 * it under the terms of the GNU General Public License as published by
diff --git a/arch/mips/pci/fixup-mpc30x.c b/arch/mips/pci/fixup-mpc30x.c
index 591159625722..e08f49cb6875 100644
--- a/arch/mips/pci/fixup-mpc30x.c
+++ b/arch/mips/pci/fixup-mpc30x.c
@@ -1,7 +1,7 @@
1/* 1/*
2 * fixup-mpc30x.c, The Victor MP-C303/304 specific PCI fixups. 2 * fixup-mpc30x.c, The Victor MP-C303/304 specific PCI fixups.
3 * 3 *
4 * Copyright (C) 2002,2004 Yoichi Yuasa <yoichi_yuasa@tripeaks.co.jp> 4 * Copyright (C) 2002,2004 Yoichi Yuasa <yuasa@linux-mips.org>
5 * 5 *
6 * This program is free software; you can redistribute it and/or modify 6 * This program is free software; you can redistribute it and/or modify
7 * it under the terms of the GNU General Public License as published by 7 * it under the terms of the GNU General Public License as published by
diff --git a/arch/mips/pci/fixup-tb0219.c b/arch/mips/pci/fixup-tb0219.c
index ed87733f6796..8084b17d4406 100644
--- a/arch/mips/pci/fixup-tb0219.c
+++ b/arch/mips/pci/fixup-tb0219.c
@@ -2,7 +2,7 @@
2 * fixup-tb0219.c, The TANBAC TB0219 specific PCI fixups. 2 * fixup-tb0219.c, The TANBAC TB0219 specific PCI fixups.
3 * 3 *
4 * Copyright (C) 2003 Megasolution Inc. <matsu@megasolution.jp> 4 * Copyright (C) 2003 Megasolution Inc. <matsu@megasolution.jp>
5 * Copyright (C) 2004-2005 Yoichi Yuasa <yoichi_yuasa@tripeaks.co.jp> 5 * Copyright (C) 2004-2005 Yoichi Yuasa <yuasa@linux-mips.org>
6 * 6 *
7 * This program is free software; you can redistribute it and/or modify 7 * This program is free software; you can redistribute it and/or modify
8 * it under the terms of the GNU General Public License as published by 8 * it under the terms of the GNU General Public License as published by
diff --git a/arch/mips/pci/fixup-tb0226.c b/arch/mips/pci/fixup-tb0226.c
index e3eedf4bf9bd..4196ccf3ea3d 100644
--- a/arch/mips/pci/fixup-tb0226.c
+++ b/arch/mips/pci/fixup-tb0226.c
@@ -1,7 +1,7 @@
1/* 1/*
2 * fixup-tb0226.c, The TANBAC TB0226 specific PCI fixups. 2 * fixup-tb0226.c, The TANBAC TB0226 specific PCI fixups.
3 * 3 *
4 * Copyright (C) 2002-2005 Yoichi Yuasa <yoichi_yuasa@tripeaks.co.jp> 4 * Copyright (C) 2002-2005 Yoichi Yuasa <yuasa@linux-mips.org>
5 * 5 *
6 * This program is free software; you can redistribute it and/or modify 6 * This program is free software; you can redistribute it and/or modify
7 * it under the terms of the GNU General Public License as published by 7 * it under the terms of the GNU General Public License as published by
diff --git a/arch/mips/pci/fixup-tb0287.c b/arch/mips/pci/fixup-tb0287.c
index 267ab3dc3d42..2fe29db43725 100644
--- a/arch/mips/pci/fixup-tb0287.c
+++ b/arch/mips/pci/fixup-tb0287.c
@@ -1,7 +1,7 @@
1/* 1/*
2 * fixup-tb0287.c, The TANBAC TB0287 specific PCI fixups. 2 * fixup-tb0287.c, The TANBAC TB0287 specific PCI fixups.
3 * 3 *
4 * Copyright (C) 2005 Yoichi Yuasa <yoichi_yuasa@tripeaks.co.jp> 4 * Copyright (C) 2005 Yoichi Yuasa <yuasa@linux-mips.org>
5 * 5 *
6 * This program is free software; you can redistribute it and/or modify 6 * This program is free software; you can redistribute it and/or modify
7 * it under the terms of the GNU General Public License as published by 7 * it under the terms of the GNU General Public License as published by
diff --git a/arch/mips/cavium-octeon/msi.c b/arch/mips/pci/msi-octeon.c
index 964b03b75a8f..03742e647657 100644
--- a/arch/mips/cavium-octeon/msi.c
+++ b/arch/mips/pci/msi-octeon.c
@@ -3,7 +3,7 @@
3 * License. See the file "COPYING" in the main directory of this archive 3 * License. See the file "COPYING" in the main directory of this archive
4 * for more details. 4 * for more details.
5 * 5 *
6 * Copyright (C) 2005-2007 Cavium Networks 6 * Copyright (C) 2005-2009 Cavium Networks
7 */ 7 */
8#include <linux/kernel.h> 8#include <linux/kernel.h>
9#include <linux/init.h> 9#include <linux/init.h>
@@ -16,8 +16,7 @@
16#include <asm/octeon/cvmx-pci-defs.h> 16#include <asm/octeon/cvmx-pci-defs.h>
17#include <asm/octeon/cvmx-npei-defs.h> 17#include <asm/octeon/cvmx-npei-defs.h>
18#include <asm/octeon/cvmx-pexp-defs.h> 18#include <asm/octeon/cvmx-pexp-defs.h>
19 19#include <asm/octeon/pci-octeon.h>
20#include "pci-common.h"
21 20
22/* 21/*
23 * Each bit in msi_free_irq_bitmask represents a MSI interrupt that is 22 * Each bit in msi_free_irq_bitmask represents a MSI interrupt that is
@@ -47,8 +46,8 @@ static DEFINE_SPINLOCK(msi_free_irq_bitmask_lock);
47 * programming the MSI control bits [6:4] before calling 46 * programming the MSI control bits [6:4] before calling
48 * pci_enable_msi(). 47 * pci_enable_msi().
49 * 48 *
50 * @param dev Device requesting MSI interrupts 49 * @dev: Device requesting MSI interrupts
51 * @param desc MSI descriptor 50 * @desc: MSI descriptor
52 * 51 *
53 * Returns 0 on success. 52 * Returns 0 on success.
54 */ 53 */
@@ -213,14 +212,9 @@ void arch_teardown_msi_irq(unsigned int irq)
213} 212}
214 213
215 214
216/** 215/*
217 * Called by the interrupt handling code when an MSI interrupt 216 * Called by the interrupt handling code when an MSI interrupt
218 * occurs. 217 * occurs.
219 *
220 * @param cpl
221 * @param dev_id
222 *
223 * @return
224 */ 218 */
225static irqreturn_t octeon_msi_interrupt(int cpl, void *dev_id) 219static irqreturn_t octeon_msi_interrupt(int cpl, void *dev_id)
226{ 220{
@@ -256,31 +250,37 @@ static irqreturn_t octeon_msi_interrupt(int cpl, void *dev_id)
256} 250}
257 251
258 252
259/** 253/*
260 * Initializes the MSI interrupt handling code 254 * Initializes the MSI interrupt handling code
261 *
262 * @return
263 */ 255 */
264int octeon_msi_initialize(void) 256int octeon_msi_initialize(void)
265{ 257{
266 int r;
267 if (octeon_has_feature(OCTEON_FEATURE_PCIE)) { 258 if (octeon_has_feature(OCTEON_FEATURE_PCIE)) {
268 r = request_irq(OCTEON_IRQ_PCI_MSI0, octeon_msi_interrupt, 259 if (request_irq(OCTEON_IRQ_PCI_MSI0, octeon_msi_interrupt,
269 IRQF_SHARED, 260 IRQF_SHARED,
270 "MSI[0:63]", octeon_msi_interrupt); 261 "MSI[0:63]", octeon_msi_interrupt))
262 panic("request_irq(OCTEON_IRQ_PCI_MSI0) failed");
271 } else if (octeon_is_pci_host()) { 263 } else if (octeon_is_pci_host()) {
272 r = request_irq(OCTEON_IRQ_PCI_MSI0, octeon_msi_interrupt, 264 if (request_irq(OCTEON_IRQ_PCI_MSI0, octeon_msi_interrupt,
273 IRQF_SHARED, 265 IRQF_SHARED,
274 "MSI[0:15]", octeon_msi_interrupt); 266 "MSI[0:15]", octeon_msi_interrupt))
275 r += request_irq(OCTEON_IRQ_PCI_MSI1, octeon_msi_interrupt, 267 panic("request_irq(OCTEON_IRQ_PCI_MSI0) failed");
276 IRQF_SHARED, 268
277 "MSI[16:31]", octeon_msi_interrupt); 269 if (request_irq(OCTEON_IRQ_PCI_MSI1, octeon_msi_interrupt,
278 r += request_irq(OCTEON_IRQ_PCI_MSI2, octeon_msi_interrupt, 270 IRQF_SHARED,
279 IRQF_SHARED, 271 "MSI[16:31]", octeon_msi_interrupt))
280 "MSI[32:47]", octeon_msi_interrupt); 272 panic("request_irq(OCTEON_IRQ_PCI_MSI1) failed");
281 r += request_irq(OCTEON_IRQ_PCI_MSI3, octeon_msi_interrupt, 273
282 IRQF_SHARED, 274 if (request_irq(OCTEON_IRQ_PCI_MSI2, octeon_msi_interrupt,
283 "MSI[48:63]", octeon_msi_interrupt); 275 IRQF_SHARED,
276 "MSI[32:47]", octeon_msi_interrupt))
277 panic("request_irq(OCTEON_IRQ_PCI_MSI2) failed");
278
279 if (request_irq(OCTEON_IRQ_PCI_MSI3, octeon_msi_interrupt,
280 IRQF_SHARED,
281 "MSI[48:63]", octeon_msi_interrupt))
282 panic("request_irq(OCTEON_IRQ_PCI_MSI3) failed");
283
284 } 284 }
285 return 0; 285 return 0;
286} 286}
diff --git a/arch/mips/pci/ops-vr41xx.c b/arch/mips/pci/ops-vr41xx.c
index 900c6b32576c..28962a7c6606 100644
--- a/arch/mips/pci/ops-vr41xx.c
+++ b/arch/mips/pci/ops-vr41xx.c
@@ -2,8 +2,8 @@
2 * ops-vr41xx.c, PCI configuration routines for the PCIU of NEC VR4100 series. 2 * ops-vr41xx.c, PCI configuration routines for the PCIU of NEC VR4100 series.
3 * 3 *
4 * Copyright (C) 2001-2003 MontaVista Software Inc. 4 * Copyright (C) 2001-2003 MontaVista Software Inc.
5 * Author: Yoichi Yuasa <yyuasa@mvista.com or source@mvista.com> 5 * Author: Yoichi Yuasa <source@mvista.com>
6 * Copyright (C) 2004-2005 Yoichi Yuasa <yoichi_yuasa@tripeaks.co.jp> 6 * Copyright (C) 2004-2005 Yoichi Yuasa <yuasa@linux-mips.org>
7 * 7 *
8 * This program is free software; you can redistribute it and/or modify 8 * This program is free software; you can redistribute it and/or modify
9 * it under the terms of the GNU General Public License as published by 9 * it under the terms of the GNU General Public License as published by
@@ -21,7 +21,7 @@
21 */ 21 */
22/* 22/*
23 * Changes: 23 * Changes:
24 * MontaVista Software Inc. <yyuasa@mvista.com> or <source@mvista.com> 24 * MontaVista Software Inc. <source@mvista.com>
25 * - New creation, NEC VR4122 and VR4131 are supported. 25 * - New creation, NEC VR4122 and VR4131 are supported.
26 */ 26 */
27#include <linux/pci.h> 27#include <linux/pci.h>
diff --git a/arch/mips/cavium-octeon/pci.c b/arch/mips/pci/pci-octeon.c
index 67c0ff5e92f1..9cb0c807f564 100644
--- a/arch/mips/cavium-octeon/pci.c
+++ b/arch/mips/pci/pci-octeon.c
@@ -3,7 +3,7 @@
3 * License. See the file "COPYING" in the main directory of this archive 3 * License. See the file "COPYING" in the main directory of this archive
4 * for more details. 4 * for more details.
5 * 5 *
6 * Copyright (C) 2005-2007 Cavium Networks 6 * Copyright (C) 2005-2009 Cavium Networks
7 */ 7 */
8#include <linux/kernel.h> 8#include <linux/kernel.h>
9#include <linux/init.h> 9#include <linux/init.h>
@@ -17,8 +17,7 @@
17#include <asm/octeon/octeon.h> 17#include <asm/octeon/octeon.h>
18#include <asm/octeon/cvmx-npi-defs.h> 18#include <asm/octeon/cvmx-npi-defs.h>
19#include <asm/octeon/cvmx-pci-defs.h> 19#include <asm/octeon/cvmx-pci-defs.h>
20 20#include <asm/octeon/pci-octeon.h>
21#include "pci-common.h"
22 21
23#define USE_OCTEON_INTERNAL_ARBITER 22#define USE_OCTEON_INTERNAL_ARBITER
24 23
@@ -54,6 +53,126 @@ union octeon_pci_address {
54 } s; 53 } s;
55}; 54};
56 55
56int __initdata (*octeon_pcibios_map_irq)(const struct pci_dev *dev,
57 u8 slot, u8 pin);
58enum octeon_dma_bar_type octeon_dma_bar_type = OCTEON_DMA_BAR_TYPE_INVALID;
59
60/**
61 * Map a PCI device to the appropriate interrupt line
62 *
63 * @dev: The Linux PCI device structure for the device to map
64 * @slot: The slot number for this device on __BUS 0__. Linux
65 * enumerates through all the bridges and figures out the
66 * slot on Bus 0 where this device eventually hooks to.
67 * @pin: The PCI interrupt pin read from the device, then swizzled
68 * as it goes through each bridge.
69 * Returns Interrupt number for the device
70 */
71int __init pcibios_map_irq(const struct pci_dev *dev, u8 slot, u8 pin)
72{
73 if (octeon_pcibios_map_irq)
74 return octeon_pcibios_map_irq(dev, slot, pin);
75 else
76 panic("octeon_pcibios_map_irq not set.");
77}
78
79
80/*
81 * Called to perform platform specific PCI setup
82 */
83int pcibios_plat_dev_init(struct pci_dev *dev)
84{
85 uint16_t config;
86 uint32_t dconfig;
87 int pos;
88 /*
89 * Force the Cache line setting to 64 bytes. The standard
90 * Linux bus scan doesn't seem to set it. Octeon really has
91 * 128 byte lines, but Intel bridges get really upset if you
92 * try and set values above 64 bytes. Value is specified in
93 * 32bit words.
94 */
95 pci_write_config_byte(dev, PCI_CACHE_LINE_SIZE, 64 / 4);
96 /* Set latency timers for all devices */
97 pci_write_config_byte(dev, PCI_LATENCY_TIMER, 48);
98
99 /* Enable reporting System errors and parity errors on all devices */
100 /* Enable parity checking and error reporting */
101 pci_read_config_word(dev, PCI_COMMAND, &config);
102 config |= PCI_COMMAND_PARITY | PCI_COMMAND_SERR;
103 pci_write_config_word(dev, PCI_COMMAND, config);
104
105 if (dev->subordinate) {
106 /* Set latency timers on sub bridges */
107 pci_write_config_byte(dev, PCI_SEC_LATENCY_TIMER, 48);
108 /* More bridge error detection */
109 pci_read_config_word(dev, PCI_BRIDGE_CONTROL, &config);
110 config |= PCI_BRIDGE_CTL_PARITY | PCI_BRIDGE_CTL_SERR;
111 pci_write_config_word(dev, PCI_BRIDGE_CONTROL, config);
112 }
113
114 /* Enable the PCIe normal error reporting */
115 pos = pci_find_capability(dev, PCI_CAP_ID_EXP);
116 if (pos) {
117 /* Update Device Control */
118 pci_read_config_word(dev, pos + PCI_EXP_DEVCTL, &config);
119 /* Correctable Error Reporting */
120 config |= PCI_EXP_DEVCTL_CERE;
121 /* Non-Fatal Error Reporting */
122 config |= PCI_EXP_DEVCTL_NFERE;
123 /* Fatal Error Reporting */
124 config |= PCI_EXP_DEVCTL_FERE;
125 /* Unsupported Request */
126 config |= PCI_EXP_DEVCTL_URRE;
127 pci_write_config_word(dev, pos + PCI_EXP_DEVCTL, config);
128 }
129
130 /* Find the Advanced Error Reporting capability */
131 pos = pci_find_ext_capability(dev, PCI_EXT_CAP_ID_ERR);
132 if (pos) {
133 /* Clear Uncorrectable Error Status */
134 pci_read_config_dword(dev, pos + PCI_ERR_UNCOR_STATUS,
135 &dconfig);
136 pci_write_config_dword(dev, pos + PCI_ERR_UNCOR_STATUS,
137 dconfig);
138 /* Enable reporting of all uncorrectable errors */
139 /* Uncorrectable Error Mask - turned on bits disable errors */
140 pci_write_config_dword(dev, pos + PCI_ERR_UNCOR_MASK, 0);
141 /*
142 * Leave severity at HW default. This only controls if
143 * errors are reported as uncorrectable or
144 * correctable, not if the error is reported.
145 */
146 /* PCI_ERR_UNCOR_SEVER - Uncorrectable Error Severity */
147 /* Clear Correctable Error Status */
148 pci_read_config_dword(dev, pos + PCI_ERR_COR_STATUS, &dconfig);
149 pci_write_config_dword(dev, pos + PCI_ERR_COR_STATUS, dconfig);
150 /* Enable reporting of all correctable errors */
151 /* Correctable Error Mask - turned on bits disable errors */
152 pci_write_config_dword(dev, pos + PCI_ERR_COR_MASK, 0);
153 /* Advanced Error Capabilities */
154 pci_read_config_dword(dev, pos + PCI_ERR_CAP, &dconfig);
155 /* ECRC Generation Enable */
156 if (config & PCI_ERR_CAP_ECRC_GENC)
157 config |= PCI_ERR_CAP_ECRC_GENE;
158 /* ECRC Check Enable */
159 if (config & PCI_ERR_CAP_ECRC_CHKC)
160 config |= PCI_ERR_CAP_ECRC_CHKE;
161 pci_write_config_dword(dev, pos + PCI_ERR_CAP, dconfig);
162 /* PCI_ERR_HEADER_LOG - Header Log Register (16 bytes) */
163 /* Report all errors to the root complex */
164 pci_write_config_dword(dev, pos + PCI_ERR_ROOT_COMMAND,
165 PCI_ERR_ROOT_CMD_COR_EN |
166 PCI_ERR_ROOT_CMD_NONFATAL_EN |
167 PCI_ERR_ROOT_CMD_FATAL_EN);
168 /* Clear the Root status register */
169 pci_read_config_dword(dev, pos + PCI_ERR_ROOT_STATUS, &dconfig);
170 pci_write_config_dword(dev, pos + PCI_ERR_ROOT_STATUS, dconfig);
171 }
172
173 return 0;
174}
175
57/** 176/**
58 * Return the mapping of PCI device number to IRQ line. Each 177 * Return the mapping of PCI device number to IRQ line. Each
59 * character in the return string represents the interrupt 178 * character in the return string represents the interrupt
@@ -136,9 +255,8 @@ int __init octeon_pci_pcibios_map_irq(const struct pci_dev *dev,
136} 255}
137 256
138 257
139/** 258/*
140 * Read a value from configuration space 259 * Read a value from configuration space
141 *
142 */ 260 */
143static int octeon_read_config(struct pci_bus *bus, unsigned int devfn, 261static int octeon_read_config(struct pci_bus *bus, unsigned int devfn,
144 int reg, int size, u32 *val) 262 int reg, int size, u32 *val)
@@ -174,15 +292,8 @@ static int octeon_read_config(struct pci_bus *bus, unsigned int devfn,
174} 292}
175 293
176 294
177/** 295/*
178 * Write a value to PCI configuration space 296 * Write a value to PCI configuration space
179 *
180 * @bus:
181 * @devfn:
182 * @reg:
183 * @size:
184 * @val:
185 * Returns
186 */ 297 */
187static int octeon_write_config(struct pci_bus *bus, unsigned int devfn, 298static int octeon_write_config(struct pci_bus *bus, unsigned int devfn,
188 int reg, int size, u32 val) 299 int reg, int size, u32 val)
@@ -251,10 +362,8 @@ static struct pci_controller octeon_pci_controller = {
251}; 362};
252 363
253 364
254/** 365/*
255 * Low level initialize the Octeon PCI controller 366 * Low level initialize the Octeon PCI controller
256 *
257 * Returns
258 */ 367 */
259static void octeon_pci_initialize(void) 368static void octeon_pci_initialize(void)
260{ 369{
@@ -398,7 +507,7 @@ static void octeon_pci_initialize(void)
398 pci_int_arb_cfg.s.en = 1; /* Internal arbiter enable */ 507 pci_int_arb_cfg.s.en = 1; /* Internal arbiter enable */
399 cvmx_write_csr(CVMX_NPI_PCI_INT_ARB_CFG, pci_int_arb_cfg.u64); 508 cvmx_write_csr(CVMX_NPI_PCI_INT_ARB_CFG, pci_int_arb_cfg.u64);
400 } 509 }
401#endif /* USE_OCTEON_INTERNAL_ARBITER */ 510#endif /* USE_OCTEON_INTERNAL_ARBITER */
402 511
403 /* 512 /*
404 * Preferrably written to 1 to set MLTD. [RDSATI,TRTAE, 513 * Preferrably written to 1 to set MLTD. [RDSATI,TRTAE,
@@ -457,10 +566,8 @@ static void octeon_pci_initialize(void)
457} 566}
458 567
459 568
460/** 569/*
461 * Initialize the Octeon PCI controller 570 * Initialize the Octeon PCI controller
462 *
463 * Returns
464 */ 571 */
465static int __init octeon_pci_setup(void) 572static int __init octeon_pci_setup(void)
466{ 573{
diff --git a/arch/mips/pci/pci-vr41xx.c b/arch/mips/pci/pci-vr41xx.c
index d1e049b55f34..56525711f8b7 100644
--- a/arch/mips/pci/pci-vr41xx.c
+++ b/arch/mips/pci/pci-vr41xx.c
@@ -2,8 +2,8 @@
2 * pci-vr41xx.c, PCI Control Unit routines for the NEC VR4100 series. 2 * pci-vr41xx.c, PCI Control Unit routines for the NEC VR4100 series.
3 * 3 *
4 * Copyright (C) 2001-2003 MontaVista Software Inc. 4 * Copyright (C) 2001-2003 MontaVista Software Inc.
5 * Author: Yoichi Yuasa <yyuasa@mvista.com or source@mvista.com> 5 * Author: Yoichi Yuasa <source@mvista.com>
6 * Copyright (C) 2004-2008 Yoichi Yuasa <yoichi_yuasa@tripeaks.co.jp> 6 * Copyright (C) 2004-2008 Yoichi Yuasa <yuasa@linux-mips.org>
7 * Copyright (C) 2004 by Ralf Baechle (ralf@linux-mips.org) 7 * Copyright (C) 2004 by Ralf Baechle (ralf@linux-mips.org)
8 * 8 *
9 * This program is free software; you can redistribute it and/or modify 9 * This program is free software; you can redistribute it and/or modify
@@ -22,7 +22,7 @@
22 */ 22 */
23/* 23/*
24 * Changes: 24 * Changes:
25 * MontaVista Software Inc. <yyuasa@mvista.com> or <source@mvista.com> 25 * MontaVista Software Inc. <source@mvista.com>
26 * - New creation, NEC VR4122 and VR4131 are supported. 26 * - New creation, NEC VR4122 and VR4131 are supported.
27 */ 27 */
28#include <linux/init.h> 28#include <linux/init.h>
diff --git a/arch/mips/pci/pci-vr41xx.h b/arch/mips/pci/pci-vr41xx.h
index 8a35e32b8376..6b1ae2eb1c06 100644
--- a/arch/mips/pci/pci-vr41xx.h
+++ b/arch/mips/pci/pci-vr41xx.h
@@ -2,8 +2,8 @@
2 * pci-vr41xx.h, Include file for PCI Control Unit of the NEC VR4100 series. 2 * pci-vr41xx.h, Include file for PCI Control Unit of the NEC VR4100 series.
3 * 3 *
4 * Copyright (C) 2002 MontaVista Software Inc. 4 * Copyright (C) 2002 MontaVista Software Inc.
5 * Author: Yoichi Yuasa <yyuasa@mvista.com or source@mvista.com> 5 * Author: Yoichi Yuasa <source@mvista.com>
6 * Copyright (C) 2004-2005 Yoichi Yuasa <yoichi_yuasa@tripeaks.co.jp> 6 * Copyright (C) 2004-2005 Yoichi Yuasa <yuasa@linux-mips.org>
7 * 7 *
8 * This program is free software; you can redistribute it and/or modify 8 * This program is free software; you can redistribute it and/or modify
9 * it under the terms of the GNU General Public License as published by 9 * it under the terms of the GNU General Public License as published by
diff --git a/arch/mips/cavium-octeon/pcie.c b/arch/mips/pci/pcie-octeon.c
index 49d14081b3b5..75262247f3e4 100644
--- a/arch/mips/cavium-octeon/pcie.c
+++ b/arch/mips/pci/pcie-octeon.c
@@ -18,8 +18,7 @@
18#include <asm/octeon/cvmx-pescx-defs.h> 18#include <asm/octeon/cvmx-pescx-defs.h>
19#include <asm/octeon/cvmx-pexp-defs.h> 19#include <asm/octeon/cvmx-pexp-defs.h>
20#include <asm/octeon/cvmx-helper-errata.h> 20#include <asm/octeon/cvmx-helper-errata.h>
21 21#include <asm/octeon/pci-octeon.h>
22#include "pci-common.h"
23 22
24union cvmx_pcie_address { 23union cvmx_pcie_address {
25 uint64_t u64; 24 uint64_t u64;
@@ -976,13 +975,13 @@ static int cvmx_pcie_rc_initialize(int pcie_port)
976/** 975/**
977 * Map a PCI device to the appropriate interrupt line 976 * Map a PCI device to the appropriate interrupt line
978 * 977 *
979 * @param dev The Linux PCI device structure for the device to map 978 * @dev: The Linux PCI device structure for the device to map
980 * @param slot The slot number for this device on __BUS 0__. Linux 979 * @slot: The slot number for this device on __BUS 0__. Linux
981 * enumerates through all the bridges and figures out the 980 * enumerates through all the bridges and figures out the
982 * slot on Bus 0 where this device eventually hooks to. 981 * slot on Bus 0 where this device eventually hooks to.
983 * @param pin The PCI interrupt pin read from the device, then swizzled 982 * @pin: The PCI interrupt pin read from the device, then swizzled
984 * as it goes through each bridge. 983 * as it goes through each bridge.
985 * @return Interrupt number for the device 984 * Returns Interrupt number for the device
986 */ 985 */
987int __init octeon_pcie_pcibios_map_irq(const struct pci_dev *dev, 986int __init octeon_pcie_pcibios_map_irq(const struct pci_dev *dev,
988 u8 slot, u8 pin) 987 u8 slot, u8 pin)
@@ -1025,12 +1024,12 @@ int __init octeon_pcie_pcibios_map_irq(const struct pci_dev *dev,
1025/** 1024/**
1026 * Read a value from configuration space 1025 * Read a value from configuration space
1027 * 1026 *
1028 * @param bus 1027 * @bus:
1029 * @param devfn 1028 * @devfn:
1030 * @param reg 1029 * @reg:
1031 * @param size 1030 * @size:
1032 * @param val 1031 * @val:
1033 * @return 1032 * Returns
1034 */ 1033 */
1035static inline int octeon_pcie_read_config(int pcie_port, struct pci_bus *bus, 1034static inline int octeon_pcie_read_config(int pcie_port, struct pci_bus *bus,
1036 unsigned int devfn, int reg, int size, 1035 unsigned int devfn, int reg, int size,
@@ -1156,12 +1155,12 @@ static int octeon_pcie1_read_config(struct pci_bus *bus, unsigned int devfn,
1156/** 1155/**
1157 * Write a value to PCI configuration space 1156 * Write a value to PCI configuration space
1158 * 1157 *
1159 * @param bus 1158 * @bus:
1160 * @param devfn 1159 * @devfn:
1161 * @param reg 1160 * @reg:
1162 * @param size 1161 * @size:
1163 * @param val 1162 * @val:
1164 * @return 1163 * Returns
1165 */ 1164 */
1166static inline int octeon_pcie_write_config(int pcie_port, struct pci_bus *bus, 1165static inline int octeon_pcie_write_config(int pcie_port, struct pci_bus *bus,
1167 unsigned int devfn, int reg, 1166 unsigned int devfn, int reg,
@@ -1254,7 +1253,7 @@ static struct pci_controller octeon_pcie1_controller = {
1254/** 1253/**
1255 * Initialize the Octeon PCIe controllers 1254 * Initialize the Octeon PCIe controllers
1256 * 1255 *
1257 * @return 1256 * Returns
1258 */ 1257 */
1259static int __init octeon_pcie_setup(void) 1258static int __init octeon_pcie_setup(void)
1260{ 1259{
diff --git a/arch/mips/vr41xx/casio-e55/setup.c b/arch/mips/vr41xx/casio-e55/setup.c
index 6d9bab890587..719f4a5b9844 100644
--- a/arch/mips/vr41xx/casio-e55/setup.c
+++ b/arch/mips/vr41xx/casio-e55/setup.c
@@ -1,7 +1,7 @@
1/* 1/*
2 * setup.c, Setup for the CASIO CASSIOPEIA E-11/15/55/65. 2 * setup.c, Setup for the CASIO CASSIOPEIA E-11/15/55/65.
3 * 3 *
4 * Copyright (C) 2002-2006 Yoichi Yuasa <yoichi_yuasa@tripeaks.co.jp> 4 * Copyright (C) 2002-2006 Yoichi Yuasa <yuasa@linux-mips.org>
5 * 5 *
6 * This program is free software; you can redistribute it and/or modify 6 * This program is free software; you can redistribute it and/or modify
7 * it under the terms of the GNU General Public License as published by 7 * it under the terms of the GNU General Public License as published by
diff --git a/arch/mips/vr41xx/common/bcu.c b/arch/mips/vr41xx/common/bcu.c
index d77c330a0d59..6346c59c9f9d 100644
--- a/arch/mips/vr41xx/common/bcu.c
+++ b/arch/mips/vr41xx/common/bcu.c
@@ -2,8 +2,8 @@
2 * bcu.c, Bus Control Unit routines for the NEC VR4100 series. 2 * bcu.c, Bus Control Unit routines for the NEC VR4100 series.
3 * 3 *
4 * Copyright (C) 2002 MontaVista Software Inc. 4 * Copyright (C) 2002 MontaVista Software Inc.
5 * Author: Yoichi Yuasa <yyuasa@mvista.com, or source@mvista.com> 5 * Author: Yoichi Yuasa <source@mvista.com>
6 * Copyright (C) 2003-2005 Yoichi Yuasa <yoichi_yuasa@tripeaks.co.jp> 6 * Copyright (C) 2003-2005 Yoichi Yuasa <yuasa@linux-mips.org>
7 * 7 *
8 * This program is free software; you can redistribute it and/or modify 8 * This program is free software; you can redistribute it and/or modify
9 * it under the terms of the GNU General Public License as published by 9 * it under the terms of the GNU General Public License as published by
@@ -21,11 +21,11 @@
21 */ 21 */
22/* 22/*
23 * Changes: 23 * Changes:
24 * MontaVista Software Inc. <yyuasa@mvista.com> or <source@mvista.com> 24 * MontaVista Software Inc. <source@mvista.com>
25 * - New creation, NEC VR4122 and VR4131 are supported. 25 * - New creation, NEC VR4122 and VR4131 are supported.
26 * - Added support for NEC VR4111 and VR4121. 26 * - Added support for NEC VR4111 and VR4121.
27 * 27 *
28 * Yoichi Yuasa <yoichi_yuasa@tripeaks.co.jp> 28 * Yoichi Yuasa <yuasa@linux-mips.org>
29 * - Added support for NEC VR4133. 29 * - Added support for NEC VR4133.
30 */ 30 */
31#include <linux/kernel.h> 31#include <linux/kernel.h>
diff --git a/arch/mips/vr41xx/common/cmu.c b/arch/mips/vr41xx/common/cmu.c
index ad0e8e3409d9..8ba7d04a5ec5 100644
--- a/arch/mips/vr41xx/common/cmu.c
+++ b/arch/mips/vr41xx/common/cmu.c
@@ -2,8 +2,8 @@
2 * cmu.c, Clock Mask Unit routines for the NEC VR4100 series. 2 * cmu.c, Clock Mask Unit routines for the NEC VR4100 series.
3 * 3 *
4 * Copyright (C) 2001-2002 MontaVista Software Inc. 4 * Copyright (C) 2001-2002 MontaVista Software Inc.
5 * Author: Yoichi Yuasa <yyuasa@mvista.com or source@mvista.com> 5 * Author: Yoichi Yuasa <source@mvista.com>
6 * Copuright (C) 2003-2005 Yoichi Yuasa <yoichi_yuasa@tripeaks.co.jp> 6 * Copuright (C) 2003-2005 Yoichi Yuasa <yuasa@linux-mips.org>
7 * 7 *
8 * This program is free software; you can redistribute it and/or modify 8 * This program is free software; you can redistribute it and/or modify
9 * it under the terms of the GNU General Public License as published by 9 * it under the terms of the GNU General Public License as published by
@@ -21,11 +21,11 @@
21 */ 21 */
22/* 22/*
23 * Changes: 23 * Changes:
24 * MontaVista Software Inc. <yyuasa@mvista.com> or <source@mvista.com> 24 * MontaVista Software Inc. <source@mvista.com>
25 * - New creation, NEC VR4122 and VR4131 are supported. 25 * - New creation, NEC VR4122 and VR4131 are supported.
26 * - Added support for NEC VR4111 and VR4121. 26 * - Added support for NEC VR4111 and VR4121.
27 * 27 *
28 * Yoichi Yuasa <yoichi_yuasa@tripeaks.co.jp> 28 * Yoichi Yuasa <yuasa@linux-mips.org>
29 * - Added support for NEC VR4133. 29 * - Added support for NEC VR4133.
30 */ 30 */
31#include <linux/init.h> 31#include <linux/init.h>
diff --git a/arch/mips/vr41xx/common/giu.c b/arch/mips/vr41xx/common/giu.c
index 2b272f1496fe..22cc6f2100a1 100644
--- a/arch/mips/vr41xx/common/giu.c
+++ b/arch/mips/vr41xx/common/giu.c
@@ -1,7 +1,7 @@
1/* 1/*
2 * NEC VR4100 series GIU platform device. 2 * NEC VR4100 series GIU platform device.
3 * 3 *
4 * Copyright (C) 2007 Yoichi Yuasa <yoichi_yuasa@tripeaks.co.jp> 4 * Copyright (C) 2007 Yoichi Yuasa <yuasa@linux-mips.org>
5 * 5 *
6 * This program is free software; you can redistribute it and/or modify 6 * This program is free software; you can redistribute it and/or modify
7 * it under the terms of the GNU General Public License as published by 7 * it under the terms of the GNU General Public License as published by
diff --git a/arch/mips/vr41xx/common/icu.c b/arch/mips/vr41xx/common/icu.c
index 3f23d9fda662..6d39e222b170 100644
--- a/arch/mips/vr41xx/common/icu.c
+++ b/arch/mips/vr41xx/common/icu.c
@@ -2,8 +2,8 @@
2 * icu.c, Interrupt Control Unit routines for the NEC VR4100 series. 2 * icu.c, Interrupt Control Unit routines for the NEC VR4100 series.
3 * 3 *
4 * Copyright (C) 2001-2002 MontaVista Software Inc. 4 * Copyright (C) 2001-2002 MontaVista Software Inc.
5 * Author: Yoichi Yuasa <yyuasa@mvista.com or source@mvista.com> 5 * Author: Yoichi Yuasa <source@mvista.com>
6 * Copyright (C) 2003-2006 Yoichi Yuasa <yoichi_yuasa@tripeaks.co.jp> 6 * Copyright (C) 2003-2006 Yoichi Yuasa <yuasa@linux-mips.org>
7 * 7 *
8 * This program is free software; you can redistribute it and/or modify 8 * This program is free software; you can redistribute it and/or modify
9 * it under the terms of the GNU General Public License as published by 9 * it under the terms of the GNU General Public License as published by
@@ -21,11 +21,11 @@
21 */ 21 */
22/* 22/*
23 * Changes: 23 * Changes:
24 * MontaVista Software Inc. <yyuasa@mvista.com> or <source@mvista.com> 24 * MontaVista Software Inc. <source@mvista.com>
25 * - New creation, NEC VR4122 and VR4131 are supported. 25 * - New creation, NEC VR4122 and VR4131 are supported.
26 * - Added support for NEC VR4111 and VR4121. 26 * - Added support for NEC VR4111 and VR4121.
27 * 27 *
28 * Yoichi Yuasa <yoichi_yuasa@tripeaks.co.jp> 28 * Yoichi Yuasa <yuasa@linux-mips.org>
29 * - Coped with INTASSIGN of NEC VR4133. 29 * - Coped with INTASSIGN of NEC VR4133.
30 */ 30 */
31#include <linux/errno.h> 31#include <linux/errno.h>
diff --git a/arch/mips/vr41xx/common/init.c b/arch/mips/vr41xx/common/init.c
index c64995342ba8..1386e6f081c8 100644
--- a/arch/mips/vr41xx/common/init.c
+++ b/arch/mips/vr41xx/common/init.c
@@ -1,7 +1,7 @@
1/* 1/*
2 * init.c, Common initialization routines for NEC VR4100 series. 2 * init.c, Common initialization routines for NEC VR4100 series.
3 * 3 *
4 * Copyright (C) 2003-2008 Yoichi Yuasa <yoichi_yuasa@tripeaks.co.jp> 4 * Copyright (C) 2003-2008 Yoichi Yuasa <yuasa@linux-mips.org>
5 * 5 *
6 * This program is free software; you can redistribute it and/or modify 6 * This program is free software; you can redistribute it and/or modify
7 * it under the terms of the GNU General Public License as published by 7 * it under the terms of the GNU General Public License as published by
diff --git a/arch/mips/vr41xx/common/irq.c b/arch/mips/vr41xx/common/irq.c
index 9cc389109b19..bef06872f012 100644
--- a/arch/mips/vr41xx/common/irq.c
+++ b/arch/mips/vr41xx/common/irq.c
@@ -1,7 +1,7 @@
1/* 1/*
2 * Interrupt handing routines for NEC VR4100 series. 2 * Interrupt handing routines for NEC VR4100 series.
3 * 3 *
4 * Copyright (C) 2005-2007 Yoichi Yuasa <yoichi_yuasa@tripeaks.co.jp> 4 * Copyright (C) 2005-2007 Yoichi Yuasa <yuasa@linux-mips.org>
5 * 5 *
6 * This program is free software; you can redistribute it and/or modify 6 * This program is free software; you can redistribute it and/or modify
7 * it under the terms of the GNU General Public License as published by 7 * it under the terms of the GNU General Public License as published by
diff --git a/arch/mips/vr41xx/common/pmu.c b/arch/mips/vr41xx/common/pmu.c
index 028aaf75eb21..692b4e85b7fc 100644
--- a/arch/mips/vr41xx/common/pmu.c
+++ b/arch/mips/vr41xx/common/pmu.c
@@ -1,7 +1,7 @@
1/* 1/*
2 * pmu.c, Power Management Unit routines for NEC VR4100 series. 2 * pmu.c, Power Management Unit routines for NEC VR4100 series.
3 * 3 *
4 * Copyright (C) 2003-2007 Yoichi Yuasa <yoichi_yuasa@tripeaks.co.jp> 4 * Copyright (C) 2003-2007 Yoichi Yuasa <yuasa@linux-mips.org>
5 * 5 *
6 * This program is free software; you can redistribute it and/or modify 6 * This program is free software; you can redistribute it and/or modify
7 * it under the terms of the GNU General Public License as published by 7 * it under the terms of the GNU General Public License as published by
diff --git a/arch/mips/vr41xx/common/rtc.c b/arch/mips/vr41xx/common/rtc.c
index 9f26c14edcac..ebc5dcf0ed8e 100644
--- a/arch/mips/vr41xx/common/rtc.c
+++ b/arch/mips/vr41xx/common/rtc.c
@@ -1,7 +1,7 @@
1/* 1/*
2 * NEC VR4100 series RTC platform device. 2 * NEC VR4100 series RTC platform device.
3 * 3 *
4 * Copyright (C) 2007 Yoichi Yuasa <yoichi_yuasa@tripeaks.co.jp> 4 * Copyright (C) 2007 Yoichi Yuasa <yuasa@linux-mips.org>
5 * 5 *
6 * This program is free software; you can redistribute it and/or modify 6 * This program is free software; you can redistribute it and/or modify
7 * it under the terms of the GNU General Public License as published by 7 * it under the terms of the GNU General Public License as published by
diff --git a/arch/mips/vr41xx/common/siu.c b/arch/mips/vr41xx/common/siu.c
index 654dee6208be..54eae56108fb 100644
--- a/arch/mips/vr41xx/common/siu.c
+++ b/arch/mips/vr41xx/common/siu.c
@@ -1,7 +1,7 @@
1/* 1/*
2 * NEC VR4100 series SIU platform device. 2 * NEC VR4100 series SIU platform device.
3 * 3 *
4 * Copyright (C) 2007-2008 Yoichi Yuasa <yoichi_yuasa@tripeaks.co.jp> 4 * Copyright (C) 2007-2008 Yoichi Yuasa <yuasa@linux-mips.org>
5 * 5 *
6 * This program is free software; you can redistribute it and/or modify 6 * This program is free software; you can redistribute it and/or modify
7 * it under the terms of the GNU General Public License as published by 7 * it under the terms of the GNU General Public License as published by
diff --git a/arch/mips/vr41xx/common/type.c b/arch/mips/vr41xx/common/type.c
index e0c1ac5e988e..ff841422b638 100644
--- a/arch/mips/vr41xx/common/type.c
+++ b/arch/mips/vr41xx/common/type.c
@@ -1,7 +1,7 @@
1/* 1/*
2 * type.c, System type for NEC VR4100 series. 2 * type.c, System type for NEC VR4100 series.
3 * 3 *
4 * Copyright (C) 2005 Yoichi Yuasa <yoichi_yuasa@tripeaks.co.jp> 4 * Copyright (C) 2005 Yoichi Yuasa <yuasa@linux-mips.org>
5 * 5 *
6 * This program is free software; you can redistribute it and/or modify 6 * This program is free software; you can redistribute it and/or modify
7 * it under the terms of the GNU General Public License as published by 7 * it under the terms of the GNU General Public License as published by
diff --git a/arch/mips/vr41xx/ibm-workpad/setup.c b/arch/mips/vr41xx/ibm-workpad/setup.c
index 9eef297eca1a..3982f378a3e6 100644
--- a/arch/mips/vr41xx/ibm-workpad/setup.c
+++ b/arch/mips/vr41xx/ibm-workpad/setup.c
@@ -1,7 +1,7 @@
1/* 1/*
2 * setup.c, Setup for the IBM WorkPad z50. 2 * setup.c, Setup for the IBM WorkPad z50.
3 * 3 *
4 * Copyright (C) 2002-2006 Yoichi Yuasa <yoichi_yuasa@tripeaks.co.jp> 4 * Copyright (C) 2002-2006 Yoichi Yuasa <yuasa@linux-mips.org>
5 * 5 *
6 * This program is free software; you can redistribute it and/or modify 6 * This program is free software; you can redistribute it and/or modify
7 * it under the terms of the GNU General Public License as published by 7 * it under the terms of the GNU General Public License as published by
diff --git a/arch/mn10300/include/asm/pci.h b/arch/mn10300/include/asm/pci.h
index e58b9a46e1b1..35d2ed6396f6 100644
--- a/arch/mn10300/include/asm/pci.h
+++ b/arch/mn10300/include/asm/pci.h
@@ -70,10 +70,6 @@ struct pci_dev;
70 */ 70 */
71#define PCI_DMA_BUS_IS_PHYS (1) 71#define PCI_DMA_BUS_IS_PHYS (1)
72 72
73
74/* This is always fine. */
75#define pci_dac_dma_supported(pci_dev, mask) (0)
76
77/* Return the index of the PCI controller for device. */ 73/* Return the index of the PCI controller for device. */
78static inline int pci_controller_num(struct pci_dev *dev) 74static inline int pci_controller_num(struct pci_dev *dev)
79{ 75{
diff --git a/arch/mn10300/include/asm/thread_info.h b/arch/mn10300/include/asm/thread_info.h
index 78a3881f3c12..58d64f8b2cc3 100644
--- a/arch/mn10300/include/asm/thread_info.h
+++ b/arch/mn10300/include/asm/thread_info.h
@@ -65,8 +65,6 @@ struct thread_info {
65 65
66/* 66/*
67 * macros/functions for gaining access to the thread information structure 67 * macros/functions for gaining access to the thread information structure
68 *
69 * preempt_count needs to be 1 initially, until the scheduler is functional.
70 */ 68 */
71#ifndef __ASSEMBLY__ 69#ifndef __ASSEMBLY__
72 70
@@ -76,7 +74,7 @@ struct thread_info {
76 .exec_domain = &default_exec_domain, \ 74 .exec_domain = &default_exec_domain, \
77 .flags = 0, \ 75 .flags = 0, \
78 .cpu = 0, \ 76 .cpu = 0, \
79 .preempt_count = 1, \ 77 .preempt_count = INIT_PREEMPT_COUNT, \
80 .addr_limit = KERNEL_DS, \ 78 .addr_limit = KERNEL_DS, \
81 .restart_block = { \ 79 .restart_block = { \
82 .fn = do_no_restart_syscall, \ 80 .fn = do_no_restart_syscall, \
diff --git a/arch/mn10300/include/asm/unistd.h b/arch/mn10300/include/asm/unistd.h
index fef5b434dadc..fad68616af32 100644
--- a/arch/mn10300/include/asm/unistd.h
+++ b/arch/mn10300/include/asm/unistd.h
@@ -346,10 +346,12 @@
346#define __NR_inotify_init1 333 346#define __NR_inotify_init1 333
347#define __NR_preadv 334 347#define __NR_preadv 334
348#define __NR_pwritev 335 348#define __NR_pwritev 335
349#define __NR_rt_tgsigqueueinfo 336
350#define __NR_perf_counter_open 337
349 351
350#ifdef __KERNEL__ 352#ifdef __KERNEL__
351 353
352#define NR_syscalls 326 354#define NR_syscalls 338
353 355
354/* 356/*
355 * specify the deprecated syscalls we want to support on this arch 357 * specify the deprecated syscalls we want to support on this arch
diff --git a/arch/mn10300/kernel/entry.S b/arch/mn10300/kernel/entry.S
index 7408a27199f3..e0d2563af4f2 100644
--- a/arch/mn10300/kernel/entry.S
+++ b/arch/mn10300/kernel/entry.S
@@ -722,6 +722,8 @@ ENTRY(sys_call_table)
722 .long sys_inotify_init1 722 .long sys_inotify_init1
723 .long sys_preadv 723 .long sys_preadv
724 .long sys_pwritev /* 335 */ 724 .long sys_pwritev /* 335 */
725 .long sys_rt_tgsigqueueinfo
726 .long sys_perf_counter_open
725 727
726 728
727nr_syscalls=(.-sys_call_table)/4 729nr_syscalls=(.-sys_call_table)/4
diff --git a/arch/mn10300/kernel/ptrace.c b/arch/mn10300/kernel/ptrace.c
index e143339ad28e..cf847dabc1bd 100644
--- a/arch/mn10300/kernel/ptrace.c
+++ b/arch/mn10300/kernel/ptrace.c
@@ -13,7 +13,6 @@
13#include <linux/sched.h> 13#include <linux/sched.h>
14#include <linux/mm.h> 14#include <linux/mm.h>
15#include <linux/smp.h> 15#include <linux/smp.h>
16#include <linux/smp_lock.h>
17#include <linux/errno.h> 16#include <linux/errno.h>
18#include <linux/ptrace.h> 17#include <linux/ptrace.h>
19#include <linux/user.h> 18#include <linux/user.h>
diff --git a/arch/mn10300/kernel/signal.c b/arch/mn10300/kernel/signal.c
index 9f7572a0f578..feb2f2e810db 100644
--- a/arch/mn10300/kernel/signal.c
+++ b/arch/mn10300/kernel/signal.c
@@ -12,7 +12,6 @@
12#include <linux/sched.h> 12#include <linux/sched.h>
13#include <linux/mm.h> 13#include <linux/mm.h>
14#include <linux/smp.h> 14#include <linux/smp.h>
15#include <linux/smp_lock.h>
16#include <linux/kernel.h> 15#include <linux/kernel.h>
17#include <linux/signal.h> 16#include <linux/signal.h>
18#include <linux/errno.h> 17#include <linux/errno.h>
diff --git a/arch/mn10300/kernel/sys_mn10300.c b/arch/mn10300/kernel/sys_mn10300.c
index bca5a84dc72c..3e52a1054327 100644
--- a/arch/mn10300/kernel/sys_mn10300.c
+++ b/arch/mn10300/kernel/sys_mn10300.c
@@ -13,7 +13,6 @@
13#include <linux/syscalls.h> 13#include <linux/syscalls.h>
14#include <linux/mm.h> 14#include <linux/mm.h>
15#include <linux/smp.h> 15#include <linux/smp.h>
16#include <linux/smp_lock.h>
17#include <linux/sem.h> 16#include <linux/sem.h>
18#include <linux/msg.h> 17#include <linux/msg.h>
19#include <linux/shm.h> 18#include <linux/shm.h>
@@ -21,7 +20,6 @@
21#include <linux/mman.h> 20#include <linux/mman.h>
22#include <linux/file.h> 21#include <linux/file.h>
23#include <linux/utsname.h> 22#include <linux/utsname.h>
24#include <linux/syscalls.h>
25#include <linux/tty.h> 23#include <linux/tty.h>
26 24
27#include <asm/uaccess.h> 25#include <asm/uaccess.h>
diff --git a/arch/mn10300/kernel/traps.c b/arch/mn10300/kernel/traps.c
index 681ad8c9e4fb..91365adba4f5 100644
--- a/arch/mn10300/kernel/traps.c
+++ b/arch/mn10300/kernel/traps.c
@@ -17,7 +17,6 @@
17#include <linux/timer.h> 17#include <linux/timer.h>
18#include <linux/mm.h> 18#include <linux/mm.h>
19#include <linux/smp.h> 19#include <linux/smp.h>
20#include <linux/smp_lock.h>
21#include <linux/init.h> 20#include <linux/init.h>
22#include <linux/delay.h> 21#include <linux/delay.h>
23#include <linux/spinlock.h> 22#include <linux/spinlock.h>
@@ -136,8 +135,7 @@ void show_trace(unsigned long *sp)
136 unsigned long *stack, addr, module_start, module_end; 135 unsigned long *stack, addr, module_start, module_end;
137 int i; 136 int i;
138 137
139 printk(KERN_EMERG "\n" 138 printk(KERN_EMERG "\nCall Trace:");
140 KERN_EMERG "Call Trace:");
141 139
142 stack = sp; 140 stack = sp;
143 i = 0; 141 i = 0;
@@ -153,7 +151,7 @@ void show_trace(unsigned long *sp)
153 printk("\n"); 151 printk("\n");
154#else 152#else
155 if ((i % 6) == 0) 153 if ((i % 6) == 0)
156 printk("\n" KERN_EMERG " "); 154 printk(KERN_EMERG " ");
157 printk("[<%08lx>] ", addr); 155 printk("[<%08lx>] ", addr);
158 i++; 156 i++;
159#endif 157#endif
@@ -180,7 +178,7 @@ void show_stack(struct task_struct *task, unsigned long *sp)
180 if (((long) stack & (THREAD_SIZE - 1)) == 0) 178 if (((long) stack & (THREAD_SIZE - 1)) == 0)
181 break; 179 break;
182 if ((i % 8) == 0) 180 if ((i % 8) == 0)
183 printk("\n" KERN_EMERG " "); 181 printk(KERN_EMERG " ");
184 printk("%08lx ", *stack++); 182 printk("%08lx ", *stack++);
185 } 183 }
186 184
@@ -264,8 +262,7 @@ void show_registers(struct pt_regs *regs)
264 show_stack(current, (unsigned long *) sp); 262 show_stack(current, (unsigned long *) sp);
265 263
266#if 0 264#if 0
267 printk(KERN_EMERG "\n" 265 printk(KERN_EMERG "\nCode: ");
268 KERN_EMERG "Code: ");
269 if (regs->pc < PAGE_OFFSET) 266 if (regs->pc < PAGE_OFFSET)
270 goto bad; 267 goto bad;
271 268
@@ -311,16 +308,14 @@ void die(const char *str, struct pt_regs *regs, enum exception_code code)
311{ 308{
312 console_verbose(); 309 console_verbose();
313 spin_lock_irq(&die_lock); 310 spin_lock_irq(&die_lock);
314 printk(KERN_EMERG "\n" 311 printk(KERN_EMERG "\n%s: %04x\n",
315 KERN_EMERG "%s: %04x\n",
316 str, code & 0xffff); 312 str, code & 0xffff);
317 show_registers(regs); 313 show_registers(regs);
318 314
319 if (regs->pc >= 0x02000000 && regs->pc < 0x04000000 && 315 if (regs->pc >= 0x02000000 && regs->pc < 0x04000000 &&
320 (regs->epsw & (EPSW_IM | EPSW_IE)) != (EPSW_IM | EPSW_IE)) { 316 (regs->epsw & (EPSW_IM | EPSW_IE)) != (EPSW_IM | EPSW_IE)) {
321 printk(KERN_EMERG "Exception in usermode interrupt handler\n"); 317 printk(KERN_EMERG "Exception in usermode interrupt handler\n");
322 printk(KERN_EMERG "\n" 318 printk(KERN_EMERG "\nPlease connect to kernel debugger !!\n");
323 KERN_EMERG " Please connect to kernel debugger !!\n");
324 asm volatile ("0: bra 0b"); 319 asm volatile ("0: bra 0b");
325 } 320 }
326 321
@@ -429,9 +424,8 @@ asmlinkage void io_bus_error(u32 bcberr, u32 bcbear, struct pt_regs *regs)
429{ 424{
430 console_verbose(); 425 console_verbose();
431 426
432 printk(KERN_EMERG "\n" 427 printk(KERN_EMERG "Asynchronous I/O Bus Error\n");
433 KERN_EMERG "Asynchronous I/O Bus Error\n" 428 printk(KERN_EMERG "==========================\n");
434 KERN_EMERG "==========================\n");
435 429
436 if (bcberr & BCBERR_BEME) 430 if (bcberr & BCBERR_BEME)
437 printk(KERN_EMERG "- Multiple recorded errors\n"); 431 printk(KERN_EMERG "- Multiple recorded errors\n");
diff --git a/arch/mn10300/kernel/vmlinux.lds.S b/arch/mn10300/kernel/vmlinux.lds.S
index bcebcefb4ad7..f4aa07934654 100644
--- a/arch/mn10300/kernel/vmlinux.lds.S
+++ b/arch/mn10300/kernel/vmlinux.lds.S
@@ -61,7 +61,7 @@ SECTIONS
61 _edata = .; /* End of data section */ 61 _edata = .; /* End of data section */
62 } 62 }
63 63
64 .data.init_task : { INIT_TASK(THREAD_SIZE); } 64 .data.init_task : { INIT_TASK_DATA(THREAD_SIZE); }
65 65
66 /* might get freed after init */ 66 /* might get freed after init */
67 . = ALIGN(PAGE_SIZE); 67 . = ALIGN(PAGE_SIZE);
@@ -107,7 +107,7 @@ SECTIONS
107 __init_end = .; 107 __init_end = .;
108 /* freed after init ends here */ 108 /* freed after init ends here */
109 109
110 BSS(4) 110 BSS_SECTION(0, PAGE_SIZE, 4)
111 111
112 _end = . ; 112 _end = . ;
113 113
diff --git a/arch/mn10300/mm/fault.c b/arch/mn10300/mm/fault.c
index a62e1e138bc1..53bb17d0f068 100644
--- a/arch/mn10300/mm/fault.c
+++ b/arch/mn10300/mm/fault.c
@@ -20,7 +20,6 @@
20#include <linux/mman.h> 20#include <linux/mman.h>
21#include <linux/mm.h> 21#include <linux/mm.h>
22#include <linux/smp.h> 22#include <linux/smp.h>
23#include <linux/smp_lock.h>
24#include <linux/interrupt.h> 23#include <linux/interrupt.h>
25#include <linux/init.h> 24#include <linux/init.h>
26#include <linux/vt_kern.h> /* For unblank_screen() */ 25#include <linux/vt_kern.h> /* For unblank_screen() */
diff --git a/arch/mn10300/mm/misalignment.c b/arch/mn10300/mm/misalignment.c
index 94c4a4358065..30016251f658 100644
--- a/arch/mn10300/mm/misalignment.c
+++ b/arch/mn10300/mm/misalignment.c
@@ -17,7 +17,6 @@
17#include <linux/timer.h> 17#include <linux/timer.h>
18#include <linux/mm.h> 18#include <linux/mm.h>
19#include <linux/smp.h> 19#include <linux/smp.h>
20#include <linux/smp_lock.h>
21#include <linux/init.h> 20#include <linux/init.h>
22#include <linux/delay.h> 21#include <linux/delay.h>
23#include <linux/spinlock.h> 22#include <linux/spinlock.h>
diff --git a/arch/parisc/Kconfig b/arch/parisc/Kconfig
index 9038f39d9d73..06f8d5b5b0f9 100644
--- a/arch/parisc/Kconfig
+++ b/arch/parisc/Kconfig
@@ -16,6 +16,8 @@ config PARISC
16 select RTC_DRV_GENERIC 16 select RTC_DRV_GENERIC
17 select INIT_ALL_POSSIBLE 17 select INIT_ALL_POSSIBLE
18 select BUG 18 select BUG
19 select HAVE_PERF_COUNTERS
20 select GENERIC_ATOMIC64 if !64BIT
19 help 21 help
20 The PA-RISC microprocessor is designed by Hewlett-Packard and used 22 The PA-RISC microprocessor is designed by Hewlett-Packard and used
21 in many of their workstations & servers (HP9000 700 and 800 series, 23 in many of their workstations & servers (HP9000 700 and 800 series,
diff --git a/arch/parisc/include/asm/atomic.h b/arch/parisc/include/asm/atomic.h
index 7eeaff944360..8bc9e96699b2 100644
--- a/arch/parisc/include/asm/atomic.h
+++ b/arch/parisc/include/asm/atomic.h
@@ -222,13 +222,13 @@ static __inline__ int atomic_add_unless(atomic_t *v, int a, int u)
222 222
223#define atomic_inc_not_zero(v) atomic_add_unless((v), 1, 0) 223#define atomic_inc_not_zero(v) atomic_add_unless((v), 1, 0)
224 224
225#define atomic_add(i,v) ((void)(__atomic_add_return( ((int)(i)),(v)))) 225#define atomic_add(i,v) ((void)(__atomic_add_return( (i),(v))))
226#define atomic_sub(i,v) ((void)(__atomic_add_return(-((int)(i)),(v)))) 226#define atomic_sub(i,v) ((void)(__atomic_add_return(-(i),(v))))
227#define atomic_inc(v) ((void)(__atomic_add_return( 1,(v)))) 227#define atomic_inc(v) ((void)(__atomic_add_return( 1,(v))))
228#define atomic_dec(v) ((void)(__atomic_add_return( -1,(v)))) 228#define atomic_dec(v) ((void)(__atomic_add_return( -1,(v))))
229 229
230#define atomic_add_return(i,v) (__atomic_add_return( ((int)(i)),(v))) 230#define atomic_add_return(i,v) (__atomic_add_return( (i),(v)))
231#define atomic_sub_return(i,v) (__atomic_add_return(-((int)(i)),(v))) 231#define atomic_sub_return(i,v) (__atomic_add_return(-(i),(v)))
232#define atomic_inc_return(v) (__atomic_add_return( 1,(v))) 232#define atomic_inc_return(v) (__atomic_add_return( 1,(v)))
233#define atomic_dec_return(v) (__atomic_add_return( -1,(v))) 233#define atomic_dec_return(v) (__atomic_add_return( -1,(v)))
234 234
@@ -336,7 +336,11 @@ static __inline__ int atomic64_add_unless(atomic64_t *v, long a, long u)
336 336
337#define atomic64_inc_not_zero(v) atomic64_add_unless((v), 1, 0) 337#define atomic64_inc_not_zero(v) atomic64_add_unless((v), 1, 0)
338 338
339#endif /* CONFIG_64BIT */ 339#else /* CONFIG_64BIT */
340
341#include <asm-generic/atomic64.h>
342
343#endif /* !CONFIG_64BIT */
340 344
341#include <asm-generic/atomic-long.h> 345#include <asm-generic/atomic-long.h>
342 346
diff --git a/arch/parisc/include/asm/dma.h b/arch/parisc/include/asm/dma.h
index 31ad0f05af3d..f7a18f968703 100644
--- a/arch/parisc/include/asm/dma.h
+++ b/arch/parisc/include/asm/dma.h
@@ -1,5 +1,4 @@
1/* $Id: dma.h,v 1.2 1999/04/27 00:46:18 deller Exp $ 1/* asm/dma.h: Defines for using and allocating dma channels.
2 * linux/include/asm/dma.h: Defines for using and allocating dma channels.
3 * Written by Hennus Bergman, 1992. 2 * Written by Hennus Bergman, 1992.
4 * High DMA channel support & info by Hannu Savolainen 3 * High DMA channel support & info by Hannu Savolainen
5 * and John Boyd, Nov. 1992. 4 * and John Boyd, Nov. 1992.
diff --git a/arch/parisc/include/asm/perf_counter.h b/arch/parisc/include/asm/perf_counter.h
new file mode 100644
index 000000000000..dc9e829f7013
--- /dev/null
+++ b/arch/parisc/include/asm/perf_counter.h
@@ -0,0 +1,7 @@
1#ifndef __ASM_PARISC_PERF_COUNTER_H
2#define __ASM_PARISC_PERF_COUNTER_H
3
4/* parisc only supports software counters through this interface. */
5static inline void set_perf_counter_pending(void) { }
6
7#endif /* __ASM_PARISC_PERF_COUNTER_H */
diff --git a/arch/parisc/include/asm/processor.h b/arch/parisc/include/asm/processor.h
index 9d64df8754ba..9ce66e9d1c2b 100644
--- a/arch/parisc/include/asm/processor.h
+++ b/arch/parisc/include/asm/processor.h
@@ -18,6 +18,7 @@
18#include <asm/types.h> 18#include <asm/types.h>
19#include <asm/system.h> 19#include <asm/system.h>
20#include <asm/percpu.h> 20#include <asm/percpu.h>
21
21#endif /* __ASSEMBLY__ */ 22#endif /* __ASSEMBLY__ */
22 23
23#define KERNEL_STACK_SIZE (4*PAGE_SIZE) 24#define KERNEL_STACK_SIZE (4*PAGE_SIZE)
@@ -127,6 +128,8 @@ struct thread_struct {
127 unsigned long flags; 128 unsigned long flags;
128}; 129};
129 130
131#define task_pt_regs(tsk) ((struct pt_regs *)&((tsk)->thread.regs))
132
130/* Thread struct flags. */ 133/* Thread struct flags. */
131#define PARISC_UAC_NOPRINT (1UL << 0) /* see prctl and unaligned.c */ 134#define PARISC_UAC_NOPRINT (1UL << 0) /* see prctl and unaligned.c */
132#define PARISC_UAC_SIGBUS (1UL << 1) 135#define PARISC_UAC_SIGBUS (1UL << 1)
diff --git a/arch/parisc/include/asm/system.h b/arch/parisc/include/asm/system.h
index ee80c920b464..d91357bca5b4 100644
--- a/arch/parisc/include/asm/system.h
+++ b/arch/parisc/include/asm/system.h
@@ -168,8 +168,8 @@ static inline void set_eiem(unsigned long val)
168/* LDCW, the only atomic read-write operation PA-RISC has. *sigh*. */ 168/* LDCW, the only atomic read-write operation PA-RISC has. *sigh*. */
169#define __ldcw(a) ({ \ 169#define __ldcw(a) ({ \
170 unsigned __ret; \ 170 unsigned __ret; \
171 __asm__ __volatile__(__LDCW " 0(%1),%0" \ 171 __asm__ __volatile__(__LDCW " 0(%2),%0" \
172 : "=r" (__ret) : "r" (a)); \ 172 : "=r" (__ret), "+m" (*(a)) : "r" (a)); \
173 __ret; \ 173 __ret; \
174}) 174})
175 175
diff --git a/arch/parisc/include/asm/thread_info.h b/arch/parisc/include/asm/thread_info.h
index 0407959da489..4ce0edfbe969 100644
--- a/arch/parisc/include/asm/thread_info.h
+++ b/arch/parisc/include/asm/thread_info.h
@@ -23,7 +23,7 @@ struct thread_info {
23 .flags = 0, \ 23 .flags = 0, \
24 .cpu = 0, \ 24 .cpu = 0, \
25 .addr_limit = KERNEL_DS, \ 25 .addr_limit = KERNEL_DS, \
26 .preempt_count = 1, \ 26 .preempt_count = INIT_PREEMPT_COUNT, \
27 .restart_block = { \ 27 .restart_block = { \
28 .fn = do_no_restart_syscall \ 28 .fn = do_no_restart_syscall \
29 } \ 29 } \
diff --git a/arch/parisc/include/asm/tlbflush.h b/arch/parisc/include/asm/tlbflush.h
index 1f6fd4fc05b9..8f1a8100bf2d 100644
--- a/arch/parisc/include/asm/tlbflush.h
+++ b/arch/parisc/include/asm/tlbflush.h
@@ -12,14 +12,12 @@
12 * N class systems, only one PxTLB inter processor broadcast can be 12 * N class systems, only one PxTLB inter processor broadcast can be
13 * active at any one time on the Merced bus. This tlb purge 13 * active at any one time on the Merced bus. This tlb purge
14 * synchronisation is fairly lightweight and harmless so we activate 14 * synchronisation is fairly lightweight and harmless so we activate
15 * it on all SMP systems not just the N class. We also need to have 15 * it on all systems not just the N class.
16 * preemption disabled on uniprocessor machines, and spin_lock does that
17 * nicely.
18 */ 16 */
19extern spinlock_t pa_tlb_lock; 17extern spinlock_t pa_tlb_lock;
20 18
21#define purge_tlb_start(x) spin_lock(&pa_tlb_lock) 19#define purge_tlb_start(flags) spin_lock_irqsave(&pa_tlb_lock, flags)
22#define purge_tlb_end(x) spin_unlock(&pa_tlb_lock) 20#define purge_tlb_end(flags) spin_unlock_irqrestore(&pa_tlb_lock, flags)
23 21
24extern void flush_tlb_all(void); 22extern void flush_tlb_all(void);
25extern void flush_tlb_all_local(void *); 23extern void flush_tlb_all_local(void *);
@@ -63,14 +61,16 @@ static inline void flush_tlb_mm(struct mm_struct *mm)
63static inline void flush_tlb_page(struct vm_area_struct *vma, 61static inline void flush_tlb_page(struct vm_area_struct *vma,
64 unsigned long addr) 62 unsigned long addr)
65{ 63{
64 unsigned long flags;
65
66 /* For one page, it's not worth testing the split_tlb variable */ 66 /* For one page, it's not worth testing the split_tlb variable */
67 67
68 mb(); 68 mb();
69 mtsp(vma->vm_mm->context,1); 69 mtsp(vma->vm_mm->context,1);
70 purge_tlb_start(); 70 purge_tlb_start(flags);
71 pdtlb(addr); 71 pdtlb(addr);
72 pitlb(addr); 72 pitlb(addr);
73 purge_tlb_end(); 73 purge_tlb_end(flags);
74} 74}
75 75
76void __flush_tlb_range(unsigned long sid, 76void __flush_tlb_range(unsigned long sid,
diff --git a/arch/parisc/include/asm/unistd.h b/arch/parisc/include/asm/unistd.h
index ef26b009dc5d..f3d3b8b012c4 100644
--- a/arch/parisc/include/asm/unistd.h
+++ b/arch/parisc/include/asm/unistd.h
@@ -807,8 +807,12 @@
807#define __NR_dup3 (__NR_Linux + 312) 807#define __NR_dup3 (__NR_Linux + 312)
808#define __NR_pipe2 (__NR_Linux + 313) 808#define __NR_pipe2 (__NR_Linux + 313)
809#define __NR_inotify_init1 (__NR_Linux + 314) 809#define __NR_inotify_init1 (__NR_Linux + 314)
810#define __NR_preadv (__NR_Linux + 315)
811#define __NR_pwritev (__NR_Linux + 316)
812#define __NR_rt_tgsigqueueinfo (__NR_Linux + 317)
813#define __NR_perf_counter_open (__NR_Linux + 318)
810 814
811#define __NR_Linux_syscalls (__NR_inotify_init1 + 1) 815#define __NR_Linux_syscalls (__NR_perf_counter_open + 1)
812 816
813 817
814#define __IGNORE_select /* newselect */ 818#define __IGNORE_select /* newselect */
diff --git a/arch/parisc/kernel/cache.c b/arch/parisc/kernel/cache.c
index 837530ea32e7..b6ed34de14e1 100644
--- a/arch/parisc/kernel/cache.c
+++ b/arch/parisc/kernel/cache.c
@@ -1,5 +1,4 @@
1/* $Id: cache.c,v 1.4 2000/01/25 00:11:38 prumpf Exp $ 1/*
2 *
3 * This file is subject to the terms and conditions of the GNU General Public 2 * This file is subject to the terms and conditions of the GNU General Public
4 * License. See the file "COPYING" in the main directory of this archive 3 * License. See the file "COPYING" in the main directory of this archive
5 * for more details. 4 * for more details.
@@ -398,12 +397,13 @@ EXPORT_SYMBOL(flush_kernel_icache_range_asm);
398 397
399void clear_user_page_asm(void *page, unsigned long vaddr) 398void clear_user_page_asm(void *page, unsigned long vaddr)
400{ 399{
400 unsigned long flags;
401 /* This function is implemented in assembly in pacache.S */ 401 /* This function is implemented in assembly in pacache.S */
402 extern void __clear_user_page_asm(void *page, unsigned long vaddr); 402 extern void __clear_user_page_asm(void *page, unsigned long vaddr);
403 403
404 purge_tlb_start(); 404 purge_tlb_start(flags);
405 __clear_user_page_asm(page, vaddr); 405 __clear_user_page_asm(page, vaddr);
406 purge_tlb_end(); 406 purge_tlb_end(flags);
407} 407}
408 408
409#define FLUSH_THRESHOLD 0x80000 /* 0.5MB */ 409#define FLUSH_THRESHOLD 0x80000 /* 0.5MB */
@@ -444,20 +444,24 @@ extern void clear_user_page_asm(void *page, unsigned long vaddr);
444 444
445void clear_user_page(void *page, unsigned long vaddr, struct page *pg) 445void clear_user_page(void *page, unsigned long vaddr, struct page *pg)
446{ 446{
447 unsigned long flags;
448
447 purge_kernel_dcache_page((unsigned long)page); 449 purge_kernel_dcache_page((unsigned long)page);
448 purge_tlb_start(); 450 purge_tlb_start(flags);
449 pdtlb_kernel(page); 451 pdtlb_kernel(page);
450 purge_tlb_end(); 452 purge_tlb_end(flags);
451 clear_user_page_asm(page, vaddr); 453 clear_user_page_asm(page, vaddr);
452} 454}
453EXPORT_SYMBOL(clear_user_page); 455EXPORT_SYMBOL(clear_user_page);
454 456
455void flush_kernel_dcache_page_addr(void *addr) 457void flush_kernel_dcache_page_addr(void *addr)
456{ 458{
459 unsigned long flags;
460
457 flush_kernel_dcache_page_asm(addr); 461 flush_kernel_dcache_page_asm(addr);
458 purge_tlb_start(); 462 purge_tlb_start(flags);
459 pdtlb_kernel(addr); 463 pdtlb_kernel(addr);
460 purge_tlb_end(); 464 purge_tlb_end(flags);
461} 465}
462EXPORT_SYMBOL(flush_kernel_dcache_page_addr); 466EXPORT_SYMBOL(flush_kernel_dcache_page_addr);
463 467
@@ -490,8 +494,10 @@ void __flush_tlb_range(unsigned long sid, unsigned long start,
490 if (npages >= 512) /* 2MB of space: arbitrary, should be tuned */ 494 if (npages >= 512) /* 2MB of space: arbitrary, should be tuned */
491 flush_tlb_all(); 495 flush_tlb_all();
492 else { 496 else {
497 unsigned long flags;
498
493 mtsp(sid, 1); 499 mtsp(sid, 1);
494 purge_tlb_start(); 500 purge_tlb_start(flags);
495 if (split_tlb) { 501 if (split_tlb) {
496 while (npages--) { 502 while (npages--) {
497 pdtlb(start); 503 pdtlb(start);
@@ -504,7 +510,7 @@ void __flush_tlb_range(unsigned long sid, unsigned long start,
504 start += PAGE_SIZE; 510 start += PAGE_SIZE;
505 } 511 }
506 } 512 }
507 purge_tlb_end(); 513 purge_tlb_end(flags);
508 } 514 }
509} 515}
510 516
diff --git a/arch/parisc/kernel/inventory.c b/arch/parisc/kernel/inventory.c
index bd1f7f1ff74e..d228d8237879 100644
--- a/arch/parisc/kernel/inventory.c
+++ b/arch/parisc/kernel/inventory.c
@@ -170,23 +170,27 @@ static void __init pagezero_memconfig(void)
170static int __init 170static int __init
171pat_query_module(ulong pcell_loc, ulong mod_index) 171pat_query_module(ulong pcell_loc, ulong mod_index)
172{ 172{
173 pdc_pat_cell_mod_maddr_block_t pa_pdc_cell; 173 pdc_pat_cell_mod_maddr_block_t *pa_pdc_cell;
174 unsigned long bytecnt; 174 unsigned long bytecnt;
175 unsigned long temp; /* 64-bit scratch value */ 175 unsigned long temp; /* 64-bit scratch value */
176 long status; /* PDC return value status */ 176 long status; /* PDC return value status */
177 struct parisc_device *dev; 177 struct parisc_device *dev;
178 178
179 pa_pdc_cell = kmalloc(sizeof (*pa_pdc_cell), GFP_KERNEL);
180 if (!pa_pdc_cell)
181 panic("couldn't allocate memory for PDC_PAT_CELL!");
182
179 /* return cell module (PA or Processor view) */ 183 /* return cell module (PA or Processor view) */
180 status = pdc_pat_cell_module(&bytecnt, pcell_loc, mod_index, 184 status = pdc_pat_cell_module(&bytecnt, pcell_loc, mod_index,
181 PA_VIEW, &pa_pdc_cell); 185 PA_VIEW, pa_pdc_cell);
182 186
183 if (status != PDC_OK) { 187 if (status != PDC_OK) {
184 /* no more cell modules or error */ 188 /* no more cell modules or error */
185 return status; 189 return status;
186 } 190 }
187 191
188 temp = pa_pdc_cell.cba; 192 temp = pa_pdc_cell->cba;
189 dev = alloc_pa_dev(PAT_GET_CBA(temp), &pa_pdc_cell.mod_path); 193 dev = alloc_pa_dev(PAT_GET_CBA(temp), &(pa_pdc_cell->mod_path));
190 if (!dev) { 194 if (!dev) {
191 return PDC_OK; 195 return PDC_OK;
192 } 196 }
@@ -203,8 +207,8 @@ pat_query_module(ulong pcell_loc, ulong mod_index)
203 207
204 /* save generic info returned from the call */ 208 /* save generic info returned from the call */
205 /* REVISIT: who is the consumer of this? not sure yet... */ 209 /* REVISIT: who is the consumer of this? not sure yet... */
206 dev->mod_info = pa_pdc_cell.mod_info; /* pass to PAT_GET_ENTITY() */ 210 dev->mod_info = pa_pdc_cell->mod_info; /* pass to PAT_GET_ENTITY() */
207 dev->pmod_loc = pa_pdc_cell.mod_location; 211 dev->pmod_loc = pa_pdc_cell->mod_location;
208 212
209 register_parisc_device(dev); /* advertise device */ 213 register_parisc_device(dev); /* advertise device */
210 214
@@ -216,14 +220,14 @@ pat_query_module(ulong pcell_loc, ulong mod_index)
216 220
217 case PAT_ENTITY_PROC: 221 case PAT_ENTITY_PROC:
218 printk(KERN_DEBUG "PAT_ENTITY_PROC: id_eid 0x%lx\n", 222 printk(KERN_DEBUG "PAT_ENTITY_PROC: id_eid 0x%lx\n",
219 pa_pdc_cell.mod[0]); 223 pa_pdc_cell->mod[0]);
220 break; 224 break;
221 225
222 case PAT_ENTITY_MEM: 226 case PAT_ENTITY_MEM:
223 printk(KERN_DEBUG 227 printk(KERN_DEBUG
224 "PAT_ENTITY_MEM: amount 0x%lx min_gni_base 0x%lx min_gni_len 0x%lx\n", 228 "PAT_ENTITY_MEM: amount 0x%lx min_gni_base 0x%lx min_gni_len 0x%lx\n",
225 pa_pdc_cell.mod[0], pa_pdc_cell.mod[1], 229 pa_pdc_cell->mod[0], pa_pdc_cell->mod[1],
226 pa_pdc_cell.mod[2]); 230 pa_pdc_cell->mod[2]);
227 break; 231 break;
228 case PAT_ENTITY_CA: 232 case PAT_ENTITY_CA:
229 printk(KERN_DEBUG "PAT_ENTITY_CA: %ld\n", pcell_loc); 233 printk(KERN_DEBUG "PAT_ENTITY_CA: %ld\n", pcell_loc);
@@ -243,23 +247,26 @@ pat_query_module(ulong pcell_loc, ulong mod_index)
243 print_ranges: 247 print_ranges:
244 pdc_pat_cell_module(&bytecnt, pcell_loc, mod_index, 248 pdc_pat_cell_module(&bytecnt, pcell_loc, mod_index,
245 IO_VIEW, &io_pdc_cell); 249 IO_VIEW, &io_pdc_cell);
246 printk(KERN_DEBUG "ranges %ld\n", pa_pdc_cell.mod[1]); 250 printk(KERN_DEBUG "ranges %ld\n", pa_pdc_cell->mod[1]);
247 for (i = 0; i < pa_pdc_cell.mod[1]; i++) { 251 for (i = 0; i < pa_pdc_cell->mod[1]; i++) {
248 printk(KERN_DEBUG 252 printk(KERN_DEBUG
249 " PA_VIEW %ld: 0x%016lx 0x%016lx 0x%016lx\n", 253 " PA_VIEW %ld: 0x%016lx 0x%016lx 0x%016lx\n",
250 i, pa_pdc_cell.mod[2 + i * 3], /* type */ 254 i, pa_pdc_cell->mod[2 + i * 3], /* type */
251 pa_pdc_cell.mod[3 + i * 3], /* start */ 255 pa_pdc_cell->mod[3 + i * 3], /* start */
252 pa_pdc_cell.mod[4 + i * 3]); /* finish (ie end) */ 256 pa_pdc_cell->mod[4 + i * 3]); /* finish (ie end) */
253 printk(KERN_DEBUG 257 printk(KERN_DEBUG
254 " IO_VIEW %ld: 0x%016lx 0x%016lx 0x%016lx\n", 258 " IO_VIEW %ld: 0x%016lx 0x%016lx 0x%016lx\n",
255 i, io_pdc_cell.mod[2 + i * 3], /* type */ 259 i, io_pdc_cell->mod[2 + i * 3], /* type */
256 io_pdc_cell.mod[3 + i * 3], /* start */ 260 io_pdc_cell->mod[3 + i * 3], /* start */
257 io_pdc_cell.mod[4 + i * 3]); /* finish (ie end) */ 261 io_pdc_cell->mod[4 + i * 3]); /* finish (ie end) */
258 } 262 }
259 printk(KERN_DEBUG "\n"); 263 printk(KERN_DEBUG "\n");
260 break; 264 break;
261 } 265 }
262#endif /* DEBUG_PAT */ 266#endif /* DEBUG_PAT */
267
268 kfree(pa_pdc_cell);
269
263 return PDC_OK; 270 return PDC_OK;
264} 271}
265 272
diff --git a/arch/parisc/kernel/irq.c b/arch/parisc/kernel/irq.c
index 8007f1e65729..330f536a9324 100644
--- a/arch/parisc/kernel/irq.c
+++ b/arch/parisc/kernel/irq.c
@@ -120,7 +120,7 @@ int cpu_check_affinity(unsigned int irq, const struct cpumask *dest)
120 if (CHECK_IRQ_PER_CPU(irq)) { 120 if (CHECK_IRQ_PER_CPU(irq)) {
121 /* Bad linux design decision. The mask has already 121 /* Bad linux design decision. The mask has already
122 * been set; we must reset it */ 122 * been set; we must reset it */
123 cpumask_setall(&irq_desc[irq].affinity); 123 cpumask_setall(irq_desc[irq].affinity);
124 return -EINVAL; 124 return -EINVAL;
125 } 125 }
126 126
@@ -138,13 +138,13 @@ static int cpu_set_affinity_irq(unsigned int irq, const struct cpumask *dest)
138 if (cpu_dest < 0) 138 if (cpu_dest < 0)
139 return -1; 139 return -1;
140 140
141 cpumask_copy(&irq_desc[irq].affinity, dest); 141 cpumask_copy(irq_desc[irq].affinity, dest);
142 142
143 return 0; 143 return 0;
144} 144}
145#endif 145#endif
146 146
147static struct hw_interrupt_type cpu_interrupt_type = { 147static struct irq_chip cpu_interrupt_type = {
148 .typename = "CPU", 148 .typename = "CPU",
149 .startup = cpu_startup_irq, 149 .startup = cpu_startup_irq,
150 .shutdown = cpu_disable_irq, 150 .shutdown = cpu_disable_irq,
@@ -299,7 +299,7 @@ int txn_alloc_irq(unsigned int bits_wide)
299unsigned long txn_affinity_addr(unsigned int irq, int cpu) 299unsigned long txn_affinity_addr(unsigned int irq, int cpu)
300{ 300{
301#ifdef CONFIG_SMP 301#ifdef CONFIG_SMP
302 cpumask_copy(&irq_desc[irq].affinity, cpumask_of(cpu)); 302 cpumask_copy(irq_desc[irq].affinity, cpumask_of(cpu));
303#endif 303#endif
304 304
305 return per_cpu(cpu_data, cpu).txn_addr; 305 return per_cpu(cpu_data, cpu).txn_addr;
@@ -356,7 +356,7 @@ void do_cpu_irq_mask(struct pt_regs *regs)
356 irq = eirr_to_irq(eirr_val); 356 irq = eirr_to_irq(eirr_val);
357 357
358#ifdef CONFIG_SMP 358#ifdef CONFIG_SMP
359 cpumask_copy(&dest, &irq_desc[irq].affinity); 359 cpumask_copy(&dest, irq_desc[irq].affinity);
360 if (CHECK_IRQ_PER_CPU(irq_desc[irq].status) && 360 if (CHECK_IRQ_PER_CPU(irq_desc[irq].status) &&
361 !cpu_isset(smp_processor_id(), dest)) { 361 !cpu_isset(smp_processor_id(), dest)) {
362 int cpu = first_cpu(dest); 362 int cpu = first_cpu(dest);
diff --git a/arch/parisc/kernel/pci-dma.c b/arch/parisc/kernel/pci-dma.c
index 7d927eac932b..c07f618ff7da 100644
--- a/arch/parisc/kernel/pci-dma.c
+++ b/arch/parisc/kernel/pci-dma.c
@@ -90,12 +90,14 @@ static inline int map_pte_uncached(pte_t * pte,
90 if (end > PMD_SIZE) 90 if (end > PMD_SIZE)
91 end = PMD_SIZE; 91 end = PMD_SIZE;
92 do { 92 do {
93 unsigned long flags;
94
93 if (!pte_none(*pte)) 95 if (!pte_none(*pte))
94 printk(KERN_ERR "map_pte_uncached: page already exists\n"); 96 printk(KERN_ERR "map_pte_uncached: page already exists\n");
95 set_pte(pte, __mk_pte(*paddr_ptr, PAGE_KERNEL_UNC)); 97 set_pte(pte, __mk_pte(*paddr_ptr, PAGE_KERNEL_UNC));
96 purge_tlb_start(); 98 purge_tlb_start(flags);
97 pdtlb_kernel(orig_vaddr); 99 pdtlb_kernel(orig_vaddr);
98 purge_tlb_end(); 100 purge_tlb_end(flags);
99 vaddr += PAGE_SIZE; 101 vaddr += PAGE_SIZE;
100 orig_vaddr += PAGE_SIZE; 102 orig_vaddr += PAGE_SIZE;
101 (*paddr_ptr) += PAGE_SIZE; 103 (*paddr_ptr) += PAGE_SIZE;
@@ -168,11 +170,13 @@ static inline void unmap_uncached_pte(pmd_t * pmd, unsigned long vaddr,
168 if (end > PMD_SIZE) 170 if (end > PMD_SIZE)
169 end = PMD_SIZE; 171 end = PMD_SIZE;
170 do { 172 do {
173 unsigned long flags;
171 pte_t page = *pte; 174 pte_t page = *pte;
175
172 pte_clear(&init_mm, vaddr, pte); 176 pte_clear(&init_mm, vaddr, pte);
173 purge_tlb_start(); 177 purge_tlb_start(flags);
174 pdtlb_kernel(orig_vaddr); 178 pdtlb_kernel(orig_vaddr);
175 purge_tlb_end(); 179 purge_tlb_end(flags);
176 vaddr += PAGE_SIZE; 180 vaddr += PAGE_SIZE;
177 orig_vaddr += PAGE_SIZE; 181 orig_vaddr += PAGE_SIZE;
178 pte++; 182 pte++;
diff --git a/arch/parisc/kernel/pci.c b/arch/parisc/kernel/pci.c
index 6936386c9861..f7064abc3bb6 100644
--- a/arch/parisc/kernel/pci.c
+++ b/arch/parisc/kernel/pci.c
@@ -1,5 +1,4 @@
1/* $Id: pci.c,v 1.6 2000/01/29 00:12:05 grundler Exp $ 1/*
2 *
3 * This file is subject to the terms and conditions of the GNU General Public 2 * This file is subject to the terms and conditions of the GNU General Public
4 * License. See the file "COPYING" in the main directory of this archive 3 * License. See the file "COPYING" in the main directory of this archive
5 * for more details. 4 * for more details.
diff --git a/arch/parisc/kernel/process.c b/arch/parisc/kernel/process.c
index 61c07078c072..1f3aa8db0203 100644
--- a/arch/parisc/kernel/process.c
+++ b/arch/parisc/kernel/process.c
@@ -156,7 +156,7 @@ void machine_power_off(void)
156 * software. The user has to press the button himself. */ 156 * software. The user has to press the button himself. */
157 157
158 printk(KERN_EMERG "System shut down completed.\n" 158 printk(KERN_EMERG "System shut down completed.\n"
159 KERN_EMERG "Please power this system off now."); 159 "Please power this system off now.");
160} 160}
161 161
162void (*pm_power_off)(void) = machine_power_off; 162void (*pm_power_off)(void) = machine_power_off;
diff --git a/arch/parisc/kernel/processor.c b/arch/parisc/kernel/processor.c
index e09d0f7fb6b0..c8fb61ed32f4 100644
--- a/arch/parisc/kernel/processor.c
+++ b/arch/parisc/kernel/processor.c
@@ -1,5 +1,4 @@
1/* $Id: processor.c,v 1.1 2002/07/20 16:27:06 rhirst Exp $ 1/*
2 *
3 * Initial setup-routines for HP 9000 based hardware. 2 * Initial setup-routines for HP 9000 based hardware.
4 * 3 *
5 * Copyright (C) 1991, 1992, 1995 Linus Torvalds 4 * Copyright (C) 1991, 1992, 1995 Linus Torvalds
@@ -121,22 +120,28 @@ static int __cpuinit processor_probe(struct parisc_device *dev)
121 if (is_pdc_pat()) { 120 if (is_pdc_pat()) {
122 ulong status; 121 ulong status;
123 unsigned long bytecnt; 122 unsigned long bytecnt;
124 pdc_pat_cell_mod_maddr_block_t pa_pdc_cell; 123 pdc_pat_cell_mod_maddr_block_t *pa_pdc_cell;
125#undef USE_PAT_CPUID 124#undef USE_PAT_CPUID
126#ifdef USE_PAT_CPUID 125#ifdef USE_PAT_CPUID
127 struct pdc_pat_cpu_num cpu_info; 126 struct pdc_pat_cpu_num cpu_info;
128#endif 127#endif
129 128
129 pa_pdc_cell = kmalloc(sizeof (*pa_pdc_cell), GFP_KERNEL);
130 if (!pa_pdc_cell)
131 panic("couldn't allocate memory for PDC_PAT_CELL!");
132
130 status = pdc_pat_cell_module(&bytecnt, dev->pcell_loc, 133 status = pdc_pat_cell_module(&bytecnt, dev->pcell_loc,
131 dev->mod_index, PA_VIEW, &pa_pdc_cell); 134 dev->mod_index, PA_VIEW, pa_pdc_cell);
132 135
133 BUG_ON(PDC_OK != status); 136 BUG_ON(PDC_OK != status);
134 137
135 /* verify it's the same as what do_pat_inventory() found */ 138 /* verify it's the same as what do_pat_inventory() found */
136 BUG_ON(dev->mod_info != pa_pdc_cell.mod_info); 139 BUG_ON(dev->mod_info != pa_pdc_cell->mod_info);
137 BUG_ON(dev->pmod_loc != pa_pdc_cell.mod_location); 140 BUG_ON(dev->pmod_loc != pa_pdc_cell->mod_location);
141
142 txn_addr = pa_pdc_cell->mod[0]; /* id_eid for IO sapic */
138 143
139 txn_addr = pa_pdc_cell.mod[0]; /* id_eid for IO sapic */ 144 kfree(pa_pdc_cell);
140 145
141#ifdef USE_PAT_CPUID 146#ifdef USE_PAT_CPUID
142/* We need contiguous numbers for cpuid. Firmware's notion 147/* We need contiguous numbers for cpuid. Firmware's notion
diff --git a/arch/parisc/kernel/setup.c b/arch/parisc/kernel/setup.c
index 82131ca8e05c..cb71f3dac995 100644
--- a/arch/parisc/kernel/setup.c
+++ b/arch/parisc/kernel/setup.c
@@ -1,5 +1,4 @@
1/* $Id: setup.c,v 1.8 2000/02/02 04:42:38 prumpf Exp $ 1/*
2 *
3 * Initial setup-routines for HP 9000 based hardware. 2 * Initial setup-routines for HP 9000 based hardware.
4 * 3 *
5 * Copyright (C) 1991, 1992, 1995 Linus Torvalds 4 * Copyright (C) 1991, 1992, 1995 Linus Torvalds
diff --git a/arch/parisc/kernel/sys_parisc32.c b/arch/parisc/kernel/sys_parisc32.c
index 1adb40c81669..92a0acaa0d12 100644
--- a/arch/parisc/kernel/sys_parisc32.c
+++ b/arch/parisc/kernel/sys_parisc32.c
@@ -174,68 +174,6 @@ asmlinkage long sys32_sched_rr_get_interval(pid_t pid,
174 return ret; 174 return ret;
175} 175}
176 176
177/*** copied from mips64 ***/
178/*
179 * Ooo, nasty. We need here to frob 32-bit unsigned longs to
180 * 64-bit unsigned longs.
181 */
182
183static inline int
184get_fd_set32(unsigned long n, u32 *ufdset, unsigned long *fdset)
185{
186 n = (n + 8*sizeof(u32) - 1) / (8*sizeof(u32));
187 if (ufdset) {
188 unsigned long odd;
189
190 if (!access_ok(VERIFY_WRITE, ufdset, n*sizeof(u32)))
191 return -EFAULT;
192
193 odd = n & 1UL;
194 n &= ~1UL;
195 while (n) {
196 unsigned long h, l;
197 __get_user(l, ufdset);
198 __get_user(h, ufdset+1);
199 ufdset += 2;
200 *fdset++ = h << 32 | l;
201 n -= 2;
202 }
203 if (odd)
204 __get_user(*fdset, ufdset);
205 } else {
206 /* Tricky, must clear full unsigned long in the
207 * kernel fdset at the end, this makes sure that
208 * actually happens.
209 */
210 memset(fdset, 0, ((n + 1) & ~1)*sizeof(u32));
211 }
212 return 0;
213}
214
215static inline void
216set_fd_set32(unsigned long n, u32 *ufdset, unsigned long *fdset)
217{
218 unsigned long odd;
219 n = (n + 8*sizeof(u32) - 1) / (8*sizeof(u32));
220
221 if (!ufdset)
222 return;
223
224 odd = n & 1UL;
225 n &= ~1UL;
226 while (n) {
227 unsigned long h, l;
228 l = *fdset++;
229 h = l >> 32;
230 __put_user(l, ufdset);
231 __put_user(h, ufdset+1);
232 ufdset += 2;
233 n -= 2;
234 }
235 if (odd)
236 __put_user(*fdset, ufdset);
237}
238
239struct msgbuf32 { 177struct msgbuf32 {
240 int mtype; 178 int mtype;
241 char mtext[1]; 179 char mtext[1];
diff --git a/arch/parisc/kernel/syscall_table.S b/arch/parisc/kernel/syscall_table.S
index 03b9a01bc16c..cf145eb026b3 100644
--- a/arch/parisc/kernel/syscall_table.S
+++ b/arch/parisc/kernel/syscall_table.S
@@ -413,6 +413,10 @@
413 ENTRY_SAME(dup3) 413 ENTRY_SAME(dup3)
414 ENTRY_SAME(pipe2) 414 ENTRY_SAME(pipe2)
415 ENTRY_SAME(inotify_init1) 415 ENTRY_SAME(inotify_init1)
416 ENTRY_COMP(preadv) /* 315 */
417 ENTRY_COMP(pwritev)
418 ENTRY_COMP(rt_tgsigqueueinfo)
419 ENTRY_SAME(perf_counter_open)
416 420
417 /* Nothing yet */ 421 /* Nothing yet */
418 422
diff --git a/arch/parisc/kernel/time.c b/arch/parisc/kernel/time.c
index d4dd05674c62..a79c6f9e7e2c 100644
--- a/arch/parisc/kernel/time.c
+++ b/arch/parisc/kernel/time.c
@@ -56,9 +56,9 @@ static unsigned long clocktick __read_mostly; /* timer cycles per tick */
56 */ 56 */
57irqreturn_t __irq_entry timer_interrupt(int irq, void *dev_id) 57irqreturn_t __irq_entry timer_interrupt(int irq, void *dev_id)
58{ 58{
59 unsigned long now; 59 unsigned long now, now2;
60 unsigned long next_tick; 60 unsigned long next_tick;
61 unsigned long cycles_elapsed, ticks_elapsed; 61 unsigned long cycles_elapsed, ticks_elapsed = 1;
62 unsigned long cycles_remainder; 62 unsigned long cycles_remainder;
63 unsigned int cpu = smp_processor_id(); 63 unsigned int cpu = smp_processor_id();
64 struct cpuinfo_parisc *cpuinfo = &per_cpu(cpu_data, cpu); 64 struct cpuinfo_parisc *cpuinfo = &per_cpu(cpu_data, cpu);
@@ -71,44 +71,24 @@ irqreturn_t __irq_entry timer_interrupt(int irq, void *dev_id)
71 /* Initialize next_tick to the expected tick time. */ 71 /* Initialize next_tick to the expected tick time. */
72 next_tick = cpuinfo->it_value; 72 next_tick = cpuinfo->it_value;
73 73
74 /* Get current interval timer. 74 /* Get current cycle counter (Control Register 16). */
75 * CR16 reads as 64 bits in CPU wide mode.
76 * CR16 reads as 32 bits in CPU narrow mode.
77 */
78 now = mfctl(16); 75 now = mfctl(16);
79 76
80 cycles_elapsed = now - next_tick; 77 cycles_elapsed = now - next_tick;
81 78
82 if ((cycles_elapsed >> 5) < cpt) { 79 if ((cycles_elapsed >> 6) < cpt) {
83 /* use "cheap" math (add/subtract) instead 80 /* use "cheap" math (add/subtract) instead
84 * of the more expensive div/mul method 81 * of the more expensive div/mul method
85 */ 82 */
86 cycles_remainder = cycles_elapsed; 83 cycles_remainder = cycles_elapsed;
87 ticks_elapsed = 1;
88 while (cycles_remainder > cpt) { 84 while (cycles_remainder > cpt) {
89 cycles_remainder -= cpt; 85 cycles_remainder -= cpt;
90 ticks_elapsed++; 86 ticks_elapsed++;
91 } 87 }
92 } else { 88 } else {
89 /* TODO: Reduce this to one fdiv op */
93 cycles_remainder = cycles_elapsed % cpt; 90 cycles_remainder = cycles_elapsed % cpt;
94 ticks_elapsed = 1 + cycles_elapsed / cpt; 91 ticks_elapsed += cycles_elapsed / cpt;
95 }
96
97 /* Can we differentiate between "early CR16" (aka Scenario 1) and
98 * "long delay" (aka Scenario 3)? I don't think so.
99 *
100 * We expected timer_interrupt to be delivered at least a few hundred
101 * cycles after the IT fires. But it's arbitrary how much time passes
102 * before we call it "late". I've picked one second.
103 */
104 if (unlikely(ticks_elapsed > HZ)) {
105 /* Scenario 3: very long delay? bad in any case */
106 printk (KERN_CRIT "timer_interrupt(CPU %d): delayed!"
107 " cycles %lX rem %lX "
108 " next/now %lX/%lX\n",
109 cpu,
110 cycles_elapsed, cycles_remainder,
111 next_tick, now );
112 } 92 }
113 93
114 /* convert from "division remainder" to "remainder of clock tick" */ 94 /* convert from "division remainder" to "remainder of clock tick" */
@@ -122,18 +102,56 @@ irqreturn_t __irq_entry timer_interrupt(int irq, void *dev_id)
122 102
123 cpuinfo->it_value = next_tick; 103 cpuinfo->it_value = next_tick;
124 104
125 /* Skip one clocktick on purpose if we are likely to miss next_tick. 105 /* Program the IT when to deliver the next interrupt.
126 * We want to avoid the new next_tick being less than CR16. 106 * Only bottom 32-bits of next_tick are writable in CR16!
127 * If that happened, itimer wouldn't fire until CR16 wrapped.
128 * We'll catch the tick we missed on the tick after that.
129 */ 107 */
130 if (!(cycles_remainder >> 13))
131 next_tick += cpt;
132
133 /* Program the IT when to deliver the next interrupt. */
134 /* Only bottom 32-bits of next_tick are written to cr16. */
135 mtctl(next_tick, 16); 108 mtctl(next_tick, 16);
136 109
110 /* Skip one clocktick on purpose if we missed next_tick.
111 * The new CR16 must be "later" than current CR16 otherwise
112 * itimer would not fire until CR16 wrapped - e.g 4 seconds
113 * later on a 1Ghz processor. We'll account for the missed
114 * tick on the next timer interrupt.
115 *
116 * "next_tick - now" will always give the difference regardless
117 * if one or the other wrapped. If "now" is "bigger" we'll end up
118 * with a very large unsigned number.
119 */
120 now2 = mfctl(16);
121 if (next_tick - now2 > cpt)
122 mtctl(next_tick+cpt, 16);
123
124#if 1
125/*
126 * GGG: DEBUG code for how many cycles programming CR16 used.
127 */
128 if (unlikely(now2 - now > 0x3000)) /* 12K cycles */
129 printk (KERN_CRIT "timer_interrupt(CPU %d): SLOW! 0x%lx cycles!"
130 " cyc %lX rem %lX "
131 " next/now %lX/%lX\n",
132 cpu, now2 - now, cycles_elapsed, cycles_remainder,
133 next_tick, now );
134#endif
135
136 /* Can we differentiate between "early CR16" (aka Scenario 1) and
137 * "long delay" (aka Scenario 3)? I don't think so.
138 *
139 * Timer_interrupt will be delivered at least a few hundred cycles
140 * after the IT fires. But it's arbitrary how much time passes
141 * before we call it "late". I've picked one second.
142 *
143 * It's important NO printk's are between reading CR16 and
144 * setting up the next value. May introduce huge variance.
145 */
146 if (unlikely(ticks_elapsed > HZ)) {
147 /* Scenario 3: very long delay? bad in any case */
148 printk (KERN_CRIT "timer_interrupt(CPU %d): delayed!"
149 " cycles %lX rem %lX "
150 " next/now %lX/%lX\n",
151 cpu,
152 cycles_elapsed, cycles_remainder,
153 next_tick, now );
154 }
137 155
138 /* Done mucking with unreliable delivery of interrupts. 156 /* Done mucking with unreliable delivery of interrupts.
139 * Go do system house keeping. 157 * Go do system house keeping.
@@ -173,7 +191,7 @@ EXPORT_SYMBOL(profile_pc);
173 191
174/* clock source code */ 192/* clock source code */
175 193
176static cycle_t read_cr16(void) 194static cycle_t read_cr16(struct clocksource *cs)
177{ 195{
178 return get_cycles(); 196 return get_cycles();
179} 197}
diff --git a/arch/parisc/kernel/traps.c b/arch/parisc/kernel/traps.c
index c32f5d6d778e..528f0ff9b273 100644
--- a/arch/parisc/kernel/traps.c
+++ b/arch/parisc/kernel/traps.c
@@ -250,15 +250,14 @@ void die_if_kernel(char *str, struct pt_regs *regs, long err)
250 oops_enter(); 250 oops_enter();
251 251
252 /* Amuse the user in a SPARC fashion */ 252 /* Amuse the user in a SPARC fashion */
253 if (err) printk( 253 if (err) printk(KERN_CRIT
254KERN_CRIT " _______________________________ \n" 254 " _______________________________ \n"
255KERN_CRIT " < Your System ate a SPARC! Gah! >\n" 255 " < Your System ate a SPARC! Gah! >\n"
256KERN_CRIT " ------------------------------- \n" 256 " ------------------------------- \n"
257KERN_CRIT " \\ ^__^\n" 257 " \\ ^__^\n"
258KERN_CRIT " \\ (xx)\\_______\n" 258 " (__)\\ )\\/\\\n"
259KERN_CRIT " (__)\\ )\\/\\\n" 259 " U ||----w |\n"
260KERN_CRIT " U ||----w |\n" 260 " || ||\n");
261KERN_CRIT " || ||\n");
262 261
263 /* unlock the pdc lock if necessary */ 262 /* unlock the pdc lock if necessary */
264 pdc_emergency_unlock(); 263 pdc_emergency_unlock();
@@ -797,7 +796,8 @@ void notrace handle_interruption(int code, struct pt_regs *regs)
797 else 796 else
798 printk(KERN_DEBUG "User Fault (long pointer) (fault %d) ", 797 printk(KERN_DEBUG "User Fault (long pointer) (fault %d) ",
799 code); 798 code);
800 printk("pid=%d command='%s'\n", task_pid_nr(current), current->comm); 799 printk(KERN_CONT "pid=%d command='%s'\n",
800 task_pid_nr(current), current->comm);
801 show_regs(regs); 801 show_regs(regs);
802#endif 802#endif
803 si.si_signo = SIGSEGV; 803 si.si_signo = SIGSEGV;
diff --git a/arch/parisc/lib/checksum.c b/arch/parisc/lib/checksum.c
index 462696d30d3b..ae66d31f9ecf 100644
--- a/arch/parisc/lib/checksum.c
+++ b/arch/parisc/lib/checksum.c
@@ -13,8 +13,6 @@
13 * modify it under the terms of the GNU General Public License 13 * modify it under the terms of the GNU General Public License
14 * as published by the Free Software Foundation; either version 14 * as published by the Free Software Foundation; either version
15 * 2 of the License, or (at your option) any later version. 15 * 2 of the License, or (at your option) any later version.
16 *
17 * $Id: checksum.c,v 1.3 1997/12/01 17:57:34 ralf Exp $
18 */ 16 */
19#include <linux/module.h> 17#include <linux/module.h>
20#include <linux/types.h> 18#include <linux/types.h>
diff --git a/arch/parisc/lib/memcpy.c b/arch/parisc/lib/memcpy.c
index bbda909c866e..abf41f4632a9 100644
--- a/arch/parisc/lib/memcpy.c
+++ b/arch/parisc/lib/memcpy.c
@@ -405,7 +405,7 @@ byte_copy:
405 405
406unaligned_copy: 406unaligned_copy:
407 /* possibly we are aligned on a word, but not on a double... */ 407 /* possibly we are aligned on a word, but not on a double... */
408 if (likely(t1 & (sizeof(unsigned int)-1)) == 0) { 408 if (likely((t1 & (sizeof(unsigned int)-1)) == 0)) {
409 t2 = src & (sizeof(unsigned int) - 1); 409 t2 = src & (sizeof(unsigned int) - 1);
410 410
411 if (unlikely(t2 != 0)) { 411 if (unlikely(t2 != 0)) {
diff --git a/arch/parisc/math-emu/decode_exc.c b/arch/parisc/math-emu/decode_exc.c
index 66c8a9f6a27e..3ca1c6149218 100644
--- a/arch/parisc/math-emu/decode_exc.c
+++ b/arch/parisc/math-emu/decode_exc.c
@@ -40,7 +40,7 @@
40 * END_DESC 40 * END_DESC
41*/ 41*/
42 42
43 43#include <linux/kernel.h>
44#include "float.h" 44#include "float.h"
45#include "sgl_float.h" 45#include "sgl_float.h"
46#include "dbl_float.h" 46#include "dbl_float.h"
diff --git a/arch/parisc/mm/fault.c b/arch/parisc/mm/fault.c
index bfb6dd6ab380..c6afbfc95770 100644
--- a/arch/parisc/mm/fault.c
+++ b/arch/parisc/mm/fault.c
@@ -1,5 +1,4 @@
1/* $Id: fault.c,v 1.5 2000/01/26 16:20:29 jsm Exp $ 1/*
2 *
3 * This file is subject to the terms and conditions of the GNU General Public 2 * This file is subject to the terms and conditions of the GNU General Public
4 * License. See the file "COPYING" in the main directory of this archive 3 * License. See the file "COPYING" in the main directory of this archive
5 * for more details. 4 * for more details.
diff --git a/arch/parisc/mm/init.c b/arch/parisc/mm/init.c
index 4356ceb1e366..b0831d9e35cb 100644
--- a/arch/parisc/mm/init.c
+++ b/arch/parisc/mm/init.c
@@ -370,34 +370,22 @@ static void __init setup_bootmem(void)
370 370
371void free_initmem(void) 371void free_initmem(void)
372{ 372{
373 unsigned long addr, init_begin, init_end; 373 unsigned long addr;
374 374 unsigned long init_begin = (unsigned long)__init_begin;
375 printk(KERN_INFO "Freeing unused kernel memory: "); 375 unsigned long init_end = (unsigned long)__init_end;
376 376
377#ifdef CONFIG_DEBUG_KERNEL 377#ifdef CONFIG_DEBUG_KERNEL
378 /* Attempt to catch anyone trying to execute code here 378 /* Attempt to catch anyone trying to execute code here
379 * by filling the page with BRK insns. 379 * by filling the page with BRK insns.
380 *
381 * If we disable interrupts for all CPUs, then IPI stops working.
382 * Kinda breaks the global cache flushing.
383 */ 380 */
384 local_irq_disable(); 381 memset((void *)init_begin, 0x00, init_end - init_begin);
385 382 flush_icache_range(init_begin, init_end);
386 memset(__init_begin, 0x00,
387 (unsigned long)__init_end - (unsigned long)__init_begin);
388
389 flush_data_cache();
390 asm volatile("sync" : : );
391 flush_icache_range((unsigned long)__init_begin, (unsigned long)__init_end);
392 asm volatile("sync" : : );
393
394 local_irq_enable();
395#endif 383#endif
396 384
397 /* align __init_begin and __init_end to page size, 385 /* align __init_begin and __init_end to page size,
398 ignoring linker script where we might have tried to save RAM */ 386 ignoring linker script where we might have tried to save RAM */
399 init_begin = PAGE_ALIGN((unsigned long)(__init_begin)); 387 init_begin = PAGE_ALIGN(init_begin);
400 init_end = PAGE_ALIGN((unsigned long)(__init_end)); 388 init_end = PAGE_ALIGN(init_end);
401 for (addr = init_begin; addr < init_end; addr += PAGE_SIZE) { 389 for (addr = init_begin; addr < init_end; addr += PAGE_SIZE) {
402 ClearPageReserved(virt_to_page(addr)); 390 ClearPageReserved(virt_to_page(addr));
403 init_page_count(virt_to_page(addr)); 391 init_page_count(virt_to_page(addr));
@@ -409,7 +397,8 @@ void free_initmem(void)
409 /* set up a new led state on systems shipped LED State panel */ 397 /* set up a new led state on systems shipped LED State panel */
410 pdc_chassis_send_status(PDC_CHASSIS_DIRECT_BCOMPLETE); 398 pdc_chassis_send_status(PDC_CHASSIS_DIRECT_BCOMPLETE);
411 399
412 printk("%luk freed\n", (init_end - init_begin) >> 10); 400 printk(KERN_INFO "Freeing unused kernel memory: %luk freed\n",
401 (init_end - init_begin) >> 10);
413} 402}
414 403
415 404
diff --git a/arch/powerpc/Kconfig b/arch/powerpc/Kconfig
index bf6cedfa05db..d00131ca0835 100644
--- a/arch/powerpc/Kconfig
+++ b/arch/powerpc/Kconfig
@@ -62,7 +62,6 @@ config HAVE_LATENCYTOP_SUPPORT
62 62
63config TRACE_IRQFLAGS_SUPPORT 63config TRACE_IRQFLAGS_SUPPORT
64 bool 64 bool
65 depends on PPC64
66 default y 65 default y
67 66
68config LOCKDEP_SUPPORT 67config LOCKDEP_SUPPORT
diff --git a/arch/powerpc/boot/.gitignore b/arch/powerpc/boot/.gitignore
index 2f50acd11a60..3d80c3e9cf60 100644
--- a/arch/powerpc/boot/.gitignore
+++ b/arch/powerpc/boot/.gitignore
@@ -36,3 +36,13 @@ zImage.pseries
36zconf.h 36zconf.h
37zlib.h 37zlib.h
38zutil.h 38zutil.h
39fdt.c
40fdt.h
41fdt_ro.c
42fdt_rw.c
43fdt_strerror.c
44fdt_sw.c
45fdt_wip.c
46libfdt.h
47libfdt_internal.h
48
diff --git a/arch/powerpc/boot/dts/amigaone.dts b/arch/powerpc/boot/dts/amigaone.dts
index 26549fca2ed4..49ac36b16dd7 100644
--- a/arch/powerpc/boot/dts/amigaone.dts
+++ b/arch/powerpc/boot/dts/amigaone.dts
@@ -70,8 +70,8 @@
70 devsel-speed = <0x00000001>; 70 devsel-speed = <0x00000001>;
71 min-grant = <0>; 71 min-grant = <0>;
72 max-latency = <0>; 72 max-latency = <0>;
73 /* First 64k for I/O at 0x0 on PCI mapped to 0x0 on ISA. */ 73 /* First 4k for I/O at 0x0 on PCI mapped to 0x0 on ISA. */
74 ranges = <0x00000001 0 0x01000000 0 0x00000000 0x00010000>; 74 ranges = <0x00000001 0 0x01000000 0 0x00000000 0x00001000>;
75 interrupt-parent = <&i8259>; 75 interrupt-parent = <&i8259>;
76 #interrupt-cells = <2>; 76 #interrupt-cells = <2>;
77 #address-cells = <2>; 77 #address-cells = <2>;
diff --git a/arch/powerpc/boot/dts/mpc8569mds.dts b/arch/powerpc/boot/dts/mpc8569mds.dts
index a8dcb018c4a5..a680165292f2 100644
--- a/arch/powerpc/boot/dts/mpc8569mds.dts
+++ b/arch/powerpc/boot/dts/mpc8569mds.dts
@@ -253,6 +253,7 @@
253 /* Filled in by U-Boot */ 253 /* Filled in by U-Boot */
254 clock-frequency = <0>; 254 clock-frequency = <0>;
255 status = "disabled"; 255 status = "disabled";
256 sdhci,1-bit-only;
256 }; 257 };
257 258
258 crypto@30000 { 259 crypto@30000 {
diff --git a/arch/powerpc/boot/dts/warp.dts b/arch/powerpc/boot/dts/warp.dts
index 01bfb56bbe80..31605ee4afb6 100644
--- a/arch/powerpc/boot/dts/warp.dts
+++ b/arch/powerpc/boot/dts/warp.dts
@@ -261,10 +261,11 @@
261 compatible = "gpio-leds"; 261 compatible = "gpio-leds";
262 green { 262 green {
263 gpios = <&GPIO1 0 0>; 263 gpios = <&GPIO1 0 0>;
264 default-state = "on"; 264 default-state = "keep";
265 }; 265 };
266 red { 266 red {
267 gpios = <&GPIO1 1 0>; 267 gpios = <&GPIO1 1 0>;
268 default-state = "keep";
268 }; 269 };
269 }; 270 };
270 271
diff --git a/arch/powerpc/configs/44x/warp_defconfig b/arch/powerpc/configs/44x/warp_defconfig
index 3b77f092abe1..787635f23d8f 100644
--- a/arch/powerpc/configs/44x/warp_defconfig
+++ b/arch/powerpc/configs/44x/warp_defconfig
@@ -1,7 +1,7 @@
1# 1#
2# Automatically generated make config: don't edit 2# Automatically generated make config: don't edit
3# Linux kernel version: 2.6.29-rc2 3# Linux kernel version: 2.6.30
4# Fri Jan 23 07:57:16 2009 4# Tue Jun 9 23:35:36 2009
5# 5#
6# CONFIG_PPC64 is not set 6# CONFIG_PPC64 is not set
7 7
@@ -41,6 +41,7 @@ CONFIG_ARCH_HAS_ILOG2_U32=y
41CONFIG_GENERIC_HWEIGHT=y 41CONFIG_GENERIC_HWEIGHT=y
42CONFIG_GENERIC_CALIBRATE_DELAY=y 42CONFIG_GENERIC_CALIBRATE_DELAY=y
43CONFIG_GENERIC_FIND_NEXT_BIT=y 43CONFIG_GENERIC_FIND_NEXT_BIT=y
44CONFIG_GENERIC_GPIO=y
44# CONFIG_ARCH_NO_VIRT_TO_BUS is not set 45# CONFIG_ARCH_NO_VIRT_TO_BUS is not set
45CONFIG_PPC=y 46CONFIG_PPC=y
46CONFIG_EARLY_PRINTK=y 47CONFIG_EARLY_PRINTK=y
@@ -53,10 +54,12 @@ CONFIG_PPC_UDBG_16550=y
53# CONFIG_GENERIC_TBSYNC is not set 54# CONFIG_GENERIC_TBSYNC is not set
54CONFIG_AUDIT_ARCH=y 55CONFIG_AUDIT_ARCH=y
55CONFIG_GENERIC_BUG=y 56CONFIG_GENERIC_BUG=y
57CONFIG_DTC=y
56# CONFIG_DEFAULT_UIMAGE is not set 58# CONFIG_DEFAULT_UIMAGE is not set
57CONFIG_PPC_DCR_NATIVE=y 59CONFIG_PPC_DCR_NATIVE=y
58# CONFIG_PPC_DCR_MMIO is not set 60# CONFIG_PPC_DCR_MMIO is not set
59CONFIG_PPC_DCR=y 61CONFIG_PPC_DCR=y
62CONFIG_ARCH_SUPPORTS_DEBUG_PAGEALLOC=y
60CONFIG_DEFCONFIG_LIST="/lib/modules/$UNAME_RELEASE/.config" 63CONFIG_DEFCONFIG_LIST="/lib/modules/$UNAME_RELEASE/.config"
61 64
62# 65#
@@ -74,7 +77,17 @@ CONFIG_SYSVIPC_SYSCTL=y
74# CONFIG_BSD_PROCESS_ACCT is not set 77# CONFIG_BSD_PROCESS_ACCT is not set
75# CONFIG_TASKSTATS is not set 78# CONFIG_TASKSTATS is not set
76# CONFIG_AUDIT is not set 79# CONFIG_AUDIT is not set
77# CONFIG_IKCONFIG is not set 80
81#
82# RCU Subsystem
83#
84CONFIG_CLASSIC_RCU=y
85# CONFIG_TREE_RCU is not set
86# CONFIG_PREEMPT_RCU is not set
87# CONFIG_TREE_RCU_TRACE is not set
88# CONFIG_PREEMPT_RCU_TRACE is not set
89CONFIG_IKCONFIG=y
90CONFIG_IKCONFIG_PROC=y
78CONFIG_LOG_BUF_SHIFT=14 91CONFIG_LOG_BUF_SHIFT=14
79CONFIG_GROUP_SCHED=y 92CONFIG_GROUP_SCHED=y
80CONFIG_FAIR_GROUP_SCHED=y 93CONFIG_FAIR_GROUP_SCHED=y
@@ -82,27 +95,29 @@ CONFIG_FAIR_GROUP_SCHED=y
82CONFIG_USER_SCHED=y 95CONFIG_USER_SCHED=y
83# CONFIG_CGROUP_SCHED is not set 96# CONFIG_CGROUP_SCHED is not set
84# CONFIG_CGROUPS is not set 97# CONFIG_CGROUPS is not set
85CONFIG_SYSFS_DEPRECATED=y 98# CONFIG_SYSFS_DEPRECATED_V2 is not set
86CONFIG_SYSFS_DEPRECATED_V2=y
87# CONFIG_RELAY is not set 99# CONFIG_RELAY is not set
88# CONFIG_NAMESPACES is not set 100# CONFIG_NAMESPACES is not set
89CONFIG_BLK_DEV_INITRD=y 101CONFIG_BLK_DEV_INITRD=y
90CONFIG_INITRAMFS_SOURCE="" 102CONFIG_INITRAMFS_SOURCE=""
103CONFIG_RD_GZIP=y
104# CONFIG_RD_BZIP2 is not set
105# CONFIG_RD_LZMA is not set
91# CONFIG_CC_OPTIMIZE_FOR_SIZE is not set 106# CONFIG_CC_OPTIMIZE_FOR_SIZE is not set
92CONFIG_SYSCTL=y 107CONFIG_SYSCTL=y
108CONFIG_ANON_INODES=y
93CONFIG_EMBEDDED=y 109CONFIG_EMBEDDED=y
94CONFIG_SYSCTL_SYSCALL=y 110CONFIG_SYSCTL_SYSCALL=y
95CONFIG_KALLSYMS=y 111CONFIG_KALLSYMS=y
96# CONFIG_KALLSYMS_ALL is not set 112# CONFIG_KALLSYMS_ALL is not set
97# CONFIG_KALLSYMS_EXTRA_PASS is not set 113# CONFIG_KALLSYMS_EXTRA_PASS is not set
98# CONFIG_HOTPLUG is not set 114# CONFIG_STRIP_ASM_SYMS is not set
115CONFIG_HOTPLUG=y
99CONFIG_PRINTK=y 116CONFIG_PRINTK=y
100CONFIG_BUG=y 117CONFIG_BUG=y
101CONFIG_ELF_CORE=y 118CONFIG_ELF_CORE=y
102CONFIG_COMPAT_BRK=y
103CONFIG_BASE_FULL=y 119CONFIG_BASE_FULL=y
104CONFIG_FUTEX=y 120CONFIG_FUTEX=y
105CONFIG_ANON_INODES=y
106CONFIG_EPOLL=y 121CONFIG_EPOLL=y
107CONFIG_SIGNALFD=y 122CONFIG_SIGNALFD=y
108CONFIG_TIMERFD=y 123CONFIG_TIMERFD=y
@@ -110,10 +125,13 @@ CONFIG_EVENTFD=y
110CONFIG_SHMEM=y 125CONFIG_SHMEM=y
111CONFIG_AIO=y 126CONFIG_AIO=y
112CONFIG_VM_EVENT_COUNTERS=y 127CONFIG_VM_EVENT_COUNTERS=y
113CONFIG_SLAB=y 128CONFIG_SLUB_DEBUG=y
114# CONFIG_SLUB is not set 129CONFIG_COMPAT_BRK=y
130# CONFIG_SLAB is not set
131CONFIG_SLUB=y
115# CONFIG_SLOB is not set 132# CONFIG_SLOB is not set
116# CONFIG_PROFILING is not set 133# CONFIG_PROFILING is not set
134# CONFIG_MARKERS is not set
117CONFIG_HAVE_OPROFILE=y 135CONFIG_HAVE_OPROFILE=y
118# CONFIG_KPROBES is not set 136# CONFIG_KPROBES is not set
119CONFIG_HAVE_EFFICIENT_UNALIGNED_ACCESS=y 137CONFIG_HAVE_EFFICIENT_UNALIGNED_ACCESS=y
@@ -121,6 +139,7 @@ CONFIG_HAVE_IOREMAP_PROT=y
121CONFIG_HAVE_KPROBES=y 139CONFIG_HAVE_KPROBES=y
122CONFIG_HAVE_KRETPROBES=y 140CONFIG_HAVE_KRETPROBES=y
123CONFIG_HAVE_ARCH_TRACEHOOK=y 141CONFIG_HAVE_ARCH_TRACEHOOK=y
142# CONFIG_SLOW_WORK is not set
124# CONFIG_HAVE_GENERIC_DMA_COHERENT is not set 143# CONFIG_HAVE_GENERIC_DMA_COHERENT is not set
125CONFIG_SLABINFO=y 144CONFIG_SLABINFO=y
126CONFIG_RT_MUTEXES=y 145CONFIG_RT_MUTEXES=y
@@ -133,7 +152,6 @@ CONFIG_MODULE_UNLOAD=y
133# CONFIG_MODULE_SRCVERSION_ALL is not set 152# CONFIG_MODULE_SRCVERSION_ALL is not set
134CONFIG_BLOCK=y 153CONFIG_BLOCK=y
135# CONFIG_LBD is not set 154# CONFIG_LBD is not set
136# CONFIG_BLK_DEV_IO_TRACE is not set
137# CONFIG_BLK_DEV_BSG is not set 155# CONFIG_BLK_DEV_BSG is not set
138# CONFIG_BLK_DEV_INTEGRITY is not set 156# CONFIG_BLK_DEV_INTEGRITY is not set
139 157
@@ -149,11 +167,6 @@ CONFIG_DEFAULT_AS=y
149# CONFIG_DEFAULT_CFQ is not set 167# CONFIG_DEFAULT_CFQ is not set
150# CONFIG_DEFAULT_NOOP is not set 168# CONFIG_DEFAULT_NOOP is not set
151CONFIG_DEFAULT_IOSCHED="anticipatory" 169CONFIG_DEFAULT_IOSCHED="anticipatory"
152CONFIG_CLASSIC_RCU=y
153# CONFIG_TREE_RCU is not set
154# CONFIG_PREEMPT_RCU is not set
155# CONFIG_TREE_RCU_TRACE is not set
156# CONFIG_PREEMPT_RCU_TRACE is not set
157# CONFIG_FREEZER is not set 170# CONFIG_FREEZER is not set
158 171
159# 172#
@@ -173,10 +186,11 @@ CONFIG_WARP=y
173# CONFIG_ARCHES is not set 186# CONFIG_ARCHES is not set
174# CONFIG_CANYONLANDS is not set 187# CONFIG_CANYONLANDS is not set
175# CONFIG_GLACIER is not set 188# CONFIG_GLACIER is not set
189# CONFIG_REDWOOD is not set
176# CONFIG_YOSEMITE is not set 190# CONFIG_YOSEMITE is not set
177# CONFIG_XILINX_VIRTEX440_GENERIC_BOARD is not set 191# CONFIG_XILINX_VIRTEX440_GENERIC_BOARD is not set
178# CONFIG_PPC44x_SIMPLE is not set 192# CONFIG_PPC44x_SIMPLE is not set
179# CONFIG_PPC4xx_GPIO is not set 193CONFIG_PPC4xx_GPIO=y
180CONFIG_440EP=y 194CONFIG_440EP=y
181CONFIG_IBM440EP_ERR42=y 195CONFIG_IBM440EP_ERR42=y
182# CONFIG_IPIC is not set 196# CONFIG_IPIC is not set
@@ -235,9 +249,13 @@ CONFIG_ZONE_DMA_FLAG=1
235CONFIG_BOUNCE=y 249CONFIG_BOUNCE=y
236CONFIG_VIRT_TO_BUS=y 250CONFIG_VIRT_TO_BUS=y
237CONFIG_UNEVICTABLE_LRU=y 251CONFIG_UNEVICTABLE_LRU=y
252CONFIG_HAVE_MLOCK=y
253CONFIG_HAVE_MLOCKED_PAGE_BIT=y
254CONFIG_STDBINUTILS=y
238CONFIG_PPC_4K_PAGES=y 255CONFIG_PPC_4K_PAGES=y
239# CONFIG_PPC_16K_PAGES is not set 256# CONFIG_PPC_16K_PAGES is not set
240# CONFIG_PPC_64K_PAGES is not set 257# CONFIG_PPC_64K_PAGES is not set
258# CONFIG_PPC_256K_PAGES is not set
241CONFIG_FORCE_MAX_ZONEORDER=11 259CONFIG_FORCE_MAX_ZONEORDER=11
242CONFIG_PROC_DEVICETREE=y 260CONFIG_PROC_DEVICETREE=y
243CONFIG_CMDLINE_BOOL=y 261CONFIG_CMDLINE_BOOL=y
@@ -256,6 +274,7 @@ CONFIG_PPC_PCI_CHOICE=y
256# CONFIG_PCI_DOMAINS is not set 274# CONFIG_PCI_DOMAINS is not set
257# CONFIG_PCI_SYSCALL is not set 275# CONFIG_PCI_SYSCALL is not set
258# CONFIG_ARCH_SUPPORTS_MSI is not set 276# CONFIG_ARCH_SUPPORTS_MSI is not set
277# CONFIG_PCCARD is not set
259# CONFIG_HAS_RAPIDIO is not set 278# CONFIG_HAS_RAPIDIO is not set
260 279
261# 280#
@@ -271,14 +290,12 @@ CONFIG_PAGE_OFFSET=0xc0000000
271CONFIG_KERNEL_START=0xc0000000 290CONFIG_KERNEL_START=0xc0000000
272CONFIG_PHYSICAL_START=0x00000000 291CONFIG_PHYSICAL_START=0x00000000
273CONFIG_TASK_SIZE=0xc0000000 292CONFIG_TASK_SIZE=0xc0000000
274CONFIG_CONSISTENT_START=0xff100000
275CONFIG_CONSISTENT_SIZE=0x00200000 293CONFIG_CONSISTENT_SIZE=0x00200000
276CONFIG_NET=y 294CONFIG_NET=y
277 295
278# 296#
279# Networking options 297# Networking options
280# 298#
281CONFIG_COMPAT_NET_DEV_OPS=y
282CONFIG_PACKET=y 299CONFIG_PACKET=y
283# CONFIG_PACKET_MMAP is not set 300# CONFIG_PACKET_MMAP is not set
284CONFIG_UNIX=y 301CONFIG_UNIX=y
@@ -353,6 +370,7 @@ CONFIG_VLAN_8021Q=y
353# CONFIG_LAPB is not set 370# CONFIG_LAPB is not set
354# CONFIG_ECONET is not set 371# CONFIG_ECONET is not set
355# CONFIG_WAN_ROUTER is not set 372# CONFIG_WAN_ROUTER is not set
373# CONFIG_PHONET is not set
356# CONFIG_NET_SCHED is not set 374# CONFIG_NET_SCHED is not set
357# CONFIG_DCB is not set 375# CONFIG_DCB is not set
358 376
@@ -365,7 +383,6 @@ CONFIG_VLAN_8021Q=y
365# CONFIG_IRDA is not set 383# CONFIG_IRDA is not set
366# CONFIG_BT is not set 384# CONFIG_BT is not set
367# CONFIG_AF_RXRPC is not set 385# CONFIG_AF_RXRPC is not set
368# CONFIG_PHONET is not set
369# CONFIG_WIRELESS is not set 386# CONFIG_WIRELESS is not set
370# CONFIG_WIMAX is not set 387# CONFIG_WIMAX is not set
371# CONFIG_RFKILL is not set 388# CONFIG_RFKILL is not set
@@ -378,8 +395,12 @@ CONFIG_VLAN_8021Q=y
378# 395#
379# Generic Driver Options 396# Generic Driver Options
380# 397#
398CONFIG_UEVENT_HELPER_PATH="/sbin/hotplug"
381# CONFIG_STANDALONE is not set 399# CONFIG_STANDALONE is not set
382CONFIG_PREVENT_FIRMWARE_BUILD=y 400CONFIG_PREVENT_FIRMWARE_BUILD=y
401CONFIG_FW_LOADER=y
402# CONFIG_FIRMWARE_IN_KERNEL is not set
403CONFIG_EXTRA_FIRMWARE=""
383# CONFIG_DEBUG_DRIVER is not set 404# CONFIG_DEBUG_DRIVER is not set
384# CONFIG_DEBUG_DEVRES is not set 405# CONFIG_DEBUG_DEVRES is not set
385# CONFIG_SYS_HYPERVISOR is not set 406# CONFIG_SYS_HYPERVISOR is not set
@@ -471,13 +492,21 @@ CONFIG_MTD_NAND_NDFC=y
471# LPDDR flash memory drivers 492# LPDDR flash memory drivers
472# 493#
473# CONFIG_MTD_LPDDR is not set 494# CONFIG_MTD_LPDDR is not set
474# CONFIG_MTD_QINFO_PROBE is not set
475 495
476# 496#
477# UBI - Unsorted block images 497# UBI - Unsorted block images
478# 498#
479# CONFIG_MTD_UBI is not set 499CONFIG_MTD_UBI=y
500CONFIG_MTD_UBI_WL_THRESHOLD=4096
501CONFIG_MTD_UBI_BEB_RESERVE=1
502# CONFIG_MTD_UBI_GLUEBI is not set
503
504#
505# UBI debugging options
506#
507# CONFIG_MTD_UBI_DEBUG is not set
480CONFIG_OF_DEVICE=y 508CONFIG_OF_DEVICE=y
509CONFIG_OF_GPIO=y
481CONFIG_OF_I2C=y 510CONFIG_OF_I2C=y
482# CONFIG_PARPORT is not set 511# CONFIG_PARPORT is not set
483CONFIG_BLK_DEV=y 512CONFIG_BLK_DEV=y
@@ -495,10 +524,17 @@ CONFIG_BLK_DEV_RAM_SIZE=4096
495# CONFIG_XILINX_SYSACE is not set 524# CONFIG_XILINX_SYSACE is not set
496# CONFIG_BLK_DEV_HD is not set 525# CONFIG_BLK_DEV_HD is not set
497CONFIG_MISC_DEVICES=y 526CONFIG_MISC_DEVICES=y
498# CONFIG_EEPROM_93CX6 is not set
499# CONFIG_ICS932S401 is not set 527# CONFIG_ICS932S401 is not set
500# CONFIG_ENCLOSURE_SERVICES is not set 528# CONFIG_ENCLOSURE_SERVICES is not set
529# CONFIG_ISL29003 is not set
501# CONFIG_C2PORT is not set 530# CONFIG_C2PORT is not set
531
532#
533# EEPROM support
534#
535CONFIG_EEPROM_AT24=y
536# CONFIG_EEPROM_LEGACY is not set
537# CONFIG_EEPROM_93CX6 is not set
502CONFIG_HAVE_IDE=y 538CONFIG_HAVE_IDE=y
503# CONFIG_IDE is not set 539# CONFIG_IDE is not set
504 540
@@ -529,7 +565,7 @@ CONFIG_BLK_DEV_SD=y
529# CONFIG_SCSI_CONSTANTS is not set 565# CONFIG_SCSI_CONSTANTS is not set
530# CONFIG_SCSI_LOGGING is not set 566# CONFIG_SCSI_LOGGING is not set
531# CONFIG_SCSI_SCAN_ASYNC is not set 567# CONFIG_SCSI_SCAN_ASYNC is not set
532CONFIG_SCSI_WAIT_SCAN=m 568# CONFIG_SCSI_WAIT_SCAN is not set
533 569
534# 570#
535# SCSI Transports 571# SCSI Transports
@@ -541,10 +577,12 @@ CONFIG_SCSI_SPI_ATTRS=y
541# CONFIG_SCSI_SRP_ATTRS is not set 577# CONFIG_SCSI_SRP_ATTRS is not set
542# CONFIG_SCSI_LOWLEVEL is not set 578# CONFIG_SCSI_LOWLEVEL is not set
543# CONFIG_SCSI_DH is not set 579# CONFIG_SCSI_DH is not set
580# CONFIG_SCSI_OSD_INITIATOR is not set
544# CONFIG_ATA is not set 581# CONFIG_ATA is not set
545# CONFIG_MD is not set 582# CONFIG_MD is not set
546# CONFIG_MACINTOSH_DRIVERS is not set 583# CONFIG_MACINTOSH_DRIVERS is not set
547CONFIG_NETDEVICES=y 584CONFIG_NETDEVICES=y
585CONFIG_COMPAT_NET_DEV_OPS=y
548# CONFIG_DUMMY is not set 586# CONFIG_DUMMY is not set
549# CONFIG_BONDING is not set 587# CONFIG_BONDING is not set
550# CONFIG_MACVLAN is not set 588# CONFIG_MACVLAN is not set
@@ -554,6 +592,8 @@ CONFIG_NETDEVICES=y
554# CONFIG_PHYLIB is not set 592# CONFIG_PHYLIB is not set
555CONFIG_NET_ETHERNET=y 593CONFIG_NET_ETHERNET=y
556CONFIG_MII=y 594CONFIG_MII=y
595# CONFIG_ETHOC is not set
596# CONFIG_DNET is not set
557CONFIG_IBM_NEW_EMAC=y 597CONFIG_IBM_NEW_EMAC=y
558CONFIG_IBM_NEW_EMAC_RXB=128 598CONFIG_IBM_NEW_EMAC_RXB=128
559CONFIG_IBM_NEW_EMAC_TXB=64 599CONFIG_IBM_NEW_EMAC_TXB=64
@@ -577,7 +617,6 @@ CONFIG_IBM_NEW_EMAC_ZMII=y
577# 617#
578# CONFIG_WLAN_PRE80211 is not set 618# CONFIG_WLAN_PRE80211 is not set
579# CONFIG_WLAN_80211 is not set 619# CONFIG_WLAN_80211 is not set
580# CONFIG_IWLWIFI_LEDS is not set
581 620
582# 621#
583# Enable WiMAX (Networking options) to see the WiMAX drivers 622# Enable WiMAX (Networking options) to see the WiMAX drivers
@@ -646,6 +685,7 @@ CONFIG_LEGACY_PTY_COUNT=256
646# CONFIG_HVC_UDBG is not set 685# CONFIG_HVC_UDBG is not set
647# CONFIG_IPMI_HANDLER is not set 686# CONFIG_IPMI_HANDLER is not set
648CONFIG_HW_RANDOM=y 687CONFIG_HW_RANDOM=y
688# CONFIG_HW_RANDOM_TIMERIOMEM is not set
649# CONFIG_NVRAM is not set 689# CONFIG_NVRAM is not set
650# CONFIG_GEN_RTC is not set 690# CONFIG_GEN_RTC is not set
651# CONFIG_R3964 is not set 691# CONFIG_R3964 is not set
@@ -663,6 +703,7 @@ CONFIG_I2C_HELPER_AUTO=y
663# 703#
664# I2C system bus drivers (mostly embedded / system-on-chip) 704# I2C system bus drivers (mostly embedded / system-on-chip)
665# 705#
706# CONFIG_I2C_GPIO is not set
666CONFIG_I2C_IBM_IIC=y 707CONFIG_I2C_IBM_IIC=y
667# CONFIG_I2C_MPC is not set 708# CONFIG_I2C_MPC is not set
668# CONFIG_I2C_OCORES is not set 709# CONFIG_I2C_OCORES is not set
@@ -685,12 +726,9 @@ CONFIG_I2C_IBM_IIC=y
685# Miscellaneous I2C Chip support 726# Miscellaneous I2C Chip support
686# 727#
687# CONFIG_DS1682 is not set 728# CONFIG_DS1682 is not set
688CONFIG_EEPROM_AT24=y
689CONFIG_EEPROM_LEGACY=y
690# CONFIG_SENSORS_PCF8574 is not set 729# CONFIG_SENSORS_PCF8574 is not set
691# CONFIG_PCF8575 is not set 730# CONFIG_PCF8575 is not set
692# CONFIG_SENSORS_PCA9539 is not set 731# CONFIG_SENSORS_PCA9539 is not set
693# CONFIG_SENSORS_PCF8591 is not set
694# CONFIG_SENSORS_MAX6875 is not set 732# CONFIG_SENSORS_MAX6875 is not set
695# CONFIG_SENSORS_TSL2550 is not set 733# CONFIG_SENSORS_TSL2550 is not set
696# CONFIG_I2C_DEBUG_CORE is not set 734# CONFIG_I2C_DEBUG_CORE is not set
@@ -699,7 +737,30 @@ CONFIG_EEPROM_LEGACY=y
699# CONFIG_I2C_DEBUG_CHIP is not set 737# CONFIG_I2C_DEBUG_CHIP is not set
700# CONFIG_SPI is not set 738# CONFIG_SPI is not set
701CONFIG_ARCH_WANT_OPTIONAL_GPIOLIB=y 739CONFIG_ARCH_WANT_OPTIONAL_GPIOLIB=y
702# CONFIG_GPIOLIB is not set 740CONFIG_ARCH_REQUIRE_GPIOLIB=y
741CONFIG_GPIOLIB=y
742# CONFIG_DEBUG_GPIO is not set
743CONFIG_GPIO_SYSFS=y
744
745#
746# Memory mapped GPIO expanders:
747#
748# CONFIG_GPIO_XILINX is not set
749
750#
751# I2C GPIO expanders:
752#
753# CONFIG_GPIO_MAX732X is not set
754# CONFIG_GPIO_PCA953X is not set
755# CONFIG_GPIO_PCF857X is not set
756
757#
758# PCI GPIO expanders:
759#
760
761#
762# SPI GPIO expanders:
763#
703# CONFIG_W1 is not set 764# CONFIG_W1 is not set
704# CONFIG_POWER_SUPPLY is not set 765# CONFIG_POWER_SUPPLY is not set
705CONFIG_HWMON=y 766CONFIG_HWMON=y
@@ -721,6 +782,7 @@ CONFIG_SENSORS_AD7414=y
721# CONFIG_SENSORS_F71805F is not set 782# CONFIG_SENSORS_F71805F is not set
722# CONFIG_SENSORS_F71882FG is not set 783# CONFIG_SENSORS_F71882FG is not set
723# CONFIG_SENSORS_F75375S is not set 784# CONFIG_SENSORS_F75375S is not set
785# CONFIG_SENSORS_G760A is not set
724# CONFIG_SENSORS_GL518SM is not set 786# CONFIG_SENSORS_GL518SM is not set
725# CONFIG_SENSORS_GL520SM is not set 787# CONFIG_SENSORS_GL520SM is not set
726# CONFIG_SENSORS_IT87 is not set 788# CONFIG_SENSORS_IT87 is not set
@@ -735,11 +797,15 @@ CONFIG_SENSORS_AD7414=y
735# CONFIG_SENSORS_LM90 is not set 797# CONFIG_SENSORS_LM90 is not set
736# CONFIG_SENSORS_LM92 is not set 798# CONFIG_SENSORS_LM92 is not set
737# CONFIG_SENSORS_LM93 is not set 799# CONFIG_SENSORS_LM93 is not set
800# CONFIG_SENSORS_LTC4215 is not set
738# CONFIG_SENSORS_LTC4245 is not set 801# CONFIG_SENSORS_LTC4245 is not set
802# CONFIG_SENSORS_LM95241 is not set
739# CONFIG_SENSORS_MAX1619 is not set 803# CONFIG_SENSORS_MAX1619 is not set
740# CONFIG_SENSORS_MAX6650 is not set 804# CONFIG_SENSORS_MAX6650 is not set
741# CONFIG_SENSORS_PC87360 is not set 805# CONFIG_SENSORS_PC87360 is not set
742# CONFIG_SENSORS_PC87427 is not set 806# CONFIG_SENSORS_PC87427 is not set
807# CONFIG_SENSORS_PCF8591 is not set
808# CONFIG_SENSORS_SHT15 is not set
743# CONFIG_SENSORS_DME1737 is not set 809# CONFIG_SENSORS_DME1737 is not set
744# CONFIG_SENSORS_SMSC47M1 is not set 810# CONFIG_SENSORS_SMSC47M1 is not set
745# CONFIG_SENSORS_SMSC47M192 is not set 811# CONFIG_SENSORS_SMSC47M192 is not set
@@ -785,6 +851,7 @@ CONFIG_SSB_POSSIBLE=y
785# CONFIG_MFD_CORE is not set 851# CONFIG_MFD_CORE is not set
786# CONFIG_MFD_SM501 is not set 852# CONFIG_MFD_SM501 is not set
787# CONFIG_HTC_PASIC3 is not set 853# CONFIG_HTC_PASIC3 is not set
854# CONFIG_TPS65010 is not set
788# CONFIG_TWL4030_CORE is not set 855# CONFIG_TWL4030_CORE is not set
789# CONFIG_MFD_TMIO is not set 856# CONFIG_MFD_TMIO is not set
790# CONFIG_PMIC_DA903X is not set 857# CONFIG_PMIC_DA903X is not set
@@ -870,11 +937,11 @@ CONFIG_USB_OHCI_LITTLE_ENDIAN=y
870# CONFIG_USB_TMC is not set 937# CONFIG_USB_TMC is not set
871 938
872# 939#
873# NOTE: USB_STORAGE depends on SCSI but BLK_DEV_SD may also be needed; 940# NOTE: USB_STORAGE depends on SCSI but BLK_DEV_SD may
874# 941#
875 942
876# 943#
877# see USB_STORAGE Help for more information 944# also be needed; see USB_STORAGE Help for more info
878# 945#
879CONFIG_USB_STORAGE=y 946CONFIG_USB_STORAGE=y
880# CONFIG_USB_STORAGE_DEBUG is not set 947# CONFIG_USB_STORAGE_DEBUG is not set
@@ -915,7 +982,6 @@ CONFIG_USB_STORAGE=y
915# CONFIG_USB_LED is not set 982# CONFIG_USB_LED is not set
916# CONFIG_USB_CYPRESS_CY7C63 is not set 983# CONFIG_USB_CYPRESS_CY7C63 is not set
917# CONFIG_USB_CYTHERM is not set 984# CONFIG_USB_CYTHERM is not set
918# CONFIG_USB_PHIDGET is not set
919# CONFIG_USB_IDMOUSE is not set 985# CONFIG_USB_IDMOUSE is not set
920# CONFIG_USB_FTDI_ELAN is not set 986# CONFIG_USB_FTDI_ELAN is not set
921# CONFIG_USB_APPLEDISPLAY is not set 987# CONFIG_USB_APPLEDISPLAY is not set
@@ -929,6 +995,8 @@ CONFIG_USB_STORAGE=y
929# 995#
930# OTG and related infrastructure 996# OTG and related infrastructure
931# 997#
998# CONFIG_USB_GPIO_VBUS is not set
999# CONFIG_NOP_USB_XCEIV is not set
932CONFIG_MMC=y 1000CONFIG_MMC=y
933# CONFIG_MMC_DEBUG is not set 1001# CONFIG_MMC_DEBUG is not set
934# CONFIG_MMC_UNSAFE_RESUME is not set 1002# CONFIG_MMC_UNSAFE_RESUME is not set
@@ -946,6 +1014,7 @@ CONFIG_MMC_BLOCK_BOUNCE=y
946# 1014#
947# CONFIG_MMC_SDHCI is not set 1015# CONFIG_MMC_SDHCI is not set
948# CONFIG_MMC_WBSD is not set 1016# CONFIG_MMC_WBSD is not set
1017CONFIG_MMC_PIKASD=y
949# CONFIG_MEMSTICK is not set 1018# CONFIG_MEMSTICK is not set
950CONFIG_NEW_LEDS=y 1019CONFIG_NEW_LEDS=y
951CONFIG_LEDS_CLASS=y 1020CONFIG_LEDS_CLASS=y
@@ -953,16 +1022,31 @@ CONFIG_LEDS_CLASS=y
953# 1022#
954# LED drivers 1023# LED drivers
955# 1024#
1025CONFIG_LEDS_GPIO=y
1026# CONFIG_LEDS_GPIO_PLATFORM is not set
1027CONFIG_LEDS_GPIO_OF=y
1028# CONFIG_LEDS_LP5521 is not set
956# CONFIG_LEDS_PCA955X is not set 1029# CONFIG_LEDS_PCA955X is not set
1030# CONFIG_LEDS_BD2802 is not set
957 1031
958# 1032#
959# LED Triggers 1033# LED Triggers
960# 1034#
961# CONFIG_LEDS_TRIGGERS is not set 1035CONFIG_LEDS_TRIGGERS=y
1036# CONFIG_LEDS_TRIGGER_TIMER is not set
1037# CONFIG_LEDS_TRIGGER_HEARTBEAT is not set
1038# CONFIG_LEDS_TRIGGER_BACKLIGHT is not set
1039# CONFIG_LEDS_TRIGGER_GPIO is not set
1040CONFIG_LEDS_TRIGGER_DEFAULT_ON=y
1041
1042#
1043# iptables trigger is under Netfilter config (LED target)
1044#
962# CONFIG_ACCESSIBILITY is not set 1045# CONFIG_ACCESSIBILITY is not set
963# CONFIG_EDAC is not set 1046# CONFIG_EDAC is not set
964# CONFIG_RTC_CLASS is not set 1047# CONFIG_RTC_CLASS is not set
965# CONFIG_DMADEVICES is not set 1048# CONFIG_DMADEVICES is not set
1049# CONFIG_AUXDISPLAY is not set
966# CONFIG_UIO is not set 1050# CONFIG_UIO is not set
967# CONFIG_STAGING is not set 1051# CONFIG_STAGING is not set
968 1052
@@ -973,6 +1057,7 @@ CONFIG_EXT2_FS=y
973# CONFIG_EXT2_FS_XATTR is not set 1057# CONFIG_EXT2_FS_XATTR is not set
974# CONFIG_EXT2_FS_XIP is not set 1058# CONFIG_EXT2_FS_XIP is not set
975CONFIG_EXT3_FS=y 1059CONFIG_EXT3_FS=y
1060# CONFIG_EXT3_DEFAULTS_TO_ORDERED is not set
976# CONFIG_EXT3_FS_XATTR is not set 1061# CONFIG_EXT3_FS_XATTR is not set
977# CONFIG_EXT4_FS is not set 1062# CONFIG_EXT4_FS is not set
978CONFIG_JBD=y 1063CONFIG_JBD=y
@@ -993,6 +1078,11 @@ CONFIG_INOTIFY_USER=y
993# CONFIG_FUSE_FS is not set 1078# CONFIG_FUSE_FS is not set
994 1079
995# 1080#
1081# Caches
1082#
1083# CONFIG_FSCACHE is not set
1084
1085#
996# CD-ROM/DVD Filesystems 1086# CD-ROM/DVD Filesystems
997# 1087#
998# CONFIG_ISO9660_FS is not set 1088# CONFIG_ISO9660_FS is not set
@@ -1039,6 +1129,12 @@ CONFIG_JFFS2_ZLIB=y
1039# CONFIG_JFFS2_LZO is not set 1129# CONFIG_JFFS2_LZO is not set
1040CONFIG_JFFS2_RTIME=y 1130CONFIG_JFFS2_RTIME=y
1041# CONFIG_JFFS2_RUBIN is not set 1131# CONFIG_JFFS2_RUBIN is not set
1132CONFIG_UBIFS_FS=y
1133# CONFIG_UBIFS_FS_XATTR is not set
1134# CONFIG_UBIFS_FS_ADVANCED_COMPR is not set
1135CONFIG_UBIFS_FS_LZO=y
1136CONFIG_UBIFS_FS_ZLIB=y
1137# CONFIG_UBIFS_FS_DEBUG is not set
1042CONFIG_CRAMFS=y 1138CONFIG_CRAMFS=y
1043# CONFIG_SQUASHFS is not set 1139# CONFIG_SQUASHFS is not set
1044# CONFIG_VXFS_FS is not set 1140# CONFIG_VXFS_FS is not set
@@ -1049,6 +1145,7 @@ CONFIG_CRAMFS=y
1049# CONFIG_ROMFS_FS is not set 1145# CONFIG_ROMFS_FS is not set
1050# CONFIG_SYSV_FS is not set 1146# CONFIG_SYSV_FS is not set
1051# CONFIG_UFS_FS is not set 1147# CONFIG_UFS_FS is not set
1148# CONFIG_NILFS2_FS is not set
1052CONFIG_NETWORK_FILESYSTEMS=y 1149CONFIG_NETWORK_FILESYSTEMS=y
1053CONFIG_NFS_FS=y 1150CONFIG_NFS_FS=y
1054CONFIG_NFS_V3=y 1151CONFIG_NFS_V3=y
@@ -1060,7 +1157,6 @@ CONFIG_LOCKD=y
1060CONFIG_LOCKD_V4=y 1157CONFIG_LOCKD_V4=y
1061CONFIG_NFS_COMMON=y 1158CONFIG_NFS_COMMON=y
1062CONFIG_SUNRPC=y 1159CONFIG_SUNRPC=y
1063# CONFIG_SUNRPC_REGISTER_V4 is not set
1064# CONFIG_RPCSEC_GSS_KRB5 is not set 1160# CONFIG_RPCSEC_GSS_KRB5 is not set
1065# CONFIG_RPCSEC_GSS_SPKM3 is not set 1161# CONFIG_RPCSEC_GSS_SPKM3 is not set
1066# CONFIG_SMB_FS is not set 1162# CONFIG_SMB_FS is not set
@@ -1115,6 +1211,7 @@ CONFIG_NLS_ISO8859_15=y
1115# CONFIG_NLS_KOI8_U is not set 1211# CONFIG_NLS_KOI8_U is not set
1116CONFIG_NLS_UTF8=y 1212CONFIG_NLS_UTF8=y
1117# CONFIG_DLM is not set 1213# CONFIG_DLM is not set
1214# CONFIG_BINARY_PRINTF is not set
1118 1215
1119# 1216#
1120# Library routines 1217# Library routines
@@ -1122,7 +1219,7 @@ CONFIG_NLS_UTF8=y
1122CONFIG_BITREVERSE=y 1219CONFIG_BITREVERSE=y
1123CONFIG_GENERIC_FIND_LAST_BIT=y 1220CONFIG_GENERIC_FIND_LAST_BIT=y
1124CONFIG_CRC_CCITT=y 1221CONFIG_CRC_CCITT=y
1125# CONFIG_CRC16 is not set 1222CONFIG_CRC16=y
1126CONFIG_CRC_T10DIF=y 1223CONFIG_CRC_T10DIF=y
1127# CONFIG_CRC_ITU_T is not set 1224# CONFIG_CRC_ITU_T is not set
1128CONFIG_CRC32=y 1225CONFIG_CRC32=y
@@ -1130,16 +1227,19 @@ CONFIG_CRC32=y
1130# CONFIG_LIBCRC32C is not set 1227# CONFIG_LIBCRC32C is not set
1131CONFIG_ZLIB_INFLATE=y 1228CONFIG_ZLIB_INFLATE=y
1132CONFIG_ZLIB_DEFLATE=y 1229CONFIG_ZLIB_DEFLATE=y
1133CONFIG_PLIST=y 1230CONFIG_LZO_COMPRESS=y
1231CONFIG_LZO_DECOMPRESS=y
1232CONFIG_DECOMPRESS_GZIP=y
1134CONFIG_HAS_IOMEM=y 1233CONFIG_HAS_IOMEM=y
1135CONFIG_HAS_IOPORT=y 1234CONFIG_HAS_IOPORT=y
1136CONFIG_HAS_DMA=y 1235CONFIG_HAS_DMA=y
1137CONFIG_HAVE_LMB=y 1236CONFIG_HAVE_LMB=y
1237CONFIG_NLATTR=y
1138 1238
1139# 1239#
1140# Kernel hacking 1240# Kernel hacking
1141# 1241#
1142# CONFIG_PRINTK_TIME is not set 1242CONFIG_PRINTK_TIME=y
1143CONFIG_ENABLE_WARN_DEPRECATED=y 1243CONFIG_ENABLE_WARN_DEPRECATED=y
1144CONFIG_ENABLE_MUST_CHECK=y 1244CONFIG_ENABLE_MUST_CHECK=y
1145CONFIG_FRAME_WARN=1024 1245CONFIG_FRAME_WARN=1024
@@ -1152,11 +1252,15 @@ CONFIG_DEBUG_KERNEL=y
1152CONFIG_DETECT_SOFTLOCKUP=y 1252CONFIG_DETECT_SOFTLOCKUP=y
1153# CONFIG_BOOTPARAM_SOFTLOCKUP_PANIC is not set 1253# CONFIG_BOOTPARAM_SOFTLOCKUP_PANIC is not set
1154CONFIG_BOOTPARAM_SOFTLOCKUP_PANIC_VALUE=0 1254CONFIG_BOOTPARAM_SOFTLOCKUP_PANIC_VALUE=0
1255CONFIG_DETECT_HUNG_TASK=y
1256# CONFIG_BOOTPARAM_HUNG_TASK_PANIC is not set
1257CONFIG_BOOTPARAM_HUNG_TASK_PANIC_VALUE=0
1155# CONFIG_SCHED_DEBUG is not set 1258# CONFIG_SCHED_DEBUG is not set
1156# CONFIG_SCHEDSTATS is not set 1259# CONFIG_SCHEDSTATS is not set
1157# CONFIG_TIMER_STATS is not set 1260# CONFIG_TIMER_STATS is not set
1158# CONFIG_DEBUG_OBJECTS is not set 1261# CONFIG_DEBUG_OBJECTS is not set
1159# CONFIG_DEBUG_SLAB is not set 1262# CONFIG_SLUB_DEBUG_ON is not set
1263# CONFIG_SLUB_STATS is not set
1160# CONFIG_DEBUG_RT_MUTEXES is not set 1264# CONFIG_DEBUG_RT_MUTEXES is not set
1161# CONFIG_RT_MUTEX_TESTER is not set 1265# CONFIG_RT_MUTEX_TESTER is not set
1162# CONFIG_DEBUG_SPINLOCK is not set 1266# CONFIG_DEBUG_SPINLOCK is not set
@@ -1180,9 +1284,12 @@ CONFIG_DEBUG_INFO=y
1180# CONFIG_FAULT_INJECTION is not set 1284# CONFIG_FAULT_INJECTION is not set
1181# CONFIG_LATENCYTOP is not set 1285# CONFIG_LATENCYTOP is not set
1182CONFIG_SYSCTL_SYSCALL_CHECK=y 1286CONFIG_SYSCTL_SYSCALL_CHECK=y
1287# CONFIG_DEBUG_PAGEALLOC is not set
1183CONFIG_HAVE_FUNCTION_TRACER=y 1288CONFIG_HAVE_FUNCTION_TRACER=y
1289CONFIG_HAVE_FUNCTION_GRAPH_TRACER=y
1184CONFIG_HAVE_DYNAMIC_FTRACE=y 1290CONFIG_HAVE_DYNAMIC_FTRACE=y
1185CONFIG_HAVE_FTRACE_MCOUNT_RECORD=y 1291CONFIG_HAVE_FTRACE_MCOUNT_RECORD=y
1292CONFIG_TRACING_SUPPORT=y
1186 1293
1187# 1294#
1188# Tracers 1295# Tracers
@@ -1190,24 +1297,27 @@ CONFIG_HAVE_FTRACE_MCOUNT_RECORD=y
1190# CONFIG_FUNCTION_TRACER is not set 1297# CONFIG_FUNCTION_TRACER is not set
1191# CONFIG_SCHED_TRACER is not set 1298# CONFIG_SCHED_TRACER is not set
1192# CONFIG_CONTEXT_SWITCH_TRACER is not set 1299# CONFIG_CONTEXT_SWITCH_TRACER is not set
1300# CONFIG_EVENT_TRACER is not set
1193# CONFIG_BOOT_TRACER is not set 1301# CONFIG_BOOT_TRACER is not set
1194# CONFIG_TRACE_BRANCH_PROFILING is not set 1302# CONFIG_TRACE_BRANCH_PROFILING is not set
1195# CONFIG_STACK_TRACER is not set 1303# CONFIG_STACK_TRACER is not set
1196# CONFIG_DYNAMIC_PRINTK_DEBUG is not set 1304# CONFIG_KMEMTRACE is not set
1305# CONFIG_WORKQUEUE_TRACER is not set
1306# CONFIG_BLK_DEV_IO_TRACE is not set
1307# CONFIG_DYNAMIC_DEBUG is not set
1197# CONFIG_SAMPLES is not set 1308# CONFIG_SAMPLES is not set
1198CONFIG_HAVE_ARCH_KGDB=y 1309CONFIG_HAVE_ARCH_KGDB=y
1199# CONFIG_KGDB is not set 1310# CONFIG_KGDB is not set
1200CONFIG_PRINT_STACK_DEPTH=64 1311CONFIG_PRINT_STACK_DEPTH=64
1201# CONFIG_DEBUG_STACKOVERFLOW is not set 1312# CONFIG_DEBUG_STACKOVERFLOW is not set
1202# CONFIG_DEBUG_STACK_USAGE is not set 1313# CONFIG_DEBUG_STACK_USAGE is not set
1203# CONFIG_DEBUG_PAGEALLOC is not set
1204# CONFIG_CODE_PATCHING_SELFTEST is not set 1314# CONFIG_CODE_PATCHING_SELFTEST is not set
1205# CONFIG_FTR_FIXUP_SELFTEST is not set 1315# CONFIG_FTR_FIXUP_SELFTEST is not set
1206# CONFIG_MSI_BITMAP_SELFTEST is not set 1316# CONFIG_MSI_BITMAP_SELFTEST is not set
1207# CONFIG_XMON is not set 1317# CONFIG_XMON is not set
1208CONFIG_IRQSTACKS=y 1318CONFIG_IRQSTACKS=y
1209# CONFIG_VIRQ_DEBUG is not set 1319# CONFIG_VIRQ_DEBUG is not set
1210CONFIG_BDI_SWITCH=y 1320# CONFIG_BDI_SWITCH is not set
1211# CONFIG_PPC_EARLY_DEBUG is not set 1321# CONFIG_PPC_EARLY_DEBUG is not set
1212 1322
1213# 1323#
@@ -1223,6 +1333,8 @@ CONFIG_CRYPTO=y
1223# Crypto core or helper 1333# Crypto core or helper
1224# 1334#
1225# CONFIG_CRYPTO_FIPS is not set 1335# CONFIG_CRYPTO_FIPS is not set
1336CONFIG_CRYPTO_ALGAPI=y
1337CONFIG_CRYPTO_ALGAPI2=y
1226# CONFIG_CRYPTO_MANAGER is not set 1338# CONFIG_CRYPTO_MANAGER is not set
1227# CONFIG_CRYPTO_MANAGER2 is not set 1339# CONFIG_CRYPTO_MANAGER2 is not set
1228# CONFIG_CRYPTO_GF128MUL is not set 1340# CONFIG_CRYPTO_GF128MUL is not set
@@ -1294,13 +1406,15 @@ CONFIG_CRYPTO=y
1294# 1406#
1295# Compression 1407# Compression
1296# 1408#
1297# CONFIG_CRYPTO_DEFLATE is not set 1409CONFIG_CRYPTO_DEFLATE=y
1298# CONFIG_CRYPTO_LZO is not set 1410# CONFIG_CRYPTO_ZLIB is not set
1411CONFIG_CRYPTO_LZO=y
1299 1412
1300# 1413#
1301# Random Number Generation 1414# Random Number Generation
1302# 1415#
1303# CONFIG_CRYPTO_ANSI_CPRNG is not set 1416# CONFIG_CRYPTO_ANSI_CPRNG is not set
1304CONFIG_CRYPTO_HW=y 1417CONFIG_CRYPTO_HW=y
1418# CONFIG_CRYPTO_DEV_PPC4XX is not set
1305# CONFIG_PPC_CLOCK is not set 1419# CONFIG_PPC_CLOCK is not set
1306# CONFIG_VIRTUALIZATION is not set 1420# CONFIG_VIRTUALIZATION is not set
diff --git a/arch/powerpc/include/asm/cpm1.h b/arch/powerpc/include/asm/cpm1.h
index 2ff798744c1d..7685ffde8821 100644
--- a/arch/powerpc/include/asm/cpm1.h
+++ b/arch/powerpc/include/asm/cpm1.h
@@ -598,8 +598,6 @@ typedef struct risc_timer_pram {
598#define CICR_IEN ((uint)0x00000080) /* Int. enable */ 598#define CICR_IEN ((uint)0x00000080) /* Int. enable */
599#define CICR_SPS ((uint)0x00000001) /* SCC Spread */ 599#define CICR_SPS ((uint)0x00000001) /* SCC Spread */
600 600
601#define IMAP_ADDR (get_immrbase())
602
603#define CPM_PIN_INPUT 0 601#define CPM_PIN_INPUT 0
604#define CPM_PIN_OUTPUT 1 602#define CPM_PIN_OUTPUT 1
605#define CPM_PIN_PRIMARY 0 603#define CPM_PIN_PRIMARY 0
diff --git a/arch/powerpc/include/asm/delay.h b/arch/powerpc/include/asm/delay.h
index 1e2eb41fa057..52e4d54da2a9 100644
--- a/arch/powerpc/include/asm/delay.h
+++ b/arch/powerpc/include/asm/delay.h
@@ -63,6 +63,8 @@ extern void udelay(unsigned long usecs);
63 udelay(delay); \ 63 udelay(delay); \
64 else \ 64 else \
65 cpu_relax(); \ 65 cpu_relax(); \
66 if (!__ret) \
67 __ret = (condition); \
66 __ret; \ 68 __ret; \
67}) 69})
68 70
diff --git a/arch/powerpc/include/asm/dma-mapping.h b/arch/powerpc/include/asm/dma-mapping.h
index 3d9e887c3c0c..b44aaabdd1a6 100644
--- a/arch/powerpc/include/asm/dma-mapping.h
+++ b/arch/powerpc/include/asm/dma-mapping.h
@@ -309,7 +309,9 @@ static inline void dma_sync_single_for_cpu(struct device *dev,
309 struct dma_mapping_ops *dma_ops = get_dma_ops(dev); 309 struct dma_mapping_ops *dma_ops = get_dma_ops(dev);
310 310
311 BUG_ON(!dma_ops); 311 BUG_ON(!dma_ops);
312 dma_ops->sync_single_range_for_cpu(dev, dma_handle, 0, 312
313 if (dma_ops->sync_single_range_for_cpu)
314 dma_ops->sync_single_range_for_cpu(dev, dma_handle, 0,
313 size, direction); 315 size, direction);
314} 316}
315 317
@@ -320,7 +322,9 @@ static inline void dma_sync_single_for_device(struct device *dev,
320 struct dma_mapping_ops *dma_ops = get_dma_ops(dev); 322 struct dma_mapping_ops *dma_ops = get_dma_ops(dev);
321 323
322 BUG_ON(!dma_ops); 324 BUG_ON(!dma_ops);
323 dma_ops->sync_single_range_for_device(dev, dma_handle, 325
326 if (dma_ops->sync_single_range_for_device)
327 dma_ops->sync_single_range_for_device(dev, dma_handle,
324 0, size, direction); 328 0, size, direction);
325} 329}
326 330
@@ -331,7 +335,9 @@ static inline void dma_sync_sg_for_cpu(struct device *dev,
331 struct dma_mapping_ops *dma_ops = get_dma_ops(dev); 335 struct dma_mapping_ops *dma_ops = get_dma_ops(dev);
332 336
333 BUG_ON(!dma_ops); 337 BUG_ON(!dma_ops);
334 dma_ops->sync_sg_for_cpu(dev, sgl, nents, direction); 338
339 if (dma_ops->sync_sg_for_cpu)
340 dma_ops->sync_sg_for_cpu(dev, sgl, nents, direction);
335} 341}
336 342
337static inline void dma_sync_sg_for_device(struct device *dev, 343static inline void dma_sync_sg_for_device(struct device *dev,
@@ -341,7 +347,9 @@ static inline void dma_sync_sg_for_device(struct device *dev,
341 struct dma_mapping_ops *dma_ops = get_dma_ops(dev); 347 struct dma_mapping_ops *dma_ops = get_dma_ops(dev);
342 348
343 BUG_ON(!dma_ops); 349 BUG_ON(!dma_ops);
344 dma_ops->sync_sg_for_device(dev, sgl, nents, direction); 350
351 if (dma_ops->sync_sg_for_device)
352 dma_ops->sync_sg_for_device(dev, sgl, nents, direction);
345} 353}
346 354
347static inline void dma_sync_single_range_for_cpu(struct device *dev, 355static inline void dma_sync_single_range_for_cpu(struct device *dev,
@@ -351,7 +359,9 @@ static inline void dma_sync_single_range_for_cpu(struct device *dev,
351 struct dma_mapping_ops *dma_ops = get_dma_ops(dev); 359 struct dma_mapping_ops *dma_ops = get_dma_ops(dev);
352 360
353 BUG_ON(!dma_ops); 361 BUG_ON(!dma_ops);
354 dma_ops->sync_single_range_for_cpu(dev, dma_handle, 362
363 if (dma_ops->sync_single_range_for_cpu)
364 dma_ops->sync_single_range_for_cpu(dev, dma_handle,
355 offset, size, direction); 365 offset, size, direction);
356} 366}
357 367
@@ -362,7 +372,9 @@ static inline void dma_sync_single_range_for_device(struct device *dev,
362 struct dma_mapping_ops *dma_ops = get_dma_ops(dev); 372 struct dma_mapping_ops *dma_ops = get_dma_ops(dev);
363 373
364 BUG_ON(!dma_ops); 374 BUG_ON(!dma_ops);
365 dma_ops->sync_single_range_for_device(dev, dma_handle, offset, 375
376 if (dma_ops->sync_single_range_for_device)
377 dma_ops->sync_single_range_for_device(dev, dma_handle, offset,
366 size, direction); 378 size, direction);
367} 379}
368#else /* CONFIG_PPC_NEED_DMA_SYNC_OPS */ 380#else /* CONFIG_PPC_NEED_DMA_SYNC_OPS */
diff --git a/arch/powerpc/include/asm/highmem.h b/arch/powerpc/include/asm/highmem.h
index 684a73f4324f..a74c4ee6c020 100644
--- a/arch/powerpc/include/asm/highmem.h
+++ b/arch/powerpc/include/asm/highmem.h
@@ -22,9 +22,7 @@
22 22
23#ifdef __KERNEL__ 23#ifdef __KERNEL__
24 24
25#include <linux/init.h>
26#include <linux/interrupt.h> 25#include <linux/interrupt.h>
27#include <linux/highmem.h>
28#include <asm/kmap_types.h> 26#include <asm/kmap_types.h>
29#include <asm/tlbflush.h> 27#include <asm/tlbflush.h>
30#include <asm/page.h> 28#include <asm/page.h>
@@ -62,6 +60,9 @@ extern pte_t *pkmap_page_table;
62 60
63extern void *kmap_high(struct page *page); 61extern void *kmap_high(struct page *page);
64extern void kunmap_high(struct page *page); 62extern void kunmap_high(struct page *page);
63extern void *kmap_atomic_prot(struct page *page, enum km_type type,
64 pgprot_t prot);
65extern void kunmap_atomic(void *kvaddr, enum km_type type);
65 66
66static inline void *kmap(struct page *page) 67static inline void *kmap(struct page *page)
67{ 68{
@@ -79,62 +80,11 @@ static inline void kunmap(struct page *page)
79 kunmap_high(page); 80 kunmap_high(page);
80} 81}
81 82
82/*
83 * The use of kmap_atomic/kunmap_atomic is discouraged - kmap/kunmap
84 * gives a more generic (and caching) interface. But kmap_atomic can
85 * be used in IRQ contexts, so in some (very limited) cases we need
86 * it.
87 */
88static inline void *kmap_atomic_prot(struct page *page, enum km_type type, pgprot_t prot)
89{
90 unsigned int idx;
91 unsigned long vaddr;
92
93 /* even !CONFIG_PREEMPT needs this, for in_atomic in do_page_fault */
94 pagefault_disable();
95 if (!PageHighMem(page))
96 return page_address(page);
97
98 debug_kmap_atomic(type);
99 idx = type + KM_TYPE_NR*smp_processor_id();
100 vaddr = __fix_to_virt(FIX_KMAP_BEGIN + idx);
101#ifdef CONFIG_DEBUG_HIGHMEM
102 BUG_ON(!pte_none(*(kmap_pte-idx)));
103#endif
104 __set_pte_at(&init_mm, vaddr, kmap_pte-idx, mk_pte(page, prot), 1);
105 local_flush_tlb_page(NULL, vaddr);
106
107 return (void*) vaddr;
108}
109
110static inline void *kmap_atomic(struct page *page, enum km_type type) 83static inline void *kmap_atomic(struct page *page, enum km_type type)
111{ 84{
112 return kmap_atomic_prot(page, type, kmap_prot); 85 return kmap_atomic_prot(page, type, kmap_prot);
113} 86}
114 87
115static inline void kunmap_atomic(void *kvaddr, enum km_type type)
116{
117#ifdef CONFIG_DEBUG_HIGHMEM
118 unsigned long vaddr = (unsigned long) kvaddr & PAGE_MASK;
119 enum fixed_addresses idx = type + KM_TYPE_NR*smp_processor_id();
120
121 if (vaddr < __fix_to_virt(FIX_KMAP_END)) {
122 pagefault_enable();
123 return;
124 }
125
126 BUG_ON(vaddr != __fix_to_virt(FIX_KMAP_BEGIN + idx));
127
128 /*
129 * force other mappings to Oops if they'll try to access
130 * this pte without first remap it
131 */
132 pte_clear(&init_mm, vaddr, kmap_pte-idx);
133 local_flush_tlb_page(NULL, vaddr);
134#endif
135 pagefault_enable();
136}
137
138static inline struct page *kmap_atomic_to_page(void *ptr) 88static inline struct page *kmap_atomic_to_page(void *ptr)
139{ 89{
140 unsigned long idx, vaddr = (unsigned long) ptr; 90 unsigned long idx, vaddr = (unsigned long) ptr;
@@ -148,6 +98,7 @@ static inline struct page *kmap_atomic_to_page(void *ptr)
148 return pte_page(*pte); 98 return pte_page(*pte);
149} 99}
150 100
101
151#define flush_cache_kmaps() flush_cache_all() 102#define flush_cache_kmaps() flush_cache_all()
152 103
153#endif /* __KERNEL__ */ 104#endif /* __KERNEL__ */
diff --git a/arch/powerpc/include/asm/hw_irq.h b/arch/powerpc/include/asm/hw_irq.h
index 867ab8ed69b3..8b505eaaa38a 100644
--- a/arch/powerpc/include/asm/hw_irq.h
+++ b/arch/powerpc/include/asm/hw_irq.h
@@ -68,13 +68,13 @@ static inline int irqs_disabled_flags(unsigned long flags)
68 68
69#if defined(CONFIG_BOOKE) 69#if defined(CONFIG_BOOKE)
70#define SET_MSR_EE(x) mtmsr(x) 70#define SET_MSR_EE(x) mtmsr(x)
71#define local_irq_restore(flags) __asm__ __volatile__("wrtee %0" : : "r" (flags) : "memory") 71#define raw_local_irq_restore(flags) __asm__ __volatile__("wrtee %0" : : "r" (flags) : "memory")
72#else 72#else
73#define SET_MSR_EE(x) mtmsr(x) 73#define SET_MSR_EE(x) mtmsr(x)
74#define local_irq_restore(flags) mtmsr(flags) 74#define raw_local_irq_restore(flags) mtmsr(flags)
75#endif 75#endif
76 76
77static inline void local_irq_disable(void) 77static inline void raw_local_irq_disable(void)
78{ 78{
79#ifdef CONFIG_BOOKE 79#ifdef CONFIG_BOOKE
80 __asm__ __volatile__("wrteei 0": : :"memory"); 80 __asm__ __volatile__("wrteei 0": : :"memory");
@@ -86,7 +86,7 @@ static inline void local_irq_disable(void)
86#endif 86#endif
87} 87}
88 88
89static inline void local_irq_enable(void) 89static inline void raw_local_irq_enable(void)
90{ 90{
91#ifdef CONFIG_BOOKE 91#ifdef CONFIG_BOOKE
92 __asm__ __volatile__("wrteei 1": : :"memory"); 92 __asm__ __volatile__("wrteei 1": : :"memory");
@@ -98,7 +98,7 @@ static inline void local_irq_enable(void)
98#endif 98#endif
99} 99}
100 100
101static inline void local_irq_save_ptr(unsigned long *flags) 101static inline void raw_local_irq_save_ptr(unsigned long *flags)
102{ 102{
103 unsigned long msr; 103 unsigned long msr;
104 msr = mfmsr(); 104 msr = mfmsr();
@@ -110,12 +110,12 @@ static inline void local_irq_save_ptr(unsigned long *flags)
110#endif 110#endif
111} 111}
112 112
113#define local_save_flags(flags) ((flags) = mfmsr()) 113#define raw_local_save_flags(flags) ((flags) = mfmsr())
114#define local_irq_save(flags) local_irq_save_ptr(&flags) 114#define raw_local_irq_save(flags) raw_local_irq_save_ptr(&flags)
115#define irqs_disabled() ((mfmsr() & MSR_EE) == 0) 115#define raw_irqs_disabled() ((mfmsr() & MSR_EE) == 0)
116#define raw_irqs_disabled_flags(flags) (((flags) & MSR_EE) == 0)
116 117
117#define hard_irq_enable() local_irq_enable() 118#define hard_irq_disable() raw_local_irq_disable()
118#define hard_irq_disable() local_irq_disable()
119 119
120static inline int irqs_disabled_flags(unsigned long flags) 120static inline int irqs_disabled_flags(unsigned long flags)
121{ 121{
diff --git a/arch/powerpc/include/asm/perf_counter.h b/arch/powerpc/include/asm/perf_counter.h
index 8ccd4e155768..0ea0639fcf75 100644
--- a/arch/powerpc/include/asm/perf_counter.h
+++ b/arch/powerpc/include/asm/perf_counter.h
@@ -61,6 +61,8 @@ struct pt_regs;
61extern unsigned long perf_misc_flags(struct pt_regs *regs); 61extern unsigned long perf_misc_flags(struct pt_regs *regs);
62extern unsigned long perf_instruction_pointer(struct pt_regs *regs); 62extern unsigned long perf_instruction_pointer(struct pt_regs *regs);
63 63
64#define PERF_COUNTER_INDEX_OFFSET 1
65
64/* 66/*
65 * Only override the default definitions in include/linux/perf_counter.h 67 * Only override the default definitions in include/linux/perf_counter.h
66 * if we have hardware PMU support. 68 * if we have hardware PMU support.
diff --git a/arch/powerpc/include/asm/pte-hash64-64k.h b/arch/powerpc/include/asm/pte-hash64-64k.h
index e05d26fa372f..82b72207c51c 100644
--- a/arch/powerpc/include/asm/pte-hash64-64k.h
+++ b/arch/powerpc/include/asm/pte-hash64-64k.h
@@ -47,7 +47,8 @@
47 * generic accessors and iterators here 47 * generic accessors and iterators here
48 */ 48 */
49#define __real_pte(e,p) ((real_pte_t) { \ 49#define __real_pte(e,p) ((real_pte_t) { \
50 (e), pte_val(*((p) + PTRS_PER_PTE)) }) 50 (e), ((e) & _PAGE_COMBO) ? \
51 (pte_val(*((p) + PTRS_PER_PTE))) : 0 })
51#define __rpte_to_hidx(r,index) ((pte_val((r).pte) & _PAGE_COMBO) ? \ 52#define __rpte_to_hidx(r,index) ((pte_val((r).pte) & _PAGE_COMBO) ? \
52 (((r).hidx >> ((index)<<2)) & 0xf) : ((pte_val((r).pte) >> 12) & 0xf)) 53 (((r).hidx >> ((index)<<2)) & 0xf) : ((pte_val((r).pte) >> 12) & 0xf))
53#define __rpte_to_pte(r) ((r).pte) 54#define __rpte_to_pte(r) ((r).pte)
diff --git a/arch/powerpc/include/asm/rtas.h b/arch/powerpc/include/asm/rtas.h
index 01c12339b304..168fce726201 100644
--- a/arch/powerpc/include/asm/rtas.h
+++ b/arch/powerpc/include/asm/rtas.h
@@ -58,7 +58,7 @@ struct rtas_t {
58 unsigned long entry; /* physical address pointer */ 58 unsigned long entry; /* physical address pointer */
59 unsigned long base; /* physical address pointer */ 59 unsigned long base; /* physical address pointer */
60 unsigned long size; 60 unsigned long size;
61 spinlock_t lock; 61 raw_spinlock_t lock;
62 struct rtas_args args; 62 struct rtas_args args;
63 struct device_node *dev; /* virtual address pointer */ 63 struct device_node *dev; /* virtual address pointer */
64}; 64};
@@ -245,5 +245,8 @@ static inline u32 rtas_config_addr(int busno, int devfn, int reg)
245 (devfn << 8) | (reg & 0xff); 245 (devfn << 8) | (reg & 0xff);
246} 246}
247 247
248extern void __cpuinit rtas_give_timebase(void);
249extern void __cpuinit rtas_take_timebase(void);
250
248#endif /* __KERNEL__ */ 251#endif /* __KERNEL__ */
249#endif /* _POWERPC_RTAS_H */ 252#endif /* _POWERPC_RTAS_H */
diff --git a/arch/powerpc/include/asm/thread_info.h b/arch/powerpc/include/asm/thread_info.h
index 9aba5a38a7c4..c8b329255678 100644
--- a/arch/powerpc/include/asm/thread_info.h
+++ b/arch/powerpc/include/asm/thread_info.h
@@ -46,15 +46,13 @@ struct thread_info {
46 46
47/* 47/*
48 * macros/functions for gaining access to the thread information structure 48 * macros/functions for gaining access to the thread information structure
49 *
50 * preempt_count needs to be 1 initially, until the scheduler is functional.
51 */ 49 */
52#define INIT_THREAD_INFO(tsk) \ 50#define INIT_THREAD_INFO(tsk) \
53{ \ 51{ \
54 .task = &tsk, \ 52 .task = &tsk, \
55 .exec_domain = &default_exec_domain, \ 53 .exec_domain = &default_exec_domain, \
56 .cpu = 0, \ 54 .cpu = 0, \
57 .preempt_count = 1, \ 55 .preempt_count = INIT_PREEMPT_COUNT, \
58 .restart_block = { \ 56 .restart_block = { \
59 .fn = do_no_restart_syscall, \ 57 .fn = do_no_restart_syscall, \
60 }, \ 58 }, \
diff --git a/arch/powerpc/kernel/entry_32.S b/arch/powerpc/kernel/entry_32.S
index 4dd38f129153..3cadba60a4b6 100644
--- a/arch/powerpc/kernel/entry_32.S
+++ b/arch/powerpc/kernel/entry_32.S
@@ -191,11 +191,49 @@ transfer_to_handler_cont:
191 mflr r9 191 mflr r9
192 lwz r11,0(r9) /* virtual address of handler */ 192 lwz r11,0(r9) /* virtual address of handler */
193 lwz r9,4(r9) /* where to go when done */ 193 lwz r9,4(r9) /* where to go when done */
194#ifdef CONFIG_TRACE_IRQFLAGS
195 lis r12,reenable_mmu@h
196 ori r12,r12,reenable_mmu@l
197 mtspr SPRN_SRR0,r12
198 mtspr SPRN_SRR1,r10
199 SYNC
200 RFI
201reenable_mmu: /* re-enable mmu so we can */
202 mfmsr r10
203 lwz r12,_MSR(r1)
204 xor r10,r10,r12
205 andi. r10,r10,MSR_EE /* Did EE change? */
206 beq 1f
207
208 /* Save handler and return address into the 2 unused words
209 * of the STACK_FRAME_OVERHEAD (sneak sneak sneak). Everything
210 * else can be recovered from the pt_regs except r3 which for
211 * normal interrupts has been set to pt_regs and for syscalls
212 * is an argument, so we temporarily use ORIG_GPR3 to save it
213 */
214 stw r9,8(r1)
215 stw r11,12(r1)
216 stw r3,ORIG_GPR3(r1)
217 bl trace_hardirqs_off
218 lwz r0,GPR0(r1)
219 lwz r3,ORIG_GPR3(r1)
220 lwz r4,GPR4(r1)
221 lwz r5,GPR5(r1)
222 lwz r6,GPR6(r1)
223 lwz r7,GPR7(r1)
224 lwz r8,GPR8(r1)
225 lwz r9,8(r1)
226 lwz r11,12(r1)
2271: mtctr r11
228 mtlr r9
229 bctr /* jump to handler */
230#else /* CONFIG_TRACE_IRQFLAGS */
194 mtspr SPRN_SRR0,r11 231 mtspr SPRN_SRR0,r11
195 mtspr SPRN_SRR1,r10 232 mtspr SPRN_SRR1,r10
196 mtlr r9 233 mtlr r9
197 SYNC 234 SYNC
198 RFI /* jump to handler, enable MMU */ 235 RFI /* jump to handler, enable MMU */
236#endif /* CONFIG_TRACE_IRQFLAGS */
199 237
200#if defined (CONFIG_6xx) || defined(CONFIG_E500) 238#if defined (CONFIG_6xx) || defined(CONFIG_E500)
2014: rlwinm r12,r12,0,~_TLF_NAPPING 2394: rlwinm r12,r12,0,~_TLF_NAPPING
@@ -251,6 +289,31 @@ _GLOBAL(DoSyscall)
251#ifdef SHOW_SYSCALLS 289#ifdef SHOW_SYSCALLS
252 bl do_show_syscall 290 bl do_show_syscall
253#endif /* SHOW_SYSCALLS */ 291#endif /* SHOW_SYSCALLS */
292#ifdef CONFIG_TRACE_IRQFLAGS
293 /* Return from syscalls can (and generally will) hard enable
294 * interrupts. You aren't supposed to call a syscall with
295 * interrupts disabled in the first place. However, to ensure
296 * that we get it right vs. lockdep if it happens, we force
297 * that hard enable here with appropriate tracing if we see
298 * that we have been called with interrupts off
299 */
300 mfmsr r11
301 andi. r12,r11,MSR_EE
302 bne+ 1f
303 /* We came in with interrupts disabled, we enable them now */
304 bl trace_hardirqs_on
305 mfmsr r11
306 lwz r0,GPR0(r1)
307 lwz r3,GPR3(r1)
308 lwz r4,GPR4(r1)
309 ori r11,r11,MSR_EE
310 lwz r5,GPR5(r1)
311 lwz r6,GPR6(r1)
312 lwz r7,GPR7(r1)
313 lwz r8,GPR8(r1)
314 mtmsr r11
3151:
316#endif /* CONFIG_TRACE_IRQFLAGS */
254 rlwinm r10,r1,0,0,(31-THREAD_SHIFT) /* current_thread_info() */ 317 rlwinm r10,r1,0,0,(31-THREAD_SHIFT) /* current_thread_info() */
255 lwz r11,TI_FLAGS(r10) 318 lwz r11,TI_FLAGS(r10)
256 andi. r11,r11,_TIF_SYSCALL_T_OR_A 319 andi. r11,r11,_TIF_SYSCALL_T_OR_A
@@ -275,6 +338,7 @@ ret_from_syscall:
275 rlwinm r12,r1,0,0,(31-THREAD_SHIFT) /* current_thread_info() */ 338 rlwinm r12,r1,0,0,(31-THREAD_SHIFT) /* current_thread_info() */
276 /* disable interrupts so current_thread_info()->flags can't change */ 339 /* disable interrupts so current_thread_info()->flags can't change */
277 LOAD_MSR_KERNEL(r10,MSR_KERNEL) /* doesn't include MSR_EE */ 340 LOAD_MSR_KERNEL(r10,MSR_KERNEL) /* doesn't include MSR_EE */
341 /* Note: We don't bother telling lockdep about it */
278 SYNC 342 SYNC
279 MTMSRD(r10) 343 MTMSRD(r10)
280 lwz r9,TI_FLAGS(r12) 344 lwz r9,TI_FLAGS(r12)
@@ -288,6 +352,19 @@ ret_from_syscall:
288 oris r11,r11,0x1000 /* Set SO bit in CR */ 352 oris r11,r11,0x1000 /* Set SO bit in CR */
289 stw r11,_CCR(r1) 353 stw r11,_CCR(r1)
290syscall_exit_cont: 354syscall_exit_cont:
355 lwz r8,_MSR(r1)
356#ifdef CONFIG_TRACE_IRQFLAGS
357 /* If we are going to return from the syscall with interrupts
358 * off, we trace that here. It shouldn't happen though but we
359 * want to catch the bugger if it does right ?
360 */
361 andi. r10,r8,MSR_EE
362 bne+ 1f
363 stw r3,GPR3(r1)
364 bl trace_hardirqs_off
365 lwz r3,GPR3(r1)
3661:
367#endif /* CONFIG_TRACE_IRQFLAGS */
291#if defined(CONFIG_4xx) || defined(CONFIG_BOOKE) 368#if defined(CONFIG_4xx) || defined(CONFIG_BOOKE)
292 /* If the process has its own DBCR0 value, load it up. The internal 369 /* If the process has its own DBCR0 value, load it up. The internal
293 debug mode bit tells us that dbcr0 should be loaded. */ 370 debug mode bit tells us that dbcr0 should be loaded. */
@@ -311,7 +388,6 @@ END_FTR_SECTION_IFSET(CPU_FTR_NEED_PAIRED_STWCX)
311 mtlr r4 388 mtlr r4
312 mtcr r5 389 mtcr r5
313 lwz r7,_NIP(r1) 390 lwz r7,_NIP(r1)
314 lwz r8,_MSR(r1)
315 FIX_SRR1(r8, r0) 391 FIX_SRR1(r8, r0)
316 lwz r2,GPR2(r1) 392 lwz r2,GPR2(r1)
317 lwz r1,GPR1(r1) 393 lwz r1,GPR1(r1)
@@ -394,7 +470,9 @@ syscall_exit_work:
394 andi. r0,r9,(_TIF_SYSCALL_T_OR_A|_TIF_SINGLESTEP) 470 andi. r0,r9,(_TIF_SYSCALL_T_OR_A|_TIF_SINGLESTEP)
395 beq ret_from_except 471 beq ret_from_except
396 472
397 /* Re-enable interrupts */ 473 /* Re-enable interrupts. There is no need to trace that with
474 * lockdep as we are supposed to have IRQs on at this point
475 */
398 ori r10,r10,MSR_EE 476 ori r10,r10,MSR_EE
399 SYNC 477 SYNC
400 MTMSRD(r10) 478 MTMSRD(r10)
@@ -705,6 +783,7 @@ ret_from_except:
705 /* Hard-disable interrupts so that current_thread_info()->flags 783 /* Hard-disable interrupts so that current_thread_info()->flags
706 * can't change between when we test it and when we return 784 * can't change between when we test it and when we return
707 * from the interrupt. */ 785 * from the interrupt. */
786 /* Note: We don't bother telling lockdep about it */
708 LOAD_MSR_KERNEL(r10,MSR_KERNEL) 787 LOAD_MSR_KERNEL(r10,MSR_KERNEL)
709 SYNC /* Some chip revs have problems here... */ 788 SYNC /* Some chip revs have problems here... */
710 MTMSRD(r10) /* disable interrupts */ 789 MTMSRD(r10) /* disable interrupts */
@@ -744,11 +823,24 @@ resume_kernel:
744 beq+ restore 823 beq+ restore
745 andi. r0,r3,MSR_EE /* interrupts off? */ 824 andi. r0,r3,MSR_EE /* interrupts off? */
746 beq restore /* don't schedule if so */ 825 beq restore /* don't schedule if so */
826#ifdef CONFIG_TRACE_IRQFLAGS
827 /* Lockdep thinks irqs are enabled, we need to call
828 * preempt_schedule_irq with IRQs off, so we inform lockdep
829 * now that we -did- turn them off already
830 */
831 bl trace_hardirqs_off
832#endif
7471: bl preempt_schedule_irq 8331: bl preempt_schedule_irq
748 rlwinm r9,r1,0,0,(31-THREAD_SHIFT) 834 rlwinm r9,r1,0,0,(31-THREAD_SHIFT)
749 lwz r3,TI_FLAGS(r9) 835 lwz r3,TI_FLAGS(r9)
750 andi. r0,r3,_TIF_NEED_RESCHED 836 andi. r0,r3,_TIF_NEED_RESCHED
751 bne- 1b 837 bne- 1b
838#ifdef CONFIG_TRACE_IRQFLAGS
839 /* And now, to properly rebalance the above, we tell lockdep they
840 * are being turned back on, which will happen when we return
841 */
842 bl trace_hardirqs_on
843#endif
752#else 844#else
753resume_kernel: 845resume_kernel:
754#endif /* CONFIG_PREEMPT */ 846#endif /* CONFIG_PREEMPT */
@@ -765,6 +857,28 @@ restore:
765 stw r6,icache_44x_need_flush@l(r4) 857 stw r6,icache_44x_need_flush@l(r4)
7661: 8581:
767#endif /* CONFIG_44x */ 859#endif /* CONFIG_44x */
860
861 lwz r9,_MSR(r1)
862#ifdef CONFIG_TRACE_IRQFLAGS
863 /* Lockdep doesn't know about the fact that IRQs are temporarily turned
864 * off in this assembly code while peeking at TI_FLAGS() and such. However
865 * we need to inform it if the exception turned interrupts off, and we
866 * are about to trun them back on.
867 *
868 * The problem here sadly is that we don't know whether the exceptions was
869 * one that turned interrupts off or not. So we always tell lockdep about
870 * turning them on here when we go back to wherever we came from with EE
871 * on, even if that may meen some redudant calls being tracked. Maybe later
872 * we could encode what the exception did somewhere or test the exception
873 * type in the pt_regs but that sounds overkill
874 */
875 andi. r10,r9,MSR_EE
876 beq 1f
877 bl trace_hardirqs_on
878 lwz r9,_MSR(r1)
8791:
880#endif /* CONFIG_TRACE_IRQFLAGS */
881
768 lwz r0,GPR0(r1) 882 lwz r0,GPR0(r1)
769 lwz r2,GPR2(r1) 883 lwz r2,GPR2(r1)
770 REST_4GPRS(3, r1) 884 REST_4GPRS(3, r1)
@@ -782,7 +896,6 @@ END_FTR_SECTION_IFSET(CPU_FTR_NEED_PAIRED_STWCX)
782 stwcx. r0,0,r1 /* to clear the reservation */ 896 stwcx. r0,0,r1 /* to clear the reservation */
783 897
784#if !(defined(CONFIG_4xx) || defined(CONFIG_BOOKE)) 898#if !(defined(CONFIG_4xx) || defined(CONFIG_BOOKE))
785 lwz r9,_MSR(r1)
786 andi. r10,r9,MSR_RI /* check if this exception occurred */ 899 andi. r10,r9,MSR_RI /* check if this exception occurred */
787 beql nonrecoverable /* at a bad place (MSR:RI = 0) */ 900 beql nonrecoverable /* at a bad place (MSR:RI = 0) */
788 901
@@ -805,7 +918,6 @@ END_FTR_SECTION_IFSET(CPU_FTR_NEED_PAIRED_STWCX)
805 MTMSRD(r10) /* clear the RI bit */ 918 MTMSRD(r10) /* clear the RI bit */
806 .globl exc_exit_restart 919 .globl exc_exit_restart
807exc_exit_restart: 920exc_exit_restart:
808 lwz r9,_MSR(r1)
809 lwz r12,_NIP(r1) 921 lwz r12,_NIP(r1)
810 FIX_SRR1(r9,r10) 922 FIX_SRR1(r9,r10)
811 mtspr SPRN_SRR0,r12 923 mtspr SPRN_SRR0,r12
@@ -1035,11 +1147,18 @@ do_work: /* r10 contains MSR_KERNEL here */
1035 beq do_user_signal 1147 beq do_user_signal
1036 1148
1037do_resched: /* r10 contains MSR_KERNEL here */ 1149do_resched: /* r10 contains MSR_KERNEL here */
1150 /* Note: We don't need to inform lockdep that we are enabling
1151 * interrupts here. As far as it knows, they are already enabled
1152 */
1038 ori r10,r10,MSR_EE 1153 ori r10,r10,MSR_EE
1039 SYNC 1154 SYNC
1040 MTMSRD(r10) /* hard-enable interrupts */ 1155 MTMSRD(r10) /* hard-enable interrupts */
1041 bl schedule 1156 bl schedule
1042recheck: 1157recheck:
1158 /* Note: And we don't tell it we are disabling them again
1159 * neither. Those disable/enable cycles used to peek at
1160 * TI_FLAGS aren't advertised.
1161 */
1043 LOAD_MSR_KERNEL(r10,MSR_KERNEL) 1162 LOAD_MSR_KERNEL(r10,MSR_KERNEL)
1044 SYNC 1163 SYNC
1045 MTMSRD(r10) /* disable interrupts */ 1164 MTMSRD(r10) /* disable interrupts */
diff --git a/arch/powerpc/kernel/head_32.S b/arch/powerpc/kernel/head_32.S
index 48469463f89e..fc2132942754 100644
--- a/arch/powerpc/kernel/head_32.S
+++ b/arch/powerpc/kernel/head_32.S
@@ -1124,9 +1124,8 @@ mmu_off:
1124 RFI 1124 RFI
1125 1125
1126/* 1126/*
1127 * Use the first pair of BAT registers to map the 1st 16MB 1127 * On 601, we use 3 BATs to map up to 24M of RAM at _PAGE_OFFSET
1128 * of RAM to PAGE_OFFSET. From this point on we can't safely 1128 * (we keep one for debugging) and on others, we use one 256M BAT.
1129 * call OF any more.
1130 */ 1129 */
1131initial_bats: 1130initial_bats:
1132 lis r11,PAGE_OFFSET@h 1131 lis r11,PAGE_OFFSET@h
@@ -1136,12 +1135,16 @@ initial_bats:
1136 bne 4f 1135 bne 4f
1137 ori r11,r11,4 /* set up BAT registers for 601 */ 1136 ori r11,r11,4 /* set up BAT registers for 601 */
1138 li r8,0x7f /* valid, block length = 8MB */ 1137 li r8,0x7f /* valid, block length = 8MB */
1139 oris r9,r11,0x800000@h /* set up BAT reg for 2nd 8M */
1140 oris r10,r8,0x800000@h /* set up BAT reg for 2nd 8M */
1141 mtspr SPRN_IBAT0U,r11 /* N.B. 601 has valid bit in */ 1138 mtspr SPRN_IBAT0U,r11 /* N.B. 601 has valid bit in */
1142 mtspr SPRN_IBAT0L,r8 /* lower BAT register */ 1139 mtspr SPRN_IBAT0L,r8 /* lower BAT register */
1143 mtspr SPRN_IBAT1U,r9 1140 addis r11,r11,0x800000@h
1144 mtspr SPRN_IBAT1L,r10 1141 addis r8,r8,0x800000@h
1142 mtspr SPRN_IBAT1U,r11
1143 mtspr SPRN_IBAT1L,r8
1144 addis r11,r11,0x800000@h
1145 addis r8,r8,0x800000@h
1146 mtspr SPRN_IBAT2U,r11
1147 mtspr SPRN_IBAT2L,r8
1145 isync 1148 isync
1146 blr 1149 blr
1147 1150
diff --git a/arch/powerpc/kernel/mpc7450-pmu.c b/arch/powerpc/kernel/mpc7450-pmu.c
index 75ff47fed7bf..c244133c67a6 100644
--- a/arch/powerpc/kernel/mpc7450-pmu.c
+++ b/arch/powerpc/kernel/mpc7450-pmu.c
@@ -10,7 +10,6 @@
10 */ 10 */
11#include <linux/string.h> 11#include <linux/string.h>
12#include <linux/perf_counter.h> 12#include <linux/perf_counter.h>
13#include <linux/string.h>
14#include <asm/reg.h> 13#include <asm/reg.h>
15#include <asm/cputable.h> 14#include <asm/cputable.h>
16 15
diff --git a/arch/powerpc/kernel/of_device.c b/arch/powerpc/kernel/of_device.c
index fa983a59c4ce..a359cb08e900 100644
--- a/arch/powerpc/kernel/of_device.c
+++ b/arch/powerpc/kernel/of_device.c
@@ -76,7 +76,7 @@ struct of_device *of_device_alloc(struct device_node *np,
76 dev->dev.archdata.of_node = np; 76 dev->dev.archdata.of_node = np;
77 77
78 if (bus_id) 78 if (bus_id)
79 dev_set_name(&dev->dev, bus_id); 79 dev_set_name(&dev->dev, "%s", bus_id);
80 else 80 else
81 of_device_make_bus_id(dev); 81 of_device_make_bus_id(dev);
82 82
diff --git a/arch/powerpc/kernel/power7-pmu.c b/arch/powerpc/kernel/power7-pmu.c
index 5d755ef7ac8f..5a9f5cbd40a4 100644
--- a/arch/powerpc/kernel/power7-pmu.c
+++ b/arch/powerpc/kernel/power7-pmu.c
@@ -358,6 +358,7 @@ static struct power_pmu power7_pmu = {
358 .get_constraint = power7_get_constraint, 358 .get_constraint = power7_get_constraint,
359 .get_alternatives = power7_get_alternatives, 359 .get_alternatives = power7_get_alternatives,
360 .disable_pmc = power7_disable_pmc, 360 .disable_pmc = power7_disable_pmc,
361 .flags = PPMU_ALT_SIPR,
361 .n_generic = ARRAY_SIZE(power7_generic_events), 362 .n_generic = ARRAY_SIZE(power7_generic_events),
362 .generic_events = power7_generic_events, 363 .generic_events = power7_generic_events,
363 .cache_events = &power7_cache_events, 364 .cache_events = &power7_cache_events,
diff --git a/arch/powerpc/kernel/ppc970-pmu.c b/arch/powerpc/kernel/ppc970-pmu.c
index 6637c87fe70e..833097ac45dc 100644
--- a/arch/powerpc/kernel/ppc970-pmu.c
+++ b/arch/powerpc/kernel/ppc970-pmu.c
@@ -10,7 +10,6 @@
10 */ 10 */
11#include <linux/string.h> 11#include <linux/string.h>
12#include <linux/perf_counter.h> 12#include <linux/perf_counter.h>
13#include <linux/string.h>
14#include <asm/reg.h> 13#include <asm/reg.h>
15#include <asm/cputable.h> 14#include <asm/cputable.h>
16 15
diff --git a/arch/powerpc/kernel/process.c b/arch/powerpc/kernel/process.c
index 3e7135bbe40f..892a9f2e6d76 100644
--- a/arch/powerpc/kernel/process.c
+++ b/arch/powerpc/kernel/process.c
@@ -528,7 +528,7 @@ void show_regs(struct pt_regs * regs)
528 528
529 for (i = 0; i < 32; i++) { 529 for (i = 0; i < 32; i++) {
530 if ((i % REGS_PER_LINE) == 0) 530 if ((i % REGS_PER_LINE) == 0)
531 printk("\n" KERN_INFO "GPR%02d: ", i); 531 printk("\nGPR%02d: ", i);
532 printk(REG " ", regs->gpr[i]); 532 printk(REG " ", regs->gpr[i]);
533 if (i == LAST_VOLATILE && !FULL_REGS(regs)) 533 if (i == LAST_VOLATILE && !FULL_REGS(regs))
534 break; 534 break;
diff --git a/arch/powerpc/kernel/ptrace.c b/arch/powerpc/kernel/ptrace.c
index 9fa2c7dcd05a..ef149880c145 100644
--- a/arch/powerpc/kernel/ptrace.c
+++ b/arch/powerpc/kernel/ptrace.c
@@ -736,15 +736,16 @@ void user_disable_single_step(struct task_struct *task)
736{ 736{
737 struct pt_regs *regs = task->thread.regs; 737 struct pt_regs *regs = task->thread.regs;
738 738
739
740#if defined(CONFIG_BOOKE)
741 /* If DAC then do not single step, skip */
742 if (task->thread.dabr)
743 return;
744#endif
745
746 if (regs != NULL) { 739 if (regs != NULL) {
747#if defined(CONFIG_40x) || defined(CONFIG_BOOKE) 740#if defined(CONFIG_BOOKE)
741 /* If DAC don't clear DBCRO_IDM or MSR_DE */
742 if (task->thread.dabr)
743 task->thread.dbcr0 &= ~(DBCR0_IC | DBCR0_BT);
744 else {
745 task->thread.dbcr0 &= ~(DBCR0_IC | DBCR0_BT | DBCR0_IDM);
746 regs->msr &= ~MSR_DE;
747 }
748#elif defined(CONFIG_40x)
748 task->thread.dbcr0 &= ~(DBCR0_IC | DBCR0_BT | DBCR0_IDM); 749 task->thread.dbcr0 &= ~(DBCR0_IC | DBCR0_BT | DBCR0_IDM);
749 regs->msr &= ~MSR_DE; 750 regs->msr &= ~MSR_DE;
750#else 751#else
diff --git a/arch/powerpc/kernel/ptrace32.c b/arch/powerpc/kernel/ptrace32.c
index 297632cba047..8a6daf4129f6 100644
--- a/arch/powerpc/kernel/ptrace32.c
+++ b/arch/powerpc/kernel/ptrace32.c
@@ -21,7 +21,6 @@
21#include <linux/sched.h> 21#include <linux/sched.h>
22#include <linux/mm.h> 22#include <linux/mm.h>
23#include <linux/smp.h> 23#include <linux/smp.h>
24#include <linux/smp_lock.h>
25#include <linux/errno.h> 24#include <linux/errno.h>
26#include <linux/ptrace.h> 25#include <linux/ptrace.h>
27#include <linux/regset.h> 26#include <linux/regset.h>
diff --git a/arch/powerpc/kernel/rtas.c b/arch/powerpc/kernel/rtas.c
index ee4c7609b649..c434823b8c83 100644
--- a/arch/powerpc/kernel/rtas.c
+++ b/arch/powerpc/kernel/rtas.c
@@ -38,9 +38,10 @@
38#include <asm/syscalls.h> 38#include <asm/syscalls.h>
39#include <asm/smp.h> 39#include <asm/smp.h>
40#include <asm/atomic.h> 40#include <asm/atomic.h>
41#include <asm/time.h>
41 42
42struct rtas_t rtas = { 43struct rtas_t rtas = {
43 .lock = SPIN_LOCK_UNLOCKED 44 .lock = __RAW_SPIN_LOCK_UNLOCKED
44}; 45};
45EXPORT_SYMBOL(rtas); 46EXPORT_SYMBOL(rtas);
46 47
@@ -67,6 +68,28 @@ unsigned long rtas_rmo_buf;
67void (*rtas_flash_term_hook)(int); 68void (*rtas_flash_term_hook)(int);
68EXPORT_SYMBOL(rtas_flash_term_hook); 69EXPORT_SYMBOL(rtas_flash_term_hook);
69 70
71/* RTAS use home made raw locking instead of spin_lock_irqsave
72 * because those can be called from within really nasty contexts
73 * such as having the timebase stopped which would lockup with
74 * normal locks and spinlock debugging enabled
75 */
76static unsigned long lock_rtas(void)
77{
78 unsigned long flags;
79
80 local_irq_save(flags);
81 preempt_disable();
82 __raw_spin_lock_flags(&rtas.lock, flags);
83 return flags;
84}
85
86static void unlock_rtas(unsigned long flags)
87{
88 __raw_spin_unlock(&rtas.lock);
89 local_irq_restore(flags);
90 preempt_enable();
91}
92
70/* 93/*
71 * call_rtas_display_status and call_rtas_display_status_delay 94 * call_rtas_display_status and call_rtas_display_status_delay
72 * are designed only for very early low-level debugging, which 95 * are designed only for very early low-level debugging, which
@@ -79,7 +102,7 @@ static void call_rtas_display_status(char c)
79 102
80 if (!rtas.base) 103 if (!rtas.base)
81 return; 104 return;
82 spin_lock_irqsave(&rtas.lock, s); 105 s = lock_rtas();
83 106
84 args->token = 10; 107 args->token = 10;
85 args->nargs = 1; 108 args->nargs = 1;
@@ -89,7 +112,7 @@ static void call_rtas_display_status(char c)
89 112
90 enter_rtas(__pa(args)); 113 enter_rtas(__pa(args));
91 114
92 spin_unlock_irqrestore(&rtas.lock, s); 115 unlock_rtas(s);
93} 116}
94 117
95static void call_rtas_display_status_delay(char c) 118static void call_rtas_display_status_delay(char c)
@@ -411,8 +434,7 @@ int rtas_call(int token, int nargs, int nret, int *outputs, ...)
411 if (!rtas.entry || token == RTAS_UNKNOWN_SERVICE) 434 if (!rtas.entry || token == RTAS_UNKNOWN_SERVICE)
412 return -1; 435 return -1;
413 436
414 /* Gotta do something different here, use global lock for now... */ 437 s = lock_rtas();
415 spin_lock_irqsave(&rtas.lock, s);
416 rtas_args = &rtas.args; 438 rtas_args = &rtas.args;
417 439
418 rtas_args->token = token; 440 rtas_args->token = token;
@@ -439,8 +461,7 @@ int rtas_call(int token, int nargs, int nret, int *outputs, ...)
439 outputs[i] = rtas_args->rets[i+1]; 461 outputs[i] = rtas_args->rets[i+1];
440 ret = (nret > 0)? rtas_args->rets[0]: 0; 462 ret = (nret > 0)? rtas_args->rets[0]: 0;
441 463
442 /* Gotta do something different here, use global lock for now... */ 464 unlock_rtas(s);
443 spin_unlock_irqrestore(&rtas.lock, s);
444 465
445 if (buff_copy) { 466 if (buff_copy) {
446 log_error(buff_copy, ERR_TYPE_RTAS_LOG, 0); 467 log_error(buff_copy, ERR_TYPE_RTAS_LOG, 0);
@@ -837,7 +858,7 @@ asmlinkage int ppc_rtas(struct rtas_args __user *uargs)
837 858
838 buff_copy = get_errorlog_buffer(); 859 buff_copy = get_errorlog_buffer();
839 860
840 spin_lock_irqsave(&rtas.lock, flags); 861 flags = lock_rtas();
841 862
842 rtas.args = args; 863 rtas.args = args;
843 enter_rtas(__pa(&rtas.args)); 864 enter_rtas(__pa(&rtas.args));
@@ -848,7 +869,7 @@ asmlinkage int ppc_rtas(struct rtas_args __user *uargs)
848 if (args.rets[0] == -1) 869 if (args.rets[0] == -1)
849 errbuf = __fetch_rtas_last_error(buff_copy); 870 errbuf = __fetch_rtas_last_error(buff_copy);
850 871
851 spin_unlock_irqrestore(&rtas.lock, flags); 872 unlock_rtas(flags);
852 873
853 if (buff_copy) { 874 if (buff_copy) {
854 if (errbuf) 875 if (errbuf)
@@ -951,3 +972,33 @@ int __init early_init_dt_scan_rtas(unsigned long node,
951 /* break now */ 972 /* break now */
952 return 1; 973 return 1;
953} 974}
975
976static raw_spinlock_t timebase_lock;
977static u64 timebase = 0;
978
979void __cpuinit rtas_give_timebase(void)
980{
981 unsigned long flags;
982
983 local_irq_save(flags);
984 hard_irq_disable();
985 __raw_spin_lock(&timebase_lock);
986 rtas_call(rtas_token("freeze-time-base"), 0, 1, NULL);
987 timebase = get_tb();
988 __raw_spin_unlock(&timebase_lock);
989
990 while (timebase)
991 barrier();
992 rtas_call(rtas_token("thaw-time-base"), 0, 1, NULL);
993 local_irq_restore(flags);
994}
995
996void __cpuinit rtas_take_timebase(void)
997{
998 while (!timebase)
999 barrier();
1000 __raw_spin_lock(&timebase_lock);
1001 set_tb(timebase >> 32, timebase & 0xffffffff);
1002 timebase = 0;
1003 __raw_spin_unlock(&timebase_lock);
1004}
diff --git a/arch/powerpc/kernel/setup_32.c b/arch/powerpc/kernel/setup_32.c
index 1d154248cf40..e1e3059cf34b 100644
--- a/arch/powerpc/kernel/setup_32.c
+++ b/arch/powerpc/kernel/setup_32.c
@@ -119,6 +119,8 @@ notrace unsigned long __init early_init(unsigned long dt_ptr)
119 */ 119 */
120notrace void __init machine_init(unsigned long dt_ptr) 120notrace void __init machine_init(unsigned long dt_ptr)
121{ 121{
122 lockdep_init();
123
122 /* Enable early debugging if any specified (see udbg.h) */ 124 /* Enable early debugging if any specified (see udbg.h) */
123 udbg_early_init(); 125 udbg_early_init();
124 126
diff --git a/arch/powerpc/kernel/smp.c b/arch/powerpc/kernel/smp.c
index 65484b2200b3..0b47de07302d 100644
--- a/arch/powerpc/kernel/smp.c
+++ b/arch/powerpc/kernel/smp.c
@@ -68,7 +68,8 @@ EXPORT_PER_CPU_SYMBOL(cpu_core_map);
68/* SMP operations for this machine */ 68/* SMP operations for this machine */
69struct smp_ops_t *smp_ops; 69struct smp_ops_t *smp_ops;
70 70
71static volatile unsigned int cpu_callin_map[NR_CPUS]; 71/* Can't be static due to PowerMac hackery */
72volatile unsigned int cpu_callin_map[NR_CPUS];
72 73
73int smt_enabled_at_boot = 1; 74int smt_enabled_at_boot = 1;
74 75
diff --git a/arch/powerpc/kernel/udbg_16550.c b/arch/powerpc/kernel/udbg_16550.c
index 0362a891e54e..acb74a17bbbf 100644
--- a/arch/powerpc/kernel/udbg_16550.c
+++ b/arch/powerpc/kernel/udbg_16550.c
@@ -219,7 +219,7 @@ void udbg_init_pas_realmode(void)
219#ifdef CONFIG_PPC_EARLY_DEBUG_44x 219#ifdef CONFIG_PPC_EARLY_DEBUG_44x
220#include <platforms/44x/44x.h> 220#include <platforms/44x/44x.h>
221 221
222static int udbg_44x_as1_flush(void) 222static void udbg_44x_as1_flush(void)
223{ 223{
224 if (udbg_comport) { 224 if (udbg_comport) {
225 while ((as1_readb(&udbg_comport->lsr) & LSR_THRE) == 0) 225 while ((as1_readb(&udbg_comport->lsr) & LSR_THRE) == 0)
diff --git a/arch/powerpc/kernel/vector.S b/arch/powerpc/kernel/vector.S
index ef36cbbc5882..ea4d64644d02 100644
--- a/arch/powerpc/kernel/vector.S
+++ b/arch/powerpc/kernel/vector.S
@@ -80,10 +80,10 @@ _GLOBAL(load_up_altivec)
80 mtvscr vr0 80 mtvscr vr0
81 REST_32VRS(0,r4,r5) 81 REST_32VRS(0,r4,r5)
82#ifndef CONFIG_SMP 82#ifndef CONFIG_SMP
83 /* Update last_task_used_math to 'current' */ 83 /* Update last_task_used_altivec to 'current' */
84 subi r4,r5,THREAD /* Back to 'current' */ 84 subi r4,r5,THREAD /* Back to 'current' */
85 fromreal(r4) 85 fromreal(r4)
86 PPC_STL r4,ADDROFF(last_task_used_math)(r3) 86 PPC_STL r4,ADDROFF(last_task_used_altivec)(r3)
87#endif /* CONFIG_SMP */ 87#endif /* CONFIG_SMP */
88 /* restore registers and return */ 88 /* restore registers and return */
89 blr 89 blr
@@ -172,7 +172,7 @@ _GLOBAL(load_up_vsx)
172 oris r12,r12,MSR_VSX@h 172 oris r12,r12,MSR_VSX@h
173 std r12,_MSR(r1) 173 std r12,_MSR(r1)
174#ifndef CONFIG_SMP 174#ifndef CONFIG_SMP
175 /* Update last_task_used_math to 'current' */ 175 /* Update last_task_used_vsx to 'current' */
176 ld r4,PACACURRENT(r13) 176 ld r4,PACACURRENT(r13)
177 std r4,0(r3) 177 std r4,0(r3)
178#endif /* CONFIG_SMP */ 178#endif /* CONFIG_SMP */
diff --git a/arch/powerpc/mm/Makefile b/arch/powerpc/mm/Makefile
index 2d2192e48de7..3e68363405b7 100644
--- a/arch/powerpc/mm/Makefile
+++ b/arch/powerpc/mm/Makefile
@@ -30,3 +30,4 @@ obj-$(CONFIG_PPC_MM_SLICES) += slice.o
30obj-$(CONFIG_HUGETLB_PAGE) += hugetlbpage.o 30obj-$(CONFIG_HUGETLB_PAGE) += hugetlbpage.o
31obj-$(CONFIG_PPC_SUBPAGE_PROT) += subpage-prot.o 31obj-$(CONFIG_PPC_SUBPAGE_PROT) += subpage-prot.o
32obj-$(CONFIG_NOT_COHERENT_CACHE) += dma-noncoherent.o 32obj-$(CONFIG_NOT_COHERENT_CACHE) += dma-noncoherent.o
33obj-$(CONFIG_HIGHMEM) += highmem.o
diff --git a/arch/powerpc/mm/gup.c b/arch/powerpc/mm/gup.c
index bc400c78c97f..bc122a120bf0 100644
--- a/arch/powerpc/mm/gup.c
+++ b/arch/powerpc/mm/gup.c
@@ -159,7 +159,7 @@ int get_user_pages_fast(unsigned long start, int nr_pages, int write,
159 int psize; 159 int psize;
160#endif 160#endif
161 161
162 pr_debug("%s(%lx,%x,%s)\n", __func__, start, nr_pages, write ? "write" : "read"); 162 pr_devel("%s(%lx,%x,%s)\n", __func__, start, nr_pages, write ? "write" : "read");
163 163
164 start &= PAGE_MASK; 164 start &= PAGE_MASK;
165 addr = start; 165 addr = start;
@@ -170,7 +170,7 @@ int get_user_pages_fast(unsigned long start, int nr_pages, int write,
170 start, len))) 170 start, len)))
171 goto slow_irqon; 171 goto slow_irqon;
172 172
173 pr_debug(" aligned: %lx .. %lx\n", start, end); 173 pr_devel(" aligned: %lx .. %lx\n", start, end);
174 174
175#ifdef CONFIG_HUGETLB_PAGE 175#ifdef CONFIG_HUGETLB_PAGE
176 /* We bail out on slice boundary crossing when hugetlb is 176 /* We bail out on slice boundary crossing when hugetlb is
@@ -234,7 +234,7 @@ int get_user_pages_fast(unsigned long start, int nr_pages, int write,
234 do { 234 do {
235 VM_BUG_ON(shift != mmu_psize_defs[get_slice_psize(mm, a)].shift); 235 VM_BUG_ON(shift != mmu_psize_defs[get_slice_psize(mm, a)].shift);
236 ptep = huge_pte_offset(mm, a); 236 ptep = huge_pte_offset(mm, a);
237 pr_debug(" %016lx: huge ptep %p\n", a, ptep); 237 pr_devel(" %016lx: huge ptep %p\n", a, ptep);
238 if (!ptep || !gup_huge_pte(ptep, hstate, &a, end, write, pages, 238 if (!ptep || !gup_huge_pte(ptep, hstate, &a, end, write, pages,
239 &nr)) 239 &nr))
240 goto slow; 240 goto slow;
@@ -249,7 +249,7 @@ int get_user_pages_fast(unsigned long start, int nr_pages, int write,
249#ifdef CONFIG_PPC64 249#ifdef CONFIG_PPC64
250 VM_BUG_ON(shift != mmu_psize_defs[get_slice_psize(mm, addr)].shift); 250 VM_BUG_ON(shift != mmu_psize_defs[get_slice_psize(mm, addr)].shift);
251#endif 251#endif
252 pr_debug(" %016lx: normal pgd %p\n", addr, 252 pr_devel(" %016lx: normal pgd %p\n", addr,
253 (void *)pgd_val(pgd)); 253 (void *)pgd_val(pgd));
254 next = pgd_addr_end(addr, end); 254 next = pgd_addr_end(addr, end);
255 if (pgd_none(pgd)) 255 if (pgd_none(pgd))
@@ -269,7 +269,7 @@ int get_user_pages_fast(unsigned long start, int nr_pages, int write,
269slow: 269slow:
270 local_irq_enable(); 270 local_irq_enable();
271slow_irqon: 271slow_irqon:
272 pr_debug(" slow path ! nr = %d\n", nr); 272 pr_devel(" slow path ! nr = %d\n", nr);
273 273
274 /* Try to get the remaining pages with get_user_pages */ 274 /* Try to get the remaining pages with get_user_pages */
275 start += nr << PAGE_SHIFT; 275 start += nr << PAGE_SHIFT;
diff --git a/arch/powerpc/mm/highmem.c b/arch/powerpc/mm/highmem.c
new file mode 100644
index 000000000000..c2186c74c85a
--- /dev/null
+++ b/arch/powerpc/mm/highmem.c
@@ -0,0 +1,77 @@
1/*
2 * highmem.c: virtual kernel memory mappings for high memory
3 *
4 * PowerPC version, stolen from the i386 version.
5 *
6 * Used in CONFIG_HIGHMEM systems for memory pages which
7 * are not addressable by direct kernel virtual addresses.
8 *
9 * Copyright (C) 1999 Gerhard Wichert, Siemens AG
10 * Gerhard.Wichert@pdb.siemens.de
11 *
12 *
13 * Redesigned the x86 32-bit VM architecture to deal with
14 * up to 16 Terrabyte physical memory. With current x86 CPUs
15 * we now support up to 64 Gigabytes physical RAM.
16 *
17 * Copyright (C) 1999 Ingo Molnar <mingo@redhat.com>
18 *
19 * Reworked for PowerPC by various contributors. Moved from
20 * highmem.h by Benjamin Herrenschmidt (c) 2009 IBM Corp.
21 */
22
23#include <linux/highmem.h>
24#include <linux/module.h>
25
26/*
27 * The use of kmap_atomic/kunmap_atomic is discouraged - kmap/kunmap
28 * gives a more generic (and caching) interface. But kmap_atomic can
29 * be used in IRQ contexts, so in some (very limited) cases we need
30 * it.
31 */
32void *kmap_atomic_prot(struct page *page, enum km_type type, pgprot_t prot)
33{
34 unsigned int idx;
35 unsigned long vaddr;
36
37 /* even !CONFIG_PREEMPT needs this, for in_atomic in do_page_fault */
38 pagefault_disable();
39 if (!PageHighMem(page))
40 return page_address(page);
41
42 debug_kmap_atomic(type);
43 idx = type + KM_TYPE_NR*smp_processor_id();
44 vaddr = __fix_to_virt(FIX_KMAP_BEGIN + idx);
45#ifdef CONFIG_DEBUG_HIGHMEM
46 BUG_ON(!pte_none(*(kmap_pte-idx)));
47#endif
48 __set_pte_at(&init_mm, vaddr, kmap_pte-idx, mk_pte(page, prot), 1);
49 local_flush_tlb_page(NULL, vaddr);
50
51 return (void*) vaddr;
52}
53EXPORT_SYMBOL(kmap_atomic_prot);
54
55void kunmap_atomic(void *kvaddr, enum km_type type)
56{
57#ifdef CONFIG_DEBUG_HIGHMEM
58 unsigned long vaddr = (unsigned long) kvaddr & PAGE_MASK;
59 enum fixed_addresses idx = type + KM_TYPE_NR*smp_processor_id();
60
61 if (vaddr < __fix_to_virt(FIX_KMAP_END)) {
62 pagefault_enable();
63 return;
64 }
65
66 BUG_ON(vaddr != __fix_to_virt(FIX_KMAP_BEGIN + idx));
67
68 /*
69 * force other mappings to Oops if they'll try to access
70 * this pte without first remap it
71 */
72 pte_clear(&init_mm, vaddr, kmap_pte-idx);
73 local_flush_tlb_page(NULL, vaddr);
74#endif
75 pagefault_enable();
76}
77EXPORT_SYMBOL(kunmap_atomic);
diff --git a/arch/powerpc/mm/mmu_context_nohash.c b/arch/powerpc/mm/mmu_context_nohash.c
index 8343986809c0..92a197117d5b 100644
--- a/arch/powerpc/mm/mmu_context_nohash.c
+++ b/arch/powerpc/mm/mmu_context_nohash.c
@@ -89,7 +89,7 @@ static unsigned int steal_context_smp(unsigned int id)
89 id = first_context; 89 id = first_context;
90 continue; 90 continue;
91 } 91 }
92 pr_debug("[%d] steal context %d from mm @%p\n", 92 pr_devel("[%d] steal context %d from mm @%p\n",
93 smp_processor_id(), id, mm); 93 smp_processor_id(), id, mm);
94 94
95 /* Mark this mm has having no context anymore */ 95 /* Mark this mm has having no context anymore */
@@ -126,7 +126,7 @@ static unsigned int steal_context_up(unsigned int id)
126 /* Pick up the victim mm */ 126 /* Pick up the victim mm */
127 mm = context_mm[id]; 127 mm = context_mm[id];
128 128
129 pr_debug("[%d] steal context %d from mm @%p\n", cpu, id, mm); 129 pr_devel("[%d] steal context %d from mm @%p\n", cpu, id, mm);
130 130
131 /* Flush the TLB for that context */ 131 /* Flush the TLB for that context */
132 local_flush_tlb_mm(mm); 132 local_flush_tlb_mm(mm);
@@ -180,7 +180,7 @@ void switch_mmu_context(struct mm_struct *prev, struct mm_struct *next)
180 spin_lock(&context_lock); 180 spin_lock(&context_lock);
181 181
182#ifndef DEBUG_STEAL_ONLY 182#ifndef DEBUG_STEAL_ONLY
183 pr_debug("[%d] activating context for mm @%p, active=%d, id=%d\n", 183 pr_devel("[%d] activating context for mm @%p, active=%d, id=%d\n",
184 cpu, next, next->context.active, next->context.id); 184 cpu, next, next->context.active, next->context.id);
185#endif 185#endif
186 186
@@ -189,7 +189,7 @@ void switch_mmu_context(struct mm_struct *prev, struct mm_struct *next)
189 next->context.active++; 189 next->context.active++;
190 if (prev) { 190 if (prev) {
191#ifndef DEBUG_STEAL_ONLY 191#ifndef DEBUG_STEAL_ONLY
192 pr_debug(" old context %p active was: %d\n", 192 pr_devel(" old context %p active was: %d\n",
193 prev, prev->context.active); 193 prev, prev->context.active);
194#endif 194#endif
195 WARN_ON(prev->context.active < 1); 195 WARN_ON(prev->context.active < 1);
@@ -236,7 +236,7 @@ void switch_mmu_context(struct mm_struct *prev, struct mm_struct *next)
236 next->context.id = id; 236 next->context.id = id;
237 237
238#ifndef DEBUG_STEAL_ONLY 238#ifndef DEBUG_STEAL_ONLY
239 pr_debug("[%d] picked up new id %d, nrf is now %d\n", 239 pr_devel("[%d] picked up new id %d, nrf is now %d\n",
240 cpu, id, nr_free_contexts); 240 cpu, id, nr_free_contexts);
241#endif 241#endif
242 242
@@ -247,7 +247,7 @@ void switch_mmu_context(struct mm_struct *prev, struct mm_struct *next)
247 * local TLB for it and unmark it before we use it 247 * local TLB for it and unmark it before we use it
248 */ 248 */
249 if (test_bit(id, stale_map[cpu])) { 249 if (test_bit(id, stale_map[cpu])) {
250 pr_debug("[%d] flushing stale context %d for mm @%p !\n", 250 pr_devel("[%d] flushing stale context %d for mm @%p !\n",
251 cpu, id, next); 251 cpu, id, next);
252 local_flush_tlb_mm(next); 252 local_flush_tlb_mm(next);
253 253
@@ -314,13 +314,13 @@ static int __cpuinit mmu_context_cpu_notify(struct notifier_block *self,
314 switch (action) { 314 switch (action) {
315 case CPU_ONLINE: 315 case CPU_ONLINE:
316 case CPU_ONLINE_FROZEN: 316 case CPU_ONLINE_FROZEN:
317 pr_debug("MMU: Allocating stale context map for CPU %d\n", cpu); 317 pr_devel("MMU: Allocating stale context map for CPU %d\n", cpu);
318 stale_map[cpu] = kzalloc(CTX_MAP_SIZE, GFP_KERNEL); 318 stale_map[cpu] = kzalloc(CTX_MAP_SIZE, GFP_KERNEL);
319 break; 319 break;
320#ifdef CONFIG_HOTPLUG_CPU 320#ifdef CONFIG_HOTPLUG_CPU
321 case CPU_DEAD: 321 case CPU_DEAD:
322 case CPU_DEAD_FROZEN: 322 case CPU_DEAD_FROZEN:
323 pr_debug("MMU: Freeing stale context map for CPU %d\n", cpu); 323 pr_devel("MMU: Freeing stale context map for CPU %d\n", cpu);
324 kfree(stale_map[cpu]); 324 kfree(stale_map[cpu]);
325 stale_map[cpu] = NULL; 325 stale_map[cpu] = NULL;
326 break; 326 break;
diff --git a/arch/powerpc/mm/pgtable.c b/arch/powerpc/mm/pgtable.c
index ae1d67cc090c..627767d6169b 100644
--- a/arch/powerpc/mm/pgtable.c
+++ b/arch/powerpc/mm/pgtable.c
@@ -129,12 +129,12 @@ static pte_t do_dcache_icache_coherency(pte_t pte)
129 page = pfn_to_page(pfn); 129 page = pfn_to_page(pfn);
130 130
131 if (!PageReserved(page) && !test_bit(PG_arch_1, &page->flags)) { 131 if (!PageReserved(page) && !test_bit(PG_arch_1, &page->flags)) {
132 pr_debug("do_dcache_icache_coherency... flushing\n"); 132 pr_devel("do_dcache_icache_coherency... flushing\n");
133 flush_dcache_icache_page(page); 133 flush_dcache_icache_page(page);
134 set_bit(PG_arch_1, &page->flags); 134 set_bit(PG_arch_1, &page->flags);
135 } 135 }
136 else 136 else
137 pr_debug("do_dcache_icache_coherency... already clean\n"); 137 pr_devel("do_dcache_icache_coherency... already clean\n");
138 return __pte(pte_val(pte) | _PAGE_HWEXEC); 138 return __pte(pte_val(pte) | _PAGE_HWEXEC);
139} 139}
140 140
diff --git a/arch/powerpc/mm/slb.c b/arch/powerpc/mm/slb.c
index 3b52c80e5e33..5b7038f248b6 100644
--- a/arch/powerpc/mm/slb.c
+++ b/arch/powerpc/mm/slb.c
@@ -14,8 +14,6 @@
14 * 2 of the License, or (at your option) any later version. 14 * 2 of the License, or (at your option) any later version.
15 */ 15 */
16 16
17#undef DEBUG
18
19#include <asm/pgtable.h> 17#include <asm/pgtable.h>
20#include <asm/mmu.h> 18#include <asm/mmu.h>
21#include <asm/mmu_context.h> 19#include <asm/mmu_context.h>
@@ -27,11 +25,6 @@
27#include <linux/compiler.h> 25#include <linux/compiler.h>
28#include <asm/udbg.h> 26#include <asm/udbg.h>
29 27
30#ifdef DEBUG
31#define DBG(fmt...) printk(fmt)
32#else
33#define DBG pr_debug
34#endif
35 28
36extern void slb_allocate_realmode(unsigned long ea); 29extern void slb_allocate_realmode(unsigned long ea);
37extern void slb_allocate_user(unsigned long ea); 30extern void slb_allocate_user(unsigned long ea);
@@ -285,13 +278,13 @@ void slb_initialize(void)
285 patch_slb_encoding(slb_compare_rr_to_size, 278 patch_slb_encoding(slb_compare_rr_to_size,
286 mmu_slb_size); 279 mmu_slb_size);
287 280
288 DBG("SLB: linear LLP = %04lx\n", linear_llp); 281 pr_devel("SLB: linear LLP = %04lx\n", linear_llp);
289 DBG("SLB: io LLP = %04lx\n", io_llp); 282 pr_devel("SLB: io LLP = %04lx\n", io_llp);
290 283
291#ifdef CONFIG_SPARSEMEM_VMEMMAP 284#ifdef CONFIG_SPARSEMEM_VMEMMAP
292 patch_slb_encoding(slb_miss_kernel_load_vmemmap, 285 patch_slb_encoding(slb_miss_kernel_load_vmemmap,
293 SLB_VSID_KERNEL | vmemmap_llp); 286 SLB_VSID_KERNEL | vmemmap_llp);
294 DBG("SLB: vmemmap LLP = %04lx\n", vmemmap_llp); 287 pr_devel("SLB: vmemmap LLP = %04lx\n", vmemmap_llp);
295#endif 288#endif
296 } 289 }
297 290
diff --git a/arch/powerpc/mm/tlb_hash64.c b/arch/powerpc/mm/tlb_hash64.c
index 1be1b5e59796..937eb90677d9 100644
--- a/arch/powerpc/mm/tlb_hash64.c
+++ b/arch/powerpc/mm/tlb_hash64.c
@@ -72,7 +72,7 @@ void hpte_need_flush(struct mm_struct *mm, unsigned long addr,
72 */ 72 */
73 if (huge) { 73 if (huge) {
74#ifdef CONFIG_HUGETLB_PAGE 74#ifdef CONFIG_HUGETLB_PAGE
75 psize = get_slice_psize(mm, addr);; 75 psize = get_slice_psize(mm, addr);
76#else 76#else
77 BUG(); 77 BUG();
78 psize = pte_pagesize_index(mm, addr, pte); /* shutup gcc */ 78 psize = pte_pagesize_index(mm, addr, pte); /* shutup gcc */
diff --git a/arch/powerpc/oprofile/cell/vma_map.c b/arch/powerpc/oprofile/cell/vma_map.c
index 258fa4411e9e..c591339daf58 100644
--- a/arch/powerpc/oprofile/cell/vma_map.c
+++ b/arch/powerpc/oprofile/cell/vma_map.c
@@ -185,7 +185,7 @@ struct vma_to_fileoffset_map *create_vma_map(const struct spu *aSpu,
185 goto fail; 185 goto fail;
186 186
187 if (shdr_str.sh_type != SHT_STRTAB) 187 if (shdr_str.sh_type != SHT_STRTAB)
188 goto fail;; 188 goto fail;
189 189
190 for (j = 0; j < shdr.sh_size / sizeof (sym); j++) { 190 for (j = 0; j < shdr.sh_size / sizeof (sym); j++) {
191 if (copy_from_user(&sym, spu_elf_start + 191 if (copy_from_user(&sym, spu_elf_start +
diff --git a/arch/powerpc/platforms/44x/warp.c b/arch/powerpc/platforms/44x/warp.c
index 42e09a9f77e2..e5c1b096c3e1 100644
--- a/arch/powerpc/platforms/44x/warp.c
+++ b/arch/powerpc/platforms/44x/warp.c
@@ -16,6 +16,7 @@
16#include <linux/interrupt.h> 16#include <linux/interrupt.h>
17#include <linux/delay.h> 17#include <linux/delay.h>
18#include <linux/of_gpio.h> 18#include <linux/of_gpio.h>
19#include <linux/of_i2c.h>
19 20
20#include <asm/machdep.h> 21#include <asm/machdep.h>
21#include <asm/prom.h> 22#include <asm/prom.h>
@@ -63,9 +64,6 @@ define_machine(warp) {
63}; 64};
64 65
65 66
66static u32 post_info;
67
68/* I am not sure this is the best place for this... */
69static int __init warp_post_info(void) 67static int __init warp_post_info(void)
70{ 68{
71 struct device_node *np; 69 struct device_node *np;
@@ -87,10 +85,9 @@ static int __init warp_post_info(void)
87 85
88 iounmap(fpga); 86 iounmap(fpga);
89 87
90 if (post1 || post2) { 88 if (post1 || post2)
91 printk(KERN_INFO "Warp POST %08x %08x\n", post1, post2); 89 printk(KERN_INFO "Warp POST %08x %08x\n", post1, post2);
92 post_info = 1; 90 else
93 } else
94 printk(KERN_INFO "Warp POST OK\n"); 91 printk(KERN_INFO "Warp POST OK\n");
95 92
96 return 0; 93 return 0;
@@ -166,6 +163,9 @@ static irqreturn_t temp_isr(int irq, void *context)
166 value ^= 1; 163 value ^= 1;
167 mdelay(500); 164 mdelay(500);
168 } 165 }
166
167 /* Not reached */
168 return IRQ_HANDLED;
169} 169}
170 170
171static int pika_setup_leds(void) 171static int pika_setup_leds(void)
@@ -179,24 +179,19 @@ static int pika_setup_leds(void)
179 } 179 }
180 180
181 for_each_child_of_node(np, child) 181 for_each_child_of_node(np, child)
182 if (strcmp(child->name, "green") == 0) { 182 if (strcmp(child->name, "green") == 0)
183 green_led = of_get_gpio(child, 0); 183 green_led = of_get_gpio(child, 0);
184 /* Turn back on the green LED */ 184 else if (strcmp(child->name, "red") == 0)
185 gpio_set_value(green_led, 1);
186 } else if (strcmp(child->name, "red") == 0) {
187 red_led = of_get_gpio(child, 0); 185 red_led = of_get_gpio(child, 0);
188 /* Set based on post */
189 gpio_set_value(red_led, post_info);
190 }
191 186
192 of_node_put(np); 187 of_node_put(np);
193 188
194 return 0; 189 return 0;
195} 190}
196 191
197static void pika_setup_critical_temp(struct i2c_client *client) 192static void pika_setup_critical_temp(struct device_node *np,
193 struct i2c_client *client)
198{ 194{
199 struct device_node *np;
200 int irq, rc; 195 int irq, rc;
201 196
202 /* Do this before enabling critical temp interrupt since we 197 /* Do this before enabling critical temp interrupt since we
@@ -208,14 +203,7 @@ static void pika_setup_critical_temp(struct i2c_client *client)
208 i2c_smbus_write_byte_data(client, 2, 65); /* Thigh */ 203 i2c_smbus_write_byte_data(client, 2, 65); /* Thigh */
209 i2c_smbus_write_byte_data(client, 3, 0); /* Tlow */ 204 i2c_smbus_write_byte_data(client, 3, 0); /* Tlow */
210 205
211 np = of_find_compatible_node(NULL, NULL, "adi,ad7414");
212 if (np == NULL) {
213 printk(KERN_ERR __FILE__ ": Unable to find ad7414\n");
214 return;
215 }
216
217 irq = irq_of_parse_and_map(np, 0); 206 irq = irq_of_parse_and_map(np, 0);
218 of_node_put(np);
219 if (irq == NO_IRQ) { 207 if (irq == NO_IRQ) {
220 printk(KERN_ERR __FILE__ ": Unable to get ad7414 irq\n"); 208 printk(KERN_ERR __FILE__ ": Unable to get ad7414 irq\n");
221 return; 209 return;
@@ -244,32 +232,24 @@ static inline void pika_dtm_check_fan(void __iomem *fpga)
244 232
245static int pika_dtm_thread(void __iomem *fpga) 233static int pika_dtm_thread(void __iomem *fpga)
246{ 234{
247 struct i2c_adapter *adap; 235 struct device_node *np;
248 struct i2c_client *client; 236 struct i2c_client *client;
249 237
250 /* We loop in case either driver was compiled as a module and 238 np = of_find_compatible_node(NULL, NULL, "adi,ad7414");
251 * has not been insmoded yet. 239 if (np == NULL)
252 */ 240 return -ENOENT;
253 while (!(adap = i2c_get_adapter(0))) {
254 set_current_state(TASK_INTERRUPTIBLE);
255 schedule_timeout(HZ);
256 }
257
258 while (1) {
259 list_for_each_entry(client, &adap->clients, list)
260 if (client->addr == 0x4a)
261 goto found_it;
262 241
263 set_current_state(TASK_INTERRUPTIBLE); 242 client = of_find_i2c_device_by_node(np);
264 schedule_timeout(HZ); 243 if (client == NULL) {
244 of_node_put(np);
245 return -ENOENT;
265 } 246 }
266 247
267found_it: 248 pika_setup_critical_temp(np, client);
268 pika_setup_critical_temp(client);
269 249
270 i2c_put_adapter(adap); 250 of_node_put(np);
271 251
272 printk(KERN_INFO "PIKA DTM thread running.\n"); 252 printk(KERN_INFO "Warp DTM thread running.\n");
273 253
274 while (!kthread_should_stop()) { 254 while (!kthread_should_stop()) {
275 int val; 255 int val;
@@ -291,7 +271,6 @@ found_it:
291 return 0; 271 return 0;
292} 272}
293 273
294
295static int __init pika_dtm_start(void) 274static int __init pika_dtm_start(void)
296{ 275{
297 struct task_struct *dtm_thread; 276 struct task_struct *dtm_thread;
diff --git a/arch/powerpc/platforms/82xx/pq2ads-pci-pic.c b/arch/powerpc/platforms/82xx/pq2ads-pci-pic.c
index ddf0bdc0fc8b..7ee979f323d1 100644
--- a/arch/powerpc/platforms/82xx/pq2ads-pci-pic.c
+++ b/arch/powerpc/platforms/82xx/pq2ads-pci-pic.c
@@ -147,7 +147,7 @@ int __init pq2ads_pci_init_irq(void)
147 goto out; 147 goto out;
148 } 148 }
149 149
150 priv = alloc_bootmem(sizeof(struct pq2ads_pci_pic)); 150 priv = kzalloc(sizeof(*priv), GFP_KERNEL);
151 if (!priv) { 151 if (!priv) {
152 of_node_put(np); 152 of_node_put(np);
153 ret = -ENOMEM; 153 ret = -ENOMEM;
diff --git a/arch/powerpc/platforms/85xx/mpc85xx_mds.c b/arch/powerpc/platforms/85xx/mpc85xx_mds.c
index 77f90b356356..60ed9c067b1d 100644
--- a/arch/powerpc/platforms/85xx/mpc85xx_mds.c
+++ b/arch/powerpc/platforms/85xx/mpc85xx_mds.c
@@ -285,6 +285,7 @@ static struct of_device_id mpc85xx_ids[] = {
285 { .type = "qe", }, 285 { .type = "qe", },
286 { .compatible = "fsl,qe", }, 286 { .compatible = "fsl,qe", },
287 { .compatible = "gianfar", }, 287 { .compatible = "gianfar", },
288 { .compatible = "fsl,rapidio-delta", },
288 {}, 289 {},
289}; 290};
290 291
diff --git a/arch/powerpc/platforms/85xx/smp.c b/arch/powerpc/platforms/85xx/smp.c
index cc0b0db8a6f3..62c592ede641 100644
--- a/arch/powerpc/platforms/85xx/smp.c
+++ b/arch/powerpc/platforms/85xx/smp.c
@@ -52,20 +52,19 @@ smp_85xx_kick_cpu(int nr)
52 52
53 pr_debug("smp_85xx_kick_cpu: kick CPU #%d\n", nr); 53 pr_debug("smp_85xx_kick_cpu: kick CPU #%d\n", nr);
54 54
55 local_irq_save(flags);
56
57 np = of_get_cpu_node(nr, NULL); 55 np = of_get_cpu_node(nr, NULL);
58 cpu_rel_addr = of_get_property(np, "cpu-release-addr", NULL); 56 cpu_rel_addr = of_get_property(np, "cpu-release-addr", NULL);
59 57
60 if (cpu_rel_addr == NULL) { 58 if (cpu_rel_addr == NULL) {
61 printk(KERN_ERR "No cpu-release-addr for cpu %d\n", nr); 59 printk(KERN_ERR "No cpu-release-addr for cpu %d\n", nr);
62 local_irq_restore(flags);
63 return; 60 return;
64 } 61 }
65 62
66 /* Map the spin table */ 63 /* Map the spin table */
67 bptr_vaddr = ioremap(*cpu_rel_addr, SIZE_BOOT_ENTRY); 64 bptr_vaddr = ioremap(*cpu_rel_addr, SIZE_BOOT_ENTRY);
68 65
66 local_irq_save(flags);
67
69 out_be32(bptr_vaddr + BOOT_ENTRY_PIR, nr); 68 out_be32(bptr_vaddr + BOOT_ENTRY_PIR, nr);
70 out_be32(bptr_vaddr + BOOT_ENTRY_ADDR_LOWER, __pa(__early_start)); 69 out_be32(bptr_vaddr + BOOT_ENTRY_ADDR_LOWER, __pa(__early_start));
71 70
@@ -73,10 +72,10 @@ smp_85xx_kick_cpu(int nr)
73 while ((__secondary_hold_acknowledge != nr) && (++n < 1000)) 72 while ((__secondary_hold_acknowledge != nr) && (++n < 1000))
74 mdelay(1); 73 mdelay(1);
75 74
76 iounmap(bptr_vaddr);
77
78 local_irq_restore(flags); 75 local_irq_restore(flags);
79 76
77 iounmap(bptr_vaddr);
78
80 pr_debug("waited %d msecs for CPU #%d.\n", n, nr); 79 pr_debug("waited %d msecs for CPU #%d.\n", n, nr);
81} 80}
82 81
diff --git a/arch/powerpc/platforms/85xx/socrates.c b/arch/powerpc/platforms/85xx/socrates.c
index d0e8443b12c6..747d8fb3ab82 100644
--- a/arch/powerpc/platforms/85xx/socrates.c
+++ b/arch/powerpc/platforms/85xx/socrates.c
@@ -102,10 +102,11 @@ static struct of_device_id __initdata socrates_of_bus_ids[] = {
102 {}, 102 {},
103}; 103};
104 104
105static void __init socrates_init(void) 105static int __init socrates_publish_devices(void)
106{ 106{
107 of_platform_bus_probe(NULL, socrates_of_bus_ids, NULL); 107 return of_platform_bus_probe(NULL, socrates_of_bus_ids, NULL);
108} 108}
109machine_device_initcall(socrates, socrates_publish_devices);
109 110
110/* 111/*
111 * Called very early, device-tree isn't unflattened 112 * Called very early, device-tree isn't unflattened
@@ -124,7 +125,6 @@ define_machine(socrates) {
124 .name = "Socrates", 125 .name = "Socrates",
125 .probe = socrates_probe, 126 .probe = socrates_probe,
126 .setup_arch = socrates_setup_arch, 127 .setup_arch = socrates_setup_arch,
127 .init = socrates_init,
128 .init_IRQ = socrates_pic_init, 128 .init_IRQ = socrates_pic_init,
129 .get_irq = mpic_get_irq, 129 .get_irq = mpic_get_irq,
130 .restart = fsl_rstcr_restart, 130 .restart = fsl_rstcr_restart,
diff --git a/arch/powerpc/platforms/85xx/xes_mpc85xx.c b/arch/powerpc/platforms/85xx/xes_mpc85xx.c
index ee01532786e4..1b426050a2f9 100644
--- a/arch/powerpc/platforms/85xx/xes_mpc85xx.c
+++ b/arch/powerpc/platforms/85xx/xes_mpc85xx.c
@@ -32,7 +32,6 @@
32 32
33#include <sysdev/fsl_soc.h> 33#include <sysdev/fsl_soc.h>
34#include <sysdev/fsl_pci.h> 34#include <sysdev/fsl_pci.h>
35#include <linux/of_platform.h>
36 35
37/* A few bit definitions needed for fixups on some boards */ 36/* A few bit definitions needed for fixups on some boards */
38#define MPC85xx_L2CTL_L2E 0x80000000 /* L2 enable */ 37#define MPC85xx_L2CTL_L2E 0x80000000 /* L2 enable */
diff --git a/arch/powerpc/platforms/cell/axon_msi.c b/arch/powerpc/platforms/cell/axon_msi.c
index c71498dbf211..aca5741ddc67 100644
--- a/arch/powerpc/platforms/cell/axon_msi.c
+++ b/arch/powerpc/platforms/cell/axon_msi.c
@@ -85,7 +85,7 @@ static inline void axon_msi_debug_setup(struct device_node *dn,
85 85
86static void msic_dcr_write(struct axon_msic *msic, unsigned int dcr_n, u32 val) 86static void msic_dcr_write(struct axon_msic *msic, unsigned int dcr_n, u32 val)
87{ 87{
88 pr_debug("axon_msi: dcr_write(0x%x, 0x%x)\n", val, dcr_n); 88 pr_devel("axon_msi: dcr_write(0x%x, 0x%x)\n", val, dcr_n);
89 89
90 dcr_write(msic->dcr_host, dcr_n, val); 90 dcr_write(msic->dcr_host, dcr_n, val);
91} 91}
@@ -98,7 +98,7 @@ static void axon_msi_cascade(unsigned int irq, struct irq_desc *desc)
98 int retry = 0; 98 int retry = 0;
99 99
100 write_offset = dcr_read(msic->dcr_host, MSIC_WRITE_OFFSET_REG); 100 write_offset = dcr_read(msic->dcr_host, MSIC_WRITE_OFFSET_REG);
101 pr_debug("axon_msi: original write_offset 0x%x\n", write_offset); 101 pr_devel("axon_msi: original write_offset 0x%x\n", write_offset);
102 102
103 /* write_offset doesn't wrap properly, so we have to mask it */ 103 /* write_offset doesn't wrap properly, so we have to mask it */
104 write_offset &= MSIC_FIFO_SIZE_MASK; 104 write_offset &= MSIC_FIFO_SIZE_MASK;
@@ -108,7 +108,7 @@ static void axon_msi_cascade(unsigned int irq, struct irq_desc *desc)
108 msi = le32_to_cpu(msic->fifo_virt[idx]); 108 msi = le32_to_cpu(msic->fifo_virt[idx]);
109 msi &= 0xFFFF; 109 msi &= 0xFFFF;
110 110
111 pr_debug("axon_msi: woff %x roff %x msi %x\n", 111 pr_devel("axon_msi: woff %x roff %x msi %x\n",
112 write_offset, msic->read_offset, msi); 112 write_offset, msic->read_offset, msi);
113 113
114 if (msi < NR_IRQS && irq_map[msi].host == msic->irq_host) { 114 if (msi < NR_IRQS && irq_map[msi].host == msic->irq_host) {
@@ -123,12 +123,12 @@ static void axon_msi_cascade(unsigned int irq, struct irq_desc *desc)
123 */ 123 */
124 udelay(1); 124 udelay(1);
125 retry++; 125 retry++;
126 pr_debug("axon_msi: invalid irq 0x%x!\n", msi); 126 pr_devel("axon_msi: invalid irq 0x%x!\n", msi);
127 continue; 127 continue;
128 } 128 }
129 129
130 if (retry) { 130 if (retry) {
131 pr_debug("axon_msi: late irq 0x%x, retry %d\n", 131 pr_devel("axon_msi: late irq 0x%x, retry %d\n",
132 msi, retry); 132 msi, retry);
133 retry = 0; 133 retry = 0;
134 } 134 }
@@ -332,7 +332,7 @@ static int axon_msi_shutdown(struct of_device *device)
332 struct axon_msic *msic = dev_get_drvdata(&device->dev); 332 struct axon_msic *msic = dev_get_drvdata(&device->dev);
333 u32 tmp; 333 u32 tmp;
334 334
335 pr_debug("axon_msi: disabling %s\n", 335 pr_devel("axon_msi: disabling %s\n",
336 msic->irq_host->of_node->full_name); 336 msic->irq_host->of_node->full_name);
337 tmp = dcr_read(msic->dcr_host, MSIC_CTRL_REG); 337 tmp = dcr_read(msic->dcr_host, MSIC_CTRL_REG);
338 tmp &= ~MSIC_CTRL_ENABLE & ~MSIC_CTRL_IRQ_ENABLE; 338 tmp &= ~MSIC_CTRL_ENABLE & ~MSIC_CTRL_IRQ_ENABLE;
@@ -349,7 +349,7 @@ static int axon_msi_probe(struct of_device *device,
349 unsigned int virq; 349 unsigned int virq;
350 int dcr_base, dcr_len; 350 int dcr_base, dcr_len;
351 351
352 pr_debug("axon_msi: setting up dn %s\n", dn->full_name); 352 pr_devel("axon_msi: setting up dn %s\n", dn->full_name);
353 353
354 msic = kzalloc(sizeof(struct axon_msic), GFP_KERNEL); 354 msic = kzalloc(sizeof(struct axon_msic), GFP_KERNEL);
355 if (!msic) { 355 if (!msic) {
@@ -403,7 +403,7 @@ static int axon_msi_probe(struct of_device *device,
403 403
404 set_irq_data(virq, msic); 404 set_irq_data(virq, msic);
405 set_irq_chained_handler(virq, axon_msi_cascade); 405 set_irq_chained_handler(virq, axon_msi_cascade);
406 pr_debug("axon_msi: irq 0x%x setup for axon_msi\n", virq); 406 pr_devel("axon_msi: irq 0x%x setup for axon_msi\n", virq);
407 407
408 /* Enable the MSIC hardware */ 408 /* Enable the MSIC hardware */
409 msic_dcr_write(msic, MSIC_BASE_ADDR_HI_REG, msic->fifo_phys >> 32); 409 msic_dcr_write(msic, MSIC_BASE_ADDR_HI_REG, msic->fifo_phys >> 32);
@@ -484,13 +484,13 @@ void axon_msi_debug_setup(struct device_node *dn, struct axon_msic *msic)
484 484
485 addr = of_translate_address(dn, of_get_property(dn, "reg", NULL)); 485 addr = of_translate_address(dn, of_get_property(dn, "reg", NULL));
486 if (addr == OF_BAD_ADDR) { 486 if (addr == OF_BAD_ADDR) {
487 pr_debug("axon_msi: couldn't translate reg property\n"); 487 pr_devel("axon_msi: couldn't translate reg property\n");
488 return; 488 return;
489 } 489 }
490 490
491 msic->trigger = ioremap(addr, 0x4); 491 msic->trigger = ioremap(addr, 0x4);
492 if (!msic->trigger) { 492 if (!msic->trigger) {
493 pr_debug("axon_msi: ioremap failed\n"); 493 pr_devel("axon_msi: ioremap failed\n");
494 return; 494 return;
495 } 495 }
496 496
@@ -498,7 +498,7 @@ void axon_msi_debug_setup(struct device_node *dn, struct axon_msic *msic)
498 498
499 if (!debugfs_create_file(name, 0600, powerpc_debugfs_root, 499 if (!debugfs_create_file(name, 0600, powerpc_debugfs_root,
500 msic, &fops_msic)) { 500 msic, &fops_msic)) {
501 pr_debug("axon_msi: debugfs_create_file failed!\n"); 501 pr_devel("axon_msi: debugfs_create_file failed!\n");
502 return; 502 return;
503 } 503 }
504} 504}
diff --git a/arch/powerpc/platforms/cell/smp.c b/arch/powerpc/platforms/cell/smp.c
index 9046803c8276..bc97fada48c6 100644
--- a/arch/powerpc/platforms/cell/smp.c
+++ b/arch/powerpc/platforms/cell/smp.c
@@ -36,7 +36,6 @@
36#include <asm/prom.h> 36#include <asm/prom.h>
37#include <asm/smp.h> 37#include <asm/smp.h>
38#include <asm/paca.h> 38#include <asm/paca.h>
39#include <asm/time.h>
40#include <asm/machdep.h> 39#include <asm/machdep.h>
41#include <asm/cputable.h> 40#include <asm/cputable.h>
42#include <asm/firmware.h> 41#include <asm/firmware.h>
@@ -140,31 +139,6 @@ static void __devinit smp_cell_setup_cpu(int cpu)
140 mtspr(SPRN_DABRX, DABRX_KERNEL | DABRX_USER); 139 mtspr(SPRN_DABRX, DABRX_KERNEL | DABRX_USER);
141} 140}
142 141
143static DEFINE_SPINLOCK(timebase_lock);
144static unsigned long timebase = 0;
145
146static void __devinit cell_give_timebase(void)
147{
148 spin_lock(&timebase_lock);
149 rtas_call(rtas_token("freeze-time-base"), 0, 1, NULL);
150 timebase = get_tb();
151 spin_unlock(&timebase_lock);
152
153 while (timebase)
154 barrier();
155 rtas_call(rtas_token("thaw-time-base"), 0, 1, NULL);
156}
157
158static void __devinit cell_take_timebase(void)
159{
160 while (!timebase)
161 barrier();
162 spin_lock(&timebase_lock);
163 set_tb(timebase >> 32, timebase & 0xffffffff);
164 timebase = 0;
165 spin_unlock(&timebase_lock);
166}
167
168static void __devinit smp_cell_kick_cpu(int nr) 142static void __devinit smp_cell_kick_cpu(int nr)
169{ 143{
170 BUG_ON(nr < 0 || nr >= NR_CPUS); 144 BUG_ON(nr < 0 || nr >= NR_CPUS);
@@ -224,8 +198,8 @@ void __init smp_init_cell(void)
224 198
225 /* Non-lpar has additional take/give timebase */ 199 /* Non-lpar has additional take/give timebase */
226 if (rtas_token("freeze-time-base") != RTAS_UNKNOWN_SERVICE) { 200 if (rtas_token("freeze-time-base") != RTAS_UNKNOWN_SERVICE) {
227 smp_ops->give_timebase = cell_give_timebase; 201 smp_ops->give_timebase = rtas_give_timebase;
228 smp_ops->take_timebase = cell_take_timebase; 202 smp_ops->take_timebase = rtas_take_timebase;
229 } 203 }
230 204
231 DBG(" <- smp_init_cell()\n"); 205 DBG(" <- smp_init_cell()\n");
diff --git a/arch/powerpc/platforms/chrp/smp.c b/arch/powerpc/platforms/chrp/smp.c
index 10a4a4d063b6..02cafecc90e3 100644
--- a/arch/powerpc/platforms/chrp/smp.c
+++ b/arch/powerpc/platforms/chrp/smp.c
@@ -26,7 +26,6 @@
26#include <asm/io.h> 26#include <asm/io.h>
27#include <asm/prom.h> 27#include <asm/prom.h>
28#include <asm/smp.h> 28#include <asm/smp.h>
29#include <asm/time.h>
30#include <asm/machdep.h> 29#include <asm/machdep.h>
31#include <asm/mpic.h> 30#include <asm/mpic.h>
32#include <asm/rtas.h> 31#include <asm/rtas.h>
@@ -42,40 +41,12 @@ static void __devinit smp_chrp_setup_cpu(int cpu_nr)
42 mpic_setup_this_cpu(); 41 mpic_setup_this_cpu();
43} 42}
44 43
45static DEFINE_SPINLOCK(timebase_lock);
46static unsigned int timebase_upper = 0, timebase_lower = 0;
47
48void __devinit smp_chrp_give_timebase(void)
49{
50 spin_lock(&timebase_lock);
51 rtas_call(rtas_token("freeze-time-base"), 0, 1, NULL);
52 timebase_upper = get_tbu();
53 timebase_lower = get_tbl();
54 spin_unlock(&timebase_lock);
55
56 while (timebase_upper || timebase_lower)
57 barrier();
58 rtas_call(rtas_token("thaw-time-base"), 0, 1, NULL);
59}
60
61void __devinit smp_chrp_take_timebase(void)
62{
63 while (!(timebase_upper || timebase_lower))
64 barrier();
65 spin_lock(&timebase_lock);
66 set_tb(timebase_upper, timebase_lower);
67 timebase_upper = 0;
68 timebase_lower = 0;
69 spin_unlock(&timebase_lock);
70 printk("CPU %i taken timebase\n", smp_processor_id());
71}
72
73/* CHRP with openpic */ 44/* CHRP with openpic */
74struct smp_ops_t chrp_smp_ops = { 45struct smp_ops_t chrp_smp_ops = {
75 .message_pass = smp_mpic_message_pass, 46 .message_pass = smp_mpic_message_pass,
76 .probe = smp_mpic_probe, 47 .probe = smp_mpic_probe,
77 .kick_cpu = smp_chrp_kick_cpu, 48 .kick_cpu = smp_chrp_kick_cpu,
78 .setup_cpu = smp_chrp_setup_cpu, 49 .setup_cpu = smp_chrp_setup_cpu,
79 .give_timebase = smp_chrp_give_timebase, 50 .give_timebase = rtas_give_timebase,
80 .take_timebase = smp_chrp_take_timebase, 51 .take_timebase = rtas_take_timebase,
81}; 52};
diff --git a/arch/powerpc/platforms/pasemi/setup.c b/arch/powerpc/platforms/pasemi/setup.c
index 153051eb6d93..a4619347aa7e 100644
--- a/arch/powerpc/platforms/pasemi/setup.c
+++ b/arch/powerpc/platforms/pasemi/setup.c
@@ -71,20 +71,25 @@ static void pas_restart(char *cmd)
71} 71}
72 72
73#ifdef CONFIG_SMP 73#ifdef CONFIG_SMP
74static DEFINE_SPINLOCK(timebase_lock); 74static raw_spinlock_t timebase_lock;
75static unsigned long timebase; 75static unsigned long timebase;
76 76
77static void __devinit pas_give_timebase(void) 77static void __devinit pas_give_timebase(void)
78{ 78{
79 spin_lock(&timebase_lock); 79 unsigned long flags;
80
81 local_irq_save(flags);
82 hard_irq_disable();
83 __raw_spin_lock(&timebase_lock);
80 mtspr(SPRN_TBCTL, TBCTL_FREEZE); 84 mtspr(SPRN_TBCTL, TBCTL_FREEZE);
81 isync(); 85 isync();
82 timebase = get_tb(); 86 timebase = get_tb();
83 spin_unlock(&timebase_lock); 87 __raw_spin_unlock(&timebase_lock);
84 88
85 while (timebase) 89 while (timebase)
86 barrier(); 90 barrier();
87 mtspr(SPRN_TBCTL, TBCTL_RESTART); 91 mtspr(SPRN_TBCTL, TBCTL_RESTART);
92 local_irq_restore(flags);
88} 93}
89 94
90static void __devinit pas_take_timebase(void) 95static void __devinit pas_take_timebase(void)
@@ -92,10 +97,10 @@ static void __devinit pas_take_timebase(void)
92 while (!timebase) 97 while (!timebase)
93 smp_rmb(); 98 smp_rmb();
94 99
95 spin_lock(&timebase_lock); 100 __raw_spin_lock(&timebase_lock);
96 set_tb(timebase >> 32, timebase & 0xffffffff); 101 set_tb(timebase >> 32, timebase & 0xffffffff);
97 timebase = 0; 102 timebase = 0;
98 spin_unlock(&timebase_lock); 103 __raw_spin_unlock(&timebase_lock);
99} 104}
100 105
101struct smp_ops_t pas_smp_ops = { 106struct smp_ops_t pas_smp_ops = {
diff --git a/arch/powerpc/platforms/powermac/cpufreq_64.c b/arch/powerpc/platforms/powermac/cpufreq_64.c
index 22ecfbe7183d..708c75133377 100644
--- a/arch/powerpc/platforms/powermac/cpufreq_64.c
+++ b/arch/powerpc/platforms/powermac/cpufreq_64.c
@@ -251,7 +251,7 @@ static void g5_pfunc_switch_volt(int speed_mode)
251static struct pmf_function *pfunc_cpu_setfreq_high; 251static struct pmf_function *pfunc_cpu_setfreq_high;
252static struct pmf_function *pfunc_cpu_setfreq_low; 252static struct pmf_function *pfunc_cpu_setfreq_low;
253static struct pmf_function *pfunc_cpu_getfreq; 253static struct pmf_function *pfunc_cpu_getfreq;
254static struct pmf_function *pfunc_slewing_done;; 254static struct pmf_function *pfunc_slewing_done;
255 255
256static int g5_pfunc_switch_freq(int speed_mode) 256static int g5_pfunc_switch_freq(int speed_mode)
257{ 257{
diff --git a/arch/powerpc/platforms/powermac/pic.c b/arch/powerpc/platforms/powermac/pic.c
index dce736349107..d212006a5b3c 100644
--- a/arch/powerpc/platforms/powermac/pic.c
+++ b/arch/powerpc/platforms/powermac/pic.c
@@ -609,7 +609,7 @@ static int pmacpic_find_viaint(void)
609 np = of_find_node_by_name(NULL, "via-pmu"); 609 np = of_find_node_by_name(NULL, "via-pmu");
610 if (np == NULL) 610 if (np == NULL)
611 goto not_found; 611 goto not_found;
612 viaint = irq_of_parse_and_map(np, 0);; 612 viaint = irq_of_parse_and_map(np, 0);
613 613
614not_found: 614not_found:
615#endif /* CONFIG_ADB_PMU */ 615#endif /* CONFIG_ADB_PMU */
diff --git a/arch/powerpc/platforms/powermac/setup.c b/arch/powerpc/platforms/powermac/setup.c
index 86f69a4eb49b..c20522656367 100644
--- a/arch/powerpc/platforms/powermac/setup.c
+++ b/arch/powerpc/platforms/powermac/setup.c
@@ -103,11 +103,6 @@ unsigned long smu_cmdbuf_abs;
103EXPORT_SYMBOL(smu_cmdbuf_abs); 103EXPORT_SYMBOL(smu_cmdbuf_abs);
104#endif 104#endif
105 105
106#ifdef CONFIG_SMP
107extern struct smp_ops_t psurge_smp_ops;
108extern struct smp_ops_t core99_smp_ops;
109#endif /* CONFIG_SMP */
110
111static void pmac_show_cpuinfo(struct seq_file *m) 106static void pmac_show_cpuinfo(struct seq_file *m)
112{ 107{
113 struct device_node *np; 108 struct device_node *np;
@@ -341,34 +336,6 @@ static void __init pmac_setup_arch(void)
341 ROOT_DEV = DEFAULT_ROOT_DEVICE; 336 ROOT_DEV = DEFAULT_ROOT_DEVICE;
342#endif 337#endif
343 338
344#ifdef CONFIG_SMP
345 /* Check for Core99 */
346 ic = of_find_node_by_name(NULL, "uni-n");
347 if (!ic)
348 ic = of_find_node_by_name(NULL, "u3");
349 if (!ic)
350 ic = of_find_node_by_name(NULL, "u4");
351 if (ic) {
352 of_node_put(ic);
353 smp_ops = &core99_smp_ops;
354 }
355#ifdef CONFIG_PPC32
356 else {
357 /*
358 * We have to set bits in cpu_possible_map here since the
359 * secondary CPU(s) aren't in the device tree, and
360 * setup_per_cpu_areas only allocates per-cpu data for
361 * CPUs in the cpu_possible_map.
362 */
363 int cpu;
364
365 for (cpu = 1; cpu < 4 && cpu < NR_CPUS; ++cpu)
366 cpu_set(cpu, cpu_possible_map);
367 smp_ops = &psurge_smp_ops;
368 }
369#endif
370#endif /* CONFIG_SMP */
371
372#ifdef CONFIG_ADB 339#ifdef CONFIG_ADB
373 if (strstr(cmd_line, "adb_sync")) { 340 if (strstr(cmd_line, "adb_sync")) {
374 extern int __adb_probe_sync; 341 extern int __adb_probe_sync;
@@ -512,6 +479,14 @@ static void __init pmac_init_early(void)
512#ifdef CONFIG_PPC64 479#ifdef CONFIG_PPC64
513 iommu_init_early_dart(); 480 iommu_init_early_dart();
514#endif 481#endif
482
483 /* SMP Init has to be done early as we need to patch up
484 * cpu_possible_map before interrupt stacks are allocated
485 * or kaboom...
486 */
487#ifdef CONFIG_SMP
488 pmac_setup_smp();
489#endif
515} 490}
516 491
517static int __init pmac_declare_of_platform_devices(void) 492static int __init pmac_declare_of_platform_devices(void)
diff --git a/arch/powerpc/platforms/powermac/smp.c b/arch/powerpc/platforms/powermac/smp.c
index cf1dbe758890..6d4da7b46b41 100644
--- a/arch/powerpc/platforms/powermac/smp.c
+++ b/arch/powerpc/platforms/powermac/smp.c
@@ -64,10 +64,11 @@
64extern void __secondary_start_pmac_0(void); 64extern void __secondary_start_pmac_0(void);
65extern int pmac_pfunc_base_install(void); 65extern int pmac_pfunc_base_install(void);
66 66
67#ifdef CONFIG_PPC32 67static void (*pmac_tb_freeze)(int freeze);
68static u64 timebase;
69static int tb_req;
68 70
69/* Sync flag for HW tb sync */ 71#ifdef CONFIG_PPC32
70static volatile int sec_tb_reset = 0;
71 72
72/* 73/*
73 * Powersurge (old powermac SMP) support. 74 * Powersurge (old powermac SMP) support.
@@ -294,6 +295,9 @@ static int __init smp_psurge_probe(void)
294 psurge_quad_init(); 295 psurge_quad_init();
295 /* All released cards using this HW design have 4 CPUs */ 296 /* All released cards using this HW design have 4 CPUs */
296 ncpus = 4; 297 ncpus = 4;
298 /* No sure how timebase sync works on those, let's use SW */
299 smp_ops->give_timebase = smp_generic_give_timebase;
300 smp_ops->take_timebase = smp_generic_take_timebase;
297 } else { 301 } else {
298 iounmap(quad_base); 302 iounmap(quad_base);
299 if ((in_8(hhead_base + HHEAD_CONFIG) & 0x02) == 0) { 303 if ((in_8(hhead_base + HHEAD_CONFIG) & 0x02) == 0) {
@@ -308,18 +312,15 @@ static int __init smp_psurge_probe(void)
308 psurge_start = ioremap(PSURGE_START, 4); 312 psurge_start = ioremap(PSURGE_START, 4);
309 psurge_pri_intr = ioremap(PSURGE_PRI_INTR, 4); 313 psurge_pri_intr = ioremap(PSURGE_PRI_INTR, 4);
310 314
311 /* 315 /* This is necessary because OF doesn't know about the
312 * This is necessary because OF doesn't know about the
313 * secondary cpu(s), and thus there aren't nodes in the 316 * secondary cpu(s), and thus there aren't nodes in the
314 * device tree for them, and smp_setup_cpu_maps hasn't 317 * device tree for them, and smp_setup_cpu_maps hasn't
315 * set their bits in cpu_possible_map and cpu_present_map. 318 * set their bits in cpu_present_map.
316 */ 319 */
317 if (ncpus > NR_CPUS) 320 if (ncpus > NR_CPUS)
318 ncpus = NR_CPUS; 321 ncpus = NR_CPUS;
319 for (i = 1; i < ncpus ; ++i) { 322 for (i = 1; i < ncpus ; ++i)
320 cpu_set(i, cpu_present_map); 323 cpu_set(i, cpu_present_map);
321 set_hard_smp_processor_id(i, i);
322 }
323 324
324 if (ppc_md.progress) ppc_md.progress("smp_psurge_probe - done", 0x352); 325 if (ppc_md.progress) ppc_md.progress("smp_psurge_probe - done", 0x352);
325 326
@@ -329,8 +330,14 @@ static int __init smp_psurge_probe(void)
329static void __init smp_psurge_kick_cpu(int nr) 330static void __init smp_psurge_kick_cpu(int nr)
330{ 331{
331 unsigned long start = __pa(__secondary_start_pmac_0) + nr * 8; 332 unsigned long start = __pa(__secondary_start_pmac_0) + nr * 8;
332 unsigned long a; 333 unsigned long a, flags;
333 int i; 334 int i, j;
335
336 /* Defining this here is evil ... but I prefer hiding that
337 * crap to avoid giving people ideas that they can do the
338 * same.
339 */
340 extern volatile unsigned int cpu_callin_map[NR_CPUS];
334 341
335 /* may need to flush here if secondary bats aren't setup */ 342 /* may need to flush here if secondary bats aren't setup */
336 for (a = KERNELBASE; a < KERNELBASE + 0x800000; a += 32) 343 for (a = KERNELBASE; a < KERNELBASE + 0x800000; a += 32)
@@ -339,47 +346,52 @@ static void __init smp_psurge_kick_cpu(int nr)
339 346
340 if (ppc_md.progress) ppc_md.progress("smp_psurge_kick_cpu", 0x353); 347 if (ppc_md.progress) ppc_md.progress("smp_psurge_kick_cpu", 0x353);
341 348
349 /* This is going to freeze the timeebase, we disable interrupts */
350 local_irq_save(flags);
351
342 out_be32(psurge_start, start); 352 out_be32(psurge_start, start);
343 mb(); 353 mb();
344 354
345 psurge_set_ipi(nr); 355 psurge_set_ipi(nr);
356
346 /* 357 /*
347 * We can't use udelay here because the timebase is now frozen. 358 * We can't use udelay here because the timebase is now frozen.
348 */ 359 */
349 for (i = 0; i < 2000; ++i) 360 for (i = 0; i < 2000; ++i)
350 barrier(); 361 asm volatile("nop" : : : "memory");
351 psurge_clr_ipi(nr); 362 psurge_clr_ipi(nr);
352 363
353 if (ppc_md.progress) ppc_md.progress("smp_psurge_kick_cpu - done", 0x354); 364 /*
354} 365 * Also, because the timebase is frozen, we must not return to the
355 366 * caller which will try to do udelay's etc... Instead, we wait -here-
356/* 367 * for the CPU to callin.
357 * With the dual-cpu powersurge board, the decrementers and timebases 368 */
358 * of both cpus are frozen after the secondary cpu is started up, 369 for (i = 0; i < 100000 && !cpu_callin_map[nr]; ++i) {
359 * until we give the secondary cpu another interrupt. This routine 370 for (j = 1; j < 10000; j++)
360 * uses this to get the timebases synchronized. 371 asm volatile("nop" : : : "memory");
361 * -- paulus. 372 asm volatile("sync" : : : "memory");
362 */ 373 }
363static void __init psurge_dual_sync_tb(int cpu_nr) 374 if (!cpu_callin_map[nr])
364{ 375 goto stuck;
365 int t; 376
366 377 /* And we do the TB sync here too for standard dual CPU cards */
367 set_dec(tb_ticks_per_jiffy); 378 if (psurge_type == PSURGE_DUAL) {
368 /* XXX fixme */ 379 while(!tb_req)
369 set_tb(0, 0); 380 barrier();
370 381 tb_req = 0;
371 if (cpu_nr > 0) { 382 mb();
383 timebase = get_tb();
384 mb();
385 while (timebase)
386 barrier();
372 mb(); 387 mb();
373 sec_tb_reset = 1;
374 return;
375 } 388 }
389 stuck:
390 /* now interrupt the secondary, restarting both TBs */
391 if (psurge_type == PSURGE_DUAL)
392 psurge_set_ipi(1);
376 393
377 /* wait for the secondary to have reset its TB before proceeding */ 394 if (ppc_md.progress) ppc_md.progress("smp_psurge_kick_cpu - done", 0x354);
378 for (t = 10000000; t > 0 && !sec_tb_reset; --t)
379 ;
380
381 /* now interrupt the secondary, starting both TBs */
382 psurge_set_ipi(1);
383} 395}
384 396
385static struct irqaction psurge_irqaction = { 397static struct irqaction psurge_irqaction = {
@@ -390,36 +402,35 @@ static struct irqaction psurge_irqaction = {
390 402
391static void __init smp_psurge_setup_cpu(int cpu_nr) 403static void __init smp_psurge_setup_cpu(int cpu_nr)
392{ 404{
405 if (cpu_nr != 0)
406 return;
393 407
394 if (cpu_nr == 0) { 408 /* reset the entry point so if we get another intr we won't
395 /* If we failed to start the second CPU, we should still 409 * try to startup again */
396 * send it an IPI to start the timebase & DEC or we might 410 out_be32(psurge_start, 0x100);
397 * have them stuck. 411 if (setup_irq(30, &psurge_irqaction))
398 */ 412 printk(KERN_ERR "Couldn't get primary IPI interrupt");
399 if (num_online_cpus() < 2) {
400 if (psurge_type == PSURGE_DUAL)
401 psurge_set_ipi(1);
402 return;
403 }
404 /* reset the entry point so if we get another intr we won't
405 * try to startup again */
406 out_be32(psurge_start, 0x100);
407 if (setup_irq(30, &psurge_irqaction))
408 printk(KERN_ERR "Couldn't get primary IPI interrupt");
409 }
410
411 if (psurge_type == PSURGE_DUAL)
412 psurge_dual_sync_tb(cpu_nr);
413} 413}
414 414
415void __init smp_psurge_take_timebase(void) 415void __init smp_psurge_take_timebase(void)
416{ 416{
417 /* Dummy implementation */ 417 if (psurge_type != PSURGE_DUAL)
418 return;
419
420 tb_req = 1;
421 mb();
422 while (!timebase)
423 barrier();
424 mb();
425 set_tb(timebase >> 32, timebase & 0xffffffff);
426 timebase = 0;
427 mb();
428 set_dec(tb_ticks_per_jiffy/2);
418} 429}
419 430
420void __init smp_psurge_give_timebase(void) 431void __init smp_psurge_give_timebase(void)
421{ 432{
422 /* Dummy implementation */ 433 /* Nothing to do here */
423} 434}
424 435
425/* PowerSurge-style Macs */ 436/* PowerSurge-style Macs */
@@ -437,9 +448,6 @@ struct smp_ops_t psurge_smp_ops = {
437 * Core 99 and later support 448 * Core 99 and later support
438 */ 449 */
439 450
440static void (*pmac_tb_freeze)(int freeze);
441static u64 timebase;
442static int tb_req;
443 451
444static void smp_core99_give_timebase(void) 452static void smp_core99_give_timebase(void)
445{ 453{
@@ -478,7 +486,6 @@ static void __devinit smp_core99_take_timebase(void)
478 set_tb(timebase >> 32, timebase & 0xffffffff); 486 set_tb(timebase >> 32, timebase & 0xffffffff);
479 timebase = 0; 487 timebase = 0;
480 mb(); 488 mb();
481 set_dec(tb_ticks_per_jiffy/2);
482 489
483 local_irq_restore(flags); 490 local_irq_restore(flags);
484} 491}
@@ -920,3 +927,34 @@ struct smp_ops_t core99_smp_ops = {
920# endif 927# endif
921#endif 928#endif
922}; 929};
930
931void __init pmac_setup_smp(void)
932{
933 struct device_node *np;
934
935 /* Check for Core99 */
936 np = of_find_node_by_name(NULL, "uni-n");
937 if (!np)
938 np = of_find_node_by_name(NULL, "u3");
939 if (!np)
940 np = of_find_node_by_name(NULL, "u4");
941 if (np) {
942 of_node_put(np);
943 smp_ops = &core99_smp_ops;
944 }
945#ifdef CONFIG_PPC32
946 else {
947 /* We have to set bits in cpu_possible_map here since the
948 * secondary CPU(s) aren't in the device tree. Various
949 * things won't be initialized for CPUs not in the possible
950 * map, so we really need to fix it up here.
951 */
952 int cpu;
953
954 for (cpu = 1; cpu < 4 && cpu < NR_CPUS; ++cpu)
955 cpu_set(cpu, cpu_possible_map);
956 smp_ops = &psurge_smp_ops;
957 }
958#endif /* CONFIG_PPC32 */
959}
960
diff --git a/arch/powerpc/platforms/ps3/system-bus.c b/arch/powerpc/platforms/ps3/system-bus.c
index 9fead0faf38b..3f763c5284ac 100644
--- a/arch/powerpc/platforms/ps3/system-bus.c
+++ b/arch/powerpc/platforms/ps3/system-bus.c
@@ -284,7 +284,6 @@ static int ps3_sb_free_mmio_region(struct ps3_mmio_region *r)
284 int result; 284 int result;
285 285
286 dump_mmio_region(r); 286 dump_mmio_region(r);
287;
288 result = lv1_unmap_device_mmio_region(r->dev->bus_id, r->dev->dev_id, 287 result = lv1_unmap_device_mmio_region(r->dev->bus_id, r->dev->dev_id,
289 r->lpar_addr); 288 r->lpar_addr);
290 289
diff --git a/arch/powerpc/platforms/pseries/lpar.c b/arch/powerpc/platforms/pseries/lpar.c
index e3139fa5e556..903eb9eec687 100644
--- a/arch/powerpc/platforms/pseries/lpar.c
+++ b/arch/powerpc/platforms/pseries/lpar.c
@@ -286,7 +286,7 @@ static long pSeries_lpar_hpte_insert(unsigned long hpte_group,
286 unsigned long hpte_v, hpte_r; 286 unsigned long hpte_v, hpte_r;
287 287
288 if (!(vflags & HPTE_V_BOLTED)) 288 if (!(vflags & HPTE_V_BOLTED))
289 pr_debug("hpte_insert(group=%lx, va=%016lx, pa=%016lx, " 289 pr_devel("hpte_insert(group=%lx, va=%016lx, pa=%016lx, "
290 "rflags=%lx, vflags=%lx, psize=%d)\n", 290 "rflags=%lx, vflags=%lx, psize=%d)\n",
291 hpte_group, va, pa, rflags, vflags, psize); 291 hpte_group, va, pa, rflags, vflags, psize);
292 292
@@ -294,7 +294,7 @@ static long pSeries_lpar_hpte_insert(unsigned long hpte_group,
294 hpte_r = hpte_encode_r(pa, psize) | rflags; 294 hpte_r = hpte_encode_r(pa, psize) | rflags;
295 295
296 if (!(vflags & HPTE_V_BOLTED)) 296 if (!(vflags & HPTE_V_BOLTED))
297 pr_debug(" hpte_v=%016lx, hpte_r=%016lx\n", hpte_v, hpte_r); 297 pr_devel(" hpte_v=%016lx, hpte_r=%016lx\n", hpte_v, hpte_r);
298 298
299 /* Now fill in the actual HPTE */ 299 /* Now fill in the actual HPTE */
300 /* Set CEC cookie to 0 */ 300 /* Set CEC cookie to 0 */
@@ -311,7 +311,7 @@ static long pSeries_lpar_hpte_insert(unsigned long hpte_group,
311 lpar_rc = plpar_pte_enter(flags, hpte_group, hpte_v, hpte_r, &slot); 311 lpar_rc = plpar_pte_enter(flags, hpte_group, hpte_v, hpte_r, &slot);
312 if (unlikely(lpar_rc == H_PTEG_FULL)) { 312 if (unlikely(lpar_rc == H_PTEG_FULL)) {
313 if (!(vflags & HPTE_V_BOLTED)) 313 if (!(vflags & HPTE_V_BOLTED))
314 pr_debug(" full\n"); 314 pr_devel(" full\n");
315 return -1; 315 return -1;
316 } 316 }
317 317
@@ -322,11 +322,11 @@ static long pSeries_lpar_hpte_insert(unsigned long hpte_group,
322 */ 322 */
323 if (unlikely(lpar_rc != H_SUCCESS)) { 323 if (unlikely(lpar_rc != H_SUCCESS)) {
324 if (!(vflags & HPTE_V_BOLTED)) 324 if (!(vflags & HPTE_V_BOLTED))
325 pr_debug(" lpar err %lu\n", lpar_rc); 325 pr_devel(" lpar err %lu\n", lpar_rc);
326 return -2; 326 return -2;
327 } 327 }
328 if (!(vflags & HPTE_V_BOLTED)) 328 if (!(vflags & HPTE_V_BOLTED))
329 pr_debug(" -> slot: %lu\n", slot & 7); 329 pr_devel(" -> slot: %lu\n", slot & 7);
330 330
331 /* Because of iSeries, we have to pass down the secondary 331 /* Because of iSeries, we have to pass down the secondary
332 * bucket bit here as well 332 * bucket bit here as well
@@ -418,17 +418,17 @@ static long pSeries_lpar_hpte_updatepp(unsigned long slot,
418 418
419 want_v = hpte_encode_avpn(va, psize, ssize); 419 want_v = hpte_encode_avpn(va, psize, ssize);
420 420
421 pr_debug(" update: avpnv=%016lx, hash=%016lx, f=%lx, psize: %d ...", 421 pr_devel(" update: avpnv=%016lx, hash=%016lx, f=%lx, psize: %d ...",
422 want_v, slot, flags, psize); 422 want_v, slot, flags, psize);
423 423
424 lpar_rc = plpar_pte_protect(flags, slot, want_v); 424 lpar_rc = plpar_pte_protect(flags, slot, want_v);
425 425
426 if (lpar_rc == H_NOT_FOUND) { 426 if (lpar_rc == H_NOT_FOUND) {
427 pr_debug("not found !\n"); 427 pr_devel("not found !\n");
428 return -1; 428 return -1;
429 } 429 }
430 430
431 pr_debug("ok\n"); 431 pr_devel("ok\n");
432 432
433 BUG_ON(lpar_rc != H_SUCCESS); 433 BUG_ON(lpar_rc != H_SUCCESS);
434 434
@@ -503,7 +503,7 @@ static void pSeries_lpar_hpte_invalidate(unsigned long slot, unsigned long va,
503 unsigned long lpar_rc; 503 unsigned long lpar_rc;
504 unsigned long dummy1, dummy2; 504 unsigned long dummy1, dummy2;
505 505
506 pr_debug(" inval : slot=%lx, va=%016lx, psize: %d, local: %d\n", 506 pr_devel(" inval : slot=%lx, va=%016lx, psize: %d, local: %d\n",
507 slot, va, psize, local); 507 slot, va, psize, local);
508 508
509 want_v = hpte_encode_avpn(va, psize, ssize); 509 want_v = hpte_encode_avpn(va, psize, ssize);
diff --git a/arch/powerpc/platforms/pseries/smp.c b/arch/powerpc/platforms/pseries/smp.c
index 1a231c389ba0..1f8f6cfb94f7 100644
--- a/arch/powerpc/platforms/pseries/smp.c
+++ b/arch/powerpc/platforms/pseries/smp.c
@@ -35,7 +35,6 @@
35#include <asm/prom.h> 35#include <asm/prom.h>
36#include <asm/smp.h> 36#include <asm/smp.h>
37#include <asm/paca.h> 37#include <asm/paca.h>
38#include <asm/time.h>
39#include <asm/machdep.h> 38#include <asm/machdep.h>
40#include <asm/cputable.h> 39#include <asm/cputable.h>
41#include <asm/firmware.h> 40#include <asm/firmware.h>
@@ -118,31 +117,6 @@ static void __devinit smp_xics_setup_cpu(int cpu)
118} 117}
119#endif /* CONFIG_XICS */ 118#endif /* CONFIG_XICS */
120 119
121static DEFINE_SPINLOCK(timebase_lock);
122static unsigned long timebase = 0;
123
124static void __devinit pSeries_give_timebase(void)
125{
126 spin_lock(&timebase_lock);
127 rtas_call(rtas_token("freeze-time-base"), 0, 1, NULL);
128 timebase = get_tb();
129 spin_unlock(&timebase_lock);
130
131 while (timebase)
132 barrier();
133 rtas_call(rtas_token("thaw-time-base"), 0, 1, NULL);
134}
135
136static void __devinit pSeries_take_timebase(void)
137{
138 while (!timebase)
139 barrier();
140 spin_lock(&timebase_lock);
141 set_tb(timebase >> 32, timebase & 0xffffffff);
142 timebase = 0;
143 spin_unlock(&timebase_lock);
144}
145
146static void __devinit smp_pSeries_kick_cpu(int nr) 120static void __devinit smp_pSeries_kick_cpu(int nr)
147{ 121{
148 BUG_ON(nr < 0 || nr >= NR_CPUS); 122 BUG_ON(nr < 0 || nr >= NR_CPUS);
@@ -209,8 +183,8 @@ static void __init smp_init_pseries(void)
209 183
210 /* Non-lpar has additional take/give timebase */ 184 /* Non-lpar has additional take/give timebase */
211 if (rtas_token("freeze-time-base") != RTAS_UNKNOWN_SERVICE) { 185 if (rtas_token("freeze-time-base") != RTAS_UNKNOWN_SERVICE) {
212 smp_ops->give_timebase = pSeries_give_timebase; 186 smp_ops->give_timebase = rtas_give_timebase;
213 smp_ops->take_timebase = pSeries_take_timebase; 187 smp_ops->take_timebase = rtas_take_timebase;
214 } 188 }
215 189
216 pr_debug(" <- smp_init_pSeries()\n"); 190 pr_debug(" <- smp_init_pSeries()\n");
diff --git a/arch/powerpc/platforms/pseries/xics.c b/arch/powerpc/platforms/pseries/xics.c
index be3581a8c294..419f8a637ffe 100644
--- a/arch/powerpc/platforms/pseries/xics.c
+++ b/arch/powerpc/platforms/pseries/xics.c
@@ -190,10 +190,10 @@ static void xics_unmask_irq(unsigned int virq)
190 int call_status; 190 int call_status;
191 int server; 191 int server;
192 192
193 pr_debug("xics: unmask virq %d\n", virq); 193 pr_devel("xics: unmask virq %d\n", virq);
194 194
195 irq = (unsigned int)irq_map[virq].hwirq; 195 irq = (unsigned int)irq_map[virq].hwirq;
196 pr_debug(" -> map to hwirq 0x%x\n", irq); 196 pr_devel(" -> map to hwirq 0x%x\n", irq);
197 if (irq == XICS_IPI || irq == XICS_IRQ_SPURIOUS) 197 if (irq == XICS_IPI || irq == XICS_IRQ_SPURIOUS)
198 return; 198 return;
199 199
@@ -252,7 +252,7 @@ static void xics_mask_irq(unsigned int virq)
252{ 252{
253 unsigned int irq; 253 unsigned int irq;
254 254
255 pr_debug("xics: mask virq %d\n", virq); 255 pr_devel("xics: mask virq %d\n", virq);
256 256
257 irq = (unsigned int)irq_map[virq].hwirq; 257 irq = (unsigned int)irq_map[virq].hwirq;
258 if (irq == XICS_IPI || irq == XICS_IRQ_SPURIOUS) 258 if (irq == XICS_IPI || irq == XICS_IRQ_SPURIOUS)
@@ -414,7 +414,7 @@ static int xics_host_match(struct irq_host *h, struct device_node *node)
414static int xics_host_map(struct irq_host *h, unsigned int virq, 414static int xics_host_map(struct irq_host *h, unsigned int virq,
415 irq_hw_number_t hw) 415 irq_hw_number_t hw)
416{ 416{
417 pr_debug("xics: map virq %d, hwirq 0x%lx\n", virq, hw); 417 pr_devel("xics: map virq %d, hwirq 0x%lx\n", virq, hw);
418 418
419 /* Insert the interrupt mapping into the radix tree for fast lookup */ 419 /* Insert the interrupt mapping into the radix tree for fast lookup */
420 irq_radix_revmap_insert(xics_host, virq, hw); 420 irq_radix_revmap_insert(xics_host, virq, hw);
diff --git a/arch/powerpc/sysdev/fsl_rio.c b/arch/powerpc/sysdev/fsl_rio.c
index 39db9d1155d2..cbb3bed75d3c 100644
--- a/arch/powerpc/sysdev/fsl_rio.c
+++ b/arch/powerpc/sysdev/fsl_rio.c
@@ -965,7 +965,7 @@ static inline void fsl_rio_info(struct device *dev, u32 ccsr)
965 break; 965 break;
966 default: 966 default:
967 str = "Unknown"; 967 str = "Unknown";
968 break;; 968 break;
969 } 969 }
970 dev_info(dev, "Hardware port width: %s\n", str); 970 dev_info(dev, "Hardware port width: %s\n", str);
971 971
diff --git a/arch/powerpc/sysdev/ipic.c b/arch/powerpc/sysdev/ipic.c
index a86d3ce01ead..69e2630c9062 100644
--- a/arch/powerpc/sysdev/ipic.c
+++ b/arch/powerpc/sysdev/ipic.c
@@ -728,12 +728,10 @@ struct ipic * __init ipic_init(struct device_node *node, unsigned int flags)
728 if (ret) 728 if (ret)
729 return NULL; 729 return NULL;
730 730
731 ipic = alloc_bootmem(sizeof(struct ipic)); 731 ipic = kzalloc(sizeof(*ipic), GFP_KERNEL);
732 if (ipic == NULL) 732 if (ipic == NULL)
733 return NULL; 733 return NULL;
734 734
735 memset(ipic, 0, sizeof(struct ipic));
736
737 ipic->irqhost = irq_alloc_host(node, IRQ_HOST_MAP_LINEAR, 735 ipic->irqhost = irq_alloc_host(node, IRQ_HOST_MAP_LINEAR,
738 NR_IPIC_INTS, 736 NR_IPIC_INTS,
739 &ipic_host_ops, 0); 737 &ipic_host_ops, 0);
diff --git a/arch/powerpc/sysdev/mpic.c b/arch/powerpc/sysdev/mpic.c
index 9c3af5045495..3981ae4cb58e 100644
--- a/arch/powerpc/sysdev/mpic.c
+++ b/arch/powerpc/sysdev/mpic.c
@@ -279,28 +279,29 @@ static void _mpic_map_mmio(struct mpic *mpic, phys_addr_t phys_addr,
279} 279}
280 280
281#ifdef CONFIG_PPC_DCR 281#ifdef CONFIG_PPC_DCR
282static void _mpic_map_dcr(struct mpic *mpic, struct mpic_reg_bank *rb, 282static void _mpic_map_dcr(struct mpic *mpic, struct device_node *node,
283 struct mpic_reg_bank *rb,
283 unsigned int offset, unsigned int size) 284 unsigned int offset, unsigned int size)
284{ 285{
285 const u32 *dbasep; 286 const u32 *dbasep;
286 287
287 dbasep = of_get_property(mpic->irqhost->of_node, "dcr-reg", NULL); 288 dbasep = of_get_property(node, "dcr-reg", NULL);
288 289
289 rb->dhost = dcr_map(mpic->irqhost->of_node, *dbasep + offset, size); 290 rb->dhost = dcr_map(node, *dbasep + offset, size);
290 BUG_ON(!DCR_MAP_OK(rb->dhost)); 291 BUG_ON(!DCR_MAP_OK(rb->dhost));
291} 292}
292 293
293static inline void mpic_map(struct mpic *mpic, phys_addr_t phys_addr, 294static inline void mpic_map(struct mpic *mpic, struct device_node *node,
294 struct mpic_reg_bank *rb, unsigned int offset, 295 phys_addr_t phys_addr, struct mpic_reg_bank *rb,
295 unsigned int size) 296 unsigned int offset, unsigned int size)
296{ 297{
297 if (mpic->flags & MPIC_USES_DCR) 298 if (mpic->flags & MPIC_USES_DCR)
298 _mpic_map_dcr(mpic, rb, offset, size); 299 _mpic_map_dcr(mpic, node, rb, offset, size);
299 else 300 else
300 _mpic_map_mmio(mpic, phys_addr, rb, offset, size); 301 _mpic_map_mmio(mpic, phys_addr, rb, offset, size);
301} 302}
302#else /* CONFIG_PPC_DCR */ 303#else /* CONFIG_PPC_DCR */
303#define mpic_map(m,p,b,o,s) _mpic_map_mmio(m,p,b,o,s) 304#define mpic_map(m,n,p,b,o,s) _mpic_map_mmio(m,p,b,o,s)
304#endif /* !CONFIG_PPC_DCR */ 305#endif /* !CONFIG_PPC_DCR */
305 306
306 307
@@ -507,9 +508,8 @@ static void __init mpic_scan_ht_pics(struct mpic *mpic)
507 printk(KERN_INFO "mpic: Setting up HT PICs workarounds for U3/U4\n"); 508 printk(KERN_INFO "mpic: Setting up HT PICs workarounds for U3/U4\n");
508 509
509 /* Allocate fixups array */ 510 /* Allocate fixups array */
510 mpic->fixups = alloc_bootmem(128 * sizeof(struct mpic_irq_fixup)); 511 mpic->fixups = kzalloc(128 * sizeof(*mpic->fixups), GFP_KERNEL);
511 BUG_ON(mpic->fixups == NULL); 512 BUG_ON(mpic->fixups == NULL);
512 memset(mpic->fixups, 0, 128 * sizeof(struct mpic_irq_fixup));
513 513
514 /* Init spinlock */ 514 /* Init spinlock */
515 spin_lock_init(&mpic->fixup_lock); 515 spin_lock_init(&mpic->fixup_lock);
@@ -1052,11 +1052,10 @@ struct mpic * __init mpic_alloc(struct device_node *node,
1052 int intvec_top; 1052 int intvec_top;
1053 u64 paddr = phys_addr; 1053 u64 paddr = phys_addr;
1054 1054
1055 mpic = alloc_bootmem(sizeof(struct mpic)); 1055 mpic = kzalloc(sizeof(struct mpic), GFP_KERNEL);
1056 if (mpic == NULL) 1056 if (mpic == NULL)
1057 return NULL; 1057 return NULL;
1058 1058
1059 memset(mpic, 0, sizeof(struct mpic));
1060 mpic->name = name; 1059 mpic->name = name;
1061 1060
1062 mpic->hc_irq = mpic_irq_chip; 1061 mpic->hc_irq = mpic_irq_chip;
@@ -1109,9 +1108,8 @@ struct mpic * __init mpic_alloc(struct device_node *node,
1109 psize /= 4; 1108 psize /= 4;
1110 bits = intvec_top + 1; 1109 bits = intvec_top + 1;
1111 mapsize = BITS_TO_LONGS(bits) * sizeof(unsigned long); 1110 mapsize = BITS_TO_LONGS(bits) * sizeof(unsigned long);
1112 mpic->protected = alloc_bootmem(mapsize); 1111 mpic->protected = kzalloc(mapsize, GFP_KERNEL);
1113 BUG_ON(mpic->protected == NULL); 1112 BUG_ON(mpic->protected == NULL);
1114 memset(mpic->protected, 0, mapsize);
1115 for (i = 0; i < psize; i++) { 1113 for (i = 0; i < psize; i++) {
1116 if (psrc[i] > intvec_top) 1114 if (psrc[i] > intvec_top)
1117 continue; 1115 continue;
@@ -1152,8 +1150,8 @@ struct mpic * __init mpic_alloc(struct device_node *node,
1152 } 1150 }
1153 1151
1154 /* Map the global registers */ 1152 /* Map the global registers */
1155 mpic_map(mpic, paddr, &mpic->gregs, MPIC_INFO(GREG_BASE), 0x1000); 1153 mpic_map(mpic, node, paddr, &mpic->gregs, MPIC_INFO(GREG_BASE), 0x1000);
1156 mpic_map(mpic, paddr, &mpic->tmregs, MPIC_INFO(TIMER_BASE), 0x1000); 1154 mpic_map(mpic, node, paddr, &mpic->tmregs, MPIC_INFO(TIMER_BASE), 0x1000);
1157 1155
1158 /* Reset */ 1156 /* Reset */
1159 if (flags & MPIC_WANTS_RESET) { 1157 if (flags & MPIC_WANTS_RESET) {
@@ -1194,7 +1192,7 @@ struct mpic * __init mpic_alloc(struct device_node *node,
1194 1192
1195 /* Map the per-CPU registers */ 1193 /* Map the per-CPU registers */
1196 for (i = 0; i < mpic->num_cpus; i++) { 1194 for (i = 0; i < mpic->num_cpus; i++) {
1197 mpic_map(mpic, paddr, &mpic->cpuregs[i], 1195 mpic_map(mpic, node, paddr, &mpic->cpuregs[i],
1198 MPIC_INFO(CPU_BASE) + i * MPIC_INFO(CPU_STRIDE), 1196 MPIC_INFO(CPU_BASE) + i * MPIC_INFO(CPU_STRIDE),
1199 0x1000); 1197 0x1000);
1200 } 1198 }
@@ -1202,7 +1200,7 @@ struct mpic * __init mpic_alloc(struct device_node *node,
1202 /* Initialize main ISU if none provided */ 1200 /* Initialize main ISU if none provided */
1203 if (mpic->isu_size == 0) { 1201 if (mpic->isu_size == 0) {
1204 mpic->isu_size = mpic->num_sources; 1202 mpic->isu_size = mpic->num_sources;
1205 mpic_map(mpic, paddr, &mpic->isus[0], 1203 mpic_map(mpic, node, paddr, &mpic->isus[0],
1206 MPIC_INFO(IRQ_BASE), MPIC_INFO(IRQ_STRIDE) * mpic->isu_size); 1204 MPIC_INFO(IRQ_BASE), MPIC_INFO(IRQ_STRIDE) * mpic->isu_size);
1207 } 1205 }
1208 mpic->isu_shift = 1 + __ilog2(mpic->isu_size - 1); 1206 mpic->isu_shift = 1 + __ilog2(mpic->isu_size - 1);
@@ -1256,8 +1254,10 @@ void __init mpic_assign_isu(struct mpic *mpic, unsigned int isu_num,
1256 1254
1257 BUG_ON(isu_num >= MPIC_MAX_ISU); 1255 BUG_ON(isu_num >= MPIC_MAX_ISU);
1258 1256
1259 mpic_map(mpic, paddr, &mpic->isus[isu_num], 0, 1257 mpic_map(mpic, mpic->irqhost->of_node,
1258 paddr, &mpic->isus[isu_num], 0,
1260 MPIC_INFO(IRQ_STRIDE) * mpic->isu_size); 1259 MPIC_INFO(IRQ_STRIDE) * mpic->isu_size);
1260
1261 if ((isu_first + mpic->isu_size) > mpic->num_sources) 1261 if ((isu_first + mpic->isu_size) > mpic->num_sources)
1262 mpic->num_sources = isu_first + mpic->isu_size; 1262 mpic->num_sources = isu_first + mpic->isu_size;
1263} 1263}
@@ -1351,7 +1351,8 @@ void __init mpic_init(struct mpic *mpic)
1351 1351
1352#ifdef CONFIG_PM 1352#ifdef CONFIG_PM
1353 /* allocate memory to save mpic state */ 1353 /* allocate memory to save mpic state */
1354 mpic->save_data = alloc_bootmem(mpic->num_sources * sizeof(struct mpic_irq_save)); 1354 mpic->save_data = kmalloc(mpic->num_sources * sizeof(*mpic->save_data),
1355 GFP_KERNEL);
1355 BUG_ON(mpic->save_data == NULL); 1356 BUG_ON(mpic->save_data == NULL);
1356#endif 1357#endif
1357} 1358}
diff --git a/arch/powerpc/sysdev/ppc4xx_pci.c b/arch/powerpc/sysdev/ppc4xx_pci.c
index daefc93ddffe..6ff9d71b4c0d 100644
--- a/arch/powerpc/sysdev/ppc4xx_pci.c
+++ b/arch/powerpc/sysdev/ppc4xx_pci.c
@@ -1531,7 +1531,7 @@ static void __init ppc4xx_configure_pciex_PIMs(struct ppc4xx_pciex_port *port,
1531 */ 1531 */
1532 1532
1533 /* Calculate window size */ 1533 /* Calculate window size */
1534 sa = (0xffffffffffffffffull << ilog2(ep_size));; 1534 sa = (0xffffffffffffffffull << ilog2(ep_size));
1535 1535
1536 /* Setup BAR0 */ 1536 /* Setup BAR0 */
1537 out_le32(mbase + PECFG_BAR0HMPA, RES_TO_U32_HIGH(sa)); 1537 out_le32(mbase + PECFG_BAR0HMPA, RES_TO_U32_HIGH(sa));
@@ -1550,7 +1550,7 @@ static void __init ppc4xx_configure_pciex_PIMs(struct ppc4xx_pciex_port *port,
1550 out_le32(mbase + PCI_BASE_ADDRESS_1, RES_TO_U32_HIGH(ep_addr)); 1550 out_le32(mbase + PCI_BASE_ADDRESS_1, RES_TO_U32_HIGH(ep_addr));
1551 } else { 1551 } else {
1552 /* Calculate window size */ 1552 /* Calculate window size */
1553 sa = (0xffffffffffffffffull << ilog2(size));; 1553 sa = (0xffffffffffffffffull << ilog2(size));
1554 if (res->flags & IORESOURCE_PREFETCH) 1554 if (res->flags & IORESOURCE_PREFETCH)
1555 sa |= 0x8; 1555 sa |= 0x8;
1556 1556
diff --git a/arch/powerpc/sysdev/qe_lib/qe.c b/arch/powerpc/sysdev/qe_lib/qe.c
index b28b0e512d67..237e3654f48c 100644
--- a/arch/powerpc/sysdev/qe_lib/qe.c
+++ b/arch/powerpc/sysdev/qe_lib/qe.c
@@ -112,6 +112,7 @@ int qe_issue_cmd(u32 cmd, u32 device, u8 mcn_protocol, u32 cmd_input)
112{ 112{
113 unsigned long flags; 113 unsigned long flags;
114 u8 mcn_shift = 0, dev_shift = 0; 114 u8 mcn_shift = 0, dev_shift = 0;
115 u32 ret;
115 116
116 spin_lock_irqsave(&qe_lock, flags); 117 spin_lock_irqsave(&qe_lock, flags);
117 if (cmd == QE_RESET) { 118 if (cmd == QE_RESET) {
@@ -139,11 +140,13 @@ int qe_issue_cmd(u32 cmd, u32 device, u8 mcn_protocol, u32 cmd_input)
139 } 140 }
140 141
141 /* wait for the QE_CR_FLG to clear */ 142 /* wait for the QE_CR_FLG to clear */
142 while(in_be32(&qe_immr->cp.cecr) & QE_CR_FLG) 143 ret = spin_event_timeout((in_be32(&qe_immr->cp.cecr) & QE_CR_FLG) == 0,
143 cpu_relax(); 144 100, 0);
145 /* On timeout (e.g. failure), the expression will be false (ret == 0),
146 otherwise it will be true (ret == 1). */
144 spin_unlock_irqrestore(&qe_lock, flags); 147 spin_unlock_irqrestore(&qe_lock, flags);
145 148
146 return 0; 149 return ret == 1;
147} 150}
148EXPORT_SYMBOL(qe_issue_cmd); 151EXPORT_SYMBOL(qe_issue_cmd);
149 152
diff --git a/arch/powerpc/sysdev/qe_lib/qe_ic.c b/arch/powerpc/sysdev/qe_lib/qe_ic.c
index 63cdf9887f36..074905c3ee5a 100644
--- a/arch/powerpc/sysdev/qe_lib/qe_ic.c
+++ b/arch/powerpc/sysdev/qe_lib/qe_ic.c
@@ -333,12 +333,10 @@ void __init qe_ic_init(struct device_node *node, unsigned int flags,
333 if (ret) 333 if (ret)
334 return; 334 return;
335 335
336 qe_ic = alloc_bootmem(sizeof(struct qe_ic)); 336 qe_ic = kzalloc(sizeof(*qe_ic), GFP_KERNEL);
337 if (qe_ic == NULL) 337 if (qe_ic == NULL)
338 return; 338 return;
339 339
340 memset(qe_ic, 0, sizeof(struct qe_ic));
341
342 qe_ic->irqhost = irq_alloc_host(node, IRQ_HOST_MAP_LINEAR, 340 qe_ic->irqhost = irq_alloc_host(node, IRQ_HOST_MAP_LINEAR,
343 NR_QE_IC_INTS, &qe_ic_host_ops, 0); 341 NR_QE_IC_INTS, &qe_ic_host_ops, 0);
344 if (qe_ic->irqhost == NULL) 342 if (qe_ic->irqhost == NULL)
diff --git a/arch/powerpc/sysdev/uic.c b/arch/powerpc/sysdev/uic.c
index d35405c59434..466ce9ace127 100644
--- a/arch/powerpc/sysdev/uic.c
+++ b/arch/powerpc/sysdev/uic.c
@@ -258,11 +258,10 @@ static struct uic * __init uic_init_one(struct device_node *node)
258 258
259 BUG_ON(! of_device_is_compatible(node, "ibm,uic")); 259 BUG_ON(! of_device_is_compatible(node, "ibm,uic"));
260 260
261 uic = alloc_bootmem(sizeof(*uic)); 261 uic = kzalloc(sizeof(*uic), GFP_KERNEL);
262 if (! uic) 262 if (! uic)
263 return NULL; /* FIXME: panic? */ 263 return NULL; /* FIXME: panic? */
264 264
265 memset(uic, 0, sizeof(*uic));
266 spin_lock_init(&uic->lock); 265 spin_lock_init(&uic->lock);
267 indexp = of_get_property(node, "cell-index", &len); 266 indexp = of_get_property(node, "cell-index", &len);
268 if (!indexp || (len != sizeof(u32))) { 267 if (!indexp || (len != sizeof(u32))) {
diff --git a/arch/s390/Kconfig b/arch/s390/Kconfig
index e577839f3073..2ae5d72f47ed 100644
--- a/arch/s390/Kconfig
+++ b/arch/s390/Kconfig
@@ -95,6 +95,11 @@ config S390
95 select HAVE_ARCH_TRACEHOOK 95 select HAVE_ARCH_TRACEHOOK
96 select INIT_ALL_POSSIBLE 96 select INIT_ALL_POSSIBLE
97 select HAVE_PERF_COUNTERS 97 select HAVE_PERF_COUNTERS
98 select GENERIC_ATOMIC64 if !64BIT
99
100config SCHED_OMIT_FRAME_POINTER
101 bool
102 default y
98 103
99source "init/Kconfig" 104source "init/Kconfig"
100 105
@@ -116,6 +121,9 @@ config 32BIT
116 bool 121 bool
117 default y if !64BIT 122 default y if !64BIT
118 123
124config KTIME_SCALAR
125 def_bool 32BIT
126
119config SMP 127config SMP
120 bool "Symmetric multi-processing support" 128 bool "Symmetric multi-processing support"
121 ---help--- 129 ---help---
diff --git a/arch/s390/include/asm/atomic.h b/arch/s390/include/asm/atomic.h
index fca9dffcc669..c7d0abfb0f00 100644
--- a/arch/s390/include/asm/atomic.h
+++ b/arch/s390/include/asm/atomic.h
@@ -268,7 +268,12 @@ static __inline__ int atomic64_add_unless(atomic64_t *v,
268#define atomic64_inc_not_zero(v) atomic64_add_unless((v), 1, 0) 268#define atomic64_inc_not_zero(v) atomic64_add_unless((v), 1, 0)
269 269
270#undef __CSG_LOOP 270#undef __CSG_LOOP
271#endif 271
272#else /* __s390x__ */
273
274#include <asm-generic/atomic64.h>
275
276#endif /* __s390x__ */
272 277
273#define smp_mb__before_atomic_dec() smp_mb() 278#define smp_mb__before_atomic_dec() smp_mb()
274#define smp_mb__after_atomic_dec() smp_mb() 279#define smp_mb__after_atomic_dec() smp_mb()
diff --git a/arch/s390/include/asm/kvm_host.h b/arch/s390/include/asm/kvm_host.h
index a27d0d5a6f86..1cd02f6073a0 100644
--- a/arch/s390/include/asm/kvm_host.h
+++ b/arch/s390/include/asm/kvm_host.h
@@ -99,7 +99,9 @@ struct kvm_s390_sie_block {
99 __u8 reservedd0[48]; /* 0x00d0 */ 99 __u8 reservedd0[48]; /* 0x00d0 */
100 __u64 gcr[16]; /* 0x0100 */ 100 __u64 gcr[16]; /* 0x0100 */
101 __u64 gbea; /* 0x0180 */ 101 __u64 gbea; /* 0x0180 */
102 __u8 reserved188[120]; /* 0x0188 */ 102 __u8 reserved188[24]; /* 0x0188 */
103 __u32 fac; /* 0x01a0 */
104 __u8 reserved1a4[92]; /* 0x01a4 */
103} __attribute__((packed)); 105} __attribute__((packed));
104 106
105struct kvm_vcpu_stat { 107struct kvm_vcpu_stat {
diff --git a/arch/s390/include/asm/perf_counter.h b/arch/s390/include/asm/perf_counter.h
index a7205a3828cb..7015188c2cc2 100644
--- a/arch/s390/include/asm/perf_counter.h
+++ b/arch/s390/include/asm/perf_counter.h
@@ -6,3 +6,5 @@
6 6
7static inline void set_perf_counter_pending(void) {} 7static inline void set_perf_counter_pending(void) {}
8static inline void clear_perf_counter_pending(void) {} 8static inline void clear_perf_counter_pending(void) {}
9
10#define PERF_COUNTER_INDEX_OFFSET 0
diff --git a/arch/s390/include/asm/thread_info.h b/arch/s390/include/asm/thread_info.h
index 925bcc649035..ba1cab9fc1f9 100644
--- a/arch/s390/include/asm/thread_info.h
+++ b/arch/s390/include/asm/thread_info.h
@@ -61,7 +61,7 @@ struct thread_info {
61 .exec_domain = &default_exec_domain, \ 61 .exec_domain = &default_exec_domain, \
62 .flags = 0, \ 62 .flags = 0, \
63 .cpu = 0, \ 63 .cpu = 0, \
64 .preempt_count = 1, \ 64 .preempt_count = INIT_PREEMPT_COUNT, \
65 .restart_block = { \ 65 .restart_block = { \
66 .fn = do_no_restart_syscall, \ 66 .fn = do_no_restart_syscall, \
67 }, \ 67 }, \
diff --git a/arch/s390/kernel/dis.c b/arch/s390/kernel/dis.c
index d2f270c995d9..db943a7ec513 100644
--- a/arch/s390/kernel/dis.c
+++ b/arch/s390/kernel/dis.c
@@ -15,7 +15,6 @@
15#include <linux/timer.h> 15#include <linux/timer.h>
16#include <linux/mm.h> 16#include <linux/mm.h>
17#include <linux/smp.h> 17#include <linux/smp.h>
18#include <linux/smp_lock.h>
19#include <linux/init.h> 18#include <linux/init.h>
20#include <linux/interrupt.h> 19#include <linux/interrupt.h>
21#include <linux/delay.h> 20#include <linux/delay.h>
diff --git a/arch/s390/kernel/ipl.c b/arch/s390/kernel/ipl.c
index b8bf4b140065..371a2d88f4ac 100644
--- a/arch/s390/kernel/ipl.c
+++ b/arch/s390/kernel/ipl.c
@@ -70,6 +70,7 @@ struct shutdown_action {
70 char *name; 70 char *name;
71 void (*fn) (struct shutdown_trigger *trigger); 71 void (*fn) (struct shutdown_trigger *trigger);
72 int (*init) (void); 72 int (*init) (void);
73 int init_rc;
73}; 74};
74 75
75static char *ipl_type_str(enum ipl_type type) 76static char *ipl_type_str(enum ipl_type type)
@@ -1486,11 +1487,13 @@ static int set_trigger(const char *buf, struct shutdown_trigger *trigger,
1486 int i; 1487 int i;
1487 1488
1488 for (i = 0; i < SHUTDOWN_ACTIONS_COUNT; i++) { 1489 for (i = 0; i < SHUTDOWN_ACTIONS_COUNT; i++) {
1489 if (!shutdown_actions_list[i])
1490 continue;
1491 if (sysfs_streq(buf, shutdown_actions_list[i]->name)) { 1490 if (sysfs_streq(buf, shutdown_actions_list[i]->name)) {
1492 trigger->action = shutdown_actions_list[i]; 1491 if (shutdown_actions_list[i]->init_rc) {
1493 return len; 1492 return shutdown_actions_list[i]->init_rc;
1493 } else {
1494 trigger->action = shutdown_actions_list[i];
1495 return len;
1496 }
1494 } 1497 }
1495 } 1498 }
1496 return -EINVAL; 1499 return -EINVAL;
@@ -1640,8 +1643,8 @@ static void __init shutdown_actions_init(void)
1640 for (i = 0; i < SHUTDOWN_ACTIONS_COUNT; i++) { 1643 for (i = 0; i < SHUTDOWN_ACTIONS_COUNT; i++) {
1641 if (!shutdown_actions_list[i]->init) 1644 if (!shutdown_actions_list[i]->init)
1642 continue; 1645 continue;
1643 if (shutdown_actions_list[i]->init()) 1646 shutdown_actions_list[i]->init_rc =
1644 shutdown_actions_list[i] = NULL; 1647 shutdown_actions_list[i]->init();
1645 } 1648 }
1646} 1649}
1647 1650
diff --git a/arch/s390/kernel/ptrace.c b/arch/s390/kernel/ptrace.c
index 490b39934d65..43acd73105b7 100644
--- a/arch/s390/kernel/ptrace.c
+++ b/arch/s390/kernel/ptrace.c
@@ -26,7 +26,6 @@
26#include <linux/sched.h> 26#include <linux/sched.h>
27#include <linux/mm.h> 27#include <linux/mm.h>
28#include <linux/smp.h> 28#include <linux/smp.h>
29#include <linux/smp_lock.h>
30#include <linux/errno.h> 29#include <linux/errno.h>
31#include <linux/ptrace.h> 30#include <linux/ptrace.h>
32#include <linux/user.h> 31#include <linux/user.h>
diff --git a/arch/s390/kvm/kvm-s390.c b/arch/s390/kvm/kvm-s390.c
index c18b21d6991c..90d9d1ba258b 100644
--- a/arch/s390/kvm/kvm-s390.c
+++ b/arch/s390/kvm/kvm-s390.c
@@ -25,6 +25,7 @@
25#include <asm/lowcore.h> 25#include <asm/lowcore.h>
26#include <asm/pgtable.h> 26#include <asm/pgtable.h>
27#include <asm/nmi.h> 27#include <asm/nmi.h>
28#include <asm/system.h>
28#include "kvm-s390.h" 29#include "kvm-s390.h"
29#include "gaccess.h" 30#include "gaccess.h"
30 31
@@ -69,6 +70,7 @@ struct kvm_stats_debugfs_item debugfs_entries[] = {
69 { NULL } 70 { NULL }
70}; 71};
71 72
73static unsigned long long *facilities;
72 74
73/* Section: not file related */ 75/* Section: not file related */
74void kvm_arch_hardware_enable(void *garbage) 76void kvm_arch_hardware_enable(void *garbage)
@@ -288,6 +290,7 @@ int kvm_arch_vcpu_setup(struct kvm_vcpu *vcpu)
288 vcpu->arch.sie_block->gmsor = vcpu->kvm->arch.guest_origin; 290 vcpu->arch.sie_block->gmsor = vcpu->kvm->arch.guest_origin;
289 vcpu->arch.sie_block->ecb = 2; 291 vcpu->arch.sie_block->ecb = 2;
290 vcpu->arch.sie_block->eca = 0xC1002001U; 292 vcpu->arch.sie_block->eca = 0xC1002001U;
293 vcpu->arch.sie_block->fac = (int) (long) facilities;
291 hrtimer_init(&vcpu->arch.ckc_timer, CLOCK_REALTIME, HRTIMER_MODE_ABS); 294 hrtimer_init(&vcpu->arch.ckc_timer, CLOCK_REALTIME, HRTIMER_MODE_ABS);
292 tasklet_init(&vcpu->arch.tasklet, kvm_s390_tasklet, 295 tasklet_init(&vcpu->arch.tasklet, kvm_s390_tasklet,
293 (unsigned long) vcpu); 296 (unsigned long) vcpu);
@@ -739,11 +742,29 @@ gfn_t unalias_gfn(struct kvm *kvm, gfn_t gfn)
739 742
740static int __init kvm_s390_init(void) 743static int __init kvm_s390_init(void)
741{ 744{
742 return kvm_init(NULL, sizeof(struct kvm_vcpu), THIS_MODULE); 745 int ret;
746 ret = kvm_init(NULL, sizeof(struct kvm_vcpu), THIS_MODULE);
747 if (ret)
748 return ret;
749
750 /*
751 * guests can ask for up to 255+1 double words, we need a full page
752 * to hold the maximum amount of facilites. On the other hand, we
753 * only set facilities that are known to work in KVM.
754 */
755 facilities = (unsigned long long *) get_zeroed_page(GFP_DMA);
756 if (!facilities) {
757 kvm_exit();
758 return -ENOMEM;
759 }
760 stfle(facilities, 1);
761 facilities[0] &= 0xff00fff3f0700000ULL;
762 return 0;
743} 763}
744 764
745static void __exit kvm_s390_exit(void) 765static void __exit kvm_s390_exit(void)
746{ 766{
767 free_page((unsigned long) facilities);
747 kvm_exit(); 768 kvm_exit();
748} 769}
749 770
diff --git a/arch/s390/kvm/priv.c b/arch/s390/kvm/priv.c
index 93ecd06e1a74..d426aac8095d 100644
--- a/arch/s390/kvm/priv.c
+++ b/arch/s390/kvm/priv.c
@@ -158,7 +158,7 @@ static int handle_stfl(struct kvm_vcpu *vcpu)
158 158
159 vcpu->stat.instruction_stfl++; 159 vcpu->stat.instruction_stfl++;
160 /* only pass the facility bits, which we can handle */ 160 /* only pass the facility bits, which we can handle */
161 facility_list &= 0xfe00fff3; 161 facility_list &= 0xff00fff3;
162 162
163 rc = copy_to_guest(vcpu, offsetof(struct _lowcore, stfl_fac_list), 163 rc = copy_to_guest(vcpu, offsetof(struct _lowcore, stfl_fac_list),
164 &facility_list, sizeof(facility_list)); 164 &facility_list, sizeof(facility_list));
diff --git a/arch/s390/lib/Makefile b/arch/s390/lib/Makefile
index ab6735df2d21..97975ec7a274 100644
--- a/arch/s390/lib/Makefile
+++ b/arch/s390/lib/Makefile
@@ -3,6 +3,6 @@
3# 3#
4 4
5lib-y += delay.o string.o uaccess_std.o uaccess_pt.o 5lib-y += delay.o string.o uaccess_std.o uaccess_pt.o
6obj-$(CONFIG_32BIT) += div64.o qrnnd.o 6obj-$(CONFIG_32BIT) += div64.o qrnnd.o ucmpdi2.o
7lib-$(CONFIG_64BIT) += uaccess_mvcos.o 7lib-$(CONFIG_64BIT) += uaccess_mvcos.o
8lib-$(CONFIG_SMP) += spinlock.o 8lib-$(CONFIG_SMP) += spinlock.o
diff --git a/arch/s390/lib/delay.c b/arch/s390/lib/delay.c
index 3f5f680726ed..97c1eca83cc2 100644
--- a/arch/s390/lib/delay.c
+++ b/arch/s390/lib/delay.c
@@ -36,9 +36,11 @@ static void __udelay_disabled(unsigned long usecs)
36 cr0 = (cr0_saved & 0xffff00e0) | 0x00000800; 36 cr0 = (cr0_saved & 0xffff00e0) | 0x00000800;
37 __ctl_load(cr0 , 0, 0); 37 __ctl_load(cr0 , 0, 0);
38 mask = psw_kernel_bits | PSW_MASK_WAIT | PSW_MASK_EXT; 38 mask = psw_kernel_bits | PSW_MASK_WAIT | PSW_MASK_EXT;
39 lockdep_off();
39 trace_hardirqs_on(); 40 trace_hardirqs_on();
40 __load_psw_mask(mask); 41 __load_psw_mask(mask);
41 local_irq_disable(); 42 local_irq_disable();
43 lockdep_on();
42 __ctl_load(cr0_saved, 0, 0); 44 __ctl_load(cr0_saved, 0, 0);
43 local_tick_enable(clock_saved); 45 local_tick_enable(clock_saved);
44 set_clock_comparator(S390_lowcore.clock_comparator); 46 set_clock_comparator(S390_lowcore.clock_comparator);
diff --git a/arch/s390/lib/ucmpdi2.c b/arch/s390/lib/ucmpdi2.c
new file mode 100644
index 000000000000..3e05ff532582
--- /dev/null
+++ b/arch/s390/lib/ucmpdi2.c
@@ -0,0 +1,26 @@
1#include <linux/module.h>
2
3union ull_union {
4 unsigned long long ull;
5 struct {
6 unsigned int high;
7 unsigned int low;
8 } ui;
9};
10
11int __ucmpdi2(unsigned long long a, unsigned long long b)
12{
13 union ull_union au = {.ull = a};
14 union ull_union bu = {.ull = b};
15
16 if (au.ui.high < bu.ui.high)
17 return 0;
18 else if (au.ui.high > bu.ui.high)
19 return 2;
20 if (au.ui.low < bu.ui.low)
21 return 0;
22 else if (au.ui.low > bu.ui.low)
23 return 2;
24 return 1;
25}
26EXPORT_SYMBOL(__ucmpdi2);
diff --git a/arch/s390/mm/fault.c b/arch/s390/mm/fault.c
index 74eb26bf1970..e5e119fe03b2 100644
--- a/arch/s390/mm/fault.c
+++ b/arch/s390/mm/fault.c
@@ -22,7 +22,6 @@
22#include <linux/compat.h> 22#include <linux/compat.h>
23#include <linux/smp.h> 23#include <linux/smp.h>
24#include <linux/kdebug.h> 24#include <linux/kdebug.h>
25#include <linux/smp_lock.h>
26#include <linux/init.h> 25#include <linux/init.h>
27#include <linux/console.h> 26#include <linux/console.h>
28#include <linux/module.h> 27#include <linux/module.h>
diff --git a/arch/sh/Kconfig.debug b/arch/sh/Kconfig.debug
index 8ece0b5bd028..39224b57c6ef 100644
--- a/arch/sh/Kconfig.debug
+++ b/arch/sh/Kconfig.debug
@@ -61,10 +61,6 @@ config EARLY_PRINTK
61 select both the EARLY_SCIF_CONSOLE and SH_STANDARD_BIOS, using 61 select both the EARLY_SCIF_CONSOLE and SH_STANDARD_BIOS, using
62 the kernel command line option to toggle back and forth. 62 the kernel command line option to toggle back and forth.
63 63
64config DEBUG_BOOTMEM
65 depends on DEBUG_KERNEL
66 bool "Debug BOOTMEM initialization"
67
68config DEBUG_STACKOVERFLOW 64config DEBUG_STACKOVERFLOW
69 bool "Check for stack overflows" 65 bool "Check for stack overflows"
70 depends on DEBUG_KERNEL && SUPERH32 66 depends on DEBUG_KERNEL && SUPERH32
diff --git a/arch/sh/boards/mach-se/7206/io.c b/arch/sh/boards/mach-se/7206/io.c
index 9c3a33210d61..180455642a43 100644
--- a/arch/sh/boards/mach-se/7206/io.c
+++ b/arch/sh/boards/mach-se/7206/io.c
@@ -50,7 +50,7 @@ unsigned char se7206_inb_p(unsigned long port)
50 50
51unsigned short se7206_inw(unsigned long port) 51unsigned short se7206_inw(unsigned long port)
52{ 52{
53 return *port2adr(port);; 53 return *port2adr(port);
54} 54}
55 55
56void se7206_outb(unsigned char value, unsigned long port) 56void se7206_outb(unsigned char value, unsigned long port)
diff --git a/arch/sh/boards/mach-se/7724/setup.c b/arch/sh/boards/mach-se/7724/setup.c
index 9cd04bd558b8..8fed45a2fb85 100644
--- a/arch/sh/boards/mach-se/7724/setup.c
+++ b/arch/sh/boards/mach-se/7724/setup.c
@@ -19,10 +19,13 @@
19#include <linux/smc91x.h> 19#include <linux/smc91x.h>
20#include <linux/gpio.h> 20#include <linux/gpio.h>
21#include <linux/input.h> 21#include <linux/input.h>
22#include <linux/usb/r8a66597.h>
22#include <video/sh_mobile_lcdc.h> 23#include <video/sh_mobile_lcdc.h>
23#include <media/sh_mobile_ceu.h> 24#include <media/sh_mobile_ceu.h>
24#include <asm/io.h> 25#include <asm/io.h>
25#include <asm/heartbeat.h> 26#include <asm/heartbeat.h>
27#include <asm/sh_eth.h>
28#include <asm/clock.h>
26#include <asm/sh_keysc.h> 29#include <asm/sh_keysc.h>
27#include <cpu/sh7724.h> 30#include <cpu/sh7724.h>
28#include <mach-se/mach/se7724.h> 31#include <mach-se/mach/se7724.h>
@@ -272,6 +275,62 @@ static struct platform_device keysc_device = {
272 }, 275 },
273}; 276};
274 277
278/* SH Eth */
279static struct resource sh_eth_resources[] = {
280 [0] = {
281 .start = SH_ETH_ADDR,
282 .end = SH_ETH_ADDR + 0x1FC,
283 .flags = IORESOURCE_MEM,
284 },
285 [1] = {
286 .start = 91,
287 .flags = IORESOURCE_IRQ | IORESOURCE_IRQ_HIGHLEVEL,
288 },
289};
290
291struct sh_eth_plat_data sh_eth_plat = {
292 .phy = 0x1f, /* SMSC LAN8187 */
293 .edmac_endian = EDMAC_LITTLE_ENDIAN,
294};
295
296static struct platform_device sh_eth_device = {
297 .name = "sh-eth",
298 .id = 0,
299 .dev = {
300 .platform_data = &sh_eth_plat,
301 },
302 .num_resources = ARRAY_SIZE(sh_eth_resources),
303 .resource = sh_eth_resources,
304};
305
306static struct r8a66597_platdata sh7724_usb0_host_data = {
307};
308
309static struct resource sh7724_usb0_host_resources[] = {
310 [0] = {
311 .start = 0xa4d80000,
312 .end = 0xa4d800ff,
313 .flags = IORESOURCE_MEM,
314 },
315 [1] = {
316 .start = 65,
317 .end = 65,
318 .flags = IORESOURCE_IRQ | IRQF_TRIGGER_LOW,
319 },
320};
321
322static struct platform_device sh7724_usb0_host_device = {
323 .name = "r8a66597_hcd",
324 .id = 0,
325 .dev = {
326 .dma_mask = NULL, /* not use dma */
327 .coherent_dma_mask = 0xffffffff,
328 .platform_data = &sh7724_usb0_host_data,
329 },
330 .num_resources = ARRAY_SIZE(sh7724_usb0_host_resources),
331 .resource = sh7724_usb0_host_resources,
332};
333
275static struct platform_device *ms7724se_devices[] __initdata = { 334static struct platform_device *ms7724se_devices[] __initdata = {
276 &heartbeat_device, 335 &heartbeat_device,
277 &smc91x_eth_device, 336 &smc91x_eth_device,
@@ -280,11 +339,62 @@ static struct platform_device *ms7724se_devices[] __initdata = {
280 &ceu0_device, 339 &ceu0_device,
281 &ceu1_device, 340 &ceu1_device,
282 &keysc_device, 341 &keysc_device,
342 &sh_eth_device,
343 &sh7724_usb0_host_device,
283}; 344};
284 345
346#define EEPROM_OP 0xBA206000
347#define EEPROM_ADR 0xBA206004
348#define EEPROM_DATA 0xBA20600C
349#define EEPROM_STAT 0xBA206010
350#define EEPROM_STRT 0xBA206014
351static int __init sh_eth_is_eeprom_ready(void)
352{
353 int t = 10000;
354
355 while (t--) {
356 if (!ctrl_inw(EEPROM_STAT))
357 return 1;
358 cpu_relax();
359 }
360
361 printk(KERN_ERR "ms7724se can not access to eeprom\n");
362 return 0;
363}
364
365static void __init sh_eth_init(void)
366{
367 int i;
368 u16 mac[3];
369
370 /* check EEPROM status */
371 if (!sh_eth_is_eeprom_ready())
372 return;
373
374 /* read MAC addr from EEPROM */
375 for (i = 0 ; i < 3 ; i++) {
376 ctrl_outw(0x0, EEPROM_OP); /* read */
377 ctrl_outw(i*2, EEPROM_ADR);
378 ctrl_outw(0x1, EEPROM_STRT);
379 if (!sh_eth_is_eeprom_ready())
380 return;
381
382 mac[i] = ctrl_inw(EEPROM_DATA);
383 mac[i] = ((mac[i] & 0xFF) << 8) | (mac[i] >> 8); /* swap */
384 }
385
386 /* reset sh-eth */
387 ctrl_outl(0x1, SH_ETH_ADDR + 0x0);
388
389 /* set MAC addr */
390 ctrl_outl(((mac[0] << 16) | (mac[1])), SH_ETH_MAHR);
391 ctrl_outl((mac[2]), SH_ETH_MALR);
392}
393
285#define SW4140 0xBA201000 394#define SW4140 0xBA201000
286#define FPGA_OUT 0xBA200400 395#define FPGA_OUT 0xBA200400
287#define PORT_HIZA 0xA4050158 396#define PORT_HIZA 0xA4050158
397#define PORT_MSELCRB 0xA4050182
288 398
289#define SW41_A 0x0100 399#define SW41_A 0x0100
290#define SW41_B 0x0200 400#define SW41_B 0x0200
@@ -294,6 +404,7 @@ static struct platform_device *ms7724se_devices[] __initdata = {
294#define SW41_F 0x2000 404#define SW41_F 0x2000
295#define SW41_G 0x4000 405#define SW41_G 0x4000
296#define SW41_H 0x8000 406#define SW41_H 0x8000
407
297static int __init devices_setup(void) 408static int __init devices_setup(void)
298{ 409{
299 u16 sw = ctrl_inw(SW4140); /* select camera, monitor */ 410 u16 sw = ctrl_inw(SW4140); /* select camera, monitor */
@@ -302,9 +413,16 @@ static int __init devices_setup(void)
302 ctrl_outw(ctrl_inw(FPGA_OUT) & 413 ctrl_outw(ctrl_inw(FPGA_OUT) &
303 ~((1 << 1) | /* LAN */ 414 ~((1 << 1) | /* LAN */
304 (1 << 6) | /* VIDEO DAC */ 415 (1 << 6) | /* VIDEO DAC */
305 (1 << 12)), /* USB0 */ 416 (1 << 12) | /* USB0 */
417 (1 << 14)), /* RMII */
306 FPGA_OUT); 418 FPGA_OUT);
307 419
420 /* turn on USB clocks, use external clock */
421 ctrl_outw((ctrl_inw(PORT_MSELCRB) & ~0xc000) | 0x8000, PORT_MSELCRB);
422
423 /* enable USB0 port */
424 ctrl_outw(0x0600, 0xa40501d4);
425
308 /* enable IRQ 0,1,2 */ 426 /* enable IRQ 0,1,2 */
309 gpio_request(GPIO_FN_INTC_IRQ0, NULL); 427 gpio_request(GPIO_FN_INTC_IRQ0, NULL);
310 gpio_request(GPIO_FN_INTC_IRQ1, NULL); 428 gpio_request(GPIO_FN_INTC_IRQ1, NULL);
@@ -374,7 +492,7 @@ static int __init devices_setup(void)
374 gpio_request(GPIO_FN_VIO0_CLK, NULL); 492 gpio_request(GPIO_FN_VIO0_CLK, NULL);
375 gpio_request(GPIO_FN_VIO0_FLD, NULL); 493 gpio_request(GPIO_FN_VIO0_FLD, NULL);
376 gpio_request(GPIO_FN_VIO0_HD, NULL); 494 gpio_request(GPIO_FN_VIO0_HD, NULL);
377 platform_resource_setup_memory(&ceu0_device, "ceu", 4 << 20); 495 platform_resource_setup_memory(&ceu0_device, "ceu0", 4 << 20);
378 496
379 /* enable CEU1 */ 497 /* enable CEU1 */
380 gpio_request(GPIO_FN_VIO1_D7, NULL); 498 gpio_request(GPIO_FN_VIO1_D7, NULL);
@@ -389,7 +507,7 @@ static int __init devices_setup(void)
389 gpio_request(GPIO_FN_VIO1_HD, NULL); 507 gpio_request(GPIO_FN_VIO1_HD, NULL);
390 gpio_request(GPIO_FN_VIO1_VD, NULL); 508 gpio_request(GPIO_FN_VIO1_VD, NULL);
391 gpio_request(GPIO_FN_VIO1_CLK, NULL); 509 gpio_request(GPIO_FN_VIO1_CLK, NULL);
392 platform_resource_setup_memory(&ceu1_device, "ceu", 4 << 20); 510 platform_resource_setup_memory(&ceu1_device, "ceu1", 4 << 20);
393 511
394 /* KEYSC */ 512 /* KEYSC */
395 gpio_request(GPIO_FN_KEYOUT5_IN5, NULL); 513 gpio_request(GPIO_FN_KEYOUT5_IN5, NULL);
@@ -404,6 +522,28 @@ static int __init devices_setup(void)
404 gpio_request(GPIO_FN_KEYOUT1, NULL); 522 gpio_request(GPIO_FN_KEYOUT1, NULL);
405 gpio_request(GPIO_FN_KEYOUT0, NULL); 523 gpio_request(GPIO_FN_KEYOUT0, NULL);
406 524
525 /*
526 * enable SH-Eth
527 *
528 * please remove J33 pin from your board !!
529 *
530 * ms7724 board should not use GPIO_FN_LNKSTA pin
531 * So, This time PTX5 is set to input pin
532 */
533 gpio_request(GPIO_FN_RMII_RXD0, NULL);
534 gpio_request(GPIO_FN_RMII_RXD1, NULL);
535 gpio_request(GPIO_FN_RMII_TXD0, NULL);
536 gpio_request(GPIO_FN_RMII_TXD1, NULL);
537 gpio_request(GPIO_FN_RMII_REF_CLK, NULL);
538 gpio_request(GPIO_FN_RMII_TX_EN, NULL);
539 gpio_request(GPIO_FN_RMII_RX_ER, NULL);
540 gpio_request(GPIO_FN_RMII_CRS_DV, NULL);
541 gpio_request(GPIO_FN_MDIO, NULL);
542 gpio_request(GPIO_FN_MDC, NULL);
543 gpio_request(GPIO_PTX5, NULL);
544 gpio_direction_input(GPIO_PTX5);
545 sh_eth_init();
546
407 if (sw & SW41_B) { 547 if (sw & SW41_B) {
408 /* SVGA */ 548 /* SVGA */
409 lcdc_info.ch[0].lcd_cfg.xres = 800; 549 lcdc_info.ch[0].lcd_cfg.xres = 800;
@@ -437,7 +577,7 @@ static int __init devices_setup(void)
437 } 577 }
438 578
439 return platform_add_devices(ms7724se_devices, 579 return platform_add_devices(ms7724se_devices,
440 ARRAY_SIZE(ms7724se_devices)); 580 ARRAY_SIZE(ms7724se_devices));
441} 581}
442device_initcall(devices_setup); 582device_initcall(devices_setup);
443 583
diff --git a/arch/sh/configs/migor_defconfig b/arch/sh/configs/migor_defconfig
index da627d22c009..b18cfd39cac6 100644
--- a/arch/sh/configs/migor_defconfig
+++ b/arch/sh/configs/migor_defconfig
@@ -309,7 +309,7 @@ CONFIG_ZERO_PAGE_OFFSET=0x00001000
309CONFIG_BOOT_LINK_OFFSET=0x00800000 309CONFIG_BOOT_LINK_OFFSET=0x00800000
310CONFIG_ENTRY_OFFSET=0x00001000 310CONFIG_ENTRY_OFFSET=0x00001000
311CONFIG_CMDLINE_BOOL=y 311CONFIG_CMDLINE_BOOL=y
312CONFIG_CMDLINE="console=ttySC0,115200 earlyprintk=serial ip=on root=/dev/nfs ip=dhcp" 312CONFIG_CMDLINE="console=tty0 console=ttySC0,115200 earlyprintk=serial ip=on root=/dev/nfs ip=dhcp"
313 313
314# 314#
315# Bus options 315# Bus options
@@ -858,7 +858,35 @@ CONFIG_VIDEO_SH_MOBILE_CEU=y
858# 858#
859# CONFIG_VGASTATE is not set 859# CONFIG_VGASTATE is not set
860# CONFIG_VIDEO_OUTPUT_CONTROL is not set 860# CONFIG_VIDEO_OUTPUT_CONTROL is not set
861# CONFIG_FB is not set 861CONFIG_FB=y
862# CONFIG_FIRMWARE_EDID is not set
863# CONFIG_FB_DDC is not set
864# CONFIG_FB_BOOT_VESA_SUPPORT is not set
865# CONFIG_FB_CFB_FILLRECT is not set
866# CONFIG_FB_CFB_COPYAREA is not set
867# CONFIG_FB_CFB_IMAGEBLIT is not set
868# CONFIG_FB_CFB_REV_PIXELS_IN_BYTE is not set
869CONFIG_FB_SYS_FILLRECT=y
870CONFIG_FB_SYS_COPYAREA=y
871CONFIG_FB_SYS_IMAGEBLIT=y
872# CONFIG_FB_FOREIGN_ENDIAN is not set
873CONFIG_FB_SYS_FOPS=y
874CONFIG_FB_DEFERRED_IO=y
875# CONFIG_FB_SVGALIB is not set
876# CONFIG_FB_MACMODES is not set
877# CONFIG_FB_BACKLIGHT is not set
878# CONFIG_FB_MODE_HELPERS is not set
879# CONFIG_FB_TILEBLITTING is not set
880
881#
882# Frame buffer hardware drivers
883#
884# CONFIG_FB_S1D13XXX is not set
885CONFIG_FB_SH_MOBILE_LCDC=y
886# CONFIG_FB_VIRTUAL is not set
887# CONFIG_FB_METRONOME is not set
888# CONFIG_FB_MB862XX is not set
889# CONFIG_FB_BROADSHEET is not set
862# CONFIG_BACKLIGHT_LCD_SUPPORT is not set 890# CONFIG_BACKLIGHT_LCD_SUPPORT is not set
863 891
864# 892#
@@ -870,6 +898,27 @@ CONFIG_VIDEO_SH_MOBILE_CEU=y
870# Console display driver support 898# Console display driver support
871# 899#
872CONFIG_DUMMY_CONSOLE=y 900CONFIG_DUMMY_CONSOLE=y
901CONFIG_FRAMEBUFFER_CONSOLE=y
902CONFIG_FRAMEBUFFER_CONSOLE_DETECT_PRIMARY=y
903# CONFIG_FRAMEBUFFER_CONSOLE_ROTATION is not set
904CONFIG_FONTS=y
905# CONFIG_FONT_8x8 is not set
906# CONFIG_FONT_8x16 is not set
907# CONFIG_FONT_6x11 is not set
908# CONFIG_FONT_7x14 is not set
909# CONFIG_FONT_PEARL_8x8 is not set
910# CONFIG_FONT_ACORN_8x8 is not set
911CONFIG_FONT_MINI_4x6=y
912# CONFIG_FONT_SUN8x16 is not set
913# CONFIG_FONT_SUN12x22 is not set
914# CONFIG_FONT_10x18 is not set
915CONFIG_LOGO=y
916# CONFIG_LOGO_LINUX_MONO is not set
917# CONFIG_LOGO_LINUX_VGA16 is not set
918# CONFIG_LOGO_LINUX_CLUT224 is not set
919# CONFIG_LOGO_SUPERH_MONO is not set
920CONFIG_LOGO_SUPERH_VGA16=y
921# CONFIG_LOGO_SUPERH_CLUT224 is not set
873# CONFIG_SOUND is not set 922# CONFIG_SOUND is not set
874CONFIG_HID_SUPPORT=y 923CONFIG_HID_SUPPORT=y
875CONFIG_HID=y 924CONFIG_HID=y
diff --git a/arch/sh/configs/se7724_defconfig b/arch/sh/configs/se7724_defconfig
index 3840270283e4..3ee783a0a075 100644
--- a/arch/sh/configs/se7724_defconfig
+++ b/arch/sh/configs/se7724_defconfig
@@ -1,7 +1,7 @@
1# 1#
2# Automatically generated make config: don't edit 2# Automatically generated make config: don't edit
3# Linux kernel version: 2.6.30 3# Linux kernel version: 2.6.30
4# Thu Jun 18 16:09:05 2009 4# Mon Jun 29 16:28:43 2009
5# 5#
6CONFIG_SUPERH=y 6CONFIG_SUPERH=y
7CONFIG_SUPERH32=y 7CONFIG_SUPERH32=y
@@ -14,6 +14,7 @@ CONFIG_GENERIC_HWEIGHT=y
14CONFIG_GENERIC_HARDIRQS=y 14CONFIG_GENERIC_HARDIRQS=y
15CONFIG_GENERIC_HARDIRQS_NO__DO_IRQ=y 15CONFIG_GENERIC_HARDIRQS_NO__DO_IRQ=y
16CONFIG_GENERIC_IRQ_PROBE=y 16CONFIG_GENERIC_IRQ_PROBE=y
17CONFIG_IRQ_PER_CPU=y
17CONFIG_GENERIC_GPIO=y 18CONFIG_GENERIC_GPIO=y
18CONFIG_GENERIC_TIME=y 19CONFIG_GENERIC_TIME=y
19CONFIG_GENERIC_CLOCKEVENTS=y 20CONFIG_GENERIC_CLOCKEVENTS=y
@@ -28,7 +29,9 @@ CONFIG_HAVE_LATENCYTOP_SUPPORT=y
28# CONFIG_ARCH_HAS_ILOG2_U64 is not set 29# CONFIG_ARCH_HAS_ILOG2_U64 is not set
29CONFIG_ARCH_NO_VIRT_TO_BUS=y 30CONFIG_ARCH_NO_VIRT_TO_BUS=y
30CONFIG_ARCH_HAS_DEFAULT_IDLE=y 31CONFIG_ARCH_HAS_DEFAULT_IDLE=y
32CONFIG_ARCH_HAS_CPU_IDLE_WAIT=y
31CONFIG_DEFCONFIG_LIST="/lib/modules/$UNAME_RELEASE/.config" 33CONFIG_DEFCONFIG_LIST="/lib/modules/$UNAME_RELEASE/.config"
34CONFIG_CONSTRUCTORS=y
32 35
33# 36#
34# General setup 37# General setup
@@ -88,10 +91,12 @@ CONFIG_TIMERFD=y
88CONFIG_EVENTFD=y 91CONFIG_EVENTFD=y
89CONFIG_SHMEM=y 92CONFIG_SHMEM=y
90CONFIG_AIO=y 93CONFIG_AIO=y
94CONFIG_HAVE_PERF_COUNTERS=y
91 95
92# 96#
93# Performance Counters 97# Performance Counters
94# 98#
99# CONFIG_PERF_COUNTERS is not set
95CONFIG_VM_EVENT_COUNTERS=y 100CONFIG_VM_EVENT_COUNTERS=y
96# CONFIG_STRIP_ASM_SYMS is not set 101# CONFIG_STRIP_ASM_SYMS is not set
97CONFIG_COMPAT_BRK=y 102CONFIG_COMPAT_BRK=y
@@ -107,6 +112,10 @@ CONFIG_HAVE_KRETPROBES=y
107CONFIG_HAVE_ARCH_TRACEHOOK=y 112CONFIG_HAVE_ARCH_TRACEHOOK=y
108CONFIG_HAVE_CLK=y 113CONFIG_HAVE_CLK=y
109CONFIG_HAVE_DMA_API_DEBUG=y 114CONFIG_HAVE_DMA_API_DEBUG=y
115
116#
117# GCOV-based kernel profiling
118#
110# CONFIG_SLOW_WORK is not set 119# CONFIG_SLOW_WORK is not set
111CONFIG_HAVE_GENERIC_DMA_COHERENT=y 120CONFIG_HAVE_GENERIC_DMA_COHERENT=y
112CONFIG_SLABINFO=y 121CONFIG_SLABINFO=y
@@ -119,7 +128,7 @@ CONFIG_MODULE_UNLOAD=y
119# CONFIG_MODVERSIONS is not set 128# CONFIG_MODVERSIONS is not set
120# CONFIG_MODULE_SRCVERSION_ALL is not set 129# CONFIG_MODULE_SRCVERSION_ALL is not set
121CONFIG_BLOCK=y 130CONFIG_BLOCK=y
122# CONFIG_LBD is not set 131CONFIG_LBDAF=y
123# CONFIG_BLK_DEV_BSG is not set 132# CONFIG_BLK_DEV_BSG is not set
124# CONFIG_BLK_DEV_INTEGRITY is not set 133# CONFIG_BLK_DEV_INTEGRITY is not set
125 134
@@ -584,7 +593,6 @@ CONFIG_SCSI_WAIT_SCAN=m
584# CONFIG_SCSI_SRP_ATTRS is not set 593# CONFIG_SCSI_SRP_ATTRS is not set
585CONFIG_SCSI_LOWLEVEL=y 594CONFIG_SCSI_LOWLEVEL=y
586# CONFIG_ISCSI_TCP is not set 595# CONFIG_ISCSI_TCP is not set
587# CONFIG_SCSI_BNX2_ISCSI is not set
588# CONFIG_LIBFC is not set 596# CONFIG_LIBFC is not set
589# CONFIG_LIBFCOE is not set 597# CONFIG_LIBFCOE is not set
590# CONFIG_SCSI_DEBUG is not set 598# CONFIG_SCSI_DEBUG is not set
@@ -624,7 +632,7 @@ CONFIG_NET_ETHERNET=y
624CONFIG_MII=y 632CONFIG_MII=y
625# CONFIG_AX88796 is not set 633# CONFIG_AX88796 is not set
626# CONFIG_STNIC is not set 634# CONFIG_STNIC is not set
627# CONFIG_SH_ETH is not set 635CONFIG_SH_ETH=y
628CONFIG_SMC91X=y 636CONFIG_SMC91X=y
629# CONFIG_ENC28J60 is not set 637# CONFIG_ENC28J60 is not set
630# CONFIG_ETHOC is not set 638# CONFIG_ETHOC is not set
@@ -801,6 +809,11 @@ CONFIG_SPI_BITBANG=y
801# 809#
802# CONFIG_SPI_SPIDEV is not set 810# CONFIG_SPI_SPIDEV is not set
803# CONFIG_SPI_TLE62X0 is not set 811# CONFIG_SPI_TLE62X0 is not set
812
813#
814# PPS support
815#
816# CONFIG_PPS is not set
804CONFIG_ARCH_REQUIRE_GPIOLIB=y 817CONFIG_ARCH_REQUIRE_GPIOLIB=y
805CONFIG_GPIOLIB=y 818CONFIG_GPIOLIB=y
806# CONFIG_GPIO_SYSFS is not set 819# CONFIG_GPIO_SYSFS is not set
@@ -851,6 +864,8 @@ CONFIG_SSB_POSSIBLE=y
851# CONFIG_MFD_WM8400 is not set 864# CONFIG_MFD_WM8400 is not set
852# CONFIG_MFD_WM8350_I2C is not set 865# CONFIG_MFD_WM8350_I2C is not set
853# CONFIG_MFD_PCF50633 is not set 866# CONFIG_MFD_PCF50633 is not set
867# CONFIG_AB3100_CORE is not set
868# CONFIG_EZX_PCAP is not set
854# CONFIG_REGULATOR is not set 869# CONFIG_REGULATOR is not set
855CONFIG_MEDIA_SUPPORT=y 870CONFIG_MEDIA_SUPPORT=y
856 871
@@ -1196,6 +1211,7 @@ CONFIG_RTC_DRV_PCF8563=y
1196# CONFIG_RTC_DRV_S35390A is not set 1211# CONFIG_RTC_DRV_S35390A is not set
1197# CONFIG_RTC_DRV_FM3130 is not set 1212# CONFIG_RTC_DRV_FM3130 is not set
1198# CONFIG_RTC_DRV_RX8581 is not set 1213# CONFIG_RTC_DRV_RX8581 is not set
1214# CONFIG_RTC_DRV_RX8025 is not set
1199 1215
1200# 1216#
1201# SPI RTC drivers 1217# SPI RTC drivers
@@ -1260,6 +1276,7 @@ CONFIG_FS_MBCACHE=y
1260# CONFIG_JFS_FS is not set 1276# CONFIG_JFS_FS is not set
1261CONFIG_FS_POSIX_ACL=y 1277CONFIG_FS_POSIX_ACL=y
1262# CONFIG_XFS_FS is not set 1278# CONFIG_XFS_FS is not set
1279# CONFIG_GFS2_FS is not set
1263# CONFIG_OCFS2_FS is not set 1280# CONFIG_OCFS2_FS is not set
1264# CONFIG_BTRFS_FS is not set 1281# CONFIG_BTRFS_FS is not set
1265CONFIG_FILE_LOCKING=y 1282CONFIG_FILE_LOCKING=y
diff --git a/arch/sh/include/asm/perf_counter.h b/arch/sh/include/asm/perf_counter.h
index a8153c2aa6fa..d8e6bb9c0ccc 100644
--- a/arch/sh/include/asm/perf_counter.h
+++ b/arch/sh/include/asm/perf_counter.h
@@ -2,6 +2,8 @@
2#define __ASM_SH_PERF_COUNTER_H 2#define __ASM_SH_PERF_COUNTER_H
3 3
4/* SH only supports software counters through this interface. */ 4/* SH only supports software counters through this interface. */
5#define set_perf_counter_pending() do { } while (0) 5static inline void set_perf_counter_pending(void) {}
6
7#define PERF_COUNTER_INDEX_OFFSET 0
6 8
7#endif /* __ASM_SH_PERF_COUNTER_H */ 9#endif /* __ASM_SH_PERF_COUNTER_H */
diff --git a/arch/sh/include/asm/syscall_32.h b/arch/sh/include/asm/syscall_32.h
index 5bc34681d994..6f83f2cc45c1 100644
--- a/arch/sh/include/asm/syscall_32.h
+++ b/arch/sh/include/asm/syscall_32.h
@@ -3,6 +3,7 @@
3 3
4#include <linux/kernel.h> 4#include <linux/kernel.h>
5#include <linux/sched.h> 5#include <linux/sched.h>
6#include <linux/err.h>
6#include <asm/ptrace.h> 7#include <asm/ptrace.h>
7 8
8/* The system call number is given by the user in R3 */ 9/* The system call number is given by the user in R3 */
diff --git a/arch/sh/include/asm/thread_info.h b/arch/sh/include/asm/thread_info.h
index f09ac4806294..d570ac2e5cb9 100644
--- a/arch/sh/include/asm/thread_info.h
+++ b/arch/sh/include/asm/thread_info.h
@@ -51,7 +51,7 @@ struct thread_info {
51 .exec_domain = &default_exec_domain, \ 51 .exec_domain = &default_exec_domain, \
52 .flags = 0, \ 52 .flags = 0, \
53 .cpu = 0, \ 53 .cpu = 0, \
54 .preempt_count = 1, \ 54 .preempt_count = INIT_PREEMPT_COUNT, \
55 .addr_limit = KERNEL_DS, \ 55 .addr_limit = KERNEL_DS, \
56 .restart_block = { \ 56 .restart_block = { \
57 .fn = do_no_restart_syscall, \ 57 .fn = do_no_restart_syscall, \
diff --git a/arch/sh/include/mach-se/mach/se7724.h b/arch/sh/include/mach-se/mach/se7724.h
index 74164b60d0db..29514a39d0f5 100644
--- a/arch/sh/include/mach-se/mach/se7724.h
+++ b/arch/sh/include/mach-se/mach/se7724.h
@@ -20,6 +20,11 @@
20 */ 20 */
21#include <asm/addrspace.h> 21#include <asm/addrspace.h>
22 22
23/* SH Eth */
24#define SH_ETH_ADDR (0xA4600000)
25#define SH_ETH_MAHR (SH_ETH_ADDR + 0x1C0)
26#define SH_ETH_MALR (SH_ETH_ADDR + 0x1C8)
27
23#define PA_LED (0xba203000) /* 8bit LED */ 28#define PA_LED (0xba203000) /* 8bit LED */
24#define IRQ_MODE (0xba200010) 29#define IRQ_MODE (0xba200010)
25#define IRQ0_SR (0xba200014) 30#define IRQ0_SR (0xba200014)
diff --git a/arch/sh/mm/fault_32.c b/arch/sh/mm/fault_32.c
index cc8ddbdf3d7a..71925946f1e1 100644
--- a/arch/sh/mm/fault_32.c
+++ b/arch/sh/mm/fault_32.c
@@ -15,12 +15,28 @@
15#include <linux/mm.h> 15#include <linux/mm.h>
16#include <linux/hardirq.h> 16#include <linux/hardirq.h>
17#include <linux/kprobes.h> 17#include <linux/kprobes.h>
18#include <linux/marker.h> 18#include <linux/perf_counter.h>
19#include <asm/io_trapped.h> 19#include <asm/io_trapped.h>
20#include <asm/system.h> 20#include <asm/system.h>
21#include <asm/mmu_context.h> 21#include <asm/mmu_context.h>
22#include <asm/tlbflush.h> 22#include <asm/tlbflush.h>
23 23
24static inline int notify_page_fault(struct pt_regs *regs, int trap)
25{
26 int ret = 0;
27
28#ifdef CONFIG_KPROBES
29 if (!user_mode(regs)) {
30 preempt_disable();
31 if (kprobe_running() && kprobe_fault_handler(regs, trap))
32 ret = 1;
33 preempt_enable();
34 }
35#endif
36
37 return ret;
38}
39
24/* 40/*
25 * This routine handles page faults. It determines the address, 41 * This routine handles page faults. It determines the address,
26 * and the problem, and then passes it off to one of the appropriate 42 * and the problem, and then passes it off to one of the appropriate
@@ -87,13 +103,16 @@ asmlinkage void __kprobes do_page_fault(struct pt_regs *regs,
87 return; 103 return;
88 } 104 }
89 105
106 mm = tsk->mm;
107
108 if (unlikely(notify_page_fault(regs, lookup_exception_vector())))
109 return;
110
90 /* Only enable interrupts if they were on before the fault */ 111 /* Only enable interrupts if they were on before the fault */
91 if ((regs->sr & SR_IMASK) != SR_IMASK) { 112 if ((regs->sr & SR_IMASK) != SR_IMASK)
92 trace_hardirqs_on();
93 local_irq_enable(); 113 local_irq_enable();
94 }
95 114
96 mm = tsk->mm; 115 perf_swcounter_event(PERF_COUNT_SW_PAGE_FAULTS, 1, 0, regs, address);
97 116
98 /* 117 /*
99 * If we're in an interrupt or have no user 118 * If we're in an interrupt or have no user
@@ -141,10 +160,15 @@ survive:
141 goto do_sigbus; 160 goto do_sigbus;
142 BUG(); 161 BUG();
143 } 162 }
144 if (fault & VM_FAULT_MAJOR) 163 if (fault & VM_FAULT_MAJOR) {
145 tsk->maj_flt++; 164 tsk->maj_flt++;
146 else 165 perf_swcounter_event(PERF_COUNT_SW_PAGE_FAULTS_MAJ, 1, 0,
166 regs, address);
167 } else {
147 tsk->min_flt++; 168 tsk->min_flt++;
169 perf_swcounter_event(PERF_COUNT_SW_PAGE_FAULTS_MIN, 1, 0,
170 regs, address);
171 }
148 172
149 up_read(&mm->mmap_sem); 173 up_read(&mm->mmap_sem);
150 return; 174 return;
@@ -245,22 +269,6 @@ do_sigbus:
245 goto no_context; 269 goto no_context;
246} 270}
247 271
248static inline int notify_page_fault(struct pt_regs *regs, int trap)
249{
250 int ret = 0;
251
252#ifdef CONFIG_KPROBES
253 if (!user_mode(regs)) {
254 preempt_disable();
255 if (kprobe_running() && kprobe_fault_handler(regs, trap))
256 ret = 1;
257 preempt_enable();
258 }
259#endif
260
261 return ret;
262}
263
264/* 272/*
265 * Called with interrupts disabled. 273 * Called with interrupts disabled.
266 */ 274 */
@@ -273,12 +281,7 @@ asmlinkage int __kprobes __do_page_fault(struct pt_regs *regs,
273 pmd_t *pmd; 281 pmd_t *pmd;
274 pte_t *pte; 282 pte_t *pte;
275 pte_t entry; 283 pte_t entry;
276 int ret = 0; 284 int ret = 1;
277
278 if (notify_page_fault(regs, lookup_exception_vector()))
279 goto out;
280
281 ret = 1;
282 285
283 /* 286 /*
284 * We don't take page faults for P1, P2, and parts of P4, these 287 * We don't take page faults for P1, P2, and parts of P4, these
diff --git a/arch/sh/mm/tlb-sh3.c b/arch/sh/mm/tlb-sh3.c
index 7fbfd5a11ffa..17cb7c3adf22 100644
--- a/arch/sh/mm/tlb-sh3.c
+++ b/arch/sh/mm/tlb-sh3.c
@@ -18,7 +18,6 @@
18#include <linux/mman.h> 18#include <linux/mman.h>
19#include <linux/mm.h> 19#include <linux/mm.h>
20#include <linux/smp.h> 20#include <linux/smp.h>
21#include <linux/smp_lock.h>
22#include <linux/interrupt.h> 21#include <linux/interrupt.h>
23 22
24#include <asm/system.h> 23#include <asm/system.h>
diff --git a/arch/sh/mm/tlbflush_64.c b/arch/sh/mm/tlbflush_64.c
index fcbb6e135cef..3ce40ea34824 100644
--- a/arch/sh/mm/tlbflush_64.c
+++ b/arch/sh/mm/tlbflush_64.c
@@ -3,7 +3,7 @@
3 * 3 *
4 * Copyright (C) 2000, 2001 Paolo Alberelli 4 * Copyright (C) 2000, 2001 Paolo Alberelli
5 * Copyright (C) 2003 Richard Curnow (/proc/tlb, bug fixes) 5 * Copyright (C) 2003 Richard Curnow (/proc/tlb, bug fixes)
6 * Copyright (C) 2003 Paul Mundt 6 * Copyright (C) 2003 - 2009 Paul Mundt
7 * 7 *
8 * This file is subject to the terms and conditions of the GNU General Public 8 * This file is subject to the terms and conditions of the GNU General Public
9 * License. See the file "COPYING" in the main directory of this archive 9 * License. See the file "COPYING" in the main directory of this archive
@@ -20,6 +20,7 @@
20#include <linux/mman.h> 20#include <linux/mman.h>
21#include <linux/mm.h> 21#include <linux/mm.h>
22#include <linux/smp.h> 22#include <linux/smp.h>
23#include <linux/perf_counter.h>
23#include <linux/interrupt.h> 24#include <linux/interrupt.h>
24#include <asm/system.h> 25#include <asm/system.h>
25#include <asm/io.h> 26#include <asm/io.h>
@@ -115,6 +116,8 @@ asmlinkage void do_page_fault(struct pt_regs *regs, unsigned long writeaccess,
115 /* Not an IO address, so reenable interrupts */ 116 /* Not an IO address, so reenable interrupts */
116 local_irq_enable(); 117 local_irq_enable();
117 118
119 perf_swcounter_event(PERF_COUNT_SW_PAGE_FAULTS, 1, 0, regs, address);
120
118 /* 121 /*
119 * If we're in an interrupt or have no user 122 * If we're in an interrupt or have no user
120 * context, we must not take the fault.. 123 * context, we must not take the fault..
@@ -195,10 +198,16 @@ survive:
195 goto do_sigbus; 198 goto do_sigbus;
196 BUG(); 199 BUG();
197 } 200 }
198 if (fault & VM_FAULT_MAJOR) 201
202 if (fault & VM_FAULT_MAJOR) {
199 tsk->maj_flt++; 203 tsk->maj_flt++;
200 else 204 perf_swcounter_event(PERF_COUNT_SW_PAGE_FAULTS_MAJ, 1, 0,
205 regs, address);
206 } else {
201 tsk->min_flt++; 207 tsk->min_flt++;
208 perf_swcounter_event(PERF_COUNT_SW_PAGE_FAULTS_MIN, 1, 0,
209 regs, address);
210 }
202 211
203 /* If we get here, the page fault has been handled. Do the TLB refill 212 /* If we get here, the page fault has been handled. Do the TLB refill
204 now from the newly-setup PTE, to avoid having to fault again right 213 now from the newly-setup PTE, to avoid having to fault again right
diff --git a/arch/sparc/boot/Makefile b/arch/sparc/boot/Makefile
index 96041a8d39e8..1ff0fd924756 100644
--- a/arch/sparc/boot/Makefile
+++ b/arch/sparc/boot/Makefile
@@ -15,7 +15,7 @@ quiet_cmd_elftoaout = ELFTOAOUT $@
15 15
16ifeq ($(CONFIG_SPARC32),y) 16ifeq ($(CONFIG_SPARC32),y)
17quiet_cmd_piggy = PIGGY $@ 17quiet_cmd_piggy = PIGGY $@
18 cmd_piggy = $(obj)/piggyback_32 $@ $(obj)/System.map $(ROOT_IMG) 18 cmd_piggy = $(obj)/piggyback_32 $@ System.map $(ROOT_IMG)
19quiet_cmd_btfix = BTFIX $@ 19quiet_cmd_btfix = BTFIX $@
20 cmd_btfix = $(OBJDUMP) -x vmlinux | $(obj)/btfixupprep > $@ 20 cmd_btfix = $(OBJDUMP) -x vmlinux | $(obj)/btfixupprep > $@
21quiet_cmd_sysmap = SYSMAP $(obj)/System.map 21quiet_cmd_sysmap = SYSMAP $(obj)/System.map
@@ -58,7 +58,7 @@ $(obj)/image: $(obj)/btfix.o FORCE
58$(obj)/zImage: $(obj)/image 58$(obj)/zImage: $(obj)/image
59 $(call if_changed,strip) 59 $(call if_changed,strip)
60 60
61$(obj)/tftpboot.img: $(obj)/piggyback $(obj)/System.map $(obj)/image FORCE 61$(obj)/tftpboot.img: $(obj)/image $(obj)/piggyback_32 System.map $(ROOT_IMG) FORCE
62 $(call if_changed,elftoaout) 62 $(call if_changed,elftoaout)
63 $(call if_changed,piggy) 63 $(call if_changed,piggy)
64 64
@@ -79,7 +79,7 @@ $(obj)/image: vmlinux FORCE
79 $(call if_changed,strip) 79 $(call if_changed,strip)
80 @echo ' kernel: $@ is ready' 80 @echo ' kernel: $@ is ready'
81 81
82$(obj)/tftpboot.img: vmlinux $(obj)/piggyback_64 System.map $(ROOT_IMG) FORCE 82$(obj)/tftpboot.img: $(obj)/image $(obj)/piggyback_64 System.map $(ROOT_IMG) FORCE
83 $(call if_changed,elftoaout) 83 $(call if_changed,elftoaout)
84 $(call if_changed,piggy) 84 $(call if_changed,piggy)
85 @echo ' kernel: $@ is ready' 85 @echo ' kernel: $@ is ready'
diff --git a/arch/sparc/boot/piggyback_32.c b/arch/sparc/boot/piggyback_32.c
index c9f500c1a8b2..e8dc9adfcd61 100644
--- a/arch/sparc/boot/piggyback_32.c
+++ b/arch/sparc/boot/piggyback_32.c
@@ -70,7 +70,7 @@ void die(char *str)
70int main(int argc,char **argv) 70int main(int argc,char **argv)
71{ 71{
72 static char aout_magic[] = { 0x01, 0x03, 0x01, 0x07 }; 72 static char aout_magic[] = { 0x01, 0x03, 0x01, 0x07 };
73 unsigned char buffer[1024], *q, *r; 73 char buffer[1024], *q, *r;
74 unsigned int i, j, k, start, end, offset; 74 unsigned int i, j, k, start, end, offset;
75 FILE *map; 75 FILE *map;
76 struct stat s; 76 struct stat s;
@@ -84,7 +84,7 @@ int main(int argc,char **argv)
84 while (fgets (buffer, 1024, map)) { 84 while (fgets (buffer, 1024, map)) {
85 if (!strcmp (buffer + 8, " T start\n") || !strcmp (buffer + 16, " T start\n")) 85 if (!strcmp (buffer + 8, " T start\n") || !strcmp (buffer + 16, " T start\n"))
86 start = strtoul (buffer, NULL, 16); 86 start = strtoul (buffer, NULL, 16);
87 else if (!strcmp (buffer + 8, " A end\n") || !strcmp (buffer + 16, " A end\n")) 87 else if (!strcmp (buffer + 8, " A _end\n") || !strcmp (buffer + 16, " A _end\n"))
88 end = strtoul (buffer, NULL, 16); 88 end = strtoul (buffer, NULL, 16);
89 } 89 }
90 fclose (map); 90 fclose (map);
diff --git a/arch/sparc/boot/piggyback_64.c b/arch/sparc/boot/piggyback_64.c
index de364bfed0bb..c63fd1b6bdd4 100644
--- a/arch/sparc/boot/piggyback_64.c
+++ b/arch/sparc/boot/piggyback_64.c
@@ -46,6 +46,7 @@ int main(int argc,char **argv)
46 struct stat s; 46 struct stat s;
47 int image, tail; 47 int image, tail;
48 48
49 start = end = 0;
49 if (stat (argv[3], &s) < 0) die (argv[3]); 50 if (stat (argv[3], &s) < 0) die (argv[3]);
50 map = fopen (argv[2], "r"); 51 map = fopen (argv[2], "r");
51 if (!map) die(argv[2]); 52 if (!map) die(argv[2]);
diff --git a/arch/sparc/include/asm/thread_info_32.h b/arch/sparc/include/asm/thread_info_32.h
index 0f7b0e5fb1c7..844d73a0340c 100644
--- a/arch/sparc/include/asm/thread_info_32.h
+++ b/arch/sparc/include/asm/thread_info_32.h
@@ -54,8 +54,6 @@ struct thread_info {
54 54
55/* 55/*
56 * macros/functions for gaining access to the thread information structure 56 * macros/functions for gaining access to the thread information structure
57 *
58 * preempt_count needs to be 1 initially, until the scheduler is functional.
59 */ 57 */
60#define INIT_THREAD_INFO(tsk) \ 58#define INIT_THREAD_INFO(tsk) \
61{ \ 59{ \
@@ -64,7 +62,7 @@ struct thread_info {
64 .exec_domain = &default_exec_domain, \ 62 .exec_domain = &default_exec_domain, \
65 .flags = 0, \ 63 .flags = 0, \
66 .cpu = 0, \ 64 .cpu = 0, \
67 .preempt_count = 1, \ 65 .preempt_count = INIT_PREEMPT_COUNT, \
68 .restart_block = { \ 66 .restart_block = { \
69 .fn = do_no_restart_syscall, \ 67 .fn = do_no_restart_syscall, \
70 }, \ 68 }, \
diff --git a/arch/sparc/include/asm/thread_info_64.h b/arch/sparc/include/asm/thread_info_64.h
index 65865726b283..1b45a7bbe407 100644
--- a/arch/sparc/include/asm/thread_info_64.h
+++ b/arch/sparc/include/asm/thread_info_64.h
@@ -125,8 +125,6 @@ struct thread_info {
125 125
126/* 126/*
127 * macros/functions for gaining access to the thread information structure 127 * macros/functions for gaining access to the thread information structure
128 *
129 * preempt_count needs to be 1 initially, until the scheduler is functional.
130 */ 128 */
131#ifndef __ASSEMBLY__ 129#ifndef __ASSEMBLY__
132 130
@@ -135,7 +133,7 @@ struct thread_info {
135 .task = &tsk, \ 133 .task = &tsk, \
136 .flags = ((unsigned long)ASI_P) << TI_FLAG_CURRENT_DS_SHIFT, \ 134 .flags = ((unsigned long)ASI_P) << TI_FLAG_CURRENT_DS_SHIFT, \
137 .exec_domain = &default_exec_domain, \ 135 .exec_domain = &default_exec_domain, \
138 .preempt_count = 1, \ 136 .preempt_count = INIT_PREEMPT_COUNT, \
139 .restart_block = { \ 137 .restart_block = { \
140 .fn = do_no_restart_syscall, \ 138 .fn = do_no_restart_syscall, \
141 }, \ 139 }, \
diff --git a/arch/sparc/kernel/irq_64.c b/arch/sparc/kernel/irq_64.c
index bd075054942b..f0ee79055409 100644
--- a/arch/sparc/kernel/irq_64.c
+++ b/arch/sparc/kernel/irq_64.c
@@ -20,7 +20,6 @@
20#include <linux/delay.h> 20#include <linux/delay.h>
21#include <linux/proc_fs.h> 21#include <linux/proc_fs.h>
22#include <linux/seq_file.h> 22#include <linux/seq_file.h>
23#include <linux/bootmem.h>
24#include <linux/irq.h> 23#include <linux/irq.h>
25 24
26#include <asm/ptrace.h> 25#include <asm/ptrace.h>
@@ -914,25 +913,19 @@ void __cpuinit notrace sun4v_register_mondo_queues(int this_cpu)
914 tb->nonresum_qmask); 913 tb->nonresum_qmask);
915} 914}
916 915
917static void __init alloc_one_mondo(unsigned long *pa_ptr, unsigned long qmask) 916/* Each queue region must be a power of 2 multiple of 64 bytes in
918{ 917 * size. The base real address must be aligned to the size of the
919 unsigned long size = PAGE_ALIGN(qmask + 1); 918 * region. Thus, an 8KB queue must be 8KB aligned, for example.
920 void *p = __alloc_bootmem(size, size, 0); 919 */
921 if (!p) { 920static void __init alloc_one_queue(unsigned long *pa_ptr, unsigned long qmask)
922 prom_printf("SUN4V: Error, cannot allocate mondo queue.\n");
923 prom_halt();
924 }
925
926 *pa_ptr = __pa(p);
927}
928
929static void __init alloc_one_kbuf(unsigned long *pa_ptr, unsigned long qmask)
930{ 921{
931 unsigned long size = PAGE_ALIGN(qmask + 1); 922 unsigned long size = PAGE_ALIGN(qmask + 1);
932 void *p = __alloc_bootmem(size, size, 0); 923 unsigned long order = get_order(size);
924 unsigned long p;
933 925
926 p = __get_free_pages(GFP_KERNEL, order);
934 if (!p) { 927 if (!p) {
935 prom_printf("SUN4V: Error, cannot allocate kbuf page.\n"); 928 prom_printf("SUN4V: Error, cannot allocate queue.\n");
936 prom_halt(); 929 prom_halt();
937 } 930 }
938 931
@@ -942,11 +935,11 @@ static void __init alloc_one_kbuf(unsigned long *pa_ptr, unsigned long qmask)
942static void __init init_cpu_send_mondo_info(struct trap_per_cpu *tb) 935static void __init init_cpu_send_mondo_info(struct trap_per_cpu *tb)
943{ 936{
944#ifdef CONFIG_SMP 937#ifdef CONFIG_SMP
945 void *page; 938 unsigned long page;
946 939
947 BUILD_BUG_ON((NR_CPUS * sizeof(u16)) > (PAGE_SIZE - 64)); 940 BUILD_BUG_ON((NR_CPUS * sizeof(u16)) > (PAGE_SIZE - 64));
948 941
949 page = alloc_bootmem_pages(PAGE_SIZE); 942 page = get_zeroed_page(GFP_KERNEL);
950 if (!page) { 943 if (!page) {
951 prom_printf("SUN4V: Error, cannot allocate cpu mondo page.\n"); 944 prom_printf("SUN4V: Error, cannot allocate cpu mondo page.\n");
952 prom_halt(); 945 prom_halt();
@@ -965,13 +958,13 @@ static void __init sun4v_init_mondo_queues(void)
965 for_each_possible_cpu(cpu) { 958 for_each_possible_cpu(cpu) {
966 struct trap_per_cpu *tb = &trap_block[cpu]; 959 struct trap_per_cpu *tb = &trap_block[cpu];
967 960
968 alloc_one_mondo(&tb->cpu_mondo_pa, tb->cpu_mondo_qmask); 961 alloc_one_queue(&tb->cpu_mondo_pa, tb->cpu_mondo_qmask);
969 alloc_one_mondo(&tb->dev_mondo_pa, tb->dev_mondo_qmask); 962 alloc_one_queue(&tb->dev_mondo_pa, tb->dev_mondo_qmask);
970 alloc_one_mondo(&tb->resum_mondo_pa, tb->resum_qmask); 963 alloc_one_queue(&tb->resum_mondo_pa, tb->resum_qmask);
971 alloc_one_kbuf(&tb->resum_kernel_buf_pa, tb->resum_qmask); 964 alloc_one_queue(&tb->resum_kernel_buf_pa, tb->resum_qmask);
972 alloc_one_mondo(&tb->nonresum_mondo_pa, tb->nonresum_qmask); 965 alloc_one_queue(&tb->nonresum_mondo_pa, tb->nonresum_qmask);
973 alloc_one_kbuf(&tb->nonresum_kernel_buf_pa, 966 alloc_one_queue(&tb->nonresum_kernel_buf_pa,
974 tb->nonresum_qmask); 967 tb->nonresum_qmask);
975 } 968 }
976} 969}
977 970
@@ -999,7 +992,7 @@ void __init init_IRQ(void)
999 kill_prom_timer(); 992 kill_prom_timer();
1000 993
1001 size = sizeof(struct ino_bucket) * NUM_IVECS; 994 size = sizeof(struct ino_bucket) * NUM_IVECS;
1002 ivector_table = alloc_bootmem(size); 995 ivector_table = kzalloc(size, GFP_KERNEL);
1003 if (!ivector_table) { 996 if (!ivector_table) {
1004 prom_printf("Fatal error, cannot allocate ivector_table\n"); 997 prom_printf("Fatal error, cannot allocate ivector_table\n");
1005 prom_halt(); 998 prom_halt();
diff --git a/arch/sparc/kernel/ptrace_32.c b/arch/sparc/kernel/ptrace_32.c
index 8ce6285a06d5..7e3dfd9bb97e 100644
--- a/arch/sparc/kernel/ptrace_32.c
+++ b/arch/sparc/kernel/ptrace_32.c
@@ -16,7 +16,6 @@
16#include <linux/ptrace.h> 16#include <linux/ptrace.h>
17#include <linux/user.h> 17#include <linux/user.h>
18#include <linux/smp.h> 18#include <linux/smp.h>
19#include <linux/smp_lock.h>
20#include <linux/security.h> 19#include <linux/security.h>
21#include <linux/signal.h> 20#include <linux/signal.h>
22#include <linux/regset.h> 21#include <linux/regset.h>
diff --git a/arch/sparc/kernel/ptrace_64.c b/arch/sparc/kernel/ptrace_64.c
index a941c610e7ce..4ae91dc2feb9 100644
--- a/arch/sparc/kernel/ptrace_64.c
+++ b/arch/sparc/kernel/ptrace_64.c
@@ -17,7 +17,6 @@
17#include <linux/ptrace.h> 17#include <linux/ptrace.h>
18#include <linux/user.h> 18#include <linux/user.h>
19#include <linux/smp.h> 19#include <linux/smp.h>
20#include <linux/smp_lock.h>
21#include <linux/security.h> 20#include <linux/security.h>
22#include <linux/seccomp.h> 21#include <linux/seccomp.h>
23#include <linux/audit.h> 22#include <linux/audit.h>
diff --git a/arch/sparc/kernel/time_64.c b/arch/sparc/kernel/time_64.c
index 5c12e79b4bdf..da1218e8ee87 100644
--- a/arch/sparc/kernel/time_64.c
+++ b/arch/sparc/kernel/time_64.c
@@ -11,7 +11,6 @@
11#include <linux/errno.h> 11#include <linux/errno.h>
12#include <linux/module.h> 12#include <linux/module.h>
13#include <linux/sched.h> 13#include <linux/sched.h>
14#include <linux/smp_lock.h>
15#include <linux/kernel.h> 14#include <linux/kernel.h>
16#include <linux/param.h> 15#include <linux/param.h>
17#include <linux/string.h> 16#include <linux/string.h>
diff --git a/arch/sparc/kernel/traps_32.c b/arch/sparc/kernel/traps_32.c
index 358283341b47..c0490c7bbde0 100644
--- a/arch/sparc/kernel/traps_32.c
+++ b/arch/sparc/kernel/traps_32.c
@@ -13,7 +13,6 @@
13#include <linux/kernel.h> 13#include <linux/kernel.h>
14#include <linux/signal.h> 14#include <linux/signal.h>
15#include <linux/smp.h> 15#include <linux/smp.h>
16#include <linux/smp_lock.h>
17#include <linux/kdebug.h> 16#include <linux/kdebug.h>
18 17
19#include <asm/delay.h> 18#include <asm/delay.h>
diff --git a/arch/sparc/kernel/vio.c b/arch/sparc/kernel/vio.c
index 753d128ed158..c28c71449a6c 100644
--- a/arch/sparc/kernel/vio.c
+++ b/arch/sparc/kernel/vio.c
@@ -224,7 +224,12 @@ static struct vio_dev *vio_create_one(struct mdesc_handle *hp, u64 mp,
224 if (!strcmp(type, "domain-services-port")) 224 if (!strcmp(type, "domain-services-port"))
225 bus_id_name = "ds"; 225 bus_id_name = "ds";
226 226
227 if (strlen(bus_id_name) >= BUS_ID_SIZE - 4) { 227 /*
228 * 20 char is the old driver-core name size limit, which is no more.
229 * This check can probably be removed after review and possible
230 * adaption of the vio users name length handling.
231 */
232 if (strlen(bus_id_name) >= 20 - 4) {
228 printk(KERN_ERR "VIO: bus_id_name [%s] is too long.\n", 233 printk(KERN_ERR "VIO: bus_id_name [%s] is too long.\n",
229 bus_id_name); 234 bus_id_name);
230 return NULL; 235 return NULL;
diff --git a/arch/um/drivers/slip_kern.c b/arch/um/drivers/slip_kern.c
index 5ec17563142e..dd2aadc14af0 100644
--- a/arch/um/drivers/slip_kern.c
+++ b/arch/um/drivers/slip_kern.c
@@ -30,7 +30,6 @@ static void slip_init(struct net_device *dev, void *data)
30 30
31 slip_proto_init(&spri->slip); 31 slip_proto_init(&spri->slip);
32 32
33 dev->init = NULL;
34 dev->hard_header_len = 0; 33 dev->hard_header_len = 0;
35 dev->header_ops = NULL; 34 dev->header_ops = NULL;
36 dev->addr_len = 0; 35 dev->addr_len = 0;
diff --git a/arch/um/drivers/slirp_kern.c b/arch/um/drivers/slirp_kern.c
index f15a6e7654f3..e376284f0fb7 100644
--- a/arch/um/drivers/slirp_kern.c
+++ b/arch/um/drivers/slirp_kern.c
@@ -32,7 +32,6 @@ void slirp_init(struct net_device *dev, void *data)
32 32
33 slip_proto_init(&spri->slip); 33 slip_proto_init(&spri->slip);
34 34
35 dev->init = NULL;
36 dev->hard_header_len = 0; 35 dev->hard_header_len = 0;
37 dev->header_ops = NULL; 36 dev->header_ops = NULL;
38 dev->addr_len = 0; 37 dev->addr_len = 0;
diff --git a/arch/um/include/asm/dma-mapping.h b/arch/um/include/asm/dma-mapping.h
index 90fc708b320e..378de4bbf49f 100644
--- a/arch/um/include/asm/dma-mapping.h
+++ b/arch/um/include/asm/dma-mapping.h
@@ -79,14 +79,14 @@ dma_unmap_sg(struct device *dev, struct scatterlist *sg, int nhwentries,
79} 79}
80 80
81static inline void 81static inline void
82dma_sync_single(struct device *dev, dma_addr_t dma_handle, size_t size, 82dma_sync_single_for_cpu(struct device *dev, dma_addr_t dma_handle, size_t size,
83 enum dma_data_direction direction) 83 enum dma_data_direction direction)
84{ 84{
85 BUG(); 85 BUG();
86} 86}
87 87
88static inline void 88static inline void
89dma_sync_sg(struct device *dev, struct scatterlist *sg, int nelems, 89dma_sync_sg_for_cpu(struct device *dev, struct scatterlist *sg, int nelems,
90 enum dma_data_direction direction) 90 enum dma_data_direction direction)
91{ 91{
92 BUG(); 92 BUG();
diff --git a/arch/um/include/asm/thread_info.h b/arch/um/include/asm/thread_info.h
index 62274ab9471f..fd911f855367 100644
--- a/arch/um/include/asm/thread_info.h
+++ b/arch/um/include/asm/thread_info.h
@@ -32,7 +32,7 @@ struct thread_info {
32 .exec_domain = &default_exec_domain, \ 32 .exec_domain = &default_exec_domain, \
33 .flags = 0, \ 33 .flags = 0, \
34 .cpu = 0, \ 34 .cpu = 0, \
35 .preempt_count = 1, \ 35 .preempt_count = INIT_PREEMPT_COUNT, \
36 .addr_limit = KERNEL_DS, \ 36 .addr_limit = KERNEL_DS, \
37 .restart_block = { \ 37 .restart_block = { \
38 .fn = do_no_restart_syscall, \ 38 .fn = do_no_restart_syscall, \
diff --git a/arch/um/kernel/sysrq.c b/arch/um/kernel/sysrq.c
index 56d43d0a3960..0960de54495a 100644
--- a/arch/um/kernel/sysrq.c
+++ b/arch/um/kernel/sysrq.c
@@ -70,8 +70,8 @@ void show_stack(struct task_struct *task, unsigned long *esp)
70 if (kstack_end(stack)) 70 if (kstack_end(stack))
71 break; 71 break;
72 if (i && ((i % 8) == 0)) 72 if (i && ((i % 8) == 0))
73 printk("\n" KERN_INFO " "); 73 printk(KERN_INFO " ");
74 printk("%08lx ", *stack++); 74 printk(KERN_CONT "%08lx ", *stack++);
75 } 75 }
76 76
77 show_trace(task, esp); 77 show_trace(task, esp);
diff --git a/arch/x86/Kconfig b/arch/x86/Kconfig
index d1430ef6b4f9..738bdc6b0f8b 100644
--- a/arch/x86/Kconfig
+++ b/arch/x86/Kconfig
@@ -1913,25 +1913,26 @@ config DMAR_DEFAULT_ON
1913 recommended you say N here while the DMAR code remains 1913 recommended you say N here while the DMAR code remains
1914 experimental. 1914 experimental.
1915 1915
1916config DMAR_GFX_WA 1916config DMAR_BROKEN_GFX_WA
1917 def_bool y 1917 def_bool n
1918 prompt "Support for Graphics workaround" 1918 prompt "Workaround broken graphics drivers (going away soon)"
1919 depends on DMAR 1919 depends on DMAR
1920 ---help--- 1920 ---help---
1921 Current Graphics drivers tend to use physical address 1921 Current Graphics drivers tend to use physical address
1922 for DMA and avoid using DMA APIs. Setting this config 1922 for DMA and avoid using DMA APIs. Setting this config
1923 option permits the IOMMU driver to set a unity map for 1923 option permits the IOMMU driver to set a unity map for
1924 all the OS-visible memory. Hence the driver can continue 1924 all the OS-visible memory. Hence the driver can continue
1925 to use physical addresses for DMA. 1925 to use physical addresses for DMA, at least until this
1926 option is removed in the 2.6.32 kernel.
1926 1927
1927config DMAR_FLOPPY_WA 1928config DMAR_FLOPPY_WA
1928 def_bool y 1929 def_bool y
1929 depends on DMAR 1930 depends on DMAR
1930 ---help--- 1931 ---help---
1931 Floppy disk drivers are know to bypass DMA API calls 1932 Floppy disk drivers are known to bypass DMA API calls
1932 thereby failing to work when IOMMU is enabled. This 1933 thereby failing to work when IOMMU is enabled. This
1933 workaround will setup a 1:1 mapping for the first 1934 workaround will setup a 1:1 mapping for the first
1934 16M to make floppy (an ISA device) work. 1935 16MiB to make floppy (an ISA device) work.
1935 1936
1936config INTR_REMAP 1937config INTR_REMAP
1937 bool "Support for Interrupt Remapping (EXPERIMENTAL)" 1938 bool "Support for Interrupt Remapping (EXPERIMENTAL)"
diff --git a/arch/x86/boot/video-bios.c b/arch/x86/boot/video-bios.c
index d660be492363..49e0c18833e0 100644
--- a/arch/x86/boot/video-bios.c
+++ b/arch/x86/boot/video-bios.c
@@ -37,14 +37,13 @@ static int set_bios_mode(u8 mode)
37 ireg.al = mode; /* AH=0x00 Set Video Mode */ 37 ireg.al = mode; /* AH=0x00 Set Video Mode */
38 intcall(0x10, &ireg, NULL); 38 intcall(0x10, &ireg, NULL);
39 39
40
41 ireg.ah = 0x0f; /* Get Current Video Mode */ 40 ireg.ah = 0x0f; /* Get Current Video Mode */
42 intcall(0x10, &ireg, &oreg); 41 intcall(0x10, &ireg, &oreg);
43 42
44 do_restore = 1; /* Assume video contents were lost */ 43 do_restore = 1; /* Assume video contents were lost */
45 44
46 /* Not all BIOSes are clean with the top bit */ 45 /* Not all BIOSes are clean with the top bit */
47 new_mode = ireg.al & 0x7f; 46 new_mode = oreg.al & 0x7f;
48 47
49 if (new_mode == mode) 48 if (new_mode == mode)
50 return 0; /* Mode change OK */ 49 return 0; /* Mode change OK */
diff --git a/arch/x86/boot/video-vesa.c b/arch/x86/boot/video-vesa.c
index c700147d6ffb..275dd177f198 100644
--- a/arch/x86/boot/video-vesa.c
+++ b/arch/x86/boot/video-vesa.c
@@ -45,7 +45,7 @@ static int vesa_probe(void)
45 ireg.di = (size_t)&vginfo; 45 ireg.di = (size_t)&vginfo;
46 intcall(0x10, &ireg, &oreg); 46 intcall(0x10, &ireg, &oreg);
47 47
48 if (ireg.ax != 0x004f || 48 if (oreg.ax != 0x004f ||
49 vginfo.signature != VESA_MAGIC || 49 vginfo.signature != VESA_MAGIC ||
50 vginfo.version < 0x0102) 50 vginfo.version < 0x0102)
51 return 0; /* Not present */ 51 return 0; /* Not present */
@@ -70,7 +70,7 @@ static int vesa_probe(void)
70 ireg.di = (size_t)&vminfo; 70 ireg.di = (size_t)&vminfo;
71 intcall(0x10, &ireg, &oreg); 71 intcall(0x10, &ireg, &oreg);
72 72
73 if (ireg.ax != 0x004f) 73 if (oreg.ax != 0x004f)
74 continue; 74 continue;
75 75
76 if ((vminfo.mode_attr & 0x15) == 0x05) { 76 if ((vminfo.mode_attr & 0x15) == 0x05) {
diff --git a/arch/x86/include/asm/atomic_32.h b/arch/x86/include/asm/atomic_32.h
index 2503d4e64c2a..dc5a667ff791 100644
--- a/arch/x86/include/asm/atomic_32.h
+++ b/arch/x86/include/asm/atomic_32.h
@@ -19,7 +19,10 @@
19 * 19 *
20 * Atomically reads the value of @v. 20 * Atomically reads the value of @v.
21 */ 21 */
22#define atomic_read(v) ((v)->counter) 22static inline int atomic_read(const atomic_t *v)
23{
24 return v->counter;
25}
23 26
24/** 27/**
25 * atomic_set - set atomic variable 28 * atomic_set - set atomic variable
@@ -28,7 +31,10 @@
28 * 31 *
29 * Atomically sets the value of @v to @i. 32 * Atomically sets the value of @v to @i.
30 */ 33 */
31#define atomic_set(v, i) (((v)->counter) = (i)) 34static inline void atomic_set(atomic_t *v, int i)
35{
36 v->counter = i;
37}
32 38
33/** 39/**
34 * atomic_add - add integer to atomic variable 40 * atomic_add - add integer to atomic variable
@@ -200,8 +206,15 @@ static inline int atomic_sub_return(int i, atomic_t *v)
200 return atomic_add_return(-i, v); 206 return atomic_add_return(-i, v);
201} 207}
202 208
203#define atomic_cmpxchg(v, old, new) (cmpxchg(&((v)->counter), (old), (new))) 209static inline int atomic_cmpxchg(atomic_t *v, int old, int new)
204#define atomic_xchg(v, new) (xchg(&((v)->counter), (new))) 210{
211 return cmpxchg(&v->counter, old, new);
212}
213
214static inline int atomic_xchg(atomic_t *v, int new)
215{
216 return xchg(&v->counter, new);
217}
205 218
206/** 219/**
207 * atomic_add_unless - add unless the number is already a given value 220 * atomic_add_unless - add unless the number is already a given value
@@ -250,45 +263,12 @@ static inline int atomic_add_unless(atomic_t *v, int a, int u)
250/* An 64bit atomic type */ 263/* An 64bit atomic type */
251 264
252typedef struct { 265typedef struct {
253 unsigned long long counter; 266 u64 __aligned(8) counter;
254} atomic64_t; 267} atomic64_t;
255 268
256#define ATOMIC64_INIT(val) { (val) } 269#define ATOMIC64_INIT(val) { (val) }
257 270
258/** 271extern u64 atomic64_cmpxchg(atomic64_t *ptr, u64 old_val, u64 new_val);
259 * atomic64_read - read atomic64 variable
260 * @ptr: pointer of type atomic64_t
261 *
262 * Atomically reads the value of @v.
263 * Doesn't imply a read memory barrier.
264 */
265#define __atomic64_read(ptr) ((ptr)->counter)
266
267static inline unsigned long long
268cmpxchg8b(unsigned long long *ptr, unsigned long long old, unsigned long long new)
269{
270 asm volatile(
271
272 LOCK_PREFIX "cmpxchg8b (%[ptr])\n"
273
274 : "=A" (old)
275
276 : [ptr] "D" (ptr),
277 "A" (old),
278 "b" (ll_low(new)),
279 "c" (ll_high(new))
280
281 : "memory");
282
283 return old;
284}
285
286static inline unsigned long long
287atomic64_cmpxchg(atomic64_t *ptr, unsigned long long old_val,
288 unsigned long long new_val)
289{
290 return cmpxchg8b(&ptr->counter, old_val, new_val);
291}
292 272
293/** 273/**
294 * atomic64_xchg - xchg atomic64 variable 274 * atomic64_xchg - xchg atomic64 variable
@@ -298,18 +278,7 @@ atomic64_cmpxchg(atomic64_t *ptr, unsigned long long old_val,
298 * Atomically xchgs the value of @ptr to @new_val and returns 278 * Atomically xchgs the value of @ptr to @new_val and returns
299 * the old value. 279 * the old value.
300 */ 280 */
301 281extern u64 atomic64_xchg(atomic64_t *ptr, u64 new_val);
302static inline unsigned long long
303atomic64_xchg(atomic64_t *ptr, unsigned long long new_val)
304{
305 unsigned long long old_val;
306
307 do {
308 old_val = atomic_read(ptr);
309 } while (atomic64_cmpxchg(ptr, old_val, new_val) != old_val);
310
311 return old_val;
312}
313 282
314/** 283/**
315 * atomic64_set - set atomic64 variable 284 * atomic64_set - set atomic64 variable
@@ -318,10 +287,7 @@ atomic64_xchg(atomic64_t *ptr, unsigned long long new_val)
318 * 287 *
319 * Atomically sets the value of @ptr to @new_val. 288 * Atomically sets the value of @ptr to @new_val.
320 */ 289 */
321static inline void atomic64_set(atomic64_t *ptr, unsigned long long new_val) 290extern void atomic64_set(atomic64_t *ptr, u64 new_val);
322{
323 atomic64_xchg(ptr, new_val);
324}
325 291
326/** 292/**
327 * atomic64_read - read atomic64 variable 293 * atomic64_read - read atomic64 variable
@@ -329,17 +295,30 @@ static inline void atomic64_set(atomic64_t *ptr, unsigned long long new_val)
329 * 295 *
330 * Atomically reads the value of @ptr and returns it. 296 * Atomically reads the value of @ptr and returns it.
331 */ 297 */
332static inline unsigned long long atomic64_read(atomic64_t *ptr) 298static inline u64 atomic64_read(atomic64_t *ptr)
333{ 299{
334 unsigned long long curr_val; 300 u64 res;
335 301
336 do { 302 /*
337 curr_val = __atomic64_read(ptr); 303 * Note, we inline this atomic64_t primitive because
338 } while (atomic64_cmpxchg(ptr, curr_val, curr_val) != curr_val); 304 * it only clobbers EAX/EDX and leaves the others
339 305 * untouched. We also (somewhat subtly) rely on the
340 return curr_val; 306 * fact that cmpxchg8b returns the current 64-bit value
307 * of the memory location we are touching:
308 */
309 asm volatile(
310 "mov %%ebx, %%eax\n\t"
311 "mov %%ecx, %%edx\n\t"
312 LOCK_PREFIX "cmpxchg8b %1\n"
313 : "=&A" (res)
314 : "m" (*ptr)
315 );
316
317 return res;
341} 318}
342 319
320extern u64 atomic64_read(atomic64_t *ptr);
321
343/** 322/**
344 * atomic64_add_return - add and return 323 * atomic64_add_return - add and return
345 * @delta: integer value to add 324 * @delta: integer value to add
@@ -347,34 +326,14 @@ static inline unsigned long long atomic64_read(atomic64_t *ptr)
347 * 326 *
348 * Atomically adds @delta to @ptr and returns @delta + *@ptr 327 * Atomically adds @delta to @ptr and returns @delta + *@ptr
349 */ 328 */
350static inline unsigned long long 329extern u64 atomic64_add_return(u64 delta, atomic64_t *ptr);
351atomic64_add_return(unsigned long long delta, atomic64_t *ptr)
352{
353 unsigned long long old_val, new_val;
354
355 do {
356 old_val = atomic_read(ptr);
357 new_val = old_val + delta;
358
359 } while (atomic64_cmpxchg(ptr, old_val, new_val) != old_val);
360
361 return new_val;
362}
363
364static inline long atomic64_sub_return(unsigned long long delta, atomic64_t *ptr)
365{
366 return atomic64_add_return(-delta, ptr);
367}
368 330
369static inline long atomic64_inc_return(atomic64_t *ptr) 331/*
370{ 332 * Other variants with different arithmetic operators:
371 return atomic64_add_return(1, ptr); 333 */
372} 334extern u64 atomic64_sub_return(u64 delta, atomic64_t *ptr);
373 335extern u64 atomic64_inc_return(atomic64_t *ptr);
374static inline long atomic64_dec_return(atomic64_t *ptr) 336extern u64 atomic64_dec_return(atomic64_t *ptr);
375{
376 return atomic64_sub_return(1, ptr);
377}
378 337
379/** 338/**
380 * atomic64_add - add integer to atomic64 variable 339 * atomic64_add - add integer to atomic64 variable
@@ -383,10 +342,7 @@ static inline long atomic64_dec_return(atomic64_t *ptr)
383 * 342 *
384 * Atomically adds @delta to @ptr. 343 * Atomically adds @delta to @ptr.
385 */ 344 */
386static inline void atomic64_add(unsigned long long delta, atomic64_t *ptr) 345extern void atomic64_add(u64 delta, atomic64_t *ptr);
387{
388 atomic64_add_return(delta, ptr);
389}
390 346
391/** 347/**
392 * atomic64_sub - subtract the atomic64 variable 348 * atomic64_sub - subtract the atomic64 variable
@@ -395,10 +351,7 @@ static inline void atomic64_add(unsigned long long delta, atomic64_t *ptr)
395 * 351 *
396 * Atomically subtracts @delta from @ptr. 352 * Atomically subtracts @delta from @ptr.
397 */ 353 */
398static inline void atomic64_sub(unsigned long long delta, atomic64_t *ptr) 354extern void atomic64_sub(u64 delta, atomic64_t *ptr);
399{
400 atomic64_add(-delta, ptr);
401}
402 355
403/** 356/**
404 * atomic64_sub_and_test - subtract value from variable and test result 357 * atomic64_sub_and_test - subtract value from variable and test result
@@ -409,13 +362,7 @@ static inline void atomic64_sub(unsigned long long delta, atomic64_t *ptr)
409 * true if the result is zero, or false for all 362 * true if the result is zero, or false for all
410 * other cases. 363 * other cases.
411 */ 364 */
412static inline int 365extern int atomic64_sub_and_test(u64 delta, atomic64_t *ptr);
413atomic64_sub_and_test(unsigned long long delta, atomic64_t *ptr)
414{
415 unsigned long long old_val = atomic64_sub_return(delta, ptr);
416
417 return old_val == 0;
418}
419 366
420/** 367/**
421 * atomic64_inc - increment atomic64 variable 368 * atomic64_inc - increment atomic64 variable
@@ -423,10 +370,7 @@ atomic64_sub_and_test(unsigned long long delta, atomic64_t *ptr)
423 * 370 *
424 * Atomically increments @ptr by 1. 371 * Atomically increments @ptr by 1.
425 */ 372 */
426static inline void atomic64_inc(atomic64_t *ptr) 373extern void atomic64_inc(atomic64_t *ptr);
427{
428 atomic64_add(1, ptr);
429}
430 374
431/** 375/**
432 * atomic64_dec - decrement atomic64 variable 376 * atomic64_dec - decrement atomic64 variable
@@ -434,10 +378,7 @@ static inline void atomic64_inc(atomic64_t *ptr)
434 * 378 *
435 * Atomically decrements @ptr by 1. 379 * Atomically decrements @ptr by 1.
436 */ 380 */
437static inline void atomic64_dec(atomic64_t *ptr) 381extern void atomic64_dec(atomic64_t *ptr);
438{
439 atomic64_sub(1, ptr);
440}
441 382
442/** 383/**
443 * atomic64_dec_and_test - decrement and test 384 * atomic64_dec_and_test - decrement and test
@@ -447,10 +388,7 @@ static inline void atomic64_dec(atomic64_t *ptr)
447 * returns true if the result is 0, or false for all other 388 * returns true if the result is 0, or false for all other
448 * cases. 389 * cases.
449 */ 390 */
450static inline int atomic64_dec_and_test(atomic64_t *ptr) 391extern int atomic64_dec_and_test(atomic64_t *ptr);
451{
452 return atomic64_sub_and_test(1, ptr);
453}
454 392
455/** 393/**
456 * atomic64_inc_and_test - increment and test 394 * atomic64_inc_and_test - increment and test
@@ -460,10 +398,7 @@ static inline int atomic64_dec_and_test(atomic64_t *ptr)
460 * and returns true if the result is zero, or false for all 398 * and returns true if the result is zero, or false for all
461 * other cases. 399 * other cases.
462 */ 400 */
463static inline int atomic64_inc_and_test(atomic64_t *ptr) 401extern int atomic64_inc_and_test(atomic64_t *ptr);
464{
465 return atomic64_sub_and_test(-1, ptr);
466}
467 402
468/** 403/**
469 * atomic64_add_negative - add and test if negative 404 * atomic64_add_negative - add and test if negative
@@ -474,13 +409,7 @@ static inline int atomic64_inc_and_test(atomic64_t *ptr)
474 * if the result is negative, or false when 409 * if the result is negative, or false when
475 * result is greater than or equal to zero. 410 * result is greater than or equal to zero.
476 */ 411 */
477static inline int 412extern int atomic64_add_negative(u64 delta, atomic64_t *ptr);
478atomic64_add_negative(unsigned long long delta, atomic64_t *ptr)
479{
480 long long old_val = atomic64_add_return(delta, ptr);
481
482 return old_val < 0;
483}
484 413
485#include <asm-generic/atomic-long.h> 414#include <asm-generic/atomic-long.h>
486#endif /* _ASM_X86_ATOMIC_32_H */ 415#endif /* _ASM_X86_ATOMIC_32_H */
diff --git a/arch/x86/include/asm/atomic_64.h b/arch/x86/include/asm/atomic_64.h
index 0d6360220007..d605dc268e79 100644
--- a/arch/x86/include/asm/atomic_64.h
+++ b/arch/x86/include/asm/atomic_64.h
@@ -18,7 +18,10 @@
18 * 18 *
19 * Atomically reads the value of @v. 19 * Atomically reads the value of @v.
20 */ 20 */
21#define atomic_read(v) ((v)->counter) 21static inline int atomic_read(const atomic_t *v)
22{
23 return v->counter;
24}
22 25
23/** 26/**
24 * atomic_set - set atomic variable 27 * atomic_set - set atomic variable
@@ -27,7 +30,10 @@
27 * 30 *
28 * Atomically sets the value of @v to @i. 31 * Atomically sets the value of @v to @i.
29 */ 32 */
30#define atomic_set(v, i) (((v)->counter) = (i)) 33static inline void atomic_set(atomic_t *v, int i)
34{
35 v->counter = i;
36}
31 37
32/** 38/**
33 * atomic_add - add integer to atomic variable 39 * atomic_add - add integer to atomic variable
@@ -192,7 +198,10 @@ static inline int atomic_sub_return(int i, atomic_t *v)
192 * Atomically reads the value of @v. 198 * Atomically reads the value of @v.
193 * Doesn't imply a read memory barrier. 199 * Doesn't imply a read memory barrier.
194 */ 200 */
195#define atomic64_read(v) ((v)->counter) 201static inline long atomic64_read(const atomic64_t *v)
202{
203 return v->counter;
204}
196 205
197/** 206/**
198 * atomic64_set - set atomic64 variable 207 * atomic64_set - set atomic64 variable
@@ -201,7 +210,10 @@ static inline int atomic_sub_return(int i, atomic_t *v)
201 * 210 *
202 * Atomically sets the value of @v to @i. 211 * Atomically sets the value of @v to @i.
203 */ 212 */
204#define atomic64_set(v, i) (((v)->counter) = (i)) 213static inline void atomic64_set(atomic64_t *v, long i)
214{
215 v->counter = i;
216}
205 217
206/** 218/**
207 * atomic64_add - add integer to atomic64 variable 219 * atomic64_add - add integer to atomic64 variable
@@ -355,11 +367,25 @@ static inline long atomic64_sub_return(long i, atomic64_t *v)
355#define atomic64_inc_return(v) (atomic64_add_return(1, (v))) 367#define atomic64_inc_return(v) (atomic64_add_return(1, (v)))
356#define atomic64_dec_return(v) (atomic64_sub_return(1, (v))) 368#define atomic64_dec_return(v) (atomic64_sub_return(1, (v)))
357 369
358#define atomic64_cmpxchg(v, old, new) (cmpxchg(&((v)->counter), (old), (new))) 370static inline long atomic64_cmpxchg(atomic64_t *v, long old, long new)
359#define atomic64_xchg(v, new) (xchg(&((v)->counter), new)) 371{
372 return cmpxchg(&v->counter, old, new);
373}
374
375static inline long atomic64_xchg(atomic64_t *v, long new)
376{
377 return xchg(&v->counter, new);
378}
360 379
361#define atomic_cmpxchg(v, old, new) (cmpxchg(&((v)->counter), (old), (new))) 380static inline long atomic_cmpxchg(atomic_t *v, int old, int new)
362#define atomic_xchg(v, new) (xchg(&((v)->counter), (new))) 381{
382 return cmpxchg(&v->counter, old, new);
383}
384
385static inline long atomic_xchg(atomic_t *v, int new)
386{
387 return xchg(&v->counter, new);
388}
363 389
364/** 390/**
365 * atomic_add_unless - add unless the number is a given value 391 * atomic_add_unless - add unless the number is a given value
diff --git a/arch/x86/include/asm/boot.h b/arch/x86/include/asm/boot.h
index 418e632d4a80..7a1065958ba9 100644
--- a/arch/x86/include/asm/boot.h
+++ b/arch/x86/include/asm/boot.h
@@ -8,7 +8,7 @@
8 8
9#ifdef __KERNEL__ 9#ifdef __KERNEL__
10 10
11#include <asm/page_types.h> 11#include <asm/pgtable_types.h>
12 12
13/* Physical address where kernel should be loaded. */ 13/* Physical address where kernel should be loaded. */
14#define LOAD_PHYSICAL_ADDR ((CONFIG_PHYSICAL_START \ 14#define LOAD_PHYSICAL_ADDR ((CONFIG_PHYSICAL_START \
@@ -16,10 +16,10 @@
16 & ~(CONFIG_PHYSICAL_ALIGN - 1)) 16 & ~(CONFIG_PHYSICAL_ALIGN - 1))
17 17
18/* Minimum kernel alignment, as a power of two */ 18/* Minimum kernel alignment, as a power of two */
19#ifdef CONFIG_x86_64 19#ifdef CONFIG_X86_64
20#define MIN_KERNEL_ALIGN_LG2 PMD_SHIFT 20#define MIN_KERNEL_ALIGN_LG2 PMD_SHIFT
21#else 21#else
22#define MIN_KERNEL_ALIGN_LG2 (PAGE_SHIFT+1) 22#define MIN_KERNEL_ALIGN_LG2 (PAGE_SHIFT + THREAD_ORDER)
23#endif 23#endif
24#define MIN_KERNEL_ALIGN (_AC(1, UL) << MIN_KERNEL_ALIGN_LG2) 24#define MIN_KERNEL_ALIGN (_AC(1, UL) << MIN_KERNEL_ALIGN_LG2)
25 25
diff --git a/arch/x86/include/asm/fixmap.h b/arch/x86/include/asm/fixmap.h
index 2d81af3974a0..7b2d71df39a6 100644
--- a/arch/x86/include/asm/fixmap.h
+++ b/arch/x86/include/asm/fixmap.h
@@ -111,12 +111,9 @@ enum fixed_addresses {
111#ifdef CONFIG_PARAVIRT 111#ifdef CONFIG_PARAVIRT
112 FIX_PARAVIRT_BOOTMAP, 112 FIX_PARAVIRT_BOOTMAP,
113#endif 113#endif
114 FIX_TEXT_POKE0, /* reserve 2 pages for text_poke() */ 114 FIX_TEXT_POKE1, /* reserve 2 pages for text_poke() */
115 FIX_TEXT_POKE1, 115 FIX_TEXT_POKE0, /* first page is last, because allocation is backward */
116 __end_of_permanent_fixed_addresses, 116 __end_of_permanent_fixed_addresses,
117#ifdef CONFIG_PROVIDE_OHCI1394_DMA_INIT
118 FIX_OHCI1394_BASE,
119#endif
120 /* 117 /*
121 * 256 temporary boot-time mappings, used by early_ioremap(), 118 * 256 temporary boot-time mappings, used by early_ioremap(),
122 * before ioremap() is functional. 119 * before ioremap() is functional.
@@ -129,6 +126,9 @@ enum fixed_addresses {
129 FIX_BTMAP_END = __end_of_permanent_fixed_addresses + 256 - 126 FIX_BTMAP_END = __end_of_permanent_fixed_addresses + 256 -
130 (__end_of_permanent_fixed_addresses & 255), 127 (__end_of_permanent_fixed_addresses & 255),
131 FIX_BTMAP_BEGIN = FIX_BTMAP_END + NR_FIX_BTMAPS*FIX_BTMAPS_SLOTS - 1, 128 FIX_BTMAP_BEGIN = FIX_BTMAP_END + NR_FIX_BTMAPS*FIX_BTMAPS_SLOTS - 1,
129#ifdef CONFIG_PROVIDE_OHCI1394_DMA_INIT
130 FIX_OHCI1394_BASE,
131#endif
132#ifdef CONFIG_X86_32 132#ifdef CONFIG_X86_32
133 FIX_WP_TEST, 133 FIX_WP_TEST,
134#endif 134#endif
diff --git a/arch/x86/include/asm/io_apic.h b/arch/x86/include/asm/io_apic.h
index daf866ed0612..330ee807f89e 100644
--- a/arch/x86/include/asm/io_apic.h
+++ b/arch/x86/include/asm/io_apic.h
@@ -161,6 +161,7 @@ extern int io_apic_set_pci_routing(struct device *dev, int irq,
161 struct io_apic_irq_attr *irq_attr); 161 struct io_apic_irq_attr *irq_attr);
162extern int (*ioapic_renumber_irq)(int ioapic, int irq); 162extern int (*ioapic_renumber_irq)(int ioapic, int irq);
163extern void ioapic_init_mappings(void); 163extern void ioapic_init_mappings(void);
164extern void ioapic_insert_resources(void);
164 165
165extern struct IO_APIC_route_entry **alloc_ioapic_entries(void); 166extern struct IO_APIC_route_entry **alloc_ioapic_entries(void);
166extern void free_ioapic_entries(struct IO_APIC_route_entry **ioapic_entries); 167extern void free_ioapic_entries(struct IO_APIC_route_entry **ioapic_entries);
@@ -180,6 +181,7 @@ extern void ioapic_write_entry(int apic, int pin,
180#define io_apic_assign_pci_irqs 0 181#define io_apic_assign_pci_irqs 0
181static const int timer_through_8259 = 0; 182static const int timer_through_8259 = 0;
182static inline void ioapic_init_mappings(void) { } 183static inline void ioapic_init_mappings(void) { }
184static inline void ioapic_insert_resources(void) { }
183 185
184static inline void probe_nr_irqs_gsi(void) { } 186static inline void probe_nr_irqs_gsi(void) { }
185#endif 187#endif
diff --git a/arch/x86/include/asm/lguest_hcall.h b/arch/x86/include/asm/lguest_hcall.h
index d31c4a684078..33600a66755f 100644
--- a/arch/x86/include/asm/lguest_hcall.h
+++ b/arch/x86/include/asm/lguest_hcall.h
@@ -30,7 +30,7 @@
30#include <asm/hw_irq.h> 30#include <asm/hw_irq.h>
31#include <asm/kvm_para.h> 31#include <asm/kvm_para.h>
32 32
33/*G:031 But first, how does our Guest contact the Host to ask for privileged 33/*G:030 But first, how does our Guest contact the Host to ask for privileged
34 * operations? There are two ways: the direct way is to make a "hypercall", 34 * operations? There are two ways: the direct way is to make a "hypercall",
35 * to make requests of the Host Itself. 35 * to make requests of the Host Itself.
36 * 36 *
diff --git a/arch/x86/include/asm/msr-index.h b/arch/x86/include/asm/msr-index.h
index 1692fb5050e3..6be7fc254b59 100644
--- a/arch/x86/include/asm/msr-index.h
+++ b/arch/x86/include/asm/msr-index.h
@@ -246,10 +246,6 @@
246#define MSR_IA32_MISC_ENABLE_TURBO_DISABLE (1ULL << 38) 246#define MSR_IA32_MISC_ENABLE_TURBO_DISABLE (1ULL << 38)
247#define MSR_IA32_MISC_ENABLE_IP_PREF_DISABLE (1ULL << 39) 247#define MSR_IA32_MISC_ENABLE_IP_PREF_DISABLE (1ULL << 39)
248 248
249/* Intel Model 6 */
250#define MSR_P6_EVNTSEL0 0x00000186
251#define MSR_P6_EVNTSEL1 0x00000187
252
253/* P4/Xeon+ specific */ 249/* P4/Xeon+ specific */
254#define MSR_IA32_MCG_EAX 0x00000180 250#define MSR_IA32_MCG_EAX 0x00000180
255#define MSR_IA32_MCG_EBX 0x00000181 251#define MSR_IA32_MCG_EBX 0x00000181
diff --git a/arch/x86/include/asm/nmi.h b/arch/x86/include/asm/nmi.h
index c97264409934..c86e5ed4af51 100644
--- a/arch/x86/include/asm/nmi.h
+++ b/arch/x86/include/asm/nmi.h
@@ -72,7 +72,6 @@ void lapic_watchdog_stop(void);
72int lapic_watchdog_init(unsigned nmi_hz); 72int lapic_watchdog_init(unsigned nmi_hz);
73int lapic_wd_event(unsigned nmi_hz); 73int lapic_wd_event(unsigned nmi_hz);
74unsigned lapic_adjust_nmi_hz(unsigned hz); 74unsigned lapic_adjust_nmi_hz(unsigned hz);
75int lapic_watchdog_ok(void);
76void disable_lapic_nmi_watchdog(void); 75void disable_lapic_nmi_watchdog(void);
77void enable_lapic_nmi_watchdog(void); 76void enable_lapic_nmi_watchdog(void);
78void stop_nmi(void); 77void stop_nmi(void);
diff --git a/arch/x86/include/asm/pci.h b/arch/x86/include/asm/pci.h
index 927958d13c19..1ff685ca221c 100644
--- a/arch/x86/include/asm/pci.h
+++ b/arch/x86/include/asm/pci.h
@@ -91,7 +91,7 @@ extern void pci_iommu_alloc(void);
91 91
92#define PCI_DMA_BUS_IS_PHYS (dma_ops->is_phys) 92#define PCI_DMA_BUS_IS_PHYS (dma_ops->is_phys)
93 93
94#if defined(CONFIG_X86_64) || defined(CONFIG_DMA_API_DEBUG) 94#if defined(CONFIG_X86_64) || defined(CONFIG_DMAR) || defined(CONFIG_DMA_API_DEBUG)
95 95
96#define DECLARE_PCI_UNMAP_ADDR(ADDR_NAME) \ 96#define DECLARE_PCI_UNMAP_ADDR(ADDR_NAME) \
97 dma_addr_t ADDR_NAME; 97 dma_addr_t ADDR_NAME;
diff --git a/arch/x86/include/asm/percpu.h b/arch/x86/include/asm/percpu.h
index 02ecb30982a3..103f1ddb0d85 100644
--- a/arch/x86/include/asm/percpu.h
+++ b/arch/x86/include/asm/percpu.h
@@ -42,6 +42,7 @@
42 42
43#else /* ...!ASSEMBLY */ 43#else /* ...!ASSEMBLY */
44 44
45#include <linux/kernel.h>
45#include <linux/stringify.h> 46#include <linux/stringify.h>
46 47
47#ifdef CONFIG_SMP 48#ifdef CONFIG_SMP
@@ -155,6 +156,15 @@ do { \
155/* We can use this directly for local CPU (faster). */ 156/* We can use this directly for local CPU (faster). */
156DECLARE_PER_CPU(unsigned long, this_cpu_off); 157DECLARE_PER_CPU(unsigned long, this_cpu_off);
157 158
159#ifdef CONFIG_NEED_MULTIPLE_NODES
160void *pcpu_lpage_remapped(void *kaddr);
161#else
162static inline void *pcpu_lpage_remapped(void *kaddr)
163{
164 return NULL;
165}
166#endif
167
158#endif /* !__ASSEMBLY__ */ 168#endif /* !__ASSEMBLY__ */
159 169
160#ifdef CONFIG_SMP 170#ifdef CONFIG_SMP
diff --git a/arch/x86/include/asm/perf_counter.h b/arch/x86/include/asm/perf_counter.h
index 5fb33e160ea0..fa64e401589d 100644
--- a/arch/x86/include/asm/perf_counter.h
+++ b/arch/x86/include/asm/perf_counter.h
@@ -87,6 +87,9 @@ union cpuid10_edx {
87#ifdef CONFIG_PERF_COUNTERS 87#ifdef CONFIG_PERF_COUNTERS
88extern void init_hw_perf_counters(void); 88extern void init_hw_perf_counters(void);
89extern void perf_counters_lapic_init(void); 89extern void perf_counters_lapic_init(void);
90
91#define PERF_COUNTER_INDEX_OFFSET 0
92
90#else 93#else
91static inline void init_hw_perf_counters(void) { } 94static inline void init_hw_perf_counters(void) { }
92static inline void perf_counters_lapic_init(void) { } 95static inline void perf_counters_lapic_init(void) { }
diff --git a/arch/x86/include/asm/proto.h b/arch/x86/include/asm/proto.h
index 49fb3ecf3bb3..621f56d73121 100644
--- a/arch/x86/include/asm/proto.h
+++ b/arch/x86/include/asm/proto.h
@@ -22,7 +22,14 @@ extern int reboot_force;
22 22
23long do_arch_prctl(struct task_struct *task, int code, unsigned long addr); 23long do_arch_prctl(struct task_struct *task, int code, unsigned long addr);
24 24
25#define round_up(x, y) (((x) + (y) - 1) & ~((y) - 1)) 25/*
26#define round_down(x, y) ((x) & ~((y) - 1)) 26 * This looks more complex than it should be. But we need to
27 * get the type for the ~ right in round_down (it needs to be
28 * as wide as the result!), and we want to evaluate the macro
29 * arguments just once each.
30 */
31#define __round_mask(x,y) ((__typeof__(x))((y)-1))
32#define round_up(x,y) ((((x)-1) | __round_mask(x,y))+1)
33#define round_down(x,y) ((x) & ~__round_mask(x,y))
27 34
28#endif /* _ASM_X86_PROTO_H */ 35#endif /* _ASM_X86_PROTO_H */
diff --git a/arch/x86/include/asm/spinlock.h b/arch/x86/include/asm/spinlock.h
index b7e5db876399..4e77853321db 100644
--- a/arch/x86/include/asm/spinlock.h
+++ b/arch/x86/include/asm/spinlock.h
@@ -302,4 +302,8 @@ static inline void __raw_write_unlock(raw_rwlock_t *rw)
302#define _raw_read_relax(lock) cpu_relax() 302#define _raw_read_relax(lock) cpu_relax()
303#define _raw_write_relax(lock) cpu_relax() 303#define _raw_write_relax(lock) cpu_relax()
304 304
305/* The {read|write|spin}_lock() on x86 are full memory barriers. */
306static inline void smp_mb__after_lock(void) { }
307#define ARCH_HAS_SMP_MB_AFTER_LOCK
308
305#endif /* _ASM_X86_SPINLOCK_H */ 309#endif /* _ASM_X86_SPINLOCK_H */
diff --git a/arch/x86/include/asm/stacktrace.h b/arch/x86/include/asm/stacktrace.h
index f517944b2b17..cf86a5e73815 100644
--- a/arch/x86/include/asm/stacktrace.h
+++ b/arch/x86/include/asm/stacktrace.h
@@ -3,6 +3,8 @@
3 3
4extern int kstack_depth_to_print; 4extern int kstack_depth_to_print;
5 5
6int x86_is_stack_id(int id, char *name);
7
6/* Generic stack tracer with callbacks */ 8/* Generic stack tracer with callbacks */
7 9
8struct stacktrace_ops { 10struct stacktrace_ops {
diff --git a/arch/x86/include/asm/thread_info.h b/arch/x86/include/asm/thread_info.h
index b0783520988b..fad7d40b75f8 100644
--- a/arch/x86/include/asm/thread_info.h
+++ b/arch/x86/include/asm/thread_info.h
@@ -49,7 +49,7 @@ struct thread_info {
49 .exec_domain = &default_exec_domain, \ 49 .exec_domain = &default_exec_domain, \
50 .flags = 0, \ 50 .flags = 0, \
51 .cpu = 0, \ 51 .cpu = 0, \
52 .preempt_count = 1, \ 52 .preempt_count = INIT_PREEMPT_COUNT, \
53 .addr_limit = KERNEL_DS, \ 53 .addr_limit = KERNEL_DS, \
54 .restart_block = { \ 54 .restart_block = { \
55 .fn = do_no_restart_syscall, \ 55 .fn = do_no_restart_syscall, \
diff --git a/arch/x86/kernel/Makefile b/arch/x86/kernel/Makefile
index 6c327b852e23..430d5b24af7b 100644
--- a/arch/x86/kernel/Makefile
+++ b/arch/x86/kernel/Makefile
@@ -26,6 +26,8 @@ CFLAGS_tsc.o := $(nostackp)
26CFLAGS_paravirt.o := $(nostackp) 26CFLAGS_paravirt.o := $(nostackp)
27GCOV_PROFILE_vsyscall_64.o := n 27GCOV_PROFILE_vsyscall_64.o := n
28GCOV_PROFILE_hpet.o := n 28GCOV_PROFILE_hpet.o := n
29GCOV_PROFILE_tsc.o := n
30GCOV_PROFILE_paravirt.o := n
29 31
30obj-y := process_$(BITS).o signal.o entry_$(BITS).o 32obj-y := process_$(BITS).o signal.o entry_$(BITS).o
31obj-y += traps.o irq.o irq_$(BITS).o dumpstack_$(BITS).o 33obj-y += traps.o irq.o irq_$(BITS).o dumpstack_$(BITS).o
diff --git a/arch/x86/kernel/amd_iommu.c b/arch/x86/kernel/amd_iommu.c
index 9372f0406ad4..6c99f5037801 100644
--- a/arch/x86/kernel/amd_iommu.c
+++ b/arch/x86/kernel/amd_iommu.c
@@ -1192,7 +1192,7 @@ out:
1192 return 0; 1192 return 0;
1193} 1193}
1194 1194
1195struct notifier_block device_nb = { 1195static struct notifier_block device_nb = {
1196 .notifier_call = device_change_notifier, 1196 .notifier_call = device_change_notifier,
1197}; 1197};
1198 1198
@@ -1763,7 +1763,7 @@ static void *alloc_coherent(struct device *dev, size_t size,
1763 flag |= __GFP_ZERO; 1763 flag |= __GFP_ZERO;
1764 virt_addr = (void *)__get_free_pages(flag, get_order(size)); 1764 virt_addr = (void *)__get_free_pages(flag, get_order(size));
1765 if (!virt_addr) 1765 if (!virt_addr)
1766 return 0; 1766 return NULL;
1767 1767
1768 paddr = virt_to_phys(virt_addr); 1768 paddr = virt_to_phys(virt_addr);
1769 1769
diff --git a/arch/x86/kernel/amd_iommu_init.c b/arch/x86/kernel/amd_iommu_init.c
index 10b2accd12ea..c1b17e97252e 100644
--- a/arch/x86/kernel/amd_iommu_init.c
+++ b/arch/x86/kernel/amd_iommu_init.c
@@ -472,6 +472,8 @@ static u8 * __init alloc_event_buffer(struct amd_iommu *iommu)
472 if (iommu->evt_buf == NULL) 472 if (iommu->evt_buf == NULL)
473 return NULL; 473 return NULL;
474 474
475 iommu->evt_buf_size = EVT_BUFFER_SIZE;
476
475 return iommu->evt_buf; 477 return iommu->evt_buf;
476} 478}
477 479
@@ -691,6 +693,7 @@ static void __init init_iommu_from_acpi(struct amd_iommu *iommu,
691 693
692 devid = e->devid; 694 devid = e->devid;
693 devid_to = e->ext >> 8; 695 devid_to = e->ext >> 8;
696 set_dev_entry_from_acpi(iommu, devid , e->flags, 0);
694 set_dev_entry_from_acpi(iommu, devid_to, e->flags, 0); 697 set_dev_entry_from_acpi(iommu, devid_to, e->flags, 0);
695 amd_iommu_alias_table[devid] = devid_to; 698 amd_iommu_alias_table[devid] = devid_to;
696 break; 699 break;
@@ -749,11 +752,13 @@ static void __init init_iommu_from_acpi(struct amd_iommu *iommu,
749 752
750 devid = e->devid; 753 devid = e->devid;
751 for (dev_i = devid_start; dev_i <= devid; ++dev_i) { 754 for (dev_i = devid_start; dev_i <= devid; ++dev_i) {
752 if (alias) 755 if (alias) {
753 amd_iommu_alias_table[dev_i] = devid_to; 756 amd_iommu_alias_table[dev_i] = devid_to;
754 set_dev_entry_from_acpi(iommu, 757 set_dev_entry_from_acpi(iommu,
755 amd_iommu_alias_table[dev_i], 758 devid_to, flags, ext_flags);
756 flags, ext_flags); 759 }
760 set_dev_entry_from_acpi(iommu, dev_i,
761 flags, ext_flags);
757 } 762 }
758 break; 763 break;
759 default: 764 default:
diff --git a/arch/x86/kernel/apic/apic.c b/arch/x86/kernel/apic/apic.c
index 8c7c042ecad1..0a1c2830ec66 100644
--- a/arch/x86/kernel/apic/apic.c
+++ b/arch/x86/kernel/apic/apic.c
@@ -140,7 +140,6 @@ int x2apic_mode;
140#ifdef CONFIG_X86_X2APIC 140#ifdef CONFIG_X86_X2APIC
141/* x2apic enabled before OS handover */ 141/* x2apic enabled before OS handover */
142static int x2apic_preenabled; 142static int x2apic_preenabled;
143static int disable_x2apic;
144static __init int setup_nox2apic(char *str) 143static __init int setup_nox2apic(char *str)
145{ 144{
146 if (x2apic_enabled()) { 145 if (x2apic_enabled()) {
@@ -149,7 +148,6 @@ static __init int setup_nox2apic(char *str)
149 return 0; 148 return 0;
150 } 149 }
151 150
152 disable_x2apic = 1;
153 setup_clear_cpu_cap(X86_FEATURE_X2APIC); 151 setup_clear_cpu_cap(X86_FEATURE_X2APIC);
154 return 0; 152 return 0;
155} 153}
diff --git a/arch/x86/kernel/apic/es7000_32.c b/arch/x86/kernel/apic/es7000_32.c
index 69328ac8de9c..8952a5890281 100644
--- a/arch/x86/kernel/apic/es7000_32.c
+++ b/arch/x86/kernel/apic/es7000_32.c
@@ -652,7 +652,8 @@ static int es7000_mps_oem_check_cluster(struct mpc_table *mpc, char *oem,
652 return ret && es7000_apic_is_cluster(); 652 return ret && es7000_apic_is_cluster();
653} 653}
654 654
655struct apic apic_es7000_cluster = { 655/* We've been warned by a false positive warning.Use __refdata to keep calm. */
656struct apic __refdata apic_es7000_cluster = {
656 657
657 .name = "es7000", 658 .name = "es7000",
658 .probe = probe_es7000, 659 .probe = probe_es7000,
diff --git a/arch/x86/kernel/apic/io_apic.c b/arch/x86/kernel/apic/io_apic.c
index 4d0216fcb36c..2284a4812b68 100644
--- a/arch/x86/kernel/apic/io_apic.c
+++ b/arch/x86/kernel/apic/io_apic.c
@@ -1716,25 +1716,19 @@ __apicdebuginit(void) print_IO_APIC(void)
1716 return; 1716 return;
1717} 1717}
1718 1718
1719__apicdebuginit(void) print_APIC_bitfield(int base) 1719__apicdebuginit(void) print_APIC_field(int base)
1720{ 1720{
1721 unsigned int v; 1721 int i;
1722 int i, j;
1723 1722
1724 if (apic_verbosity == APIC_QUIET) 1723 if (apic_verbosity == APIC_QUIET)
1725 return; 1724 return;
1726 1725
1727 printk(KERN_DEBUG "0123456789abcdef0123456789abcdef\n" KERN_DEBUG); 1726 printk(KERN_DEBUG);
1728 for (i = 0; i < 8; i++) { 1727
1729 v = apic_read(base + i*0x10); 1728 for (i = 0; i < 8; i++)
1730 for (j = 0; j < 32; j++) { 1729 printk(KERN_CONT "%08x", apic_read(base + i*0x10));
1731 if (v & (1<<j)) 1730
1732 printk("1"); 1731 printk(KERN_CONT "\n");
1733 else
1734 printk("0");
1735 }
1736 printk("\n");
1737 }
1738} 1732}
1739 1733
1740__apicdebuginit(void) print_local_APIC(void *dummy) 1734__apicdebuginit(void) print_local_APIC(void *dummy)
@@ -1745,7 +1739,7 @@ __apicdebuginit(void) print_local_APIC(void *dummy)
1745 if (apic_verbosity == APIC_QUIET) 1739 if (apic_verbosity == APIC_QUIET)
1746 return; 1740 return;
1747 1741
1748 printk("\n" KERN_DEBUG "printing local APIC contents on CPU#%d/%d:\n", 1742 printk(KERN_DEBUG "printing local APIC contents on CPU#%d/%d:\n",
1749 smp_processor_id(), hard_smp_processor_id()); 1743 smp_processor_id(), hard_smp_processor_id());
1750 v = apic_read(APIC_ID); 1744 v = apic_read(APIC_ID);
1751 printk(KERN_INFO "... APIC ID: %08x (%01x)\n", v, read_apic_id()); 1745 printk(KERN_INFO "... APIC ID: %08x (%01x)\n", v, read_apic_id());
@@ -1786,11 +1780,11 @@ __apicdebuginit(void) print_local_APIC(void *dummy)
1786 printk(KERN_DEBUG "... APIC SPIV: %08x\n", v); 1780 printk(KERN_DEBUG "... APIC SPIV: %08x\n", v);
1787 1781
1788 printk(KERN_DEBUG "... APIC ISR field:\n"); 1782 printk(KERN_DEBUG "... APIC ISR field:\n");
1789 print_APIC_bitfield(APIC_ISR); 1783 print_APIC_field(APIC_ISR);
1790 printk(KERN_DEBUG "... APIC TMR field:\n"); 1784 printk(KERN_DEBUG "... APIC TMR field:\n");
1791 print_APIC_bitfield(APIC_TMR); 1785 print_APIC_field(APIC_TMR);
1792 printk(KERN_DEBUG "... APIC IRR field:\n"); 1786 printk(KERN_DEBUG "... APIC IRR field:\n");
1793 print_APIC_bitfield(APIC_IRR); 1787 print_APIC_field(APIC_IRR);
1794 1788
1795 if (APIC_INTEGRATED(ver)) { /* !82489DX */ 1789 if (APIC_INTEGRATED(ver)) { /* !82489DX */
1796 if (maxlvt > 3) /* Due to the Pentium erratum 3AP. */ 1790 if (maxlvt > 3) /* Due to the Pentium erratum 3AP. */
@@ -4187,28 +4181,20 @@ fake_ioapic_page:
4187 } 4181 }
4188} 4182}
4189 4183
4190static int __init ioapic_insert_resources(void) 4184void __init ioapic_insert_resources(void)
4191{ 4185{
4192 int i; 4186 int i;
4193 struct resource *r = ioapic_resources; 4187 struct resource *r = ioapic_resources;
4194 4188
4195 if (!r) { 4189 if (!r) {
4196 if (nr_ioapics > 0) { 4190 if (nr_ioapics > 0)
4197 printk(KERN_ERR 4191 printk(KERN_ERR
4198 "IO APIC resources couldn't be allocated.\n"); 4192 "IO APIC resources couldn't be allocated.\n");
4199 return -1; 4193 return;
4200 }
4201 return 0;
4202 } 4194 }
4203 4195
4204 for (i = 0; i < nr_ioapics; i++) { 4196 for (i = 0; i < nr_ioapics; i++) {
4205 insert_resource(&iomem_resource, r); 4197 insert_resource(&iomem_resource, r);
4206 r++; 4198 r++;
4207 } 4199 }
4208
4209 return 0;
4210} 4200}
4211
4212/* Insert the IO APIC resources after PCI initialization has occured to handle
4213 * IO APICS that are mapped in on a BAR in PCI space. */
4214late_initcall(ioapic_insert_resources);
diff --git a/arch/x86/kernel/apic/numaq_32.c b/arch/x86/kernel/apic/numaq_32.c
index 533e59c6fc82..ca96e68f0d23 100644
--- a/arch/x86/kernel/apic/numaq_32.c
+++ b/arch/x86/kernel/apic/numaq_32.c
@@ -493,7 +493,8 @@ static void numaq_setup_portio_remap(void)
493 (u_long) xquad_portio, (u_long) num_quads*XQUAD_PORTIO_QUAD); 493 (u_long) xquad_portio, (u_long) num_quads*XQUAD_PORTIO_QUAD);
494} 494}
495 495
496struct apic apic_numaq = { 496/* Use __refdata to keep false positive warning calm. */
497struct apic __refdata apic_numaq = {
497 498
498 .name = "NUMAQ", 499 .name = "NUMAQ",
499 .probe = probe_numaq, 500 .probe = probe_numaq,
diff --git a/arch/x86/kernel/cpu/amd.c b/arch/x86/kernel/cpu/amd.c
index e5b27d8f1b47..28e5f5956042 100644
--- a/arch/x86/kernel/cpu/amd.c
+++ b/arch/x86/kernel/cpu/amd.c
@@ -258,13 +258,15 @@ static void __cpuinit amd_detect_cmp(struct cpuinfo_x86 *c)
258{ 258{
259#ifdef CONFIG_X86_HT 259#ifdef CONFIG_X86_HT
260 unsigned bits; 260 unsigned bits;
261 int cpu = smp_processor_id();
261 262
262 bits = c->x86_coreid_bits; 263 bits = c->x86_coreid_bits;
263
264 /* Low order bits define the core id (index of core in socket) */ 264 /* Low order bits define the core id (index of core in socket) */
265 c->cpu_core_id = c->initial_apicid & ((1 << bits)-1); 265 c->cpu_core_id = c->initial_apicid & ((1 << bits)-1);
266 /* Convert the initial APIC ID into the socket ID */ 266 /* Convert the initial APIC ID into the socket ID */
267 c->phys_proc_id = c->initial_apicid >> bits; 267 c->phys_proc_id = c->initial_apicid >> bits;
268 /* use socket ID also for last level cache */
269 per_cpu(cpu_llc_id, cpu) = c->phys_proc_id;
268#endif 270#endif
269} 271}
270 272
diff --git a/arch/x86/kernel/cpu/common.c b/arch/x86/kernel/cpu/common.c
index 6b26d4deada0..f1961c07af9a 100644
--- a/arch/x86/kernel/cpu/common.c
+++ b/arch/x86/kernel/cpu/common.c
@@ -848,9 +848,6 @@ static void __cpuinit identify_cpu(struct cpuinfo_x86 *c)
848#if defined(CONFIG_NUMA) && defined(CONFIG_X86_64) 848#if defined(CONFIG_NUMA) && defined(CONFIG_X86_64)
849 numa_add_cpu(smp_processor_id()); 849 numa_add_cpu(smp_processor_id());
850#endif 850#endif
851
852 /* Cap the iomem address space to what is addressable on all CPUs */
853 iomem_resource.end &= (1ULL << c->x86_phys_bits) - 1;
854} 851}
855 852
856#ifdef CONFIG_X86_64 853#ifdef CONFIG_X86_64
diff --git a/arch/x86/kernel/cpu/cpufreq/powernow-k8.c b/arch/x86/kernel/cpu/cpufreq/powernow-k8.c
index 81cbe64ed6b4..2a50ef891000 100644
--- a/arch/x86/kernel/cpu/cpufreq/powernow-k8.c
+++ b/arch/x86/kernel/cpu/cpufreq/powernow-k8.c
@@ -299,7 +299,7 @@ static int transition_pstate(struct powernow_k8_data *data, u32 pstate)
299static int transition_fid_vid(struct powernow_k8_data *data, 299static int transition_fid_vid(struct powernow_k8_data *data,
300 u32 reqfid, u32 reqvid) 300 u32 reqfid, u32 reqvid)
301{ 301{
302 if (core_voltage_pre_transition(data, reqvid)) 302 if (core_voltage_pre_transition(data, reqvid, reqfid))
303 return 1; 303 return 1;
304 304
305 if (core_frequency_transition(data, reqfid)) 305 if (core_frequency_transition(data, reqfid))
@@ -327,17 +327,20 @@ static int transition_fid_vid(struct powernow_k8_data *data,
327 327
328/* Phase 1 - core voltage transition ... setup voltage */ 328/* Phase 1 - core voltage transition ... setup voltage */
329static int core_voltage_pre_transition(struct powernow_k8_data *data, 329static int core_voltage_pre_transition(struct powernow_k8_data *data,
330 u32 reqvid) 330 u32 reqvid, u32 reqfid)
331{ 331{
332 u32 rvosteps = data->rvo; 332 u32 rvosteps = data->rvo;
333 u32 savefid = data->currfid; 333 u32 savefid = data->currfid;
334 u32 maxvid, lo; 334 u32 maxvid, lo, rvomult = 1;
335 335
336 dprintk("ph1 (cpu%d): start, currfid 0x%x, currvid 0x%x, " 336 dprintk("ph1 (cpu%d): start, currfid 0x%x, currvid 0x%x, "
337 "reqvid 0x%x, rvo 0x%x\n", 337 "reqvid 0x%x, rvo 0x%x\n",
338 smp_processor_id(), 338 smp_processor_id(),
339 data->currfid, data->currvid, reqvid, data->rvo); 339 data->currfid, data->currvid, reqvid, data->rvo);
340 340
341 if ((savefid < LO_FID_TABLE_TOP) && (reqfid < LO_FID_TABLE_TOP))
342 rvomult = 2;
343 rvosteps *= rvomult;
341 rdmsr(MSR_FIDVID_STATUS, lo, maxvid); 344 rdmsr(MSR_FIDVID_STATUS, lo, maxvid);
342 maxvid = 0x1f & (maxvid >> 16); 345 maxvid = 0x1f & (maxvid >> 16);
343 dprintk("ph1 maxvid=0x%x\n", maxvid); 346 dprintk("ph1 maxvid=0x%x\n", maxvid);
@@ -351,7 +354,8 @@ static int core_voltage_pre_transition(struct powernow_k8_data *data,
351 return 1; 354 return 1;
352 } 355 }
353 356
354 while ((rvosteps > 0) && ((data->rvo + data->currvid) > reqvid)) { 357 while ((rvosteps > 0) &&
358 ((rvomult * data->rvo + data->currvid) > reqvid)) {
355 if (data->currvid == maxvid) { 359 if (data->currvid == maxvid) {
356 rvosteps = 0; 360 rvosteps = 0;
357 } else { 361 } else {
@@ -384,13 +388,6 @@ static int core_frequency_transition(struct powernow_k8_data *data, u32 reqfid)
384 u32 vcoreqfid, vcocurrfid, vcofiddiff; 388 u32 vcoreqfid, vcocurrfid, vcofiddiff;
385 u32 fid_interval, savevid = data->currvid; 389 u32 fid_interval, savevid = data->currvid;
386 390
387 if ((reqfid < HI_FID_TABLE_BOTTOM) &&
388 (data->currfid < HI_FID_TABLE_BOTTOM)) {
389 printk(KERN_ERR PFX "ph2: illegal lo-lo transition "
390 "0x%x 0x%x\n", reqfid, data->currfid);
391 return 1;
392 }
393
394 if (data->currfid == reqfid) { 391 if (data->currfid == reqfid) {
395 printk(KERN_ERR PFX "ph2 null fid transition 0x%x\n", 392 printk(KERN_ERR PFX "ph2 null fid transition 0x%x\n",
396 data->currfid); 393 data->currfid);
@@ -407,6 +404,9 @@ static int core_frequency_transition(struct powernow_k8_data *data, u32 reqfid)
407 vcofiddiff = vcocurrfid > vcoreqfid ? vcocurrfid - vcoreqfid 404 vcofiddiff = vcocurrfid > vcoreqfid ? vcocurrfid - vcoreqfid
408 : vcoreqfid - vcocurrfid; 405 : vcoreqfid - vcocurrfid;
409 406
407 if ((reqfid <= LO_FID_TABLE_TOP) && (data->currfid <= LO_FID_TABLE_TOP))
408 vcofiddiff = 0;
409
410 while (vcofiddiff > 2) { 410 while (vcofiddiff > 2) {
411 (data->currfid & 1) ? (fid_interval = 1) : (fid_interval = 2); 411 (data->currfid & 1) ? (fid_interval = 1) : (fid_interval = 2);
412 412
@@ -1081,14 +1081,6 @@ static int transition_frequency_fidvid(struct powernow_k8_data *data,
1081 return 0; 1081 return 0;
1082 } 1082 }
1083 1083
1084 if ((fid < HI_FID_TABLE_BOTTOM) &&
1085 (data->currfid < HI_FID_TABLE_BOTTOM)) {
1086 printk(KERN_ERR PFX
1087 "ignoring illegal change in lo freq table-%x to 0x%x\n",
1088 data->currfid, fid);
1089 return 1;
1090 }
1091
1092 dprintk("cpu %d, changing to fid 0x%x, vid 0x%x\n", 1084 dprintk("cpu %d, changing to fid 0x%x, vid 0x%x\n",
1093 smp_processor_id(), fid, vid); 1085 smp_processor_id(), fid, vid);
1094 freqs.old = find_khz_freq_from_fid(data->currfid); 1086 freqs.old = find_khz_freq_from_fid(data->currfid);
@@ -1267,7 +1259,7 @@ static int __cpuinit powernowk8_cpu_init(struct cpufreq_policy *pol)
1267{ 1259{
1268 static const char ACPI_PSS_BIOS_BUG_MSG[] = 1260 static const char ACPI_PSS_BIOS_BUG_MSG[] =
1269 KERN_ERR FW_BUG PFX "No compatible ACPI _PSS objects found.\n" 1261 KERN_ERR FW_BUG PFX "No compatible ACPI _PSS objects found.\n"
1270 KERN_ERR FW_BUG PFX "Try again with latest BIOS.\n"; 1262 FW_BUG PFX "Try again with latest BIOS.\n";
1271 struct powernow_k8_data *data; 1263 struct powernow_k8_data *data;
1272 struct init_on_cpu init_on_cpu; 1264 struct init_on_cpu init_on_cpu;
1273 int rc; 1265 int rc;
diff --git a/arch/x86/kernel/cpu/cpufreq/powernow-k8.h b/arch/x86/kernel/cpu/cpufreq/powernow-k8.h
index c9c1190b5e1f..02ce824073cb 100644
--- a/arch/x86/kernel/cpu/cpufreq/powernow-k8.h
+++ b/arch/x86/kernel/cpu/cpufreq/powernow-k8.h
@@ -215,7 +215,8 @@ struct pst_s {
215 215
216#define dprintk(msg...) cpufreq_debug_printk(CPUFREQ_DEBUG_DRIVER, "powernow-k8", msg) 216#define dprintk(msg...) cpufreq_debug_printk(CPUFREQ_DEBUG_DRIVER, "powernow-k8", msg)
217 217
218static int core_voltage_pre_transition(struct powernow_k8_data *data, u32 reqvid); 218static int core_voltage_pre_transition(struct powernow_k8_data *data,
219 u32 reqvid, u32 regfid);
219static int core_voltage_post_transition(struct powernow_k8_data *data, u32 reqvid); 220static int core_voltage_post_transition(struct powernow_k8_data *data, u32 reqvid);
220static int core_frequency_transition(struct powernow_k8_data *data, u32 reqfid); 221static int core_frequency_transition(struct powernow_k8_data *data, u32 reqfid);
221 222
diff --git a/arch/x86/kernel/cpu/mcheck/mce.c b/arch/x86/kernel/cpu/mcheck/mce.c
index 284d1de968bc..484c1e5f658e 100644
--- a/arch/x86/kernel/cpu/mcheck/mce.c
+++ b/arch/x86/kernel/cpu/mcheck/mce.c
@@ -194,14 +194,14 @@ static void print_mce(struct mce *m)
194 m->cs, m->ip); 194 m->cs, m->ip);
195 if (m->cs == __KERNEL_CS) 195 if (m->cs == __KERNEL_CS)
196 print_symbol("{%s}", m->ip); 196 print_symbol("{%s}", m->ip);
197 printk("\n"); 197 printk(KERN_CONT "\n");
198 } 198 }
199 printk(KERN_EMERG "TSC %llx ", m->tsc); 199 printk(KERN_EMERG "TSC %llx ", m->tsc);
200 if (m->addr) 200 if (m->addr)
201 printk("ADDR %llx ", m->addr); 201 printk(KERN_CONT "ADDR %llx ", m->addr);
202 if (m->misc) 202 if (m->misc)
203 printk("MISC %llx ", m->misc); 203 printk(KERN_CONT "MISC %llx ", m->misc);
204 printk("\n"); 204 printk(KERN_CONT "\n");
205 printk(KERN_EMERG "PROCESSOR %u:%x TIME %llu SOCKET %u APIC %x\n", 205 printk(KERN_EMERG "PROCESSOR %u:%x TIME %llu SOCKET %u APIC %x\n",
206 m->cpuvendor, m->cpuid, m->time, m->socketid, 206 m->cpuvendor, m->cpuid, m->time, m->socketid,
207 m->apicid); 207 m->apicid);
@@ -209,13 +209,13 @@ static void print_mce(struct mce *m)
209 209
210static void print_mce_head(void) 210static void print_mce_head(void)
211{ 211{
212 printk(KERN_EMERG "\n" KERN_EMERG "HARDWARE ERROR\n"); 212 printk(KERN_EMERG "\nHARDWARE ERROR\n");
213} 213}
214 214
215static void print_mce_tail(void) 215static void print_mce_tail(void)
216{ 216{
217 printk(KERN_EMERG "This is not a software problem!\n" 217 printk(KERN_EMERG "This is not a software problem!\n"
218 KERN_EMERG "Run through mcelog --ascii to decode and contact your hardware vendor\n"); 218 "Run through mcelog --ascii to decode and contact your hardware vendor\n");
219} 219}
220 220
221#define PANIC_TIMEOUT 5 /* 5 seconds */ 221#define PANIC_TIMEOUT 5 /* 5 seconds */
@@ -1117,7 +1117,7 @@ static void mcheck_timer(unsigned long data)
1117 *n = min(*n*2, (int)round_jiffies_relative(check_interval*HZ)); 1117 *n = min(*n*2, (int)round_jiffies_relative(check_interval*HZ));
1118 1118
1119 t->expires = jiffies + *n; 1119 t->expires = jiffies + *n;
1120 add_timer(t); 1120 add_timer_on(t, smp_processor_id());
1121} 1121}
1122 1122
1123static void mce_do_trigger(struct work_struct *work) 1123static void mce_do_trigger(struct work_struct *work)
@@ -1321,7 +1321,7 @@ static void mce_init_timer(void)
1321 return; 1321 return;
1322 setup_timer(t, mcheck_timer, smp_processor_id()); 1322 setup_timer(t, mcheck_timer, smp_processor_id());
1323 t->expires = round_jiffies(jiffies + *n); 1323 t->expires = round_jiffies(jiffies + *n);
1324 add_timer(t); 1324 add_timer_on(t, smp_processor_id());
1325} 1325}
1326 1326
1327/* 1327/*
diff --git a/arch/x86/kernel/cpu/perf_counter.c b/arch/x86/kernel/cpu/perf_counter.c
index 76dfef23f789..a7aa8f900954 100644
--- a/arch/x86/kernel/cpu/perf_counter.c
+++ b/arch/x86/kernel/cpu/perf_counter.c
@@ -66,6 +66,52 @@ static DEFINE_PER_CPU(struct cpu_hw_counters, cpu_hw_counters) = {
66}; 66};
67 67
68/* 68/*
69 * Not sure about some of these
70 */
71static const u64 p6_perfmon_event_map[] =
72{
73 [PERF_COUNT_HW_CPU_CYCLES] = 0x0079,
74 [PERF_COUNT_HW_INSTRUCTIONS] = 0x00c0,
75 [PERF_COUNT_HW_CACHE_REFERENCES] = 0x0000,
76 [PERF_COUNT_HW_CACHE_MISSES] = 0x0000,
77 [PERF_COUNT_HW_BRANCH_INSTRUCTIONS] = 0x00c4,
78 [PERF_COUNT_HW_BRANCH_MISSES] = 0x00c5,
79 [PERF_COUNT_HW_BUS_CYCLES] = 0x0062,
80};
81
82static u64 p6_pmu_event_map(int event)
83{
84 return p6_perfmon_event_map[event];
85}
86
87/*
88 * Counter setting that is specified not to count anything.
89 * We use this to effectively disable a counter.
90 *
91 * L2_RQSTS with 0 MESI unit mask.
92 */
93#define P6_NOP_COUNTER 0x0000002EULL
94
95static u64 p6_pmu_raw_event(u64 event)
96{
97#define P6_EVNTSEL_EVENT_MASK 0x000000FFULL
98#define P6_EVNTSEL_UNIT_MASK 0x0000FF00ULL
99#define P6_EVNTSEL_EDGE_MASK 0x00040000ULL
100#define P6_EVNTSEL_INV_MASK 0x00800000ULL
101#define P6_EVNTSEL_COUNTER_MASK 0xFF000000ULL
102
103#define P6_EVNTSEL_MASK \
104 (P6_EVNTSEL_EVENT_MASK | \
105 P6_EVNTSEL_UNIT_MASK | \
106 P6_EVNTSEL_EDGE_MASK | \
107 P6_EVNTSEL_INV_MASK | \
108 P6_EVNTSEL_COUNTER_MASK)
109
110 return event & P6_EVNTSEL_MASK;
111}
112
113
114/*
69 * Intel PerfMon v3. Used on Core2 and later. 115 * Intel PerfMon v3. Used on Core2 and later.
70 */ 116 */
71static const u64 intel_perfmon_event_map[] = 117static const u64 intel_perfmon_event_map[] =
@@ -401,7 +447,7 @@ static const u64 amd_hw_cache_event_ids
401 [ C(RESULT_MISS) ] = 0x0041, /* Data Cache Misses */ 447 [ C(RESULT_MISS) ] = 0x0041, /* Data Cache Misses */
402 }, 448 },
403 [ C(OP_WRITE) ] = { 449 [ C(OP_WRITE) ] = {
404 [ C(RESULT_ACCESS) ] = 0x0042, /* Data Cache Refills from L2 */ 450 [ C(RESULT_ACCESS) ] = 0x0142, /* Data Cache Refills :system */
405 [ C(RESULT_MISS) ] = 0, 451 [ C(RESULT_MISS) ] = 0,
406 }, 452 },
407 [ C(OP_PREFETCH) ] = { 453 [ C(OP_PREFETCH) ] = {
@@ -666,6 +712,7 @@ static int __hw_perf_counter_init(struct perf_counter *counter)
666{ 712{
667 struct perf_counter_attr *attr = &counter->attr; 713 struct perf_counter_attr *attr = &counter->attr;
668 struct hw_perf_counter *hwc = &counter->hw; 714 struct hw_perf_counter *hwc = &counter->hw;
715 u64 config;
669 int err; 716 int err;
670 717
671 if (!x86_pmu_initialized()) 718 if (!x86_pmu_initialized())
@@ -718,14 +765,40 @@ static int __hw_perf_counter_init(struct perf_counter *counter)
718 765
719 if (attr->config >= x86_pmu.max_events) 766 if (attr->config >= x86_pmu.max_events)
720 return -EINVAL; 767 return -EINVAL;
768
721 /* 769 /*
722 * The generic map: 770 * The generic map:
723 */ 771 */
724 hwc->config |= x86_pmu.event_map(attr->config); 772 config = x86_pmu.event_map(attr->config);
773
774 if (config == 0)
775 return -ENOENT;
776
777 if (config == -1LL)
778 return -EINVAL;
779
780 hwc->config |= config;
725 781
726 return 0; 782 return 0;
727} 783}
728 784
785static void p6_pmu_disable_all(void)
786{
787 struct cpu_hw_counters *cpuc = &__get_cpu_var(cpu_hw_counters);
788 u64 val;
789
790 if (!cpuc->enabled)
791 return;
792
793 cpuc->enabled = 0;
794 barrier();
795
796 /* p6 only has one enable register */
797 rdmsrl(MSR_P6_EVNTSEL0, val);
798 val &= ~ARCH_PERFMON_EVENTSEL0_ENABLE;
799 wrmsrl(MSR_P6_EVNTSEL0, val);
800}
801
729static void intel_pmu_disable_all(void) 802static void intel_pmu_disable_all(void)
730{ 803{
731 wrmsrl(MSR_CORE_PERF_GLOBAL_CTRL, 0); 804 wrmsrl(MSR_CORE_PERF_GLOBAL_CTRL, 0);
@@ -767,6 +840,23 @@ void hw_perf_disable(void)
767 return x86_pmu.disable_all(); 840 return x86_pmu.disable_all();
768} 841}
769 842
843static void p6_pmu_enable_all(void)
844{
845 struct cpu_hw_counters *cpuc = &__get_cpu_var(cpu_hw_counters);
846 unsigned long val;
847
848 if (cpuc->enabled)
849 return;
850
851 cpuc->enabled = 1;
852 barrier();
853
854 /* p6 only has one enable register */
855 rdmsrl(MSR_P6_EVNTSEL0, val);
856 val |= ARCH_PERFMON_EVENTSEL0_ENABLE;
857 wrmsrl(MSR_P6_EVNTSEL0, val);
858}
859
770static void intel_pmu_enable_all(void) 860static void intel_pmu_enable_all(void)
771{ 861{
772 wrmsrl(MSR_CORE_PERF_GLOBAL_CTRL, x86_pmu.intel_ctrl); 862 wrmsrl(MSR_CORE_PERF_GLOBAL_CTRL, x86_pmu.intel_ctrl);
@@ -784,13 +874,13 @@ static void amd_pmu_enable_all(void)
784 barrier(); 874 barrier();
785 875
786 for (idx = 0; idx < x86_pmu.num_counters; idx++) { 876 for (idx = 0; idx < x86_pmu.num_counters; idx++) {
877 struct perf_counter *counter = cpuc->counters[idx];
787 u64 val; 878 u64 val;
788 879
789 if (!test_bit(idx, cpuc->active_mask)) 880 if (!test_bit(idx, cpuc->active_mask))
790 continue; 881 continue;
791 rdmsrl(MSR_K7_EVNTSEL0 + idx, val); 882
792 if (val & ARCH_PERFMON_EVENTSEL0_ENABLE) 883 val = counter->hw.config;
793 continue;
794 val |= ARCH_PERFMON_EVENTSEL0_ENABLE; 884 val |= ARCH_PERFMON_EVENTSEL0_ENABLE;
795 wrmsrl(MSR_K7_EVNTSEL0 + idx, val); 885 wrmsrl(MSR_K7_EVNTSEL0 + idx, val);
796 } 886 }
@@ -819,16 +909,13 @@ static inline void intel_pmu_ack_status(u64 ack)
819 909
820static inline void x86_pmu_enable_counter(struct hw_perf_counter *hwc, int idx) 910static inline void x86_pmu_enable_counter(struct hw_perf_counter *hwc, int idx)
821{ 911{
822 int err; 912 (void)checking_wrmsrl(hwc->config_base + idx,
823 err = checking_wrmsrl(hwc->config_base + idx,
824 hwc->config | ARCH_PERFMON_EVENTSEL0_ENABLE); 913 hwc->config | ARCH_PERFMON_EVENTSEL0_ENABLE);
825} 914}
826 915
827static inline void x86_pmu_disable_counter(struct hw_perf_counter *hwc, int idx) 916static inline void x86_pmu_disable_counter(struct hw_perf_counter *hwc, int idx)
828{ 917{
829 int err; 918 (void)checking_wrmsrl(hwc->config_base + idx, hwc->config);
830 err = checking_wrmsrl(hwc->config_base + idx,
831 hwc->config);
832} 919}
833 920
834static inline void 921static inline void
@@ -836,13 +923,24 @@ intel_pmu_disable_fixed(struct hw_perf_counter *hwc, int __idx)
836{ 923{
837 int idx = __idx - X86_PMC_IDX_FIXED; 924 int idx = __idx - X86_PMC_IDX_FIXED;
838 u64 ctrl_val, mask; 925 u64 ctrl_val, mask;
839 int err;
840 926
841 mask = 0xfULL << (idx * 4); 927 mask = 0xfULL << (idx * 4);
842 928
843 rdmsrl(hwc->config_base, ctrl_val); 929 rdmsrl(hwc->config_base, ctrl_val);
844 ctrl_val &= ~mask; 930 ctrl_val &= ~mask;
845 err = checking_wrmsrl(hwc->config_base, ctrl_val); 931 (void)checking_wrmsrl(hwc->config_base, ctrl_val);
932}
933
934static inline void
935p6_pmu_disable_counter(struct hw_perf_counter *hwc, int idx)
936{
937 struct cpu_hw_counters *cpuc = &__get_cpu_var(cpu_hw_counters);
938 u64 val = P6_NOP_COUNTER;
939
940 if (cpuc->enabled)
941 val |= ARCH_PERFMON_EVENTSEL0_ENABLE;
942
943 (void)checking_wrmsrl(hwc->config_base + idx, val);
846} 944}
847 945
848static inline void 946static inline void
@@ -912,6 +1010,8 @@ x86_perf_counter_set_period(struct perf_counter *counter,
912 err = checking_wrmsrl(hwc->counter_base + idx, 1010 err = checking_wrmsrl(hwc->counter_base + idx,
913 (u64)(-left) & x86_pmu.counter_mask); 1011 (u64)(-left) & x86_pmu.counter_mask);
914 1012
1013 perf_counter_update_userpage(counter);
1014
915 return ret; 1015 return ret;
916} 1016}
917 1017
@@ -941,6 +1041,19 @@ intel_pmu_enable_fixed(struct hw_perf_counter *hwc, int __idx)
941 err = checking_wrmsrl(hwc->config_base, ctrl_val); 1041 err = checking_wrmsrl(hwc->config_base, ctrl_val);
942} 1042}
943 1043
1044static void p6_pmu_enable_counter(struct hw_perf_counter *hwc, int idx)
1045{
1046 struct cpu_hw_counters *cpuc = &__get_cpu_var(cpu_hw_counters);
1047 u64 val;
1048
1049 val = hwc->config;
1050 if (cpuc->enabled)
1051 val |= ARCH_PERFMON_EVENTSEL0_ENABLE;
1052
1053 (void)checking_wrmsrl(hwc->config_base + idx, val);
1054}
1055
1056
944static void intel_pmu_enable_counter(struct hw_perf_counter *hwc, int idx) 1057static void intel_pmu_enable_counter(struct hw_perf_counter *hwc, int idx)
945{ 1058{
946 if (unlikely(hwc->config_base == MSR_ARCH_PERFMON_FIXED_CTR_CTRL)) { 1059 if (unlikely(hwc->config_base == MSR_ARCH_PERFMON_FIXED_CTR_CTRL)) {
@@ -957,8 +1070,6 @@ static void amd_pmu_enable_counter(struct hw_perf_counter *hwc, int idx)
957 1070
958 if (cpuc->enabled) 1071 if (cpuc->enabled)
959 x86_pmu_enable_counter(hwc, idx); 1072 x86_pmu_enable_counter(hwc, idx);
960 else
961 x86_pmu_disable_counter(hwc, idx);
962} 1073}
963 1074
964static int 1075static int
@@ -969,13 +1080,6 @@ fixed_mode_idx(struct perf_counter *counter, struct hw_perf_counter *hwc)
969 if (!x86_pmu.num_counters_fixed) 1080 if (!x86_pmu.num_counters_fixed)
970 return -1; 1081 return -1;
971 1082
972 /*
973 * Quirk, IA32_FIXED_CTRs do not work on current Atom processors:
974 */
975 if (boot_cpu_data.x86_vendor == X86_VENDOR_INTEL &&
976 boot_cpu_data.x86_model == 28)
977 return -1;
978
979 event = hwc->config & ARCH_PERFMON_EVENT_MASK; 1083 event = hwc->config & ARCH_PERFMON_EVENT_MASK;
980 1084
981 if (unlikely(event == x86_pmu.event_map(PERF_COUNT_HW_INSTRUCTIONS))) 1085 if (unlikely(event == x86_pmu.event_map(PERF_COUNT_HW_INSTRUCTIONS)))
@@ -1041,6 +1145,8 @@ try_generic:
1041 x86_perf_counter_set_period(counter, hwc, idx); 1145 x86_perf_counter_set_period(counter, hwc, idx);
1042 x86_pmu.enable(hwc, idx); 1146 x86_pmu.enable(hwc, idx);
1043 1147
1148 perf_counter_update_userpage(counter);
1149
1044 return 0; 1150 return 0;
1045} 1151}
1046 1152
@@ -1133,6 +1239,8 @@ static void x86_pmu_disable(struct perf_counter *counter)
1133 x86_perf_counter_update(counter, hwc, idx); 1239 x86_perf_counter_update(counter, hwc, idx);
1134 cpuc->counters[idx] = NULL; 1240 cpuc->counters[idx] = NULL;
1135 clear_bit(idx, cpuc->used_mask); 1241 clear_bit(idx, cpuc->used_mask);
1242
1243 perf_counter_update_userpage(counter);
1136} 1244}
1137 1245
1138/* 1246/*
@@ -1177,6 +1285,49 @@ static void intel_pmu_reset(void)
1177 local_irq_restore(flags); 1285 local_irq_restore(flags);
1178} 1286}
1179 1287
1288static int p6_pmu_handle_irq(struct pt_regs *regs)
1289{
1290 struct perf_sample_data data;
1291 struct cpu_hw_counters *cpuc;
1292 struct perf_counter *counter;
1293 struct hw_perf_counter *hwc;
1294 int idx, handled = 0;
1295 u64 val;
1296
1297 data.regs = regs;
1298 data.addr = 0;
1299
1300 cpuc = &__get_cpu_var(cpu_hw_counters);
1301
1302 for (idx = 0; idx < x86_pmu.num_counters; idx++) {
1303 if (!test_bit(idx, cpuc->active_mask))
1304 continue;
1305
1306 counter = cpuc->counters[idx];
1307 hwc = &counter->hw;
1308
1309 val = x86_perf_counter_update(counter, hwc, idx);
1310 if (val & (1ULL << (x86_pmu.counter_bits - 1)))
1311 continue;
1312
1313 /*
1314 * counter overflow
1315 */
1316 handled = 1;
1317 data.period = counter->hw.last_period;
1318
1319 if (!x86_perf_counter_set_period(counter, hwc, idx))
1320 continue;
1321
1322 if (perf_counter_overflow(counter, 1, &data))
1323 p6_pmu_disable_counter(hwc, idx);
1324 }
1325
1326 if (handled)
1327 inc_irq_stat(apic_perf_irqs);
1328
1329 return handled;
1330}
1180 1331
1181/* 1332/*
1182 * This handler is triggered by the local APIC, so the APIC IRQ handling 1333 * This handler is triggered by the local APIC, so the APIC IRQ handling
@@ -1186,14 +1337,13 @@ static int intel_pmu_handle_irq(struct pt_regs *regs)
1186{ 1337{
1187 struct perf_sample_data data; 1338 struct perf_sample_data data;
1188 struct cpu_hw_counters *cpuc; 1339 struct cpu_hw_counters *cpuc;
1189 int bit, cpu, loops; 1340 int bit, loops;
1190 u64 ack, status; 1341 u64 ack, status;
1191 1342
1192 data.regs = regs; 1343 data.regs = regs;
1193 data.addr = 0; 1344 data.addr = 0;
1194 1345
1195 cpu = smp_processor_id(); 1346 cpuc = &__get_cpu_var(cpu_hw_counters);
1196 cpuc = &per_cpu(cpu_hw_counters, cpu);
1197 1347
1198 perf_disable(); 1348 perf_disable();
1199 status = intel_pmu_get_status(); 1349 status = intel_pmu_get_status();
@@ -1250,14 +1400,13 @@ static int amd_pmu_handle_irq(struct pt_regs *regs)
1250 struct cpu_hw_counters *cpuc; 1400 struct cpu_hw_counters *cpuc;
1251 struct perf_counter *counter; 1401 struct perf_counter *counter;
1252 struct hw_perf_counter *hwc; 1402 struct hw_perf_counter *hwc;
1253 int cpu, idx, handled = 0; 1403 int idx, handled = 0;
1254 u64 val; 1404 u64 val;
1255 1405
1256 data.regs = regs; 1406 data.regs = regs;
1257 data.addr = 0; 1407 data.addr = 0;
1258 1408
1259 cpu = smp_processor_id(); 1409 cpuc = &__get_cpu_var(cpu_hw_counters);
1260 cpuc = &per_cpu(cpu_hw_counters, cpu);
1261 1410
1262 for (idx = 0; idx < x86_pmu.num_counters; idx++) { 1411 for (idx = 0; idx < x86_pmu.num_counters; idx++) {
1263 if (!test_bit(idx, cpuc->active_mask)) 1412 if (!test_bit(idx, cpuc->active_mask))
@@ -1354,6 +1503,32 @@ static __read_mostly struct notifier_block perf_counter_nmi_notifier = {
1354 .priority = 1 1503 .priority = 1
1355}; 1504};
1356 1505
1506static struct x86_pmu p6_pmu = {
1507 .name = "p6",
1508 .handle_irq = p6_pmu_handle_irq,
1509 .disable_all = p6_pmu_disable_all,
1510 .enable_all = p6_pmu_enable_all,
1511 .enable = p6_pmu_enable_counter,
1512 .disable = p6_pmu_disable_counter,
1513 .eventsel = MSR_P6_EVNTSEL0,
1514 .perfctr = MSR_P6_PERFCTR0,
1515 .event_map = p6_pmu_event_map,
1516 .raw_event = p6_pmu_raw_event,
1517 .max_events = ARRAY_SIZE(p6_perfmon_event_map),
1518 .max_period = (1ULL << 31) - 1,
1519 .version = 0,
1520 .num_counters = 2,
1521 /*
1522 * Counters have 40 bits implemented. However they are designed such
1523 * that bits [32-39] are sign extensions of bit 31. As such the
1524 * effective width of a counter for P6-like PMU is 32 bits only.
1525 *
1526 * See IA-32 Intel Architecture Software developer manual Vol 3B
1527 */
1528 .counter_bits = 32,
1529 .counter_mask = (1ULL << 32) - 1,
1530};
1531
1357static struct x86_pmu intel_pmu = { 1532static struct x86_pmu intel_pmu = {
1358 .name = "Intel", 1533 .name = "Intel",
1359 .handle_irq = intel_pmu_handle_irq, 1534 .handle_irq = intel_pmu_handle_irq,
@@ -1393,6 +1568,37 @@ static struct x86_pmu amd_pmu = {
1393 .max_period = (1ULL << 47) - 1, 1568 .max_period = (1ULL << 47) - 1,
1394}; 1569};
1395 1570
1571static int p6_pmu_init(void)
1572{
1573 switch (boot_cpu_data.x86_model) {
1574 case 1:
1575 case 3: /* Pentium Pro */
1576 case 5:
1577 case 6: /* Pentium II */
1578 case 7:
1579 case 8:
1580 case 11: /* Pentium III */
1581 break;
1582 case 9:
1583 case 13:
1584 /* Pentium M */
1585 break;
1586 default:
1587 pr_cont("unsupported p6 CPU model %d ",
1588 boot_cpu_data.x86_model);
1589 return -ENODEV;
1590 }
1591
1592 if (!cpu_has_apic) {
1593 pr_info("no Local APIC, try rebooting with lapic");
1594 return -ENODEV;
1595 }
1596
1597 x86_pmu = p6_pmu;
1598
1599 return 0;
1600}
1601
1396static int intel_pmu_init(void) 1602static int intel_pmu_init(void)
1397{ 1603{
1398 union cpuid10_edx edx; 1604 union cpuid10_edx edx;
@@ -1401,8 +1607,14 @@ static int intel_pmu_init(void)
1401 unsigned int ebx; 1607 unsigned int ebx;
1402 int version; 1608 int version;
1403 1609
1404 if (!cpu_has(&boot_cpu_data, X86_FEATURE_ARCH_PERFMON)) 1610 if (!cpu_has(&boot_cpu_data, X86_FEATURE_ARCH_PERFMON)) {
1611 /* check for P6 processor family */
1612 if (boot_cpu_data.x86 == 6) {
1613 return p6_pmu_init();
1614 } else {
1405 return -ENODEV; 1615 return -ENODEV;
1616 }
1617 }
1406 1618
1407 /* 1619 /*
1408 * Check whether the Architectural PerfMon supports 1620 * Check whether the Architectural PerfMon supports
@@ -1428,8 +1640,6 @@ static int intel_pmu_init(void)
1428 */ 1640 */
1429 x86_pmu.num_counters_fixed = max((int)edx.split.num_counters_fixed, 3); 1641 x86_pmu.num_counters_fixed = max((int)edx.split.num_counters_fixed, 3);
1430 1642
1431 rdmsrl(MSR_CORE_PERF_GLOBAL_CTRL, x86_pmu.intel_ctrl);
1432
1433 /* 1643 /*
1434 * Install the hw-cache-events table: 1644 * Install the hw-cache-events table:
1435 */ 1645 */
@@ -1499,21 +1709,22 @@ void __init init_hw_perf_counters(void)
1499 pr_cont("%s PMU driver.\n", x86_pmu.name); 1709 pr_cont("%s PMU driver.\n", x86_pmu.name);
1500 1710
1501 if (x86_pmu.num_counters > X86_PMC_MAX_GENERIC) { 1711 if (x86_pmu.num_counters > X86_PMC_MAX_GENERIC) {
1502 x86_pmu.num_counters = X86_PMC_MAX_GENERIC;
1503 WARN(1, KERN_ERR "hw perf counters %d > max(%d), clipping!", 1712 WARN(1, KERN_ERR "hw perf counters %d > max(%d), clipping!",
1504 x86_pmu.num_counters, X86_PMC_MAX_GENERIC); 1713 x86_pmu.num_counters, X86_PMC_MAX_GENERIC);
1714 x86_pmu.num_counters = X86_PMC_MAX_GENERIC;
1505 } 1715 }
1506 perf_counter_mask = (1 << x86_pmu.num_counters) - 1; 1716 perf_counter_mask = (1 << x86_pmu.num_counters) - 1;
1507 perf_max_counters = x86_pmu.num_counters; 1717 perf_max_counters = x86_pmu.num_counters;
1508 1718
1509 if (x86_pmu.num_counters_fixed > X86_PMC_MAX_FIXED) { 1719 if (x86_pmu.num_counters_fixed > X86_PMC_MAX_FIXED) {
1510 x86_pmu.num_counters_fixed = X86_PMC_MAX_FIXED;
1511 WARN(1, KERN_ERR "hw perf counters fixed %d > max(%d), clipping!", 1720 WARN(1, KERN_ERR "hw perf counters fixed %d > max(%d), clipping!",
1512 x86_pmu.num_counters_fixed, X86_PMC_MAX_FIXED); 1721 x86_pmu.num_counters_fixed, X86_PMC_MAX_FIXED);
1722 x86_pmu.num_counters_fixed = X86_PMC_MAX_FIXED;
1513 } 1723 }
1514 1724
1515 perf_counter_mask |= 1725 perf_counter_mask |=
1516 ((1LL << x86_pmu.num_counters_fixed)-1) << X86_PMC_IDX_FIXED; 1726 ((1LL << x86_pmu.num_counters_fixed)-1) << X86_PMC_IDX_FIXED;
1727 x86_pmu.intel_ctrl = perf_counter_mask;
1517 1728
1518 perf_counters_lapic_init(); 1729 perf_counters_lapic_init();
1519 register_die_notifier(&perf_counter_nmi_notifier); 1730 register_die_notifier(&perf_counter_nmi_notifier);
@@ -1563,6 +1774,7 @@ void callchain_store(struct perf_callchain_entry *entry, u64 ip)
1563 1774
1564static DEFINE_PER_CPU(struct perf_callchain_entry, irq_entry); 1775static DEFINE_PER_CPU(struct perf_callchain_entry, irq_entry);
1565static DEFINE_PER_CPU(struct perf_callchain_entry, nmi_entry); 1776static DEFINE_PER_CPU(struct perf_callchain_entry, nmi_entry);
1777static DEFINE_PER_CPU(int, in_nmi_frame);
1566 1778
1567 1779
1568static void 1780static void
@@ -1578,7 +1790,9 @@ static void backtrace_warning(void *data, char *msg)
1578 1790
1579static int backtrace_stack(void *data, char *name) 1791static int backtrace_stack(void *data, char *name)
1580{ 1792{
1581 /* Process all stacks: */ 1793 per_cpu(in_nmi_frame, smp_processor_id()) =
1794 x86_is_stack_id(NMI_STACK, name);
1795
1582 return 0; 1796 return 0;
1583} 1797}
1584 1798
@@ -1586,6 +1800,9 @@ static void backtrace_address(void *data, unsigned long addr, int reliable)
1586{ 1800{
1587 struct perf_callchain_entry *entry = data; 1801 struct perf_callchain_entry *entry = data;
1588 1802
1803 if (per_cpu(in_nmi_frame, smp_processor_id()))
1804 return;
1805
1589 if (reliable) 1806 if (reliable)
1590 callchain_store(entry, addr); 1807 callchain_store(entry, addr);
1591} 1808}
diff --git a/arch/x86/kernel/cpu/perfctr-watchdog.c b/arch/x86/kernel/cpu/perfctr-watchdog.c
index 5c481f6205bf..e60ed740d2b3 100644
--- a/arch/x86/kernel/cpu/perfctr-watchdog.c
+++ b/arch/x86/kernel/cpu/perfctr-watchdog.c
@@ -803,8 +803,3 @@ int __kprobes lapic_wd_event(unsigned nmi_hz)
803 wd_ops->rearm(wd, nmi_hz); 803 wd_ops->rearm(wd, nmi_hz);
804 return 1; 804 return 1;
805} 805}
806
807int lapic_watchdog_ok(void)
808{
809 return wd_ops != NULL;
810}
diff --git a/arch/x86/kernel/dumpstack.c b/arch/x86/kernel/dumpstack.c
index 95ea5fa7d444..c8405718a4c3 100644
--- a/arch/x86/kernel/dumpstack.c
+++ b/arch/x86/kernel/dumpstack.c
@@ -22,6 +22,7 @@
22#include "dumpstack.h" 22#include "dumpstack.h"
23 23
24int panic_on_unrecovered_nmi; 24int panic_on_unrecovered_nmi;
25int panic_on_io_nmi;
25unsigned int code_bytes = 64; 26unsigned int code_bytes = 64;
26int kstack_depth_to_print = 3 * STACKSLOTS_PER_LINE; 27int kstack_depth_to_print = 3 * STACKSLOTS_PER_LINE;
27static int die_counter; 28static int die_counter;
diff --git a/arch/x86/kernel/dumpstack_32.c b/arch/x86/kernel/dumpstack_32.c
index d593cd1f58dc..bca5fba91c9e 100644
--- a/arch/x86/kernel/dumpstack_32.c
+++ b/arch/x86/kernel/dumpstack_32.c
@@ -19,6 +19,12 @@
19 19
20#include "dumpstack.h" 20#include "dumpstack.h"
21 21
22/* Just a stub for now */
23int x86_is_stack_id(int id, char *name)
24{
25 return 0;
26}
27
22void dump_trace(struct task_struct *task, struct pt_regs *regs, 28void dump_trace(struct task_struct *task, struct pt_regs *regs,
23 unsigned long *stack, unsigned long bp, 29 unsigned long *stack, unsigned long bp,
24 const struct stacktrace_ops *ops, void *data) 30 const struct stacktrace_ops *ops, void *data)
diff --git a/arch/x86/kernel/dumpstack_64.c b/arch/x86/kernel/dumpstack_64.c
index d35db5993fd6..54b0a3276766 100644
--- a/arch/x86/kernel/dumpstack_64.c
+++ b/arch/x86/kernel/dumpstack_64.c
@@ -19,10 +19,8 @@
19 19
20#include "dumpstack.h" 20#include "dumpstack.h"
21 21
22static unsigned long *in_exception_stack(unsigned cpu, unsigned long stack, 22
23 unsigned *usedp, char **idp) 23static char x86_stack_ids[][8] = {
24{
25 static char ids[][8] = {
26 [DEBUG_STACK - 1] = "#DB", 24 [DEBUG_STACK - 1] = "#DB",
27 [NMI_STACK - 1] = "NMI", 25 [NMI_STACK - 1] = "NMI",
28 [DOUBLEFAULT_STACK - 1] = "#DF", 26 [DOUBLEFAULT_STACK - 1] = "#DF",
@@ -33,6 +31,15 @@ static unsigned long *in_exception_stack(unsigned cpu, unsigned long stack,
33 N_EXCEPTION_STACKS + DEBUG_STKSZ / EXCEPTION_STKSZ - 2] = "#DB[?]" 31 N_EXCEPTION_STACKS + DEBUG_STKSZ / EXCEPTION_STKSZ - 2] = "#DB[?]"
34#endif 32#endif
35 }; 33 };
34
35int x86_is_stack_id(int id, char *name)
36{
37 return x86_stack_ids[id - 1] == name;
38}
39
40static unsigned long *in_exception_stack(unsigned cpu, unsigned long stack,
41 unsigned *usedp, char **idp)
42{
36 unsigned k; 43 unsigned k;
37 44
38 /* 45 /*
@@ -61,7 +68,7 @@ static unsigned long *in_exception_stack(unsigned cpu, unsigned long stack,
61 if (*usedp & (1U << k)) 68 if (*usedp & (1U << k))
62 break; 69 break;
63 *usedp |= 1U << k; 70 *usedp |= 1U << k;
64 *idp = ids[k]; 71 *idp = x86_stack_ids[k];
65 return (unsigned long *)end; 72 return (unsigned long *)end;
66 } 73 }
67 /* 74 /*
@@ -81,12 +88,13 @@ static unsigned long *in_exception_stack(unsigned cpu, unsigned long stack,
81 do { 88 do {
82 ++j; 89 ++j;
83 end -= EXCEPTION_STKSZ; 90 end -= EXCEPTION_STKSZ;
84 ids[j][4] = '1' + (j - N_EXCEPTION_STACKS); 91 x86_stack_ids[j][4] = '1' +
92 (j - N_EXCEPTION_STACKS);
85 } while (stack < end - EXCEPTION_STKSZ); 93 } while (stack < end - EXCEPTION_STKSZ);
86 if (*usedp & (1U << j)) 94 if (*usedp & (1U << j))
87 break; 95 break;
88 *usedp |= 1U << j; 96 *usedp |= 1U << j;
89 *idp = ids[j]; 97 *idp = x86_stack_ids[j];
90 return (unsigned long *)end; 98 return (unsigned long *)end;
91 } 99 }
92#endif 100#endif
diff --git a/arch/x86/kernel/e820.c b/arch/x86/kernel/e820.c
index 7271fa33d791..5cb5725b2bae 100644
--- a/arch/x86/kernel/e820.c
+++ b/arch/x86/kernel/e820.c
@@ -627,10 +627,9 @@ __init void e820_setup_gap(void)
627#ifdef CONFIG_X86_64 627#ifdef CONFIG_X86_64
628 if (!found) { 628 if (!found) {
629 gapstart = (max_pfn << PAGE_SHIFT) + 1024*1024; 629 gapstart = (max_pfn << PAGE_SHIFT) + 1024*1024;
630 printk(KERN_ERR "PCI: Warning: Cannot find a gap in the 32bit " 630 printk(KERN_ERR
631 "address range\n" 631 "PCI: Warning: Cannot find a gap in the 32bit address range\n"
632 KERN_ERR "PCI: Unassigned devices with 32bit resource " 632 "PCI: Unassigned devices with 32bit resource registers may break!\n");
633 "registers may break!\n");
634 } 633 }
635#endif 634#endif
636 635
@@ -1383,6 +1382,8 @@ static unsigned long ram_alignment(resource_size_t pos)
1383 return 32*1024*1024; 1382 return 32*1024*1024;
1384} 1383}
1385 1384
1385#define MAX_RESOURCE_SIZE ((resource_size_t)-1)
1386
1386void __init e820_reserve_resources_late(void) 1387void __init e820_reserve_resources_late(void)
1387{ 1388{
1388 int i; 1389 int i;
@@ -1400,17 +1401,19 @@ void __init e820_reserve_resources_late(void)
1400 * avoid stolen RAM: 1401 * avoid stolen RAM:
1401 */ 1402 */
1402 for (i = 0; i < e820.nr_map; i++) { 1403 for (i = 0; i < e820.nr_map; i++) {
1403 struct e820entry *entry = &e820_saved.map[i]; 1404 struct e820entry *entry = &e820.map[i];
1404 resource_size_t start, end; 1405 u64 start, end;
1405 1406
1406 if (entry->type != E820_RAM) 1407 if (entry->type != E820_RAM)
1407 continue; 1408 continue;
1408 start = entry->addr + entry->size; 1409 start = entry->addr + entry->size;
1409 end = round_up(start, ram_alignment(start)); 1410 end = round_up(start, ram_alignment(start)) - 1;
1410 if (start == end) 1411 if (end > MAX_RESOURCE_SIZE)
1412 end = MAX_RESOURCE_SIZE;
1413 if (start >= end)
1411 continue; 1414 continue;
1412 reserve_region_with_split(&iomem_resource, start, 1415 reserve_region_with_split(&iomem_resource, start, end,
1413 end - 1, "RAM buffer"); 1416 "RAM buffer");
1414 } 1417 }
1415} 1418}
1416 1419
diff --git a/arch/x86/kernel/kvm.c b/arch/x86/kernel/kvm.c
index a78ecad0c900..c664d515f613 100644
--- a/arch/x86/kernel/kvm.c
+++ b/arch/x86/kernel/kvm.c
@@ -200,7 +200,7 @@ static void kvm_leave_lazy_mmu(void)
200 state->mode = paravirt_get_lazy_mode(); 200 state->mode = paravirt_get_lazy_mode();
201} 201}
202 202
203static void paravirt_ops_setup(void) 203static void __init paravirt_ops_setup(void)
204{ 204{
205 pv_info.name = "KVM"; 205 pv_info.name = "KVM";
206 pv_info.paravirt_enabled = 1; 206 pv_info.paravirt_enabled = 1;
diff --git a/arch/x86/kernel/pci-dma.c b/arch/x86/kernel/pci-dma.c
index 47630479b067..1a041bcf506b 100644
--- a/arch/x86/kernel/pci-dma.c
+++ b/arch/x86/kernel/pci-dma.c
@@ -211,11 +211,11 @@ static __init int iommu_setup(char *p)
211#ifdef CONFIG_SWIOTLB 211#ifdef CONFIG_SWIOTLB
212 if (!strncmp(p, "soft", 4)) 212 if (!strncmp(p, "soft", 4))
213 swiotlb = 1; 213 swiotlb = 1;
214#endif
214 if (!strncmp(p, "pt", 2)) { 215 if (!strncmp(p, "pt", 2)) {
215 iommu_pass_through = 1; 216 iommu_pass_through = 1;
216 return 1; 217 return 1;
217 } 218 }
218#endif
219 219
220 gart_parse_options(p); 220 gart_parse_options(p);
221 221
diff --git a/arch/x86/kernel/pci-gart_64.c b/arch/x86/kernel/pci-gart_64.c
index cfd9f9063896..d2e56b8f48e7 100644
--- a/arch/x86/kernel/pci-gart_64.c
+++ b/arch/x86/kernel/pci-gart_64.c
@@ -675,7 +675,7 @@ static __init int init_k8_gatt(struct agp_kern_info *info)
675 nommu: 675 nommu:
676 /* Should not happen anymore */ 676 /* Should not happen anymore */
677 printk(KERN_WARNING "PCI-DMA: More than 4GB of RAM and no IOMMU\n" 677 printk(KERN_WARNING "PCI-DMA: More than 4GB of RAM and no IOMMU\n"
678 KERN_WARNING "falling back to iommu=soft.\n"); 678 "falling back to iommu=soft.\n");
679 return -1; 679 return -1;
680} 680}
681 681
diff --git a/arch/x86/kernel/pvclock.c b/arch/x86/kernel/pvclock.c
index 4f9c55f3a7c0..03801f2f761f 100644
--- a/arch/x86/kernel/pvclock.c
+++ b/arch/x86/kernel/pvclock.c
@@ -60,7 +60,7 @@ static inline u64 scale_delta(u64 delta, u32 mul_frac, int shift)
60 "adc %5,%%edx ; " 60 "adc %5,%%edx ; "
61 : "=A" (product), "=r" (tmp1), "=r" (tmp2) 61 : "=A" (product), "=r" (tmp1), "=r" (tmp2)
62 : "a" ((u32)delta), "1" ((u32)(delta >> 32)), "2" (mul_frac) ); 62 : "a" ((u32)delta), "1" ((u32)(delta >> 32)), "2" (mul_frac) );
63#elif __x86_64__ 63#elif defined(__x86_64__)
64 __asm__ ( 64 __asm__ (
65 "mul %%rdx ; shrd $32,%%rdx,%%rax" 65 "mul %%rdx ; shrd $32,%%rdx,%%rax"
66 : "=a" (product) : "0" (delta), "d" ((u64)mul_frac) ); 66 : "=a" (product) : "0" (delta), "d" ((u64)mul_frac) );
diff --git a/arch/x86/kernel/setup.c b/arch/x86/kernel/setup.c
index be5ae80f897f..de2cab132844 100644
--- a/arch/x86/kernel/setup.c
+++ b/arch/x86/kernel/setup.c
@@ -289,6 +289,20 @@ void * __init extend_brk(size_t size, size_t align)
289 return ret; 289 return ret;
290} 290}
291 291
292#ifdef CONFIG_X86_64
293static void __init init_gbpages(void)
294{
295 if (direct_gbpages && cpu_has_gbpages)
296 printk(KERN_INFO "Using GB pages for direct mapping\n");
297 else
298 direct_gbpages = 0;
299}
300#else
301static inline void init_gbpages(void)
302{
303}
304#endif
305
292static void __init reserve_brk(void) 306static void __init reserve_brk(void)
293{ 307{
294 if (_brk_end > _brk_start) 308 if (_brk_end > _brk_start)
@@ -871,6 +885,8 @@ void __init setup_arch(char **cmdline_p)
871 885
872 reserve_brk(); 886 reserve_brk();
873 887
888 init_gbpages();
889
874 /* max_pfn_mapped is updated here */ 890 /* max_pfn_mapped is updated here */
875 max_low_pfn_mapped = init_memory_mapping(0, max_low_pfn<<PAGE_SHIFT); 891 max_low_pfn_mapped = init_memory_mapping(0, max_low_pfn<<PAGE_SHIFT);
876 max_pfn_mapped = max_low_pfn_mapped; 892 max_pfn_mapped = max_low_pfn_mapped;
diff --git a/arch/x86/kernel/setup_percpu.c b/arch/x86/kernel/setup_percpu.c
index 9c3f0823e6aa..29a3eef7cf4a 100644
--- a/arch/x86/kernel/setup_percpu.c
+++ b/arch/x86/kernel/setup_percpu.c
@@ -124,7 +124,7 @@ static void * __init pcpu_alloc_bootmem(unsigned int cpu, unsigned long size,
124} 124}
125 125
126/* 126/*
127 * Remap allocator 127 * Large page remap allocator
128 * 128 *
129 * This allocator uses PMD page as unit. A PMD page is allocated for 129 * This allocator uses PMD page as unit. A PMD page is allocated for
130 * each cpu and each is remapped into vmalloc area using PMD mapping. 130 * each cpu and each is remapped into vmalloc area using PMD mapping.
@@ -137,105 +137,185 @@ static void * __init pcpu_alloc_bootmem(unsigned int cpu, unsigned long size,
137 * better than only using 4k mappings while still being NUMA friendly. 137 * better than only using 4k mappings while still being NUMA friendly.
138 */ 138 */
139#ifdef CONFIG_NEED_MULTIPLE_NODES 139#ifdef CONFIG_NEED_MULTIPLE_NODES
140static size_t pcpur_size __initdata; 140struct pcpul_ent {
141static void **pcpur_ptrs __initdata; 141 unsigned int cpu;
142 void *ptr;
143};
144
145static size_t pcpul_size;
146static struct pcpul_ent *pcpul_map;
147static struct vm_struct pcpul_vm;
142 148
143static struct page * __init pcpur_get_page(unsigned int cpu, int pageno) 149static struct page * __init pcpul_get_page(unsigned int cpu, int pageno)
144{ 150{
145 size_t off = (size_t)pageno << PAGE_SHIFT; 151 size_t off = (size_t)pageno << PAGE_SHIFT;
146 152
147 if (off >= pcpur_size) 153 if (off >= pcpul_size)
148 return NULL; 154 return NULL;
149 155
150 return virt_to_page(pcpur_ptrs[cpu] + off); 156 return virt_to_page(pcpul_map[cpu].ptr + off);
151} 157}
152 158
153static ssize_t __init setup_pcpu_remap(size_t static_size) 159static ssize_t __init setup_pcpu_lpage(size_t static_size, bool chosen)
154{ 160{
155 static struct vm_struct vm; 161 size_t map_size, dyn_size;
156 size_t ptrs_size, dyn_size;
157 unsigned int cpu; 162 unsigned int cpu;
163 int i, j;
158 ssize_t ret; 164 ssize_t ret;
159 165
160 /* 166 if (!chosen) {
161 * If large page isn't supported, there's no benefit in doing 167 size_t vm_size = VMALLOC_END - VMALLOC_START;
162 * this. Also, on non-NUMA, embedding is better. 168 size_t tot_size = num_possible_cpus() * PMD_SIZE;
163 * 169
164 * NOTE: disabled for now. 170 /* on non-NUMA, embedding is better */
165 */ 171 if (!pcpu_need_numa())
166 if (true || !cpu_has_pse || !pcpu_need_numa()) 172 return -EINVAL;
173
174 /* don't consume more than 20% of vmalloc area */
175 if (tot_size > vm_size / 5) {
176 pr_info("PERCPU: too large chunk size %zuMB for "
177 "large page remap\n", tot_size >> 20);
178 return -EINVAL;
179 }
180 }
181
182 /* need PSE */
183 if (!cpu_has_pse) {
184 pr_warning("PERCPU: lpage allocator requires PSE\n");
167 return -EINVAL; 185 return -EINVAL;
186 }
168 187
169 /* 188 /*
170 * Currently supports only single page. Supporting multiple 189 * Currently supports only single page. Supporting multiple
171 * pages won't be too difficult if it ever becomes necessary. 190 * pages won't be too difficult if it ever becomes necessary.
172 */ 191 */
173 pcpur_size = PFN_ALIGN(static_size + PERCPU_MODULE_RESERVE + 192 pcpul_size = PFN_ALIGN(static_size + PERCPU_MODULE_RESERVE +
174 PERCPU_DYNAMIC_RESERVE); 193 PERCPU_DYNAMIC_RESERVE);
175 if (pcpur_size > PMD_SIZE) { 194 if (pcpul_size > PMD_SIZE) {
176 pr_warning("PERCPU: static data is larger than large page, " 195 pr_warning("PERCPU: static data is larger than large page, "
177 "can't use large page\n"); 196 "can't use large page\n");
178 return -EINVAL; 197 return -EINVAL;
179 } 198 }
180 dyn_size = pcpur_size - static_size - PERCPU_FIRST_CHUNK_RESERVE; 199 dyn_size = pcpul_size - static_size - PERCPU_FIRST_CHUNK_RESERVE;
181 200
182 /* allocate pointer array and alloc large pages */ 201 /* allocate pointer array and alloc large pages */
183 ptrs_size = PFN_ALIGN(num_possible_cpus() * sizeof(pcpur_ptrs[0])); 202 map_size = PFN_ALIGN(num_possible_cpus() * sizeof(pcpul_map[0]));
184 pcpur_ptrs = alloc_bootmem(ptrs_size); 203 pcpul_map = alloc_bootmem(map_size);
185 204
186 for_each_possible_cpu(cpu) { 205 for_each_possible_cpu(cpu) {
187 pcpur_ptrs[cpu] = pcpu_alloc_bootmem(cpu, PMD_SIZE, PMD_SIZE); 206 pcpul_map[cpu].cpu = cpu;
188 if (!pcpur_ptrs[cpu]) 207 pcpul_map[cpu].ptr = pcpu_alloc_bootmem(cpu, PMD_SIZE,
208 PMD_SIZE);
209 if (!pcpul_map[cpu].ptr) {
210 pr_warning("PERCPU: failed to allocate large page "
211 "for cpu%u\n", cpu);
189 goto enomem; 212 goto enomem;
213 }
190 214
191 /* 215 /*
192 * Only use pcpur_size bytes and give back the rest. 216 * Only use pcpul_size bytes and give back the rest.
193 * 217 *
194 * Ingo: The 2MB up-rounding bootmem is needed to make 218 * Ingo: The 2MB up-rounding bootmem is needed to make
195 * sure the partial 2MB page is still fully RAM - it's 219 * sure the partial 2MB page is still fully RAM - it's
196 * not well-specified to have a PAT-incompatible area 220 * not well-specified to have a PAT-incompatible area
197 * (unmapped RAM, device memory, etc.) in that hole. 221 * (unmapped RAM, device memory, etc.) in that hole.
198 */ 222 */
199 free_bootmem(__pa(pcpur_ptrs[cpu] + pcpur_size), 223 free_bootmem(__pa(pcpul_map[cpu].ptr + pcpul_size),
200 PMD_SIZE - pcpur_size); 224 PMD_SIZE - pcpul_size);
201 225
202 memcpy(pcpur_ptrs[cpu], __per_cpu_load, static_size); 226 memcpy(pcpul_map[cpu].ptr, __per_cpu_load, static_size);
203 } 227 }
204 228
205 /* allocate address and map */ 229 /* allocate address and map */
206 vm.flags = VM_ALLOC; 230 pcpul_vm.flags = VM_ALLOC;
207 vm.size = num_possible_cpus() * PMD_SIZE; 231 pcpul_vm.size = num_possible_cpus() * PMD_SIZE;
208 vm_area_register_early(&vm, PMD_SIZE); 232 vm_area_register_early(&pcpul_vm, PMD_SIZE);
209 233
210 for_each_possible_cpu(cpu) { 234 for_each_possible_cpu(cpu) {
211 pmd_t *pmd; 235 pmd_t *pmd, pmd_v;
212 236
213 pmd = populate_extra_pmd((unsigned long)vm.addr 237 pmd = populate_extra_pmd((unsigned long)pcpul_vm.addr +
214 + cpu * PMD_SIZE); 238 cpu * PMD_SIZE);
215 set_pmd(pmd, pfn_pmd(page_to_pfn(virt_to_page(pcpur_ptrs[cpu])), 239 pmd_v = pfn_pmd(page_to_pfn(virt_to_page(pcpul_map[cpu].ptr)),
216 PAGE_KERNEL_LARGE)); 240 PAGE_KERNEL_LARGE);
241 set_pmd(pmd, pmd_v);
217 } 242 }
218 243
219 /* we're ready, commit */ 244 /* we're ready, commit */
220 pr_info("PERCPU: Remapped at %p with large pages, static data " 245 pr_info("PERCPU: Remapped at %p with large pages, static data "
221 "%zu bytes\n", vm.addr, static_size); 246 "%zu bytes\n", pcpul_vm.addr, static_size);
222 247
223 ret = pcpu_setup_first_chunk(pcpur_get_page, static_size, 248 ret = pcpu_setup_first_chunk(pcpul_get_page, static_size,
224 PERCPU_FIRST_CHUNK_RESERVE, dyn_size, 249 PERCPU_FIRST_CHUNK_RESERVE, dyn_size,
225 PMD_SIZE, vm.addr, NULL); 250 PMD_SIZE, pcpul_vm.addr, NULL);
226 goto out_free_ar; 251
252 /* sort pcpul_map array for pcpu_lpage_remapped() */
253 for (i = 0; i < num_possible_cpus() - 1; i++)
254 for (j = i + 1; j < num_possible_cpus(); j++)
255 if (pcpul_map[i].ptr > pcpul_map[j].ptr) {
256 struct pcpul_ent tmp = pcpul_map[i];
257 pcpul_map[i] = pcpul_map[j];
258 pcpul_map[j] = tmp;
259 }
260
261 return ret;
227 262
228enomem: 263enomem:
229 for_each_possible_cpu(cpu) 264 for_each_possible_cpu(cpu)
230 if (pcpur_ptrs[cpu]) 265 if (pcpul_map[cpu].ptr)
231 free_bootmem(__pa(pcpur_ptrs[cpu]), PMD_SIZE); 266 free_bootmem(__pa(pcpul_map[cpu].ptr), pcpul_size);
232 ret = -ENOMEM; 267 free_bootmem(__pa(pcpul_map), map_size);
233out_free_ar: 268 return -ENOMEM;
234 free_bootmem(__pa(pcpur_ptrs), ptrs_size); 269}
235 return ret; 270
271/**
272 * pcpu_lpage_remapped - determine whether a kaddr is in pcpul recycled area
273 * @kaddr: the kernel address in question
274 *
275 * Determine whether @kaddr falls in the pcpul recycled area. This is
276 * used by pageattr to detect VM aliases and break up the pcpu PMD
277 * mapping such that the same physical page is not mapped under
278 * different attributes.
279 *
280 * The recycled area is always at the tail of a partially used PMD
281 * page.
282 *
283 * RETURNS:
284 * Address of corresponding remapped pcpu address if match is found;
285 * otherwise, NULL.
286 */
287void *pcpu_lpage_remapped(void *kaddr)
288{
289 void *pmd_addr = (void *)((unsigned long)kaddr & PMD_MASK);
290 unsigned long offset = (unsigned long)kaddr & ~PMD_MASK;
291 int left = 0, right = num_possible_cpus() - 1;
292 int pos;
293
294 /* pcpul in use at all? */
295 if (!pcpul_map)
296 return NULL;
297
298 /* okay, perform binary search */
299 while (left <= right) {
300 pos = (left + right) / 2;
301
302 if (pcpul_map[pos].ptr < pmd_addr)
303 left = pos + 1;
304 else if (pcpul_map[pos].ptr > pmd_addr)
305 right = pos - 1;
306 else {
307 /* it shouldn't be in the area for the first chunk */
308 WARN_ON(offset < pcpul_size);
309
310 return pcpul_vm.addr +
311 pcpul_map[pos].cpu * PMD_SIZE + offset;
312 }
313 }
314
315 return NULL;
236} 316}
237#else 317#else
238static ssize_t __init setup_pcpu_remap(size_t static_size) 318static ssize_t __init setup_pcpu_lpage(size_t static_size, bool chosen)
239{ 319{
240 return -EINVAL; 320 return -EINVAL;
241} 321}
@@ -249,7 +329,7 @@ static ssize_t __init setup_pcpu_remap(size_t static_size)
249 * mapping so that it can use PMD mapping without additional TLB 329 * mapping so that it can use PMD mapping without additional TLB
250 * pressure. 330 * pressure.
251 */ 331 */
252static ssize_t __init setup_pcpu_embed(size_t static_size) 332static ssize_t __init setup_pcpu_embed(size_t static_size, bool chosen)
253{ 333{
254 size_t reserve = PERCPU_MODULE_RESERVE + PERCPU_DYNAMIC_RESERVE; 334 size_t reserve = PERCPU_MODULE_RESERVE + PERCPU_DYNAMIC_RESERVE;
255 335
@@ -258,7 +338,7 @@ static ssize_t __init setup_pcpu_embed(size_t static_size)
258 * this. Also, embedding allocation doesn't play well with 338 * this. Also, embedding allocation doesn't play well with
259 * NUMA. 339 * NUMA.
260 */ 340 */
261 if (!cpu_has_pse || pcpu_need_numa()) 341 if (!chosen && (!cpu_has_pse || pcpu_need_numa()))
262 return -EINVAL; 342 return -EINVAL;
263 343
264 return pcpu_embed_first_chunk(static_size, PERCPU_FIRST_CHUNK_RESERVE, 344 return pcpu_embed_first_chunk(static_size, PERCPU_FIRST_CHUNK_RESERVE,
@@ -308,8 +388,11 @@ static ssize_t __init setup_pcpu_4k(size_t static_size)
308 void *ptr; 388 void *ptr;
309 389
310 ptr = pcpu_alloc_bootmem(cpu, PAGE_SIZE, PAGE_SIZE); 390 ptr = pcpu_alloc_bootmem(cpu, PAGE_SIZE, PAGE_SIZE);
311 if (!ptr) 391 if (!ptr) {
392 pr_warning("PERCPU: failed to allocate "
393 "4k page for cpu%u\n", cpu);
312 goto enomem; 394 goto enomem;
395 }
313 396
314 memcpy(ptr, __per_cpu_load + i * PAGE_SIZE, PAGE_SIZE); 397 memcpy(ptr, __per_cpu_load + i * PAGE_SIZE, PAGE_SIZE);
315 pcpu4k_pages[j++] = virt_to_page(ptr); 398 pcpu4k_pages[j++] = virt_to_page(ptr);
@@ -333,6 +416,16 @@ out_free_ar:
333 return ret; 416 return ret;
334} 417}
335 418
419/* for explicit first chunk allocator selection */
420static char pcpu_chosen_alloc[16] __initdata;
421
422static int __init percpu_alloc_setup(char *str)
423{
424 strncpy(pcpu_chosen_alloc, str, sizeof(pcpu_chosen_alloc) - 1);
425 return 0;
426}
427early_param("percpu_alloc", percpu_alloc_setup);
428
336static inline void setup_percpu_segment(int cpu) 429static inline void setup_percpu_segment(int cpu)
337{ 430{
338#ifdef CONFIG_X86_32 431#ifdef CONFIG_X86_32
@@ -346,11 +439,6 @@ static inline void setup_percpu_segment(int cpu)
346#endif 439#endif
347} 440}
348 441
349/*
350 * Great future plan:
351 * Declare PDA itself and support (irqstack,tss,pgd) as per cpu data.
352 * Always point %gs to its beginning
353 */
354void __init setup_per_cpu_areas(void) 442void __init setup_per_cpu_areas(void)
355{ 443{
356 size_t static_size = __per_cpu_end - __per_cpu_start; 444 size_t static_size = __per_cpu_end - __per_cpu_start;
@@ -367,9 +455,26 @@ void __init setup_per_cpu_areas(void)
367 * of large page mappings. Please read comments on top of 455 * of large page mappings. Please read comments on top of
368 * each allocator for details. 456 * each allocator for details.
369 */ 457 */
370 ret = setup_pcpu_remap(static_size); 458 ret = -EINVAL;
371 if (ret < 0) 459 if (strlen(pcpu_chosen_alloc)) {
372 ret = setup_pcpu_embed(static_size); 460 if (strcmp(pcpu_chosen_alloc, "4k")) {
461 if (!strcmp(pcpu_chosen_alloc, "lpage"))
462 ret = setup_pcpu_lpage(static_size, true);
463 else if (!strcmp(pcpu_chosen_alloc, "embed"))
464 ret = setup_pcpu_embed(static_size, true);
465 else
466 pr_warning("PERCPU: unknown allocator %s "
467 "specified\n", pcpu_chosen_alloc);
468 if (ret < 0)
469 pr_warning("PERCPU: %s allocator failed (%zd), "
470 "falling back to 4k\n",
471 pcpu_chosen_alloc, ret);
472 }
473 } else {
474 ret = setup_pcpu_lpage(static_size, false);
475 if (ret < 0)
476 ret = setup_pcpu_embed(static_size, false);
477 }
373 if (ret < 0) 478 if (ret < 0)
374 ret = setup_pcpu_4k(static_size); 479 ret = setup_pcpu_4k(static_size);
375 if (ret < 0) 480 if (ret < 0)
diff --git a/arch/x86/kernel/tlb_uv.c b/arch/x86/kernel/tlb_uv.c
index 124d40c575df..8ccabb8a2f6a 100644
--- a/arch/x86/kernel/tlb_uv.c
+++ b/arch/x86/kernel/tlb_uv.c
@@ -711,7 +711,6 @@ uv_activation_descriptor_init(int node, int pnode)
711 unsigned long pa; 711 unsigned long pa;
712 unsigned long m; 712 unsigned long m;
713 unsigned long n; 713 unsigned long n;
714 unsigned long mmr_image;
715 struct bau_desc *adp; 714 struct bau_desc *adp;
716 struct bau_desc *ad2; 715 struct bau_desc *ad2;
717 716
@@ -727,12 +726,8 @@ uv_activation_descriptor_init(int node, int pnode)
727 n = pa >> uv_nshift; 726 n = pa >> uv_nshift;
728 m = pa & uv_mmask; 727 m = pa & uv_mmask;
729 728
730 mmr_image = uv_read_global_mmr64(pnode, UVH_LB_BAU_SB_DESCRIPTOR_BASE); 729 uv_write_global_mmr64(pnode, UVH_LB_BAU_SB_DESCRIPTOR_BASE,
731 if (mmr_image) { 730 (n << UV_DESC_BASE_PNODE_SHIFT | m));
732 uv_write_global_mmr64(pnode, (unsigned long)
733 UVH_LB_BAU_SB_DESCRIPTOR_BASE,
734 (n << UV_DESC_BASE_PNODE_SHIFT | m));
735 }
736 731
737 /* 732 /*
738 * initializing all 8 (UV_ITEMS_PER_DESCRIPTOR) descriptors for each 733 * initializing all 8 (UV_ITEMS_PER_DESCRIPTOR) descriptors for each
diff --git a/arch/x86/kernel/traps.c b/arch/x86/kernel/traps.c
index a0f48f5671c0..5204332f475d 100644
--- a/arch/x86/kernel/traps.c
+++ b/arch/x86/kernel/traps.c
@@ -346,6 +346,9 @@ io_check_error(unsigned char reason, struct pt_regs *regs)
346 printk(KERN_EMERG "NMI: IOCK error (debug interrupt?)\n"); 346 printk(KERN_EMERG "NMI: IOCK error (debug interrupt?)\n");
347 show_registers(regs); 347 show_registers(regs);
348 348
349 if (panic_on_io_nmi)
350 panic("NMI IOCK error: Not continuing");
351
349 /* Re-enable the IOCK line, wait for a few seconds */ 352 /* Re-enable the IOCK line, wait for a few seconds */
350 reason = (reason & 0xf) | 8; 353 reason = (reason & 0xf) | 8;
351 outb(reason, 0x61); 354 outb(reason, 0x61);
diff --git a/arch/x86/kvm/mmu.c b/arch/x86/kvm/mmu.c
index 5c3d6e81a7dc..7030b5f911bf 100644
--- a/arch/x86/kvm/mmu.c
+++ b/arch/x86/kvm/mmu.c
@@ -2157,7 +2157,7 @@ static void reset_rsvds_bits_mask(struct kvm_vcpu *vcpu, int level)
2157 else 2157 else
2158 /* 32 bits PSE 4MB page */ 2158 /* 32 bits PSE 4MB page */
2159 context->rsvd_bits_mask[1][1] = rsvd_bits(13, 21); 2159 context->rsvd_bits_mask[1][1] = rsvd_bits(13, 21);
2160 context->rsvd_bits_mask[1][0] = ~0ull; 2160 context->rsvd_bits_mask[1][0] = context->rsvd_bits_mask[1][0];
2161 break; 2161 break;
2162 case PT32E_ROOT_LEVEL: 2162 case PT32E_ROOT_LEVEL:
2163 context->rsvd_bits_mask[0][2] = 2163 context->rsvd_bits_mask[0][2] =
@@ -2170,7 +2170,7 @@ static void reset_rsvds_bits_mask(struct kvm_vcpu *vcpu, int level)
2170 context->rsvd_bits_mask[1][1] = exb_bit_rsvd | 2170 context->rsvd_bits_mask[1][1] = exb_bit_rsvd |
2171 rsvd_bits(maxphyaddr, 62) | 2171 rsvd_bits(maxphyaddr, 62) |
2172 rsvd_bits(13, 20); /* large page */ 2172 rsvd_bits(13, 20); /* large page */
2173 context->rsvd_bits_mask[1][0] = ~0ull; 2173 context->rsvd_bits_mask[1][0] = context->rsvd_bits_mask[1][0];
2174 break; 2174 break;
2175 case PT64_ROOT_LEVEL: 2175 case PT64_ROOT_LEVEL:
2176 context->rsvd_bits_mask[0][3] = exb_bit_rsvd | 2176 context->rsvd_bits_mask[0][3] = exb_bit_rsvd |
@@ -2186,7 +2186,7 @@ static void reset_rsvds_bits_mask(struct kvm_vcpu *vcpu, int level)
2186 context->rsvd_bits_mask[1][1] = exb_bit_rsvd | 2186 context->rsvd_bits_mask[1][1] = exb_bit_rsvd |
2187 rsvd_bits(maxphyaddr, 51) | 2187 rsvd_bits(maxphyaddr, 51) |
2188 rsvd_bits(13, 20); /* large page */ 2188 rsvd_bits(13, 20); /* large page */
2189 context->rsvd_bits_mask[1][0] = ~0ull; 2189 context->rsvd_bits_mask[1][0] = context->rsvd_bits_mask[1][0];
2190 break; 2190 break;
2191 } 2191 }
2192} 2192}
diff --git a/arch/x86/kvm/paging_tmpl.h b/arch/x86/kvm/paging_tmpl.h
index 258e4591e1ca..67785f635399 100644
--- a/arch/x86/kvm/paging_tmpl.h
+++ b/arch/x86/kvm/paging_tmpl.h
@@ -281,7 +281,7 @@ static u64 *FNAME(fetch)(struct kvm_vcpu *vcpu, gva_t addr,
281{ 281{
282 unsigned access = gw->pt_access; 282 unsigned access = gw->pt_access;
283 struct kvm_mmu_page *shadow_page; 283 struct kvm_mmu_page *shadow_page;
284 u64 spte, *sptep; 284 u64 spte, *sptep = NULL;
285 int direct; 285 int direct;
286 gfn_t table_gfn; 286 gfn_t table_gfn;
287 int r; 287 int r;
diff --git a/arch/x86/kvm/vmx.c b/arch/x86/kvm/vmx.c
index e770bf349ec4..356a0ce85c68 100644
--- a/arch/x86/kvm/vmx.c
+++ b/arch/x86/kvm/vmx.c
@@ -3012,6 +3012,12 @@ static int handle_vmcall(struct kvm_vcpu *vcpu, struct kvm_run *kvm_run)
3012 return 1; 3012 return 1;
3013} 3013}
3014 3014
3015static int handle_vmx_insn(struct kvm_vcpu *vcpu, struct kvm_run *kvm_run)
3016{
3017 kvm_queue_exception(vcpu, UD_VECTOR);
3018 return 1;
3019}
3020
3015static int handle_invlpg(struct kvm_vcpu *vcpu, struct kvm_run *kvm_run) 3021static int handle_invlpg(struct kvm_vcpu *vcpu, struct kvm_run *kvm_run)
3016{ 3022{
3017 unsigned long exit_qualification = vmcs_readl(EXIT_QUALIFICATION); 3023 unsigned long exit_qualification = vmcs_readl(EXIT_QUALIFICATION);
@@ -3198,6 +3204,15 @@ static int (*kvm_vmx_exit_handlers[])(struct kvm_vcpu *vcpu,
3198 [EXIT_REASON_HLT] = handle_halt, 3204 [EXIT_REASON_HLT] = handle_halt,
3199 [EXIT_REASON_INVLPG] = handle_invlpg, 3205 [EXIT_REASON_INVLPG] = handle_invlpg,
3200 [EXIT_REASON_VMCALL] = handle_vmcall, 3206 [EXIT_REASON_VMCALL] = handle_vmcall,
3207 [EXIT_REASON_VMCLEAR] = handle_vmx_insn,
3208 [EXIT_REASON_VMLAUNCH] = handle_vmx_insn,
3209 [EXIT_REASON_VMPTRLD] = handle_vmx_insn,
3210 [EXIT_REASON_VMPTRST] = handle_vmx_insn,
3211 [EXIT_REASON_VMREAD] = handle_vmx_insn,
3212 [EXIT_REASON_VMRESUME] = handle_vmx_insn,
3213 [EXIT_REASON_VMWRITE] = handle_vmx_insn,
3214 [EXIT_REASON_VMOFF] = handle_vmx_insn,
3215 [EXIT_REASON_VMON] = handle_vmx_insn,
3201 [EXIT_REASON_TPR_BELOW_THRESHOLD] = handle_tpr_below_threshold, 3216 [EXIT_REASON_TPR_BELOW_THRESHOLD] = handle_tpr_below_threshold,
3202 [EXIT_REASON_APIC_ACCESS] = handle_apic_access, 3217 [EXIT_REASON_APIC_ACCESS] = handle_apic_access,
3203 [EXIT_REASON_WBINVD] = handle_wbinvd, 3218 [EXIT_REASON_WBINVD] = handle_wbinvd,
diff --git a/arch/x86/kvm/x86.c b/arch/x86/kvm/x86.c
index 249540f98513..fe5474aec41a 100644
--- a/arch/x86/kvm/x86.c
+++ b/arch/x86/kvm/x86.c
@@ -898,6 +898,7 @@ int kvm_get_msr_common(struct kvm_vcpu *vcpu, u32 msr, u64 *pdata)
898 case MSR_VM_HSAVE_PA: 898 case MSR_VM_HSAVE_PA:
899 case MSR_P6_EVNTSEL0: 899 case MSR_P6_EVNTSEL0:
900 case MSR_P6_EVNTSEL1: 900 case MSR_P6_EVNTSEL1:
901 case MSR_K7_EVNTSEL0:
901 data = 0; 902 data = 0;
902 break; 903 break;
903 case MSR_MTRRcap: 904 case MSR_MTRRcap:
diff --git a/arch/x86/kvm/x86_emulate.c b/arch/x86/kvm/x86_emulate.c
index c1b6c232e02b..616de4628d60 100644
--- a/arch/x86/kvm/x86_emulate.c
+++ b/arch/x86/kvm/x86_emulate.c
@@ -1361,7 +1361,7 @@ static inline int writeback(struct x86_emulate_ctxt *ctxt,
1361 return 0; 1361 return 0;
1362} 1362}
1363 1363
1364void toggle_interruptibility(struct x86_emulate_ctxt *ctxt, u32 mask) 1364static void toggle_interruptibility(struct x86_emulate_ctxt *ctxt, u32 mask)
1365{ 1365{
1366 u32 int_shadow = kvm_x86_ops->get_interrupt_shadow(ctxt->vcpu, mask); 1366 u32 int_shadow = kvm_x86_ops->get_interrupt_shadow(ctxt->vcpu, mask);
1367 /* 1367 /*
diff --git a/arch/x86/lguest/boot.c b/arch/x86/lguest/boot.c
index 7bc65f0f62c4..f2bf1f73d468 100644
--- a/arch/x86/lguest/boot.c
+++ b/arch/x86/lguest/boot.c
@@ -379,6 +379,11 @@ static void lguest_cpuid(unsigned int *ax, unsigned int *bx,
379 379
380 native_cpuid(ax, bx, cx, dx); 380 native_cpuid(ax, bx, cx, dx);
381 switch (function) { 381 switch (function) {
382 case 0: /* ID and highest CPUID. Futureproof a little by sticking to
383 * older ones. */
384 if (*ax > 5)
385 *ax = 5;
386 break;
382 case 1: /* Basic feature request. */ 387 case 1: /* Basic feature request. */
383 /* We only allow kernel to see SSE3, CMPXCHG16B and SSSE3 */ 388 /* We only allow kernel to see SSE3, CMPXCHG16B and SSSE3 */
384 *cx &= 0x00002201; 389 *cx &= 0x00002201;
@@ -1079,7 +1084,7 @@ static unsigned lguest_patch(u8 type, u16 clobber, void *ibuf,
1079 return insn_len; 1084 return insn_len;
1080} 1085}
1081 1086
1082/*G:030 Once we get to lguest_init(), we know we're a Guest. The various 1087/*G:029 Once we get to lguest_init(), we know we're a Guest. The various
1083 * pv_ops structures in the kernel provide points for (almost) every routine we 1088 * pv_ops structures in the kernel provide points for (almost) every routine we
1084 * have to override to avoid privileged instructions. */ 1089 * have to override to avoid privileged instructions. */
1085__init void lguest_init(void) 1090__init void lguest_init(void)
diff --git a/arch/x86/lib/Makefile b/arch/x86/lib/Makefile
index f9d35632666b..07c31899c9c2 100644
--- a/arch/x86/lib/Makefile
+++ b/arch/x86/lib/Makefile
@@ -10,6 +10,7 @@ lib-y += usercopy_$(BITS).o getuser.o putuser.o
10lib-y += memcpy_$(BITS).o 10lib-y += memcpy_$(BITS).o
11 11
12ifeq ($(CONFIG_X86_32),y) 12ifeq ($(CONFIG_X86_32),y)
13 obj-y += atomic64_32.o
13 lib-y += checksum_32.o 14 lib-y += checksum_32.o
14 lib-y += strstr_32.o 15 lib-y += strstr_32.o
15 lib-y += semaphore_32.o string_32.o 16 lib-y += semaphore_32.o string_32.o
diff --git a/arch/x86/lib/atomic64_32.c b/arch/x86/lib/atomic64_32.c
new file mode 100644
index 000000000000..824fa0be55a3
--- /dev/null
+++ b/arch/x86/lib/atomic64_32.c
@@ -0,0 +1,230 @@
1#include <linux/compiler.h>
2#include <linux/module.h>
3#include <linux/types.h>
4
5#include <asm/processor.h>
6#include <asm/cmpxchg.h>
7#include <asm/atomic.h>
8
9static noinline u64 cmpxchg8b(u64 *ptr, u64 old, u64 new)
10{
11 u32 low = new;
12 u32 high = new >> 32;
13
14 asm volatile(
15 LOCK_PREFIX "cmpxchg8b %1\n"
16 : "+A" (old), "+m" (*ptr)
17 : "b" (low), "c" (high)
18 );
19 return old;
20}
21
22u64 atomic64_cmpxchg(atomic64_t *ptr, u64 old_val, u64 new_val)
23{
24 return cmpxchg8b(&ptr->counter, old_val, new_val);
25}
26EXPORT_SYMBOL(atomic64_cmpxchg);
27
28/**
29 * atomic64_xchg - xchg atomic64 variable
30 * @ptr: pointer to type atomic64_t
31 * @new_val: value to assign
32 *
33 * Atomically xchgs the value of @ptr to @new_val and returns
34 * the old value.
35 */
36u64 atomic64_xchg(atomic64_t *ptr, u64 new_val)
37{
38 /*
39 * Try first with a (possibly incorrect) assumption about
40 * what we have there. We'll do two loops most likely,
41 * but we'll get an ownership MESI transaction straight away
42 * instead of a read transaction followed by a
43 * flush-for-ownership transaction:
44 */
45 u64 old_val, real_val = 0;
46
47 do {
48 old_val = real_val;
49
50 real_val = atomic64_cmpxchg(ptr, old_val, new_val);
51
52 } while (real_val != old_val);
53
54 return old_val;
55}
56EXPORT_SYMBOL(atomic64_xchg);
57
58/**
59 * atomic64_set - set atomic64 variable
60 * @ptr: pointer to type atomic64_t
61 * @new_val: value to assign
62 *
63 * Atomically sets the value of @ptr to @new_val.
64 */
65void atomic64_set(atomic64_t *ptr, u64 new_val)
66{
67 atomic64_xchg(ptr, new_val);
68}
69EXPORT_SYMBOL(atomic64_set);
70
71/**
72EXPORT_SYMBOL(atomic64_read);
73 * atomic64_add_return - add and return
74 * @delta: integer value to add
75 * @ptr: pointer to type atomic64_t
76 *
77 * Atomically adds @delta to @ptr and returns @delta + *@ptr
78 */
79noinline u64 atomic64_add_return(u64 delta, atomic64_t *ptr)
80{
81 /*
82 * Try first with a (possibly incorrect) assumption about
83 * what we have there. We'll do two loops most likely,
84 * but we'll get an ownership MESI transaction straight away
85 * instead of a read transaction followed by a
86 * flush-for-ownership transaction:
87 */
88 u64 old_val, new_val, real_val = 0;
89
90 do {
91 old_val = real_val;
92 new_val = old_val + delta;
93
94 real_val = atomic64_cmpxchg(ptr, old_val, new_val);
95
96 } while (real_val != old_val);
97
98 return new_val;
99}
100EXPORT_SYMBOL(atomic64_add_return);
101
102u64 atomic64_sub_return(u64 delta, atomic64_t *ptr)
103{
104 return atomic64_add_return(-delta, ptr);
105}
106EXPORT_SYMBOL(atomic64_sub_return);
107
108u64 atomic64_inc_return(atomic64_t *ptr)
109{
110 return atomic64_add_return(1, ptr);
111}
112EXPORT_SYMBOL(atomic64_inc_return);
113
114u64 atomic64_dec_return(atomic64_t *ptr)
115{
116 return atomic64_sub_return(1, ptr);
117}
118EXPORT_SYMBOL(atomic64_dec_return);
119
120/**
121 * atomic64_add - add integer to atomic64 variable
122 * @delta: integer value to add
123 * @ptr: pointer to type atomic64_t
124 *
125 * Atomically adds @delta to @ptr.
126 */
127void atomic64_add(u64 delta, atomic64_t *ptr)
128{
129 atomic64_add_return(delta, ptr);
130}
131EXPORT_SYMBOL(atomic64_add);
132
133/**
134 * atomic64_sub - subtract the atomic64 variable
135 * @delta: integer value to subtract
136 * @ptr: pointer to type atomic64_t
137 *
138 * Atomically subtracts @delta from @ptr.
139 */
140void atomic64_sub(u64 delta, atomic64_t *ptr)
141{
142 atomic64_add(-delta, ptr);
143}
144EXPORT_SYMBOL(atomic64_sub);
145
146/**
147 * atomic64_sub_and_test - subtract value from variable and test result
148 * @delta: integer value to subtract
149 * @ptr: pointer to type atomic64_t
150 *
151 * Atomically subtracts @delta from @ptr and returns
152 * true if the result is zero, or false for all
153 * other cases.
154 */
155int atomic64_sub_and_test(u64 delta, atomic64_t *ptr)
156{
157 u64 new_val = atomic64_sub_return(delta, ptr);
158
159 return new_val == 0;
160}
161EXPORT_SYMBOL(atomic64_sub_and_test);
162
163/**
164 * atomic64_inc - increment atomic64 variable
165 * @ptr: pointer to type atomic64_t
166 *
167 * Atomically increments @ptr by 1.
168 */
169void atomic64_inc(atomic64_t *ptr)
170{
171 atomic64_add(1, ptr);
172}
173EXPORT_SYMBOL(atomic64_inc);
174
175/**
176 * atomic64_dec - decrement atomic64 variable
177 * @ptr: pointer to type atomic64_t
178 *
179 * Atomically decrements @ptr by 1.
180 */
181void atomic64_dec(atomic64_t *ptr)
182{
183 atomic64_sub(1, ptr);
184}
185EXPORT_SYMBOL(atomic64_dec);
186
187/**
188 * atomic64_dec_and_test - decrement and test
189 * @ptr: pointer to type atomic64_t
190 *
191 * Atomically decrements @ptr by 1 and
192 * returns true if the result is 0, or false for all other
193 * cases.
194 */
195int atomic64_dec_and_test(atomic64_t *ptr)
196{
197 return atomic64_sub_and_test(1, ptr);
198}
199EXPORT_SYMBOL(atomic64_dec_and_test);
200
201/**
202 * atomic64_inc_and_test - increment and test
203 * @ptr: pointer to type atomic64_t
204 *
205 * Atomically increments @ptr by 1
206 * and returns true if the result is zero, or false for all
207 * other cases.
208 */
209int atomic64_inc_and_test(atomic64_t *ptr)
210{
211 return atomic64_sub_and_test(-1, ptr);
212}
213EXPORT_SYMBOL(atomic64_inc_and_test);
214
215/**
216 * atomic64_add_negative - add and test if negative
217 * @delta: integer value to add
218 * @ptr: pointer to type atomic64_t
219 *
220 * Atomically adds @delta to @ptr and returns true
221 * if the result is negative, or false when
222 * result is greater than or equal to zero.
223 */
224int atomic64_add_negative(u64 delta, atomic64_t *ptr)
225{
226 s64 new_val = atomic64_add_return(delta, ptr);
227
228 return new_val < 0;
229}
230EXPORT_SYMBOL(atomic64_add_negative);
diff --git a/arch/x86/lib/clear_page_64.S b/arch/x86/lib/clear_page_64.S
index 9a10a78bb4a4..ebeafcce04a9 100644
--- a/arch/x86/lib/clear_page_64.S
+++ b/arch/x86/lib/clear_page_64.S
@@ -5,15 +5,14 @@
5 * Zero a page. 5 * Zero a page.
6 * rdi page 6 * rdi page
7 */ 7 */
8 ALIGN 8ENTRY(clear_page_c)
9clear_page_c:
10 CFI_STARTPROC 9 CFI_STARTPROC
11 movl $4096/8,%ecx 10 movl $4096/8,%ecx
12 xorl %eax,%eax 11 xorl %eax,%eax
13 rep stosq 12 rep stosq
14 ret 13 ret
15 CFI_ENDPROC 14 CFI_ENDPROC
16ENDPROC(clear_page) 15ENDPROC(clear_page_c)
17 16
18ENTRY(clear_page) 17ENTRY(clear_page)
19 CFI_STARTPROC 18 CFI_STARTPROC
diff --git a/arch/x86/lib/copy_user_64.S b/arch/x86/lib/copy_user_64.S
index f118c110af32..6ba0f7bb85ea 100644
--- a/arch/x86/lib/copy_user_64.S
+++ b/arch/x86/lib/copy_user_64.S
@@ -75,6 +75,7 @@ ENTRY(copy_to_user)
75 jae bad_to_user 75 jae bad_to_user
76 ALTERNATIVE_JUMP X86_FEATURE_REP_GOOD,copy_user_generic_unrolled,copy_user_generic_string 76 ALTERNATIVE_JUMP X86_FEATURE_REP_GOOD,copy_user_generic_unrolled,copy_user_generic_string
77 CFI_ENDPROC 77 CFI_ENDPROC
78ENDPROC(copy_to_user)
78 79
79/* Standard copy_from_user with segment limit checking */ 80/* Standard copy_from_user with segment limit checking */
80ENTRY(copy_from_user) 81ENTRY(copy_from_user)
diff --git a/arch/x86/lib/delay.c b/arch/x86/lib/delay.c
index f4568605d7d5..ff485d361182 100644
--- a/arch/x86/lib/delay.c
+++ b/arch/x86/lib/delay.c
@@ -55,8 +55,10 @@ static void delay_tsc(unsigned long loops)
55 55
56 preempt_disable(); 56 preempt_disable();
57 cpu = smp_processor_id(); 57 cpu = smp_processor_id();
58 rdtsc_barrier();
58 rdtscl(bclock); 59 rdtscl(bclock);
59 for (;;) { 60 for (;;) {
61 rdtsc_barrier();
60 rdtscl(now); 62 rdtscl(now);
61 if ((now - bclock) >= loops) 63 if ((now - bclock) >= loops)
62 break; 64 break;
@@ -78,6 +80,7 @@ static void delay_tsc(unsigned long loops)
78 if (unlikely(cpu != smp_processor_id())) { 80 if (unlikely(cpu != smp_processor_id())) {
79 loops -= (now - bclock); 81 loops -= (now - bclock);
80 cpu = smp_processor_id(); 82 cpu = smp_processor_id();
83 rdtsc_barrier();
81 rdtscl(bclock); 84 rdtscl(bclock);
82 } 85 }
83 } 86 }
diff --git a/arch/x86/lib/usercopy_32.c b/arch/x86/lib/usercopy_32.c
index 7c8ca91bb9ec..1f118d462acc 100644
--- a/arch/x86/lib/usercopy_32.c
+++ b/arch/x86/lib/usercopy_32.c
@@ -751,7 +751,7 @@ survive:
751 751
752 if (retval == -ENOMEM && is_global_init(current)) { 752 if (retval == -ENOMEM && is_global_init(current)) {
753 up_read(&current->mm->mmap_sem); 753 up_read(&current->mm->mmap_sem);
754 congestion_wait(WRITE, HZ/50); 754 congestion_wait(BLK_RW_ASYNC, HZ/50);
755 goto survive; 755 goto survive;
756 } 756 }
757 757
diff --git a/arch/x86/mm/fault.c b/arch/x86/mm/fault.c
index 78a5fff857be..bfae139182ff 100644
--- a/arch/x86/mm/fault.c
+++ b/arch/x86/mm/fault.c
@@ -426,10 +426,11 @@ static noinline int vmalloc_fault(unsigned long address)
426} 426}
427 427
428static const char errata93_warning[] = 428static const char errata93_warning[] =
429KERN_ERR "******* Your BIOS seems to not contain a fix for K8 errata #93\n" 429KERN_ERR
430KERN_ERR "******* Working around it, but it may cause SEGVs or burn power.\n" 430"******* Your BIOS seems to not contain a fix for K8 errata #93\n"
431KERN_ERR "******* Please consider a BIOS update.\n" 431"******* Working around it, but it may cause SEGVs or burn power.\n"
432KERN_ERR "******* Disabling USB legacy in the BIOS may also help.\n"; 432"******* Please consider a BIOS update.\n"
433"******* Disabling USB legacy in the BIOS may also help.\n";
433 434
434/* 435/*
435 * No vm86 mode in 64-bit mode: 436 * No vm86 mode in 64-bit mode:
@@ -696,7 +697,7 @@ show_signal_msg(struct pt_regs *regs, unsigned long error_code,
696 if (!printk_ratelimit()) 697 if (!printk_ratelimit())
697 return; 698 return;
698 699
699 printk(KERN_CONT "%s%s[%d]: segfault at %lx ip %p sp %p error %lx", 700 printk("%s%s[%d]: segfault at %lx ip %p sp %p error %lx",
700 task_pid_nr(tsk) > 1 ? KERN_INFO : KERN_EMERG, 701 task_pid_nr(tsk) > 1 ? KERN_INFO : KERN_EMERG,
701 tsk->comm, task_pid_nr(tsk), address, 702 tsk->comm, task_pid_nr(tsk), address,
702 (void *)regs->ip, (void *)regs->sp, error_code); 703 (void *)regs->ip, (void *)regs->sp, error_code);
diff --git a/arch/x86/mm/init.c b/arch/x86/mm/init.c
index f53b57e4086f..0607119cef94 100644
--- a/arch/x86/mm/init.c
+++ b/arch/x86/mm/init.c
@@ -12,6 +12,7 @@
12#include <asm/system.h> 12#include <asm/system.h>
13#include <asm/tlbflush.h> 13#include <asm/tlbflush.h>
14#include <asm/tlb.h> 14#include <asm/tlb.h>
15#include <asm/proto.h>
15 16
16DEFINE_PER_CPU(struct mmu_gather, mmu_gathers); 17DEFINE_PER_CPU(struct mmu_gather, mmu_gathers);
17 18
@@ -177,20 +178,6 @@ static int __meminit save_mr(struct map_range *mr, int nr_range,
177 return nr_range; 178 return nr_range;
178} 179}
179 180
180#ifdef CONFIG_X86_64
181static void __init init_gbpages(void)
182{
183 if (direct_gbpages && cpu_has_gbpages)
184 printk(KERN_INFO "Using GB pages for direct mapping\n");
185 else
186 direct_gbpages = 0;
187}
188#else
189static inline void init_gbpages(void)
190{
191}
192#endif
193
194/* 181/*
195 * Setup the direct mapping of the physical memory at PAGE_OFFSET. 182 * Setup the direct mapping of the physical memory at PAGE_OFFSET.
196 * This runs before bootmem is initialized and gets pages directly from 183 * This runs before bootmem is initialized and gets pages directly from
@@ -210,9 +197,6 @@ unsigned long __init_refok init_memory_mapping(unsigned long start,
210 197
211 printk(KERN_INFO "init_memory_mapping: %016lx-%016lx\n", start, end); 198 printk(KERN_INFO "init_memory_mapping: %016lx-%016lx\n", start, end);
212 199
213 if (!after_bootmem)
214 init_gbpages();
215
216#if defined(CONFIG_DEBUG_PAGEALLOC) || defined(CONFIG_KMEMCHECK) 200#if defined(CONFIG_DEBUG_PAGEALLOC) || defined(CONFIG_KMEMCHECK)
217 /* 201 /*
218 * For CONFIG_DEBUG_PAGEALLOC, identity mapping will use small pages. 202 * For CONFIG_DEBUG_PAGEALLOC, identity mapping will use small pages.
diff --git a/arch/x86/mm/init_64.c b/arch/x86/mm/init_64.c
index c4378f4fd4a5..6176fe8f29e0 100644
--- a/arch/x86/mm/init_64.c
+++ b/arch/x86/mm/init_64.c
@@ -598,6 +598,15 @@ void __init paging_init(void)
598 598
599 sparse_memory_present_with_active_regions(MAX_NUMNODES); 599 sparse_memory_present_with_active_regions(MAX_NUMNODES);
600 sparse_init(); 600 sparse_init();
601
602 /*
603 * clear the default setting with node 0
604 * note: don't use nodes_clear here, that is really clearing when
605 * numa support is not compiled in, and later node_set_state
606 * will not set it back.
607 */
608 node_clear_state(0, N_NORMAL_MEMORY);
609
601 free_area_init_nodes(max_zone_pfns); 610 free_area_init_nodes(max_zone_pfns);
602} 611}
603 612
diff --git a/arch/x86/mm/pageattr.c b/arch/x86/mm/pageattr.c
index 3cfe9ced8a4c..1b734d7a8966 100644
--- a/arch/x86/mm/pageattr.c
+++ b/arch/x86/mm/pageattr.c
@@ -11,6 +11,7 @@
11#include <linux/interrupt.h> 11#include <linux/interrupt.h>
12#include <linux/seq_file.h> 12#include <linux/seq_file.h>
13#include <linux/debugfs.h> 13#include <linux/debugfs.h>
14#include <linux/pfn.h>
14 15
15#include <asm/e820.h> 16#include <asm/e820.h>
16#include <asm/processor.h> 17#include <asm/processor.h>
@@ -681,8 +682,9 @@ static int __change_page_attr_set_clr(struct cpa_data *cpa, int checkalias);
681static int cpa_process_alias(struct cpa_data *cpa) 682static int cpa_process_alias(struct cpa_data *cpa)
682{ 683{
683 struct cpa_data alias_cpa; 684 struct cpa_data alias_cpa;
684 int ret = 0; 685 unsigned long laddr = (unsigned long)__va(cpa->pfn << PAGE_SHIFT);
685 unsigned long temp_cpa_vaddr, vaddr; 686 unsigned long vaddr, remapped;
687 int ret;
686 688
687 if (cpa->pfn >= max_pfn_mapped) 689 if (cpa->pfn >= max_pfn_mapped)
688 return 0; 690 return 0;
@@ -706,42 +708,55 @@ static int cpa_process_alias(struct cpa_data *cpa)
706 PAGE_OFFSET + (max_pfn_mapped << PAGE_SHIFT)))) { 708 PAGE_OFFSET + (max_pfn_mapped << PAGE_SHIFT)))) {
707 709
708 alias_cpa = *cpa; 710 alias_cpa = *cpa;
709 temp_cpa_vaddr = (unsigned long) __va(cpa->pfn << PAGE_SHIFT); 711 alias_cpa.vaddr = &laddr;
710 alias_cpa.vaddr = &temp_cpa_vaddr;
711 alias_cpa.flags &= ~(CPA_PAGES_ARRAY | CPA_ARRAY); 712 alias_cpa.flags &= ~(CPA_PAGES_ARRAY | CPA_ARRAY);
712 713
713
714 ret = __change_page_attr_set_clr(&alias_cpa, 0); 714 ret = __change_page_attr_set_clr(&alias_cpa, 0);
715 if (ret)
716 return ret;
715 } 717 }
716 718
717#ifdef CONFIG_X86_64 719#ifdef CONFIG_X86_64
718 if (ret)
719 return ret;
720 /* 720 /*
721 * No need to redo, when the primary call touched the high 721 * If the primary call didn't touch the high mapping already
722 * mapping already: 722 * and the physical address is inside the kernel map, we need
723 */
724 if (within(vaddr, (unsigned long) _text, _brk_end))
725 return 0;
726
727 /*
728 * If the physical address is inside the kernel map, we need
729 * to touch the high mapped kernel as well: 723 * to touch the high mapped kernel as well:
730 */ 724 */
731 if (!within(cpa->pfn, highmap_start_pfn(), highmap_end_pfn())) 725 if (!within(vaddr, (unsigned long)_text, _brk_end) &&
732 return 0; 726 within(cpa->pfn, highmap_start_pfn(), highmap_end_pfn())) {
727 unsigned long temp_cpa_vaddr = (cpa->pfn << PAGE_SHIFT) +
728 __START_KERNEL_map - phys_base;
729 alias_cpa = *cpa;
730 alias_cpa.vaddr = &temp_cpa_vaddr;
731 alias_cpa.flags &= ~(CPA_PAGES_ARRAY | CPA_ARRAY);
733 732
734 alias_cpa = *cpa; 733 /*
735 temp_cpa_vaddr = (cpa->pfn << PAGE_SHIFT) + __START_KERNEL_map - phys_base; 734 * The high mapping range is imprecise, so ignore the
736 alias_cpa.vaddr = &temp_cpa_vaddr; 735 * return value.
737 alias_cpa.flags &= ~(CPA_PAGES_ARRAY | CPA_ARRAY); 736 */
737 __change_page_attr_set_clr(&alias_cpa, 0);
738 }
739#endif
738 740
739 /* 741 /*
740 * The high mapping range is imprecise, so ignore the return value. 742 * If the PMD page was partially used for per-cpu remapping,
743 * the recycled area needs to be split and modified. Because
744 * the area is always proper subset of a PMD page
745 * cpa->numpages is guaranteed to be 1 for these areas, so
746 * there's no need to loop over and check for further remaps.
741 */ 747 */
742 __change_page_attr_set_clr(&alias_cpa, 0); 748 remapped = (unsigned long)pcpu_lpage_remapped((void *)laddr);
743#endif 749 if (remapped) {
744 return ret; 750 WARN_ON(cpa->numpages > 1);
751 alias_cpa = *cpa;
752 alias_cpa.vaddr = &remapped;
753 alias_cpa.flags &= ~(CPA_PAGES_ARRAY | CPA_ARRAY);
754 ret = __change_page_attr_set_clr(&alias_cpa, 0);
755 if (ret)
756 return ret;
757 }
758
759 return 0;
745} 760}
746 761
747static int __change_page_attr_set_clr(struct cpa_data *cpa, int checkalias) 762static int __change_page_attr_set_clr(struct cpa_data *cpa, int checkalias)
diff --git a/arch/x86/oprofile/nmi_int.c b/arch/x86/oprofile/nmi_int.c
index b07dd8d0b321..89b9a5cd63da 100644
--- a/arch/x86/oprofile/nmi_int.c
+++ b/arch/x86/oprofile/nmi_int.c
@@ -390,7 +390,7 @@ static int __init p4_init(char **cpu_type)
390static int force_arch_perfmon; 390static int force_arch_perfmon;
391static int force_cpu_type(const char *str, struct kernel_param *kp) 391static int force_cpu_type(const char *str, struct kernel_param *kp)
392{ 392{
393 if (!strcmp(str, "archperfmon")) { 393 if (!strcmp(str, "arch_perfmon")) {
394 force_arch_perfmon = 1; 394 force_arch_perfmon = 1;
395 printk(KERN_INFO "oprofile: forcing architectural perfmon\n"); 395 printk(KERN_INFO "oprofile: forcing architectural perfmon\n");
396 } 396 }
diff --git a/arch/x86/pci/acpi.c b/arch/x86/pci/acpi.c
index b26626dc517c..1014eb4bfc37 100644
--- a/arch/x86/pci/acpi.c
+++ b/arch/x86/pci/acpi.c
@@ -68,6 +68,10 @@ setup_resource(struct acpi_resource *acpi_res, void *data)
68 unsigned long flags; 68 unsigned long flags;
69 struct resource *root; 69 struct resource *root;
70 int max_root_bus_resources = PCI_BUS_NUM_RESOURCES; 70 int max_root_bus_resources = PCI_BUS_NUM_RESOURCES;
71 u64 start, end;
72
73 if (bus_has_transparent_bridge(info->bus))
74 max_root_bus_resources -= 3;
71 75
72 status = resource_to_addr(acpi_res, &addr); 76 status = resource_to_addr(acpi_res, &addr);
73 if (!ACPI_SUCCESS(status)) 77 if (!ACPI_SUCCESS(status))
@@ -84,25 +88,24 @@ setup_resource(struct acpi_resource *acpi_res, void *data)
84 } else 88 } else
85 return AE_OK; 89 return AE_OK;
86 90
87 res = &info->res[info->res_num]; 91 start = addr.minimum + addr.translation_offset;
88 res->name = info->name; 92 end = start + addr.address_length - 1;
89 res->flags = flags;
90 res->start = addr.minimum + addr.translation_offset;
91 res->end = res->start + addr.address_length - 1;
92 res->child = NULL;
93
94 if (bus_has_transparent_bridge(info->bus))
95 max_root_bus_resources -= 3;
96 if (info->res_num >= max_root_bus_resources) { 93 if (info->res_num >= max_root_bus_resources) {
97 printk(KERN_WARNING "PCI: Failed to allocate 0x%lx-0x%lx " 94 printk(KERN_WARNING "PCI: Failed to allocate 0x%lx-0x%lx "
98 "from %s for %s due to _CRS returning more than " 95 "from %s for %s due to _CRS returning more than "
99 "%d resource descriptors\n", (unsigned long) res->start, 96 "%d resource descriptors\n", (unsigned long) start,
100 (unsigned long) res->end, root->name, info->name, 97 (unsigned long) end, root->name, info->name,
101 max_root_bus_resources); 98 max_root_bus_resources);
102 info->res_num++;
103 return AE_OK; 99 return AE_OK;
104 } 100 }
105 101
102 res = &info->res[info->res_num];
103 res->name = info->name;
104 res->flags = flags;
105 res->start = start;
106 res->end = end;
107 res->child = NULL;
108
106 if (insert_resource(root, res)) { 109 if (insert_resource(root, res)) {
107 printk(KERN_ERR "PCI: Failed to allocate 0x%lx-0x%lx " 110 printk(KERN_ERR "PCI: Failed to allocate 0x%lx-0x%lx "
108 "from %s for %s\n", (unsigned long) res->start, 111 "from %s for %s\n", (unsigned long) res->start,
@@ -115,23 +118,6 @@ setup_resource(struct acpi_resource *acpi_res, void *data)
115} 118}
116 119
117static void 120static void
118adjust_transparent_bridge_resources(struct pci_bus *bus)
119{
120 struct pci_dev *dev;
121
122 list_for_each_entry(dev, &bus->devices, bus_list) {
123 int i;
124 u16 class = dev->class >> 8;
125
126 if (class == PCI_CLASS_BRIDGE_PCI && dev->transparent) {
127 for(i = 3; i < PCI_BUS_NUM_RESOURCES; i++)
128 dev->subordinate->resource[i] =
129 dev->bus->resource[i - 3];
130 }
131 }
132}
133
134static void
135get_current_resources(struct acpi_device *device, int busnum, 121get_current_resources(struct acpi_device *device, int busnum,
136 int domain, struct pci_bus *bus) 122 int domain, struct pci_bus *bus)
137{ 123{
@@ -158,8 +144,6 @@ get_current_resources(struct acpi_device *device, int busnum,
158 info.res_num = 0; 144 info.res_num = 0;
159 acpi_walk_resources(device->handle, METHOD_NAME__CRS, setup_resource, 145 acpi_walk_resources(device->handle, METHOD_NAME__CRS, setup_resource,
160 &info); 146 &info);
161 if (info.res_num)
162 adjust_transparent_bridge_resources(bus);
163 147
164 return; 148 return;
165 149
@@ -222,8 +206,15 @@ struct pci_bus * __devinit pci_acpi_scan_root(struct acpi_device *device, int do
222 */ 206 */
223 memcpy(bus->sysdata, sd, sizeof(*sd)); 207 memcpy(bus->sysdata, sd, sizeof(*sd));
224 kfree(sd); 208 kfree(sd);
225 } else 209 } else {
226 bus = pci_scan_bus_parented(NULL, busnum, &pci_root_ops, sd); 210 bus = pci_create_bus(NULL, busnum, &pci_root_ops, sd);
211 if (bus) {
212 if (pci_probe & PCI_USE__CRS)
213 get_current_resources(device, busnum, domain,
214 bus);
215 bus->subordinate = pci_scan_child_bus(bus);
216 }
217 }
227 218
228 if (!bus) 219 if (!bus)
229 kfree(sd); 220 kfree(sd);
@@ -238,8 +229,6 @@ struct pci_bus * __devinit pci_acpi_scan_root(struct acpi_device *device, int do
238#endif 229#endif
239 } 230 }
240 231
241 if (bus && (pci_probe & PCI_USE__CRS))
242 get_current_resources(device, busnum, domain, bus);
243 return bus; 232 return bus;
244} 233}
245 234
diff --git a/arch/x86/pci/amd_bus.c b/arch/x86/pci/amd_bus.c
index f893d6a6e803..3ffa10df20b9 100644
--- a/arch/x86/pci/amd_bus.c
+++ b/arch/x86/pci/amd_bus.c
@@ -100,8 +100,9 @@ void x86_pci_root_bus_res_quirks(struct pci_bus *b)
100 int j; 100 int j;
101 struct pci_root_info *info; 101 struct pci_root_info *info;
102 102
103 /* don't go for it if _CRS is used */ 103 /* don't go for it if _CRS is used already */
104 if (pci_probe & PCI_USE__CRS) 104 if (b->resource[0] != &ioport_resource ||
105 b->resource[1] != &iomem_resource)
105 return; 106 return;
106 107
107 /* if only one root bus, don't need to anything */ 108 /* if only one root bus, don't need to anything */
@@ -116,6 +117,9 @@ void x86_pci_root_bus_res_quirks(struct pci_bus *b)
116 if (i == pci_root_num) 117 if (i == pci_root_num)
117 return; 118 return;
118 119
120 printk(KERN_DEBUG "PCI: peer root bus %02x res updated from pci conf\n",
121 b->number);
122
119 info = &pci_root_info[i]; 123 info = &pci_root_info[i];
120 for (j = 0; j < info->res_num; j++) { 124 for (j = 0; j < info->res_num; j++) {
121 struct resource *res; 125 struct resource *res;
diff --git a/arch/x86/pci/i386.c b/arch/x86/pci/i386.c
index 0fb56db16d18..52e62e57fedd 100644
--- a/arch/x86/pci/i386.c
+++ b/arch/x86/pci/i386.c
@@ -35,6 +35,7 @@
35#include <asm/pat.h> 35#include <asm/pat.h>
36#include <asm/e820.h> 36#include <asm/e820.h>
37#include <asm/pci_x86.h> 37#include <asm/pci_x86.h>
38#include <asm/io_apic.h>
38 39
39 40
40static int 41static int
@@ -227,6 +228,12 @@ void __init pcibios_resource_survey(void)
227 pcibios_allocate_resources(1); 228 pcibios_allocate_resources(1);
228 229
229 e820_reserve_resources_late(); 230 e820_reserve_resources_late();
231 /*
232 * Insert the IO APIC resources after PCI initialization has
233 * occured to handle IO APICS that are mapped in on a BAR in
234 * PCI space, but before trying to assign unassigned pci res.
235 */
236 ioapic_insert_resources();
230} 237}
231 238
232/** 239/**
diff --git a/arch/x86/power/Makefile b/arch/x86/power/Makefile
index de2abbd07544..a6a198c33623 100644
--- a/arch/x86/power/Makefile
+++ b/arch/x86/power/Makefile
@@ -1,7 +1,7 @@
1# __restore_processor_state() restores %gs after S3 resume and so should not 1# __restore_processor_state() restores %gs after S3 resume and so should not
2# itself be stack-protected 2# itself be stack-protected
3nostackp := $(call cc-option, -fno-stack-protector) 3nostackp := $(call cc-option, -fno-stack-protector)
4CFLAGS_cpu_$(BITS).o := $(nostackp) 4CFLAGS_cpu.o := $(nostackp)
5 5
6obj-$(CONFIG_PM_SLEEP) += cpu.o 6obj-$(CONFIG_PM_SLEEP) += cpu.o
7obj-$(CONFIG_HIBERNATION) += hibernate_$(BITS).o hibernate_asm_$(BITS).o 7obj-$(CONFIG_HIBERNATION) += hibernate_$(BITS).o hibernate_asm_$(BITS).o
diff --git a/arch/x86/power/cpu.c b/arch/x86/power/cpu.c
index d277ef1eea51..b3d20b9cac63 100644
--- a/arch/x86/power/cpu.c
+++ b/arch/x86/power/cpu.c
@@ -244,7 +244,7 @@ static void __restore_processor_state(struct saved_context *ctxt)
244 do_fpu_end(); 244 do_fpu_end();
245 mtrr_ap_init(); 245 mtrr_ap_init();
246 246
247#ifdef CONFIG_X86_32 247#ifdef CONFIG_X86_OLD_MCE
248 mcheck_init(&boot_cpu_data); 248 mcheck_init(&boot_cpu_data);
249#endif 249#endif
250} 250}
diff --git a/arch/xtensa/include/asm/thread_info.h b/arch/xtensa/include/asm/thread_info.h
index 0f4fe1faf9ba..13165641cc51 100644
--- a/arch/xtensa/include/asm/thread_info.h
+++ b/arch/xtensa/include/asm/thread_info.h
@@ -80,8 +80,6 @@ struct thread_info {
80 80
81/* 81/*
82 * macros/functions for gaining access to the thread information structure 82 * macros/functions for gaining access to the thread information structure
83 *
84 * preempt_count needs to be 1 initially, until the scheduler is functional.
85 */ 83 */
86 84
87#ifndef __ASSEMBLY__ 85#ifndef __ASSEMBLY__
@@ -92,7 +90,7 @@ struct thread_info {
92 .exec_domain = &default_exec_domain, \ 90 .exec_domain = &default_exec_domain, \
93 .flags = 0, \ 91 .flags = 0, \
94 .cpu = 0, \ 92 .cpu = 0, \
95 .preempt_count = 1, \ 93 .preempt_count = INIT_PREEMPT_COUNT, \
96 .addr_limit = KERNEL_DS, \ 94 .addr_limit = KERNEL_DS, \
97 .restart_block = { \ 95 .restart_block = { \
98 .fn = do_no_restart_syscall, \ 96 .fn = do_no_restart_syscall, \
diff --git a/arch/xtensa/kernel/traps.c b/arch/xtensa/kernel/traps.c
index ba9ab9349782..e64efac3b9db 100644
--- a/arch/xtensa/kernel/traps.c
+++ b/arch/xtensa/kernel/traps.c
@@ -354,10 +354,10 @@ void show_regs(struct pt_regs * regs)
354 354
355 for (i = 0; i < 16; i++) { 355 for (i = 0; i < 16; i++) {
356 if ((i % 8) == 0) 356 if ((i % 8) == 0)
357 printk ("\n" KERN_INFO "a%02d: ", i); 357 printk(KERN_INFO "a%02d:", i);
358 printk("%08lx ", regs->areg[i]); 358 printk(KERN_CONT " %08lx", regs->areg[i]);
359 } 359 }
360 printk("\n"); 360 printk(KERN_CONT "\n");
361 361
362 printk("pc: %08lx, ps: %08lx, depc: %08lx, excvaddr: %08lx\n", 362 printk("pc: %08lx, ps: %08lx, depc: %08lx, excvaddr: %08lx\n",
363 regs->pc, regs->ps, regs->depc, regs->excvaddr); 363 regs->pc, regs->ps, regs->depc, regs->excvaddr);