aboutsummaryrefslogtreecommitdiffstats
path: root/arch
diff options
context:
space:
mode:
authorRussell King <rmk+kernel@arm.linux.org.uk>2009-09-22 15:54:53 -0400
committerRussell King <rmk+kernel@arm.linux.org.uk>2009-09-22 16:01:40 -0400
commitae19ffbadc1b2100285a5b5b3d0a4e0a11390904 (patch)
tree3c2086ab67398a019089a47ca3f362a4bc6db74f /arch
parent34e84f39a27d059a3e6ec6e8b94aafa702e6f220 (diff)
parent9173a8ef24a6b1b8031507b35b8ffe5f85a87692 (diff)
Merge branch 'master' into for-linus
Diffstat (limited to 'arch')
-rw-r--r--arch/Kconfig1
-rw-r--r--arch/alpha/include/asm/agp.h4
-rw-r--r--arch/alpha/include/asm/pci.h1
-rw-r--r--arch/alpha/include/asm/percpu.h100
-rw-r--r--arch/alpha/include/asm/tlbflush.h1
-rw-r--r--arch/alpha/kernel/vmlinux.lds.S9
-rw-r--r--arch/arm/boot/compressed/head-sa1100.S2
-rw-r--r--arch/arm/common/vic.c1
-rw-r--r--arch/arm/include/asm/atomic.h26
-rw-r--r--arch/arm/include/asm/cache.h2
-rw-r--r--arch/arm/include/asm/pci.h2
-rw-r--r--arch/arm/include/asm/unified.h4
-rw-r--r--arch/arm/kernel/entry-armv.S19
-rw-r--r--arch/arm/kernel/entry-header.S14
-rw-r--r--arch/arm/kernel/kprobes.c19
-rw-r--r--arch/arm/kernel/vmlinux.lds.S1
-rw-r--r--arch/arm/lib/copy_page.S16
-rw-r--r--arch/arm/lib/lib1funcs.S2
-rw-r--r--arch/arm/lib/sha1.S2
-rw-r--r--arch/arm/mach-at91/at91cap9_devices.c10
-rw-r--r--arch/arm/mach-at91/board-cap9adk.c2
-rw-r--r--arch/arm/mach-at91/board-neocore926.c2
-rw-r--r--arch/arm/mach-pxa/spitz.c1
-rw-r--r--arch/arm/mach-s3c2410/Kconfig5
-rw-r--r--arch/arm/mach-s3c2412/Kconfig3
-rw-r--r--arch/arm/mach-s3c2440/Kconfig6
-rw-r--r--arch/arm/mach-s3c6400/Kconfig1
-rw-r--r--arch/arm/mach-s3c6410/Kconfig1
-rw-r--r--arch/arm/mach-sa1100/dma.c2
-rw-r--r--arch/arm/mach-sa1100/include/mach/assabet.h2
-rw-r--r--arch/arm/mach-sa1100/include/mach/hardware.h2
-rw-r--r--arch/arm/mach-sa1100/include/mach/memory.h2
-rw-r--r--arch/arm/mach-sa1100/include/mach/neponset.h2
-rw-r--r--arch/arm/mach-sa1100/include/mach/system.h2
-rw-r--r--arch/arm/mach-sa1100/include/mach/uncompress.h2
-rw-r--r--arch/arm/mach-sa1100/pm.c2
-rw-r--r--arch/arm/mach-sa1100/time.c2
-rw-r--r--arch/arm/mm/Kconfig5
-rw-r--r--arch/arm/mm/fault.c110
-rw-r--r--arch/arm/mm/proc-xscale.S2
-rw-r--r--arch/arm/plat-iop/setup.c2
-rw-r--r--arch/arm/plat-omap/include/mach/system.h2
-rw-r--r--arch/arm/plat-s3c/gpio.c2
-rw-r--r--arch/arm/plat-s3c64xx/dma.c6
-rw-r--r--arch/arm/plat-s3c64xx/include/plat/dma-plat.h2
-rw-r--r--arch/arm/plat-s3c64xx/include/plat/irqs.h10
-rw-r--r--arch/arm/plat-s3c64xx/s3c6400-clock.c8
-rw-r--r--arch/arm/plat-stmp3xxx/dma.c2
-rw-r--r--arch/arm/tools/mach-types20
-rw-r--r--arch/avr32/kernel/vmlinux.lds.S9
-rw-r--r--arch/blackfin/Kconfig25
-rw-r--r--arch/blackfin/Kconfig.debug6
-rw-r--r--arch/blackfin/configs/BF518F-EZBRD_defconfig4
-rw-r--r--arch/blackfin/configs/BF526-EZBRD_defconfig4
-rw-r--r--arch/blackfin/configs/BF527-EZKIT_defconfig4
-rw-r--r--arch/blackfin/configs/BF548-EZKIT_defconfig2
-rw-r--r--arch/blackfin/include/asm/bfin-global.h6
-rw-r--r--arch/blackfin/include/asm/bfin5xx_spi.h1
-rw-r--r--arch/blackfin/include/asm/cplb.h46
-rw-r--r--arch/blackfin/include/asm/early_printk.h24
-rw-r--r--arch/blackfin/include/asm/elf.h2
-rw-r--r--arch/blackfin/include/asm/entry.h30
-rw-r--r--arch/blackfin/include/asm/ftrace.h2
-rw-r--r--arch/blackfin/include/asm/ipipe.h7
-rw-r--r--arch/blackfin/include/asm/irq_handler.h1
-rw-r--r--arch/blackfin/include/asm/mmu_context.h6
-rw-r--r--arch/blackfin/include/asm/pda.h7
-rw-r--r--arch/blackfin/kernel/Makefile1
-rw-r--r--arch/blackfin/kernel/asm-offsets.c7
-rw-r--r--arch/blackfin/kernel/bfin_dma_5xx.c14
-rw-r--r--arch/blackfin/kernel/bfin_gpio.c1
-rw-r--r--arch/blackfin/kernel/cplb-mpu/Makefile2
-rw-r--r--arch/blackfin/kernel/cplb-mpu/cacheinit.c69
-rw-r--r--arch/blackfin/kernel/cplb-mpu/cplbmgr.c63
-rw-r--r--arch/blackfin/kernel/cplb-nompu/Makefile2
-rw-r--r--arch/blackfin/kernel/cplb-nompu/cacheinit.c69
-rw-r--r--arch/blackfin/kernel/cplb-nompu/cplbinit.c11
-rw-r--r--arch/blackfin/kernel/cplb-nompu/cplbmgr.c35
-rw-r--r--arch/blackfin/kernel/early_printk.c74
-rw-r--r--arch/blackfin/kernel/entry.S24
-rw-r--r--arch/blackfin/kernel/ftrace-entry.S23
-rw-r--r--arch/blackfin/kernel/ftrace.c2
-rw-r--r--arch/blackfin/kernel/ipipe.c83
-rw-r--r--arch/blackfin/kernel/kgdb_test.c2
-rw-r--r--arch/blackfin/kernel/module.c266
-rw-r--r--arch/blackfin/kernel/process.c10
-rw-r--r--arch/blackfin/kernel/ptrace.c155
-rw-r--r--arch/blackfin/kernel/setup.c120
-rw-r--r--arch/blackfin/kernel/shadow_console.c113
-rw-r--r--arch/blackfin/kernel/time-ts.c4
-rw-r--r--arch/blackfin/kernel/traps.c88
-rw-r--r--arch/blackfin/kernel/vmlinux.lds.S9
-rw-r--r--arch/blackfin/lib/ins.S4
-rw-r--r--arch/blackfin/mach-bf518/boards/ezbrd.c29
-rw-r--r--arch/blackfin/mach-bf518/include/mach/anomaly.h1
-rw-r--r--arch/blackfin/mach-bf518/include/mach/blackfin.h10
-rw-r--r--arch/blackfin/mach-bf527/boards/cm_bf527.c164
-rw-r--r--arch/blackfin/mach-bf527/boards/ezbrd.c29
-rw-r--r--arch/blackfin/mach-bf527/boards/ezkit.c58
-rw-r--r--arch/blackfin/mach-bf527/include/mach/anomaly.h13
-rw-r--r--arch/blackfin/mach-bf527/include/mach/blackfin.h10
-rw-r--r--arch/blackfin/mach-bf533/boards/H8606.c39
-rw-r--r--arch/blackfin/mach-bf533/boards/blackstamp.c11
-rw-r--r--arch/blackfin/mach-bf533/boards/cm_bf533.c127
-rw-r--r--arch/blackfin/mach-bf533/boards/ezkit.c13
-rw-r--r--arch/blackfin/mach-bf533/boards/stamp.c83
-rw-r--r--arch/blackfin/mach-bf533/dma.c8
-rw-r--r--arch/blackfin/mach-bf533/include/mach/bfin_serial_5xx.h8
-rw-r--r--arch/blackfin/mach-bf533/include/mach/blackfin.h7
-rw-r--r--arch/blackfin/mach-bf537/boards/Kconfig12
-rw-r--r--arch/blackfin/mach-bf537/boards/Makefile3
-rw-r--r--arch/blackfin/mach-bf537/boards/cm_bf537e.c727
-rw-r--r--arch/blackfin/mach-bf537/boards/cm_bf537u.c (renamed from arch/blackfin/mach-bf537/boards/cm_bf537.c)47
-rw-r--r--arch/blackfin/mach-bf537/boards/pnav10.c29
-rw-r--r--arch/blackfin/mach-bf537/boards/stamp.c249
-rw-r--r--arch/blackfin/mach-bf537/boards/tcm_bf537.c43
-rw-r--r--arch/blackfin/mach-bf537/dma.c8
-rw-r--r--arch/blackfin/mach-bf537/include/mach/anomaly.h2
-rw-r--r--arch/blackfin/mach-bf537/include/mach/blackfin.h90
-rw-r--r--arch/blackfin/mach-bf538/boards/ezkit.c65
-rw-r--r--arch/blackfin/mach-bf538/include/mach/anomaly.h2
-rw-r--r--arch/blackfin/mach-bf538/include/mach/blackfin.h10
-rw-r--r--arch/blackfin/mach-bf538/include/mach/cdefBF538.h1
-rw-r--r--arch/blackfin/mach-bf548/boards/cm_bf548.c19
-rw-r--r--arch/blackfin/mach-bf548/boards/ezkit.c12
-rw-r--r--arch/blackfin/mach-bf548/dma.c8
-rw-r--r--arch/blackfin/mach-bf548/include/mach/anomaly.h21
-rw-r--r--arch/blackfin/mach-bf548/include/mach/blackfin.h89
-rw-r--r--arch/blackfin/mach-bf561/boards/cm_bf561.c141
-rw-r--r--arch/blackfin/mach-bf561/boards/ezkit.c13
-rw-r--r--arch/blackfin/mach-bf561/include/mach/anomaly.h2
-rw-r--r--arch/blackfin/mach-bf561/secondary.S28
-rw-r--r--arch/blackfin/mach-common/Makefile1
-rw-r--r--arch/blackfin/mach-common/cache-c.c44
-rw-r--r--arch/blackfin/mach-common/entry.S191
-rw-r--r--arch/blackfin/mach-common/head.S19
-rw-r--r--arch/blackfin/mach-common/interrupt.S78
-rw-r--r--arch/blackfin/mach-common/ints-priority.c19
-rw-r--r--arch/blackfin/mach-common/lock.S223
-rw-r--r--arch/blackfin/mach-common/pm.c64
-rw-r--r--arch/blackfin/mm/init.c3
-rw-r--r--arch/blackfin/mm/isram-driver.c222
-rw-r--r--arch/blackfin/mm/sram-alloc.c30
-rw-r--r--arch/cris/include/asm/mmu_context.h3
-rw-r--r--arch/cris/kernel/vmlinux.lds.S9
-rw-r--r--arch/cris/mm/fault.c2
-rw-r--r--arch/frv/kernel/vmlinux.lds.S2
-rw-r--r--arch/frv/mb93090-mb00/pci-frv.c10
-rw-r--r--arch/h8300/include/asm/pci.h1
-rw-r--r--arch/h8300/kernel/vmlinux.lds.S5
-rw-r--r--arch/ia64/Kconfig7
-rw-r--r--arch/ia64/include/asm/agp.h4
-rw-r--r--arch/ia64/include/asm/pci.h14
-rw-r--r--arch/ia64/include/asm/topology.h17
-rw-r--r--arch/ia64/kernel/head.S1
-rw-r--r--arch/ia64/kernel/head.h1
-rw-r--r--arch/ia64/kernel/setup.c6
-rw-r--r--arch/ia64/kernel/smp.c3
-rw-r--r--arch/ia64/kernel/vmlinux.lds.S16
-rw-r--r--arch/ia64/sn/kernel/setup.c2
-rw-r--r--arch/m32r/kernel/vmlinux.lds.S10
-rw-r--r--arch/m68k/include/asm/checksum.h173
-rw-r--r--arch/m68k/include/asm/checksum_mm.h148
-rw-r--r--arch/m68k/include/asm/checksum_no.h132
-rw-r--r--arch/m68k/include/asm/dma.h492
-rw-r--r--arch/m68k/include/asm/dma_mm.h16
-rw-r--r--arch/m68k/include/asm/dma_no.h494
-rw-r--r--arch/m68k/include/asm/elia.h41
-rw-r--r--arch/m68k/include/asm/gpio.h238
-rw-r--r--arch/m68k/include/asm/hardirq_no.h10
-rw-r--r--arch/m68k/include/asm/io_no.h2
-rw-r--r--arch/m68k/include/asm/irq.h135
-rw-r--r--arch/m68k/include/asm/irq_mm.h126
-rw-r--r--arch/m68k/include/asm/irq_no.h26
-rw-r--r--arch/m68k/include/asm/m5206sim.h33
-rw-r--r--arch/m68k/include/asm/m520xsim.h77
-rw-r--r--arch/m68k/include/asm/m523xsim.h77
-rw-r--r--arch/m68k/include/asm/m5249sim.h54
-rw-r--r--arch/m68k/include/asm/m5272sim.h62
-rw-r--r--arch/m68k/include/asm/m527xsim.h169
-rw-r--r--arch/m68k/include/asm/m528xsim.h151
-rw-r--r--arch/m68k/include/asm/m5307sim.h32
-rw-r--r--arch/m68k/include/asm/m532xsim.h198
-rw-r--r--arch/m68k/include/asm/m5407sim.h28
-rw-r--r--arch/m68k/include/asm/mcfgpio.h40
-rw-r--r--arch/m68k/include/asm/mcfintc.h89
-rw-r--r--arch/m68k/include/asm/mcfne.h83
-rw-r--r--arch/m68k/include/asm/mcfsim.h95
-rw-r--r--arch/m68k/include/asm/mcfsmc.h6
-rw-r--r--arch/m68k/include/asm/nettel.h4
-rw-r--r--arch/m68k/include/asm/page_no.h4
-rw-r--r--arch/m68k/include/asm/pinmux.h30
-rw-r--r--arch/m68k/include/asm/processor.h171
-rw-r--r--arch/m68k/include/asm/processor_mm.h130
-rw-r--r--arch/m68k/include/asm/processor_no.h143
-rw-r--r--arch/m68k/include/asm/timex.h17
-rw-r--r--arch/m68k/kernel/vmlinux-std.lds10
-rw-r--r--arch/m68k/kernel/vmlinux-sun3.lds9
-rw-r--r--arch/m68knommu/Kconfig6
-rw-r--r--arch/m68knommu/kernel/irq.c26
-rw-r--r--arch/m68knommu/kernel/time.c2
-rw-r--r--arch/m68knommu/kernel/vmlinux.lds.S7
-rw-r--r--arch/m68knommu/lib/checksum.c11
-rw-r--r--arch/m68knommu/platform/5206/Makefile2
-rw-r--r--arch/m68knommu/platform/5206/config.c56
-rw-r--r--arch/m68knommu/platform/5206/gpio.c49
-rw-r--r--arch/m68knommu/platform/5206e/Makefile2
-rw-r--r--arch/m68knommu/platform/5206e/config.c58
-rw-r--r--arch/m68knommu/platform/5206e/gpio.c49
-rw-r--r--arch/m68knommu/platform/520x/Makefile2
-rw-r--r--arch/m68knommu/platform/520x/config.c30
-rw-r--r--arch/m68knommu/platform/520x/gpio.c211
-rw-r--r--arch/m68knommu/platform/523x/Makefile2
-rw-r--r--arch/m68knommu/platform/523x/config.c66
-rw-r--r--arch/m68knommu/platform/523x/gpio.c283
-rw-r--r--arch/m68knommu/platform/5249/Makefile2
-rw-r--r--arch/m68knommu/platform/5249/config.c49
-rw-r--r--arch/m68knommu/platform/5249/gpio.c65
-rw-r--r--arch/m68knommu/platform/5249/intc2.c59
-rw-r--r--arch/m68knommu/platform/5272/Makefile2
-rw-r--r--arch/m68knommu/platform/5272/config.c78
-rw-r--r--arch/m68knommu/platform/5272/gpio.c81
-rw-r--r--arch/m68knommu/platform/5272/intc.c138
-rw-r--r--arch/m68knommu/platform/527x/Makefile2
-rw-r--r--arch/m68knommu/platform/527x/config.c49
-rw-r--r--arch/m68knommu/platform/527x/gpio.c607
-rw-r--r--arch/m68knommu/platform/528x/Makefile2
-rw-r--r--arch/m68knommu/platform/528x/config.c51
-rw-r--r--arch/m68knommu/platform/528x/gpio.c438
-rw-r--r--arch/m68knommu/platform/5307/Makefile2
-rw-r--r--arch/m68knommu/platform/5307/config.c65
-rw-r--r--arch/m68knommu/platform/5307/gpio.c49
-rw-r--r--arch/m68knommu/platform/532x/Makefile2
-rw-r--r--arch/m68knommu/platform/532x/config.c53
-rw-r--r--arch/m68knommu/platform/532x/gpio.c337
-rw-r--r--arch/m68knommu/platform/5407/Makefile2
-rw-r--r--arch/m68knommu/platform/5407/config.c68
-rw-r--r--arch/m68knommu/platform/5407/gpio.c49
-rw-r--r--arch/m68knommu/platform/68328/ints.c72
-rw-r--r--arch/m68knommu/platform/68360/ints.c44
-rw-r--r--arch/m68knommu/platform/coldfire/Makefile21
-rw-r--r--arch/m68knommu/platform/coldfire/gpio.c127
-rw-r--r--arch/m68knommu/platform/coldfire/intc-2.c93
-rw-r--r--arch/m68knommu/platform/coldfire/intc-simr.c78
-rw-r--r--arch/m68knommu/platform/coldfire/intc.c153
-rw-r--r--arch/m68knommu/platform/coldfire/pinmux.c28
-rw-r--r--arch/m68knommu/platform/coldfire/pit.c8
-rw-r--r--arch/m68knommu/platform/coldfire/timers.c18
-rw-r--r--arch/m68knommu/platform/coldfire/vectors.c20
-rw-r--r--arch/microblaze/kernel/vmlinux.lds.S6
-rw-r--r--arch/mips/Kconfig88
-rw-r--r--arch/mips/Makefile22
-rw-r--r--arch/mips/alchemy/common/setup.c4
-rw-r--r--arch/mips/alchemy/common/time.c15
-rw-r--r--arch/mips/ar7/platform.c32
-rw-r--r--arch/mips/bcm63xx/Kconfig25
-rw-r--r--arch/mips/bcm63xx/Makefile7
-rw-r--r--arch/mips/bcm63xx/boards/Kconfig11
-rw-r--r--arch/mips/bcm63xx/boards/Makefile3
-rw-r--r--arch/mips/bcm63xx/boards/board_bcm963xx.c837
-rw-r--r--arch/mips/bcm63xx/clk.c226
-rw-r--r--arch/mips/bcm63xx/cpu.c345
-rw-r--r--arch/mips/bcm63xx/cs.c144
-rw-r--r--arch/mips/bcm63xx/dev-dsp.c56
-rw-r--r--arch/mips/bcm63xx/dev-enet.c159
-rw-r--r--arch/mips/bcm63xx/early_printk.c30
-rw-r--r--arch/mips/bcm63xx/gpio.c134
-rw-r--r--arch/mips/bcm63xx/irq.c253
-rw-r--r--arch/mips/bcm63xx/prom.c55
-rw-r--r--arch/mips/bcm63xx/setup.c125
-rw-r--r--arch/mips/bcm63xx/timer.c205
-rw-r--r--arch/mips/boot/elf2ecoff.c4
-rw-r--r--arch/mips/cavium-octeon/Makefile4
-rw-r--r--arch/mips/cavium-octeon/octeon-platform.c164
-rw-r--r--arch/mips/cavium-octeon/setup.c103
-rw-r--r--arch/mips/configs/ar7_defconfig1
-rw-r--r--arch/mips/configs/bcm47xx_defconfig1
-rw-r--r--arch/mips/configs/bcm63xx_defconfig972
-rw-r--r--arch/mips/configs/bigsur_defconfig1
-rw-r--r--arch/mips/configs/cobalt_defconfig1
-rw-r--r--arch/mips/configs/db1000_defconfig1
-rw-r--r--arch/mips/configs/db1100_defconfig1
-rw-r--r--arch/mips/configs/db1200_defconfig1
-rw-r--r--arch/mips/configs/db1500_defconfig1
-rw-r--r--arch/mips/configs/db1550_defconfig1
-rw-r--r--arch/mips/configs/excite_defconfig1
-rw-r--r--arch/mips/configs/fuloong2e_defconfig (renamed from arch/mips/configs/fulong_defconfig)473
-rw-r--r--arch/mips/configs/ip22_defconfig1
-rw-r--r--arch/mips/configs/ip27_defconfig1
-rw-r--r--arch/mips/configs/ip28_defconfig1
-rw-r--r--arch/mips/configs/ip32_defconfig1
-rw-r--r--arch/mips/configs/jazz_defconfig1
-rw-r--r--arch/mips/configs/lasat_defconfig1
-rw-r--r--arch/mips/configs/malta_defconfig1
-rw-r--r--arch/mips/configs/markeins_defconfig1
-rw-r--r--arch/mips/configs/mipssim_defconfig1
-rw-r--r--arch/mips/configs/msp71xx_defconfig1
-rw-r--r--arch/mips/configs/mtx1_defconfig1
-rw-r--r--arch/mips/configs/pb1100_defconfig1
-rw-r--r--arch/mips/configs/pb1500_defconfig1
-rw-r--r--arch/mips/configs/pb1550_defconfig1
-rw-r--r--arch/mips/configs/pnx8335-stb225_defconfig1
-rw-r--r--arch/mips/configs/pnx8550-jbs_defconfig1
-rw-r--r--arch/mips/configs/pnx8550-stb810_defconfig1
-rw-r--r--arch/mips/configs/rb532_defconfig1
-rw-r--r--arch/mips/configs/rbtx49xx_defconfig1
-rw-r--r--arch/mips/configs/rm200_defconfig1
-rw-r--r--arch/mips/configs/sb1250-swarm_defconfig1
-rw-r--r--arch/mips/configs/wrppmc_defconfig1
-rw-r--r--arch/mips/configs/yosemite_defconfig1
-rw-r--r--arch/mips/dec/prom/memory.c2
-rw-r--r--arch/mips/emma/markeins/setup.c2
-rw-r--r--arch/mips/fw/arc/Makefile2
-rw-r--r--arch/mips/fw/cfe/cfe_api.c4
-rw-r--r--arch/mips/include/asm/atomic.h40
-rw-r--r--arch/mips/include/asm/bitops.h34
-rw-r--r--arch/mips/include/asm/bootinfo.h12
-rw-r--r--arch/mips/include/asm/cmpxchg.h4
-rw-r--r--arch/mips/include/asm/cpu-features.h3
-rw-r--r--arch/mips/include/asm/cpu.h7
-rw-r--r--arch/mips/include/asm/delay.h2
-rw-r--r--arch/mips/include/asm/fixmap.h4
-rw-r--r--arch/mips/include/asm/hardirq.h12
-rw-r--r--arch/mips/include/asm/lasat/lasat.h1
-rw-r--r--arch/mips/include/asm/local.h8
-rw-r--r--arch/mips/include/asm/mach-au1x00/gpio-au1000.h9
-rw-r--r--arch/mips/include/asm/mach-bcm63xx/bcm63xx_board.h12
-rw-r--r--arch/mips/include/asm/mach-bcm63xx/bcm63xx_clk.h11
-rw-r--r--arch/mips/include/asm/mach-bcm63xx/bcm63xx_cpu.h538
-rw-r--r--arch/mips/include/asm/mach-bcm63xx/bcm63xx_cs.h10
-rw-r--r--arch/mips/include/asm/mach-bcm63xx/bcm63xx_dev_dsp.h13
-rw-r--r--arch/mips/include/asm/mach-bcm63xx/bcm63xx_dev_enet.h45
-rw-r--r--arch/mips/include/asm/mach-bcm63xx/bcm63xx_dev_pci.h6
-rw-r--r--arch/mips/include/asm/mach-bcm63xx/bcm63xx_gpio.h22
-rw-r--r--arch/mips/include/asm/mach-bcm63xx/bcm63xx_io.h93
-rw-r--r--arch/mips/include/asm/mach-bcm63xx/bcm63xx_irq.h15
-rw-r--r--arch/mips/include/asm/mach-bcm63xx/bcm63xx_regs.h773
-rw-r--r--arch/mips/include/asm/mach-bcm63xx/bcm63xx_timer.h11
-rw-r--r--arch/mips/include/asm/mach-bcm63xx/board_bcm963xx.h60
-rw-r--r--arch/mips/include/asm/mach-bcm63xx/cpu-feature-overrides.h51
-rw-r--r--arch/mips/include/asm/mach-bcm63xx/gpio.h15
-rw-r--r--arch/mips/include/asm/mach-bcm63xx/war.h25
-rw-r--r--arch/mips/include/asm/mach-cavium-octeon/cpu-feature-overrides.h12
-rw-r--r--arch/mips/include/asm/mach-ip27/topology.h1
-rw-r--r--arch/mips/include/asm/mach-loongson/cpu-feature-overrides.h (renamed from arch/mips/include/asm/mach-lemote/cpu-feature-overrides.h)6
-rw-r--r--arch/mips/include/asm/mach-loongson/dma-coherence.h (renamed from arch/mips/include/asm/mach-lemote/dma-coherence.h)6
-rw-r--r--arch/mips/include/asm/mach-loongson/loongson.h64
-rw-r--r--arch/mips/include/asm/mach-loongson/machine.h22
-rw-r--r--arch/mips/include/asm/mach-loongson/mc146818rtc.h (renamed from arch/mips/include/asm/mach-lemote/mc146818rtc.h)6
-rw-r--r--arch/mips/include/asm/mach-loongson/mem.h30
-rw-r--r--arch/mips/include/asm/mach-loongson/pci.h (renamed from arch/mips/include/asm/mach-lemote/pci.h)21
-rw-r--r--arch/mips/include/asm/mach-loongson/war.h (renamed from arch/mips/include/asm/mach-lemote/war.h)6
-rw-r--r--arch/mips/include/asm/mach-malta/cpu-feature-overrides.h4
-rw-r--r--arch/mips/include/asm/mips-boards/bonito64.h2
-rw-r--r--arch/mips/include/asm/mips-boards/generic.h2
-rw-r--r--arch/mips/include/asm/octeon/cvmx-rnm-defs.h88
-rw-r--r--arch/mips/include/asm/octeon/cvmx.h2
-rw-r--r--arch/mips/include/asm/page.h5
-rw-r--r--arch/mips/include/asm/pci.h2
-rw-r--r--arch/mips/include/asm/pgtable-64.h11
-rw-r--r--arch/mips/include/asm/system.h18
-rw-r--r--arch/mips/kernel/asm-offsets.c3
-rw-r--r--arch/mips/kernel/cpu-bugs64.c2
-rw-r--r--arch/mips/kernel/cpu-probe.c40
-rw-r--r--arch/mips/kernel/kspd.c6
-rw-r--r--arch/mips/kernel/mips-mt-fpaff.c2
-rw-r--r--arch/mips/kernel/mips-mt.c10
-rw-r--r--arch/mips/kernel/octeon_switch.S3
-rw-r--r--arch/mips/kernel/r2300_switch.S3
-rw-r--r--arch/mips/kernel/r4k_switch.S3
-rw-r--r--arch/mips/kernel/rtlx.c2
-rw-r--r--arch/mips/kernel/scall32-o32.S72
-rw-r--r--arch/mips/kernel/scall64-64.S72
-rw-r--r--arch/mips/kernel/setup.c2
-rw-r--r--arch/mips/kernel/smp.c3
-rw-r--r--arch/mips/kernel/smtc.c10
-rw-r--r--arch/mips/kernel/syscall.c112
-rw-r--r--arch/mips/kernel/traps.c5
-rw-r--r--arch/mips/kernel/vmlinux.lds.S114
-rw-r--r--arch/mips/kernel/vpe.c2
-rw-r--r--arch/mips/lemote/lm2e/Makefile7
-rw-r--r--arch/mips/lemote/lm2e/dbg_io.c146
-rw-r--r--arch/mips/lemote/lm2e/irq.c143
-rw-r--r--arch/mips/lemote/lm2e/pci.c97
-rw-r--r--arch/mips/lemote/lm2e/prom.c97
-rw-r--r--arch/mips/lemote/lm2e/reset.c41
-rw-r--r--arch/mips/lemote/lm2e/setup.c111
-rw-r--r--arch/mips/loongson/Kconfig31
-rw-r--r--arch/mips/loongson/Makefile11
-rw-r--r--arch/mips/loongson/common/Makefile11
-rw-r--r--arch/mips/loongson/common/bonito-irq.c (renamed from arch/mips/lemote/lm2e/bonito-irq.c)27
-rw-r--r--arch/mips/loongson/common/cmdline.c52
-rw-r--r--arch/mips/loongson/common/early_printk.c38
-rw-r--r--arch/mips/loongson/common/env.c58
-rw-r--r--arch/mips/loongson/common/init.c30
-rw-r--r--arch/mips/loongson/common/irq.c74
-rw-r--r--arch/mips/loongson/common/machtype.c50
-rw-r--r--arch/mips/loongson/common/mem.c (renamed from arch/mips/lemote/lm2e/mem.c)22
-rw-r--r--arch/mips/loongson/common/pci.c83
-rw-r--r--arch/mips/loongson/common/reset.c44
-rw-r--r--arch/mips/loongson/common/setup.c58
-rw-r--r--arch/mips/loongson/common/time.c27
-rw-r--r--arch/mips/loongson/fuloong-2e/Makefile7
-rw-r--r--arch/mips/loongson/fuloong-2e/irq.c71
-rw-r--r--arch/mips/loongson/fuloong-2e/reset.c23
-rw-r--r--arch/mips/mipssim/sim_setup.c2
-rw-r--r--arch/mips/mm/fault.c12
-rw-r--r--arch/mips/mm/init.c3
-rw-r--r--arch/mips/mm/pgtable-64.c3
-rw-r--r--arch/mips/mm/tlb-r4k.c2
-rw-r--r--arch/mips/mm/tlbex.c53
-rw-r--r--arch/mips/mti-malta/malta-init.c2
-rw-r--r--arch/mips/mti-malta/malta-reset.c7
-rw-r--r--arch/mips/mti-malta/malta-setup.c1
-rw-r--r--arch/mips/nxp/pnx833x/stb22x/board.c2
-rw-r--r--arch/mips/nxp/pnx8550/common/proc.c6
-rw-r--r--arch/mips/oprofile/Makefile1
-rw-r--r--arch/mips/oprofile/common.c4
-rw-r--r--arch/mips/oprofile/op_model_loongson2.c177
-rw-r--r--arch/mips/pci/Makefile4
-rw-r--r--arch/mips/pci/fixup-bcm63xx.c21
-rw-r--r--arch/mips/pci/fixup-fuloong2e.c (renamed from arch/mips/pci/fixup-lm2e.c)18
-rw-r--r--arch/mips/pci/ops-bcm63xx.c467
-rw-r--r--arch/mips/pci/ops-bonito64.c4
-rw-r--r--arch/mips/pci/pci-bcm1480.c2
-rw-r--r--arch/mips/pci/pci-bcm1480ht.c2
-rw-r--r--arch/mips/pci/pci-bcm63xx.c224
-rw-r--r--arch/mips/pci/pci-bcm63xx.h27
-rw-r--r--arch/mips/pci/pci-sb1250.c2
-rw-r--r--arch/mips/pci/pci.c4
-rw-r--r--arch/mips/power/hibernate.S3
-rw-r--r--arch/mips/sgi-ip22/Makefile2
-rw-r--r--arch/mips/txx9/generic/pci.c13
-rw-r--r--arch/mips/txx9/generic/setup.c17
-rw-r--r--arch/mn10300/include/asm/pci.h13
-rw-r--r--arch/mn10300/kernel/vmlinux.lds.S8
-rw-r--r--arch/parisc/include/asm/agp.h4
-rw-r--r--arch/parisc/include/asm/pci.h1
-rw-r--r--arch/parisc/kernel/vmlinux.lds.S8
-rw-r--r--arch/powerpc/Kconfig32
-rw-r--r--arch/powerpc/Makefile2
-rw-r--r--arch/powerpc/boot/4xx.c142
-rw-r--r--arch/powerpc/boot/4xx.h1
-rw-r--r--arch/powerpc/boot/Makefile6
-rw-r--r--arch/powerpc/boot/cuboot-hotfoot.c142
-rw-r--r--arch/powerpc/boot/cuboot-kilauea.c49
-rw-r--r--arch/powerpc/boot/dcr.h4
-rw-r--r--arch/powerpc/boot/dts/arches.dts50
-rw-r--r--arch/powerpc/boot/dts/canyonlands.dts49
-rw-r--r--arch/powerpc/boot/dts/eiger.dts421
-rw-r--r--arch/powerpc/boot/dts/gef_sbc310.dts64
-rw-r--r--arch/powerpc/boot/dts/hotfoot.dts294
-rw-r--r--arch/powerpc/boot/dts/kilauea.dts44
-rw-r--r--arch/powerpc/boot/dts/mgcoge.dts53
-rw-r--r--arch/powerpc/boot/dts/mpc8272ads.dts8
-rw-r--r--arch/powerpc/boot/dts/mpc8377_rdb.dts2
-rw-r--r--arch/powerpc/boot/dts/mpc8377_wlan.dts464
-rw-r--r--arch/powerpc/boot/dts/mpc8378_rdb.dts2
-rw-r--r--arch/powerpc/boot/dts/mpc8379_rdb.dts2
-rw-r--r--arch/powerpc/boot/dts/mpc8536ds.dts40
-rw-r--r--arch/powerpc/boot/dts/mpc8536ds_36b.dts475
-rw-r--r--arch/powerpc/boot/dts/mpc8548cds.dts20
-rw-r--r--arch/powerpc/boot/dts/mpc8569mds.dts45
-rw-r--r--arch/powerpc/boot/dts/p2020rdb.dts586
-rw-r--r--arch/powerpc/boot/dts/sbc8349.dts60
-rw-r--r--arch/powerpc/boot/dts/sbc8560.dts1
-rw-r--r--arch/powerpc/boot/mktree.c10
-rw-r--r--arch/powerpc/boot/ppcboot-hotfoot.h133
-rwxr-xr-xarch/powerpc/boot/wrapper3
-rw-r--r--arch/powerpc/configs/40x/kilauea_defconfig298
-rw-r--r--arch/powerpc/configs/44x/arches_defconfig382
-rw-r--r--arch/powerpc/configs/44x/canyonlands_defconfig350
-rw-r--r--arch/powerpc/configs/44x/eiger_defconfig1252
-rw-r--r--arch/powerpc/configs/83xx/sbc834x_defconfig320
-rw-r--r--arch/powerpc/configs/mgcoge_defconfig86
-rw-r--r--arch/powerpc/configs/mpc85xx_defconfig1
-rw-r--r--arch/powerpc/include/asm/agp.h4
-rw-r--r--arch/powerpc/include/asm/bitops.h196
-rw-r--r--arch/powerpc/include/asm/cell-regs.h11
-rw-r--r--arch/powerpc/include/asm/cputhreads.h16
-rw-r--r--arch/powerpc/include/asm/device.h7
-rw-r--r--arch/powerpc/include/asm/dma-mapping.h318
-rw-r--r--arch/powerpc/include/asm/exception-64e.h205
-rw-r--r--arch/powerpc/include/asm/exception-64s.h (renamed from arch/powerpc/include/asm/exception.h)25
-rw-r--r--arch/powerpc/include/asm/hardirq.h30
-rw-r--r--arch/powerpc/include/asm/hw_irq.h5
-rw-r--r--arch/powerpc/include/asm/iommu.h10
-rw-r--r--arch/powerpc/include/asm/irq.h7
-rw-r--r--arch/powerpc/include/asm/machdep.h6
-rw-r--r--arch/powerpc/include/asm/mmu-40x.h3
-rw-r--r--arch/powerpc/include/asm/mmu-44x.h6
-rw-r--r--arch/powerpc/include/asm/mmu-8xx.h3
-rw-r--r--arch/powerpc/include/asm/mmu-book3e.h208
-rw-r--r--arch/powerpc/include/asm/mmu-hash32.h16
-rw-r--r--arch/powerpc/include/asm/mmu-hash64.h22
-rw-r--r--arch/powerpc/include/asm/mmu.h46
-rw-r--r--arch/powerpc/include/asm/mmu_context.h15
-rw-r--r--arch/powerpc/include/asm/nvram.h3
-rw-r--r--arch/powerpc/include/asm/paca.h23
-rw-r--r--arch/powerpc/include/asm/page.h4
-rw-r--r--arch/powerpc/include/asm/page_64.h10
-rw-r--r--arch/powerpc/include/asm/pci-bridge.h40
-rw-r--r--arch/powerpc/include/asm/pci.h12
-rw-r--r--arch/powerpc/include/asm/pgalloc.h46
-rw-r--r--arch/powerpc/include/asm/pgtable-ppc32.h9
-rw-r--r--arch/powerpc/include/asm/pgtable-ppc64-64k.h4
-rw-r--r--arch/powerpc/include/asm/pgtable-ppc64.h67
-rw-r--r--arch/powerpc/include/asm/pmc.h16
-rw-r--r--arch/powerpc/include/asm/ppc-opcode.h6
-rw-r--r--arch/powerpc/include/asm/ppc-pci.h1
-rw-r--r--arch/powerpc/include/asm/ppc_asm.h26
-rw-r--r--arch/powerpc/include/asm/pte-40x.h2
-rw-r--r--arch/powerpc/include/asm/pte-44x.h2
-rw-r--r--arch/powerpc/include/asm/pte-8xx.h1
-rw-r--r--arch/powerpc/include/asm/pte-book3e.h84
-rw-r--r--arch/powerpc/include/asm/pte-common.h25
-rw-r--r--arch/powerpc/include/asm/pte-fsl-booke.h9
-rw-r--r--arch/powerpc/include/asm/pte-hash32.h1
-rw-r--r--arch/powerpc/include/asm/reg.h141
-rw-r--r--arch/powerpc/include/asm/reg_booke.h50
-rw-r--r--arch/powerpc/include/asm/setup.h2
-rw-r--r--arch/powerpc/include/asm/smp.h10
-rw-r--r--arch/powerpc/include/asm/swiotlb.h8
-rw-r--r--arch/powerpc/include/asm/systbl.h4
-rw-r--r--arch/powerpc/include/asm/tlb.h38
-rw-r--r--arch/powerpc/include/asm/tlbflush.h11
-rw-r--r--arch/powerpc/include/asm/topology.h9
-rw-r--r--arch/powerpc/include/asm/vdso.h3
-rw-r--r--arch/powerpc/kernel/Makefile19
-rw-r--r--arch/powerpc/kernel/asm-offsets.c19
-rw-r--r--arch/powerpc/kernel/cpu_setup_6xx.S2
-rw-r--r--arch/powerpc/kernel/cputable.c62
-rw-r--r--arch/powerpc/kernel/dma-iommu.c2
-rw-r--r--arch/powerpc/kernel/dma-swiotlb.c53
-rw-r--r--arch/powerpc/kernel/dma.c13
-rw-r--r--arch/powerpc/kernel/entry_32.S20
-rw-r--r--arch/powerpc/kernel/entry_64.S102
-rw-r--r--arch/powerpc/kernel/exceptions-64e.S1001
-rw-r--r--arch/powerpc/kernel/exceptions-64s.S78
-rw-r--r--arch/powerpc/kernel/fpu.S2
-rw-r--r--arch/powerpc/kernel/head_32.S40
-rw-r--r--arch/powerpc/kernel/head_40x.S124
-rw-r--r--arch/powerpc/kernel/head_44x.S58
-rw-r--r--arch/powerpc/kernel/head_64.S83
-rw-r--r--arch/powerpc/kernel/head_8xx.S13
-rw-r--r--arch/powerpc/kernel/head_booke.h50
-rw-r--r--arch/powerpc/kernel/head_fsl_booke.S100
-rw-r--r--arch/powerpc/kernel/ibmebus.c2
-rw-r--r--arch/powerpc/kernel/lparcfg.c3
-rw-r--r--arch/powerpc/kernel/misc_32.S7
-rw-r--r--arch/powerpc/kernel/of_platform.c2
-rw-r--r--arch/powerpc/kernel/paca.c3
-rw-r--r--arch/powerpc/kernel/pci-common.c133
-rw-r--r--arch/powerpc/kernel/pci_32.c105
-rw-r--r--arch/powerpc/kernel/pci_64.c335
-rw-r--r--arch/powerpc/kernel/pci_of_scan.c359
-rw-r--r--arch/powerpc/kernel/perf_counter.c68
-rw-r--r--arch/powerpc/kernel/process.c16
-rw-r--r--arch/powerpc/kernel/prom_init.c107
-rw-r--r--arch/powerpc/kernel/rtas.c7
-rw-r--r--arch/powerpc/kernel/setup_32.c8
-rw-r--r--arch/powerpc/kernel/setup_64.c95
-rw-r--r--arch/powerpc/kernel/smp.c15
-rw-r--r--arch/powerpc/kernel/sys_ppc32.c12
-rw-r--r--arch/powerpc/kernel/sysfs.c3
-rw-r--r--arch/powerpc/kernel/time.c33
-rw-r--r--arch/powerpc/kernel/vdso.c7
-rw-r--r--arch/powerpc/kernel/vdso32/Makefile1
-rw-r--r--arch/powerpc/kernel/vdso64/Makefile2
-rw-r--r--arch/powerpc/kernel/vector.S2
-rw-r--r--arch/powerpc/kernel/vio.c2
-rw-r--r--arch/powerpc/kernel/vmlinux.lds.S17
-rw-r--r--arch/powerpc/kvm/booke_interrupts.S18
-rw-r--r--arch/powerpc/mm/40x_mmu.c4
-rw-r--r--arch/powerpc/mm/Makefile1
-rw-r--r--arch/powerpc/mm/fsl_booke_mmu.c2
-rw-r--r--arch/powerpc/mm/hash_low_32.S4
-rw-r--r--arch/powerpc/mm/hugetlbpage.c8
-rw-r--r--arch/powerpc/mm/init_32.c2
-rw-r--r--arch/powerpc/mm/init_64.c55
-rw-r--r--arch/powerpc/mm/mmu_context_nohash.c96
-rw-r--r--arch/powerpc/mm/mmu_decl.h37
-rw-r--r--arch/powerpc/mm/pgtable.c179
-rw-r--r--arch/powerpc/mm/pgtable_32.c2
-rw-r--r--arch/powerpc/mm/pgtable_64.c59
-rw-r--r--arch/powerpc/mm/slb.c46
-rw-r--r--arch/powerpc/mm/stab.c2
-rw-r--r--arch/powerpc/mm/tlb_hash32.c3
-rw-r--r--arch/powerpc/mm/tlb_hash64.c20
-rw-r--r--arch/powerpc/mm/tlb_low_64e.S770
-rw-r--r--arch/powerpc/mm/tlb_nohash.c268
-rw-r--r--arch/powerpc/mm/tlb_nohash_low.S87
-rw-r--r--arch/powerpc/platforms/40x/Kconfig10
-rw-r--r--arch/powerpc/platforms/40x/ppc40x_simple.c3
-rw-r--r--arch/powerpc/platforms/44x/Kconfig12
-rw-r--r--arch/powerpc/platforms/44x/ppc44x_simple.c1
-rw-r--r--arch/powerpc/platforms/82xx/mgcoge.c69
-rw-r--r--arch/powerpc/platforms/82xx/mpc8272_ads.c22
-rw-r--r--arch/powerpc/platforms/83xx/Kconfig4
-rw-r--r--arch/powerpc/platforms/83xx/mpc837x_rdb.c28
-rw-r--r--arch/powerpc/platforms/83xx/mpc83xx.h4
-rw-r--r--arch/powerpc/platforms/85xx/Kconfig9
-rw-r--r--arch/powerpc/platforms/85xx/Makefile3
-rw-r--r--arch/powerpc/platforms/85xx/mpc8536_ds.c3
-rw-r--r--arch/powerpc/platforms/85xx/mpc85xx_ds.c3
-rw-r--r--arch/powerpc/platforms/85xx/mpc85xx_mds.c7
-rw-r--r--arch/powerpc/platforms/85xx/mpc85xx_rdb.c141
-rw-r--r--arch/powerpc/platforms/85xx/sbc8560.c39
-rw-r--r--arch/powerpc/platforms/85xx/smp.c23
-rw-r--r--arch/powerpc/platforms/86xx/gef_ppc9a.c37
-rw-r--r--arch/powerpc/platforms/86xx/mpc86xx_hpcn.c3
-rw-r--r--arch/powerpc/platforms/86xx/mpc86xx_smp.c1
-rw-r--r--arch/powerpc/platforms/Kconfig.cputype38
-rw-r--r--arch/powerpc/platforms/amigaone/setup.c6
-rw-r--r--arch/powerpc/platforms/cell/Kconfig7
-rw-r--r--arch/powerpc/platforms/cell/celleb_setup.c3
-rw-r--r--arch/powerpc/platforms/cell/iommu.c2
-rw-r--r--arch/powerpc/platforms/cell/smp.c2
-rw-r--r--arch/powerpc/platforms/cell/spufs/Makefile3
-rw-r--r--arch/powerpc/platforms/cell/spufs/context.c1
-rw-r--r--arch/powerpc/platforms/cell/spufs/file.c1
-rw-r--r--arch/powerpc/platforms/cell/spufs/sched.c2
-rw-r--r--arch/powerpc/platforms/cell/spufs/spufs.h5
-rw-r--r--arch/powerpc/platforms/cell/spufs/sputrace.c272
-rw-r--r--arch/powerpc/platforms/cell/spufs/sputrace.h39
-rw-r--r--arch/powerpc/platforms/iseries/exception.S59
-rw-r--r--arch/powerpc/platforms/iseries/exception.h6
-rw-r--r--arch/powerpc/platforms/iseries/mf.c2
-rw-r--r--arch/powerpc/platforms/pasemi/idle.c2
-rw-r--r--arch/powerpc/platforms/powermac/cpufreq_32.c8
-rw-r--r--arch/powerpc/platforms/powermac/feature.c13
-rw-r--r--arch/powerpc/platforms/powermac/pci.c61
-rw-r--r--arch/powerpc/platforms/powermac/smp.c2
-rw-r--r--arch/powerpc/platforms/ps3/mm.c2
-rw-r--r--arch/powerpc/platforms/ps3/smp.c2
-rw-r--r--arch/powerpc/platforms/ps3/system-bus.c6
-rw-r--r--arch/powerpc/platforms/pseries/eeh.c10
-rw-r--r--arch/powerpc/platforms/pseries/pci_dlpar.c2
-rw-r--r--arch/powerpc/platforms/pseries/reconfig.c9
-rw-r--r--arch/powerpc/platforms/pseries/setup.c4
-rw-r--r--arch/powerpc/platforms/pseries/smp.c2
-rw-r--r--arch/powerpc/sysdev/fsl_rio.c18
-rw-r--r--arch/powerpc/sysdev/fsl_soc.c6
-rw-r--r--arch/powerpc/sysdev/ipic.c7
-rw-r--r--arch/powerpc/sysdev/mmio_nvram.c32
-rw-r--r--arch/powerpc/sysdev/mpic.c13
-rw-r--r--arch/powerpc/sysdev/qe_lib/gpio.c4
-rw-r--r--arch/powerpc/sysdev/qe_lib/qe_ic.c5
-rw-r--r--arch/powerpc/xmon/Makefile2
-rw-r--r--arch/powerpc/xmon/xmon.c2
-rw-r--r--arch/s390/include/asm/percpu.h32
-rw-r--r--arch/s390/kernel/vmlinux.lds.S9
-rw-r--r--arch/sh/include/asm/pci.h1
-rw-r--r--arch/sh/include/asm/topology.h10
-rw-r--r--arch/sh/kernel/vmlinux.lds.S10
-rw-r--r--arch/sparc/Kconfig2
-rw-r--r--arch/sparc/configs/sparc32_defconfig44
-rw-r--r--arch/sparc/configs/sparc64_defconfig51
-rw-r--r--arch/sparc/include/asm/agp.h4
-rw-r--r--arch/sparc/include/asm/pci_32.h1
-rw-r--r--arch/sparc/include/asm/pci_64.h1
-rw-r--r--arch/sparc/include/asm/topology_64.h7
-rw-r--r--arch/sparc/kernel/setup_32.c2
-rw-r--r--arch/sparc/kernel/setup_64.c2
-rw-r--r--arch/sparc/kernel/smp_64.c132
-rw-r--r--arch/sparc/kernel/vmlinux.lds.S8
-rw-r--r--arch/um/include/asm/common.lds.S5
-rw-r--r--arch/um/include/asm/pci.h1
-rw-r--r--arch/um/kernel/dyn.lds.S2
-rw-r--r--arch/um/kernel/uml.lds.S2
-rw-r--r--arch/x86/Kconfig75
-rw-r--r--arch/x86/include/asm/agp.h4
-rw-r--r--arch/x86/include/asm/bootparam.h3
-rw-r--r--arch/x86/include/asm/cacheflush.h54
-rw-r--r--arch/x86/include/asm/cpufeature.h1
-rw-r--r--arch/x86/include/asm/elf.h2
-rw-r--r--arch/x86/include/asm/entry_arch.h2
-rw-r--r--arch/x86/include/asm/fixmap.h3
-rw-r--r--arch/x86/include/asm/iomap.h9
-rw-r--r--arch/x86/include/asm/mce.h32
-rw-r--r--arch/x86/include/asm/msr-index.h11
-rw-r--r--arch/x86/include/asm/mtrr.h6
-rw-r--r--arch/x86/include/asm/nops.h2
-rw-r--r--arch/x86/include/asm/pat.h5
-rw-r--r--arch/x86/include/asm/pci.h1
-rw-r--r--arch/x86/include/asm/percpu.h9
-rw-r--r--arch/x86/include/asm/processor.h32
-rw-r--r--arch/x86/include/asm/topology.h14
-rw-r--r--arch/x86/kernel/Makefile1
-rw-r--r--arch/x86/kernel/apic/nmi.c2
-rw-r--r--arch/x86/kernel/cpu/Makefile2
-rw-r--r--arch/x86/kernel/cpu/amd.c10
-rw-r--r--arch/x86/kernel/cpu/cpu_debug.c4
-rw-r--r--arch/x86/kernel/cpu/cpufreq/acpi-cpufreq.c88
-rw-r--r--arch/x86/kernel/cpu/intel.c6
-rw-r--r--arch/x86/kernel/cpu/mcheck/Makefile5
-rw-r--r--arch/x86/kernel/cpu/mcheck/k7.c116
-rw-r--r--arch/x86/kernel/cpu/mcheck/mce-inject.c158
-rw-r--r--arch/x86/kernel/cpu/mcheck/mce-internal.h15
-rw-r--r--arch/x86/kernel/cpu/mcheck/mce-severity.c8
-rw-r--r--arch/x86/kernel/cpu/mcheck/mce.c312
-rw-r--r--arch/x86/kernel/cpu/mcheck/mce_amd.c2
-rw-r--r--arch/x86/kernel/cpu/mcheck/mce_intel.c10
-rw-r--r--arch/x86/kernel/cpu/mcheck/non-fatal.c94
-rw-r--r--arch/x86/kernel/cpu/mcheck/p4.c163
-rw-r--r--arch/x86/kernel/cpu/mcheck/p6.c127
-rw-r--r--arch/x86/kernel/cpu/mcheck/therm_throt.c13
-rw-r--r--arch/x86/kernel/cpu/mtrr/main.c46
-rw-r--r--arch/x86/kernel/cpu/perf_counter.c14
-rw-r--r--arch/x86/kernel/cpu/sched.c55
-rw-r--r--arch/x86/kernel/entry_64.S6
-rw-r--r--arch/x86/kernel/irq.c4
-rw-r--r--arch/x86/kernel/irqinit.c2
-rw-r--r--arch/x86/kernel/pci-dma.c4
-rw-r--r--arch/x86/kernel/quirks.c2
-rw-r--r--arch/x86/kernel/reboot.c7
-rw-r--r--arch/x86/kernel/setup.c23
-rw-r--r--arch/x86/kernel/setup_percpu.c364
-rw-r--r--arch/x86/kernel/signal.c2
-rw-r--r--arch/x86/kernel/smpboot.c16
-rw-r--r--arch/x86/kernel/tboot.c447
-rw-r--r--arch/x86/kernel/vmlinux.lds.S11
-rw-r--r--arch/x86/mm/iomap_32.c27
-rw-r--r--arch/x86/mm/ioremap.c18
-rw-r--r--arch/x86/mm/mmap.c17
-rw-r--r--arch/x86/mm/pageattr.c29
-rw-r--r--arch/x86/mm/pat.c353
-rw-r--r--arch/x86/pci/amd_bus.c64
-rw-r--r--arch/x86/pci/common.c69
-rw-r--r--arch/x86/power/cpu.c2
-rw-r--r--arch/xtensa/kernel/vmlinux.lds.S13
731 files changed, 29085 insertions, 10159 deletions
diff --git a/arch/Kconfig b/arch/Kconfig
index beea3ccebb5e..7f418bbc261a 100644
--- a/arch/Kconfig
+++ b/arch/Kconfig
@@ -9,6 +9,7 @@ config OPROFILE
9 depends on TRACING_SUPPORT 9 depends on TRACING_SUPPORT
10 select TRACING 10 select TRACING
11 select RING_BUFFER 11 select RING_BUFFER
12 select RING_BUFFER_ALLOW_SWAP
12 help 13 help
13 OProfile is a profiling system capable of profiling the 14 OProfile is a profiling system capable of profiling the
14 whole system, include the kernel, kernel modules, libraries, 15 whole system, include the kernel, kernel modules, libraries,
diff --git a/arch/alpha/include/asm/agp.h b/arch/alpha/include/asm/agp.h
index 26c179135293..a94d48b8677f 100644
--- a/arch/alpha/include/asm/agp.h
+++ b/arch/alpha/include/asm/agp.h
@@ -9,10 +9,6 @@
9#define unmap_page_from_agp(page) 9#define unmap_page_from_agp(page)
10#define flush_agp_cache() mb() 10#define flush_agp_cache() mb()
11 11
12/* Convert a physical address to an address suitable for the GART. */
13#define phys_to_gart(x) (x)
14#define gart_to_phys(x) (x)
15
16/* GATT allocation. Returns/accepts GATT kernel virtual address. */ 12/* GATT allocation. Returns/accepts GATT kernel virtual address. */
17#define alloc_gatt_pages(order) \ 13#define alloc_gatt_pages(order) \
18 ((char *)__get_free_pages(GFP_KERNEL, (order))) 14 ((char *)__get_free_pages(GFP_KERNEL, (order)))
diff --git a/arch/alpha/include/asm/pci.h b/arch/alpha/include/asm/pci.h
index d22ace99d13d..dd8dcabf160f 100644
--- a/arch/alpha/include/asm/pci.h
+++ b/arch/alpha/include/asm/pci.h
@@ -52,7 +52,6 @@ struct pci_controller {
52 bus numbers. */ 52 bus numbers. */
53 53
54#define pcibios_assign_all_busses() 1 54#define pcibios_assign_all_busses() 1
55#define pcibios_scan_all_fns(a, b) 0
56 55
57#define PCIBIOS_MIN_IO alpha_mv.min_io_address 56#define PCIBIOS_MIN_IO alpha_mv.min_io_address
58#define PCIBIOS_MIN_MEM alpha_mv.min_mem_address 57#define PCIBIOS_MIN_MEM alpha_mv.min_mem_address
diff --git a/arch/alpha/include/asm/percpu.h b/arch/alpha/include/asm/percpu.h
index b663f1f10b6a..2c12378e3aa9 100644
--- a/arch/alpha/include/asm/percpu.h
+++ b/arch/alpha/include/asm/percpu.h
@@ -1,102 +1,18 @@
1#ifndef __ALPHA_PERCPU_H 1#ifndef __ALPHA_PERCPU_H
2#define __ALPHA_PERCPU_H 2#define __ALPHA_PERCPU_H
3 3
4#include <linux/compiler.h>
5#include <linux/threads.h>
6#include <linux/percpu-defs.h>
7
8/*
9 * Determine the real variable name from the name visible in the
10 * kernel sources.
11 */
12#define per_cpu_var(var) per_cpu__##var
13
14#ifdef CONFIG_SMP
15
16/*
17 * per_cpu_offset() is the offset that has to be added to a
18 * percpu variable to get to the instance for a certain processor.
19 */
20extern unsigned long __per_cpu_offset[NR_CPUS];
21
22#define per_cpu_offset(x) (__per_cpu_offset[x])
23
24#define __my_cpu_offset per_cpu_offset(raw_smp_processor_id())
25#ifdef CONFIG_DEBUG_PREEMPT
26#define my_cpu_offset per_cpu_offset(smp_processor_id())
27#else
28#define my_cpu_offset __my_cpu_offset
29#endif
30
31#ifndef MODULE
32#define SHIFT_PERCPU_PTR(var, offset) RELOC_HIDE(&per_cpu_var(var), (offset))
33#define PER_CPU_DEF_ATTRIBUTES
34#else
35/* 4/*
36 * To calculate addresses of locally defined variables, GCC uses 32-bit 5 * To calculate addresses of locally defined variables, GCC uses
37 * displacement from the GP. Which doesn't work for per cpu variables in 6 * 32-bit displacement from the GP. Which doesn't work for per cpu
38 * modules, as an offset to the kernel per cpu area is way above 4G. 7 * variables in modules, as an offset to the kernel per cpu area is
8 * way above 4G.
39 * 9 *
40 * This forces allocation of a GOT entry for per cpu variable using 10 * Always use weak definitions for percpu variables in modules.
41 * ldq instruction with a 'literal' relocation.
42 */
43#define SHIFT_PERCPU_PTR(var, offset) ({ \
44 extern int simple_identifier_##var(void); \
45 unsigned long __ptr, tmp_gp; \
46 asm ( "br %1, 1f \n\
47 1: ldgp %1, 0(%1) \n\
48 ldq %0, per_cpu__" #var"(%1)\t!literal" \
49 : "=&r"(__ptr), "=&r"(tmp_gp)); \
50 (typeof(&per_cpu_var(var)))(__ptr + (offset)); })
51
52#define PER_CPU_DEF_ATTRIBUTES __used
53
54#endif /* MODULE */
55
56/*
57 * A percpu variable may point to a discarded regions. The following are
58 * established ways to produce a usable pointer from the percpu variable
59 * offset.
60 */ 11 */
61#define per_cpu(var, cpu) \ 12#if defined(MODULE) && defined(CONFIG_SMP)
62 (*SHIFT_PERCPU_PTR(var, per_cpu_offset(cpu))) 13#define ARCH_NEEDS_WEAK_PER_CPU
63#define __get_cpu_var(var) \
64 (*SHIFT_PERCPU_PTR(var, my_cpu_offset))
65#define __raw_get_cpu_var(var) \
66 (*SHIFT_PERCPU_PTR(var, __my_cpu_offset))
67
68#else /* ! SMP */
69
70#define per_cpu(var, cpu) (*((void)(cpu), &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)
73
74#define PER_CPU_DEF_ATTRIBUTES
75
76#endif /* SMP */
77
78#ifdef CONFIG_SMP
79#define PER_CPU_BASE_SECTION ".data.percpu"
80#else
81#define PER_CPU_BASE_SECTION ".data"
82#endif
83
84#ifdef CONFIG_SMP
85
86#ifdef MODULE
87#define PER_CPU_SHARED_ALIGNED_SECTION ""
88#else
89#define PER_CPU_SHARED_ALIGNED_SECTION ".shared_aligned"
90#endif
91#define PER_CPU_FIRST_SECTION ".first"
92
93#else
94
95#define PER_CPU_SHARED_ALIGNED_SECTION ""
96#define PER_CPU_FIRST_SECTION ""
97
98#endif 14#endif
99 15
100#define PER_CPU_ATTRIBUTES 16#include <asm-generic/percpu.h>
101 17
102#endif /* __ALPHA_PERCPU_H */ 18#endif /* __ALPHA_PERCPU_H */
diff --git a/arch/alpha/include/asm/tlbflush.h b/arch/alpha/include/asm/tlbflush.h
index 9d87aaa08c0d..e89e0c2e15b1 100644
--- a/arch/alpha/include/asm/tlbflush.h
+++ b/arch/alpha/include/asm/tlbflush.h
@@ -2,6 +2,7 @@
2#define _ALPHA_TLBFLUSH_H 2#define _ALPHA_TLBFLUSH_H
3 3
4#include <linux/mm.h> 4#include <linux/mm.h>
5#include <linux/sched.h>
5#include <asm/compiler.h> 6#include <asm/compiler.h>
6#include <asm/pgalloc.h> 7#include <asm/pgalloc.h>
7 8
diff --git a/arch/alpha/kernel/vmlinux.lds.S b/arch/alpha/kernel/vmlinux.lds.S
index b9d6568e5f7f..6dc03c35caa0 100644
--- a/arch/alpha/kernel/vmlinux.lds.S
+++ b/arch/alpha/kernel/vmlinux.lds.S
@@ -134,13 +134,6 @@ SECTIONS
134 __bss_stop = .; 134 __bss_stop = .;
135 _end = .; 135 _end = .;
136 136
137 /* Sections to be discarded */
138 /DISCARD/ : {
139 EXIT_TEXT
140 EXIT_DATA
141 *(.exitcall.exit)
142 }
143
144 .mdebug 0 : { 137 .mdebug 0 : {
145 *(.mdebug) 138 *(.mdebug)
146 } 139 }
@@ -150,4 +143,6 @@ SECTIONS
150 143
151 STABS_DEBUG 144 STABS_DEBUG
152 DWARF_DEBUG 145 DWARF_DEBUG
146
147 DISCARDS
153} 148}
diff --git a/arch/arm/boot/compressed/head-sa1100.S b/arch/arm/boot/compressed/head-sa1100.S
index 4c8c0e46027d..6179d94dd5c6 100644
--- a/arch/arm/boot/compressed/head-sa1100.S
+++ b/arch/arm/boot/compressed/head-sa1100.S
@@ -1,7 +1,7 @@
1/* 1/*
2 * linux/arch/arm/boot/compressed/head-sa1100.S 2 * linux/arch/arm/boot/compressed/head-sa1100.S
3 * 3 *
4 * Copyright (C) 1999 Nicolas Pitre <nico@cam.org> 4 * Copyright (C) 1999 Nicolas Pitre <nico@fluxnic.net>
5 * 5 *
6 * SA1100 specific tweaks. This is merged into head.S by the linker. 6 * SA1100 specific tweaks. This is merged into head.S by the linker.
7 * 7 *
diff --git a/arch/arm/common/vic.c b/arch/arm/common/vic.c
index 920ced0b73c5..f232941de8ab 100644
--- a/arch/arm/common/vic.c
+++ b/arch/arm/common/vic.c
@@ -22,6 +22,7 @@
22#include <linux/list.h> 22#include <linux/list.h>
23#include <linux/io.h> 23#include <linux/io.h>
24#include <linux/sysdev.h> 24#include <linux/sysdev.h>
25#include <linux/device.h>
25#include <linux/amba/bus.h> 26#include <linux/amba/bus.h>
26 27
27#include <asm/mach/irq.h> 28#include <asm/mach/irq.h>
diff --git a/arch/arm/include/asm/atomic.h b/arch/arm/include/asm/atomic.h
index 9ed2377fe8e5..d0daeab2234e 100644
--- a/arch/arm/include/asm/atomic.h
+++ b/arch/arm/include/asm/atomic.h
@@ -19,31 +19,21 @@
19 19
20#ifdef __KERNEL__ 20#ifdef __KERNEL__
21 21
22/*
23 * On ARM, ordinary assignment (str instruction) doesn't clear the local
24 * strex/ldrex monitor on some implementations. The reason we can use it for
25 * atomic_set() is the clrex or dummy strex done on every exception return.
26 */
22#define atomic_read(v) ((v)->counter) 27#define atomic_read(v) ((v)->counter)
28#define atomic_set(v,i) (((v)->counter) = (i))
23 29
24#if __LINUX_ARM_ARCH__ >= 6 30#if __LINUX_ARM_ARCH__ >= 6
25 31
26/* 32/*
27 * ARMv6 UP and SMP safe atomic ops. We use load exclusive and 33 * ARMv6 UP and SMP safe atomic ops. We use load exclusive and
28 * store exclusive to ensure that these are atomic. We may loop 34 * store exclusive to ensure that these are atomic. We may loop
29 * to ensure that the update happens. Writing to 'v->counter' 35 * to ensure that the update happens.
30 * without using the following operations WILL break the atomic
31 * nature of these ops.
32 */ 36 */
33static inline void atomic_set(atomic_t *v, int i)
34{
35 unsigned long tmp;
36
37 __asm__ __volatile__("@ atomic_set\n"
38"1: ldrex %0, [%1]\n"
39" strex %0, %2, [%1]\n"
40" teq %0, #0\n"
41" bne 1b"
42 : "=&r" (tmp)
43 : "r" (&v->counter), "r" (i)
44 : "cc");
45}
46
47static inline void atomic_add(int i, atomic_t *v) 37static inline void atomic_add(int i, atomic_t *v)
48{ 38{
49 unsigned long tmp; 39 unsigned long tmp;
@@ -163,8 +153,6 @@ static inline void atomic_clear_mask(unsigned long mask, unsigned long *addr)
163#error SMP not supported on pre-ARMv6 CPUs 153#error SMP not supported on pre-ARMv6 CPUs
164#endif 154#endif
165 155
166#define atomic_set(v,i) (((v)->counter) = (i))
167
168static inline int atomic_add_return(int i, atomic_t *v) 156static inline int atomic_add_return(int i, atomic_t *v)
169{ 157{
170 unsigned long flags; 158 unsigned long flags;
diff --git a/arch/arm/include/asm/cache.h b/arch/arm/include/asm/cache.h
index feaa75f0013e..66c160b8547f 100644
--- a/arch/arm/include/asm/cache.h
+++ b/arch/arm/include/asm/cache.h
@@ -4,7 +4,7 @@
4#ifndef __ASMARM_CACHE_H 4#ifndef __ASMARM_CACHE_H
5#define __ASMARM_CACHE_H 5#define __ASMARM_CACHE_H
6 6
7#define L1_CACHE_SHIFT 5 7#define L1_CACHE_SHIFT CONFIG_ARM_L1_CACHE_SHIFT
8#define L1_CACHE_BYTES (1 << L1_CACHE_SHIFT) 8#define L1_CACHE_BYTES (1 << L1_CACHE_SHIFT)
9 9
10/* 10/*
diff --git a/arch/arm/include/asm/pci.h b/arch/arm/include/asm/pci.h
index 0abf386ba3d3..226cddd2fb65 100644
--- a/arch/arm/include/asm/pci.h
+++ b/arch/arm/include/asm/pci.h
@@ -6,8 +6,6 @@
6 6
7#include <mach/hardware.h> /* for PCIBIOS_MIN_* */ 7#include <mach/hardware.h> /* for PCIBIOS_MIN_* */
8 8
9#define pcibios_scan_all_fns(a, b) 0
10
11#ifdef CONFIG_PCI_HOST_ITE8152 9#ifdef CONFIG_PCI_HOST_ITE8152
12/* ITE bridge requires setting latency timer to avoid early bus access 10/* ITE bridge requires setting latency timer to avoid early bus access
13 termination by PIC bus mater devices 11 termination by PIC bus mater devices
diff --git a/arch/arm/include/asm/unified.h b/arch/arm/include/asm/unified.h
index 073e85b9b961..bc631161e9c6 100644
--- a/arch/arm/include/asm/unified.h
+++ b/arch/arm/include/asm/unified.h
@@ -35,7 +35,9 @@
35 35
36#define ARM(x...) 36#define ARM(x...)
37#define THUMB(x...) x 37#define THUMB(x...) x
38#ifdef __ASSEMBLY__
38#define W(instr) instr.w 39#define W(instr) instr.w
40#endif
39#define BSYM(sym) sym + 1 41#define BSYM(sym) sym + 1
40 42
41#else /* !CONFIG_THUMB2_KERNEL */ 43#else /* !CONFIG_THUMB2_KERNEL */
@@ -45,7 +47,9 @@
45 47
46#define ARM(x...) x 48#define ARM(x...) x
47#define THUMB(x...) 49#define THUMB(x...)
50#ifdef __ASSEMBLY__
48#define W(instr) instr 51#define W(instr) instr
52#endif
49#define BSYM(sym) sym 53#define BSYM(sym) sym
50 54
51#endif /* CONFIG_THUMB2_KERNEL */ 55#endif /* CONFIG_THUMB2_KERNEL */
diff --git a/arch/arm/kernel/entry-armv.S b/arch/arm/kernel/entry-armv.S
index 3d727a8a23bc..0a2ba51cf35d 100644
--- a/arch/arm/kernel/entry-armv.S
+++ b/arch/arm/kernel/entry-armv.S
@@ -272,7 +272,15 @@ __und_svc:
272 @ 272 @
273 @ r0 - instruction 273 @ r0 - instruction
274 @ 274 @
275#ifndef CONFIG_THUMB2_KERNEL
275 ldr r0, [r2, #-4] 276 ldr r0, [r2, #-4]
277#else
278 ldrh r0, [r2, #-2] @ Thumb instruction at LR - 2
279 and r9, r0, #0xf800
280 cmp r9, #0xe800 @ 32-bit instruction if xx >= 0
281 ldrhhs r9, [r2] @ bottom 16 bits
282 orrhs r0, r9, r0, lsl #16
283#endif
276 adr r9, BSYM(1f) 284 adr r9, BSYM(1f)
277 bl call_fpe 285 bl call_fpe
278 286
@@ -678,7 +686,9 @@ ENTRY(fp_enter)
678 .word no_fp 686 .word no_fp
679 .previous 687 .previous
680 688
681no_fp: mov pc, lr 689ENTRY(no_fp)
690 mov pc, lr
691ENDPROC(no_fp)
682 692
683__und_usr_unknown: 693__und_usr_unknown:
684 enable_irq 694 enable_irq
@@ -734,13 +744,6 @@ ENTRY(__switch_to)
734#ifdef CONFIG_MMU 744#ifdef CONFIG_MMU
735 ldr r6, [r2, #TI_CPU_DOMAIN] 745 ldr r6, [r2, #TI_CPU_DOMAIN]
736#endif 746#endif
737#if __LINUX_ARM_ARCH__ >= 6
738#ifdef CONFIG_CPU_32v6K
739 clrex
740#else
741 strex r5, r4, [ip] @ Clear exclusive monitor
742#endif
743#endif
744#if defined(CONFIG_HAS_TLS_REG) 747#if defined(CONFIG_HAS_TLS_REG)
745 mcr p15, 0, r3, c13, c0, 3 @ set TLS register 748 mcr p15, 0, r3, c13, c0, 3 @ set TLS register
746#elif !defined(CONFIG_TLS_REG_EMUL) 749#elif !defined(CONFIG_TLS_REG_EMUL)
diff --git a/arch/arm/kernel/entry-header.S b/arch/arm/kernel/entry-header.S
index a4eaf4f920c5..e17e3c30d957 100644
--- a/arch/arm/kernel/entry-header.S
+++ b/arch/arm/kernel/entry-header.S
@@ -76,13 +76,25 @@
76#ifndef CONFIG_THUMB2_KERNEL 76#ifndef CONFIG_THUMB2_KERNEL
77 .macro svc_exit, rpsr 77 .macro svc_exit, rpsr
78 msr spsr_cxsf, \rpsr 78 msr spsr_cxsf, \rpsr
79#if defined(CONFIG_CPU_32v6K)
80 clrex @ clear the exclusive monitor
79 ldmia sp, {r0 - pc}^ @ load r0 - pc, cpsr 81 ldmia sp, {r0 - pc}^ @ load r0 - pc, cpsr
82#elif defined (CONFIG_CPU_V6)
83 ldr r0, [sp]
84 strex r1, r2, [sp] @ clear the exclusive monitor
85 ldmib sp, {r1 - pc}^ @ load r1 - pc, cpsr
86#endif
80 .endm 87 .endm
81 88
82 .macro restore_user_regs, fast = 0, offset = 0 89 .macro restore_user_regs, fast = 0, offset = 0
83 ldr r1, [sp, #\offset + S_PSR] @ get calling cpsr 90 ldr r1, [sp, #\offset + S_PSR] @ get calling cpsr
84 ldr lr, [sp, #\offset + S_PC]! @ get pc 91 ldr lr, [sp, #\offset + S_PC]! @ get pc
85 msr spsr_cxsf, r1 @ save in spsr_svc 92 msr spsr_cxsf, r1 @ save in spsr_svc
93#if defined(CONFIG_CPU_32v6K)
94 clrex @ clear the exclusive monitor
95#elif defined (CONFIG_CPU_V6)
96 strex r1, r2, [sp] @ clear the exclusive monitor
97#endif
86 .if \fast 98 .if \fast
87 ldmdb sp, {r1 - lr}^ @ get calling r1 - lr 99 ldmdb sp, {r1 - lr}^ @ get calling r1 - lr
88 .else 100 .else
@@ -98,6 +110,7 @@
98 .endm 110 .endm
99#else /* CONFIG_THUMB2_KERNEL */ 111#else /* CONFIG_THUMB2_KERNEL */
100 .macro svc_exit, rpsr 112 .macro svc_exit, rpsr
113 clrex @ clear the exclusive monitor
101 ldr r0, [sp, #S_SP] @ top of the stack 114 ldr r0, [sp, #S_SP] @ top of the stack
102 ldr r1, [sp, #S_PC] @ return address 115 ldr r1, [sp, #S_PC] @ return address
103 tst r0, #4 @ orig stack 8-byte aligned? 116 tst r0, #4 @ orig stack 8-byte aligned?
@@ -110,6 +123,7 @@
110 .endm 123 .endm
111 124
112 .macro restore_user_regs, fast = 0, offset = 0 125 .macro restore_user_regs, fast = 0, offset = 0
126 clrex @ clear the exclusive monitor
113 mov r2, sp 127 mov r2, sp
114 load_user_sp_lr r2, r3, \offset + S_SP @ calling sp, lr 128 load_user_sp_lr r2, r3, \offset + S_SP @ calling sp, lr
115 ldr r1, [sp, #\offset + S_PSR] @ get calling cpsr 129 ldr r1, [sp, #\offset + S_PSR] @ get calling cpsr
diff --git a/arch/arm/kernel/kprobes.c b/arch/arm/kernel/kprobes.c
index f692efddd449..60c62c377fa9 100644
--- a/arch/arm/kernel/kprobes.c
+++ b/arch/arm/kernel/kprobes.c
@@ -22,6 +22,7 @@
22#include <linux/kernel.h> 22#include <linux/kernel.h>
23#include <linux/kprobes.h> 23#include <linux/kprobes.h>
24#include <linux/module.h> 24#include <linux/module.h>
25#include <linux/stop_machine.h>
25#include <linux/stringify.h> 26#include <linux/stringify.h>
26#include <asm/traps.h> 27#include <asm/traps.h>
27#include <asm/cacheflush.h> 28#include <asm/cacheflush.h>
@@ -83,10 +84,24 @@ void __kprobes arch_arm_kprobe(struct kprobe *p)
83 flush_insns(p->addr, 1); 84 flush_insns(p->addr, 1);
84} 85}
85 86
87/*
88 * The actual disarming is done here on each CPU and synchronized using
89 * stop_machine. This synchronization is necessary on SMP to avoid removing
90 * a probe between the moment the 'Undefined Instruction' exception is raised
91 * and the moment the exception handler reads the faulting instruction from
92 * memory.
93 */
94int __kprobes __arch_disarm_kprobe(void *p)
95{
96 struct kprobe *kp = p;
97 *kp->addr = kp->opcode;
98 flush_insns(kp->addr, 1);
99 return 0;
100}
101
86void __kprobes arch_disarm_kprobe(struct kprobe *p) 102void __kprobes arch_disarm_kprobe(struct kprobe *p)
87{ 103{
88 *p->addr = p->opcode; 104 stop_machine(__arch_disarm_kprobe, p, &cpu_online_map);
89 flush_insns(p->addr, 1);
90} 105}
91 106
92void __kprobes arch_remove_kprobe(struct kprobe *p) 107void __kprobes arch_remove_kprobe(struct kprobe *p)
diff --git a/arch/arm/kernel/vmlinux.lds.S b/arch/arm/kernel/vmlinux.lds.S
index 39d3ffb9ff2b..aecf87dfbaec 100644
--- a/arch/arm/kernel/vmlinux.lds.S
+++ b/arch/arm/kernel/vmlinux.lds.S
@@ -83,6 +83,7 @@ SECTIONS
83 EXIT_TEXT 83 EXIT_TEXT
84 EXIT_DATA 84 EXIT_DATA
85 *(.exitcall.exit) 85 *(.exitcall.exit)
86 *(.discard)
86 *(.ARM.exidx.exit.text) 87 *(.ARM.exidx.exit.text)
87 *(.ARM.extab.exit.text) 88 *(.ARM.extab.exit.text)
88#ifndef CONFIG_HOTPLUG_CPU 89#ifndef CONFIG_HOTPLUG_CPU
diff --git a/arch/arm/lib/copy_page.S b/arch/arm/lib/copy_page.S
index 6ae04db1ca4f..6ee2f6706f86 100644
--- a/arch/arm/lib/copy_page.S
+++ b/arch/arm/lib/copy_page.S
@@ -12,8 +12,9 @@
12#include <linux/linkage.h> 12#include <linux/linkage.h>
13#include <asm/assembler.h> 13#include <asm/assembler.h>
14#include <asm/asm-offsets.h> 14#include <asm/asm-offsets.h>
15#include <asm/cache.h>
15 16
16#define COPY_COUNT (PAGE_SZ/64 PLD( -1 )) 17#define COPY_COUNT (PAGE_SZ / (2 * L1_CACHE_BYTES) PLD( -1 ))
17 18
18 .text 19 .text
19 .align 5 20 .align 5
@@ -26,17 +27,16 @@
26ENTRY(copy_page) 27ENTRY(copy_page)
27 stmfd sp!, {r4, lr} @ 2 28 stmfd sp!, {r4, lr} @ 2
28 PLD( pld [r1, #0] ) 29 PLD( pld [r1, #0] )
29 PLD( pld [r1, #32] ) 30 PLD( pld [r1, #L1_CACHE_BYTES] )
30 mov r2, #COPY_COUNT @ 1 31 mov r2, #COPY_COUNT @ 1
31 ldmia r1!, {r3, r4, ip, lr} @ 4+1 32 ldmia r1!, {r3, r4, ip, lr} @ 4+1
321: PLD( pld [r1, #64] ) 331: PLD( pld [r1, #2 * L1_CACHE_BYTES])
33 PLD( pld [r1, #96] ) 34 PLD( pld [r1, #3 * L1_CACHE_BYTES])
342: stmia r0!, {r3, r4, ip, lr} @ 4 352:
35 ldmia r1!, {r3, r4, ip, lr} @ 4+1 36 .rept (2 * L1_CACHE_BYTES / 16 - 1)
36 stmia r0!, {r3, r4, ip, lr} @ 4
37 ldmia r1!, {r3, r4, ip, lr} @ 4+1
38 stmia r0!, {r3, r4, ip, lr} @ 4 37 stmia r0!, {r3, r4, ip, lr} @ 4
39 ldmia r1!, {r3, r4, ip, lr} @ 4 38 ldmia r1!, {r3, r4, ip, lr} @ 4
39 .endr
40 subs r2, r2, #1 @ 1 40 subs r2, r2, #1 @ 1
41 stmia r0!, {r3, r4, ip, lr} @ 4 41 stmia r0!, {r3, r4, ip, lr} @ 4
42 ldmgtia r1!, {r3, r4, ip, lr} @ 4 42 ldmgtia r1!, {r3, r4, ip, lr} @ 4
diff --git a/arch/arm/lib/lib1funcs.S b/arch/arm/lib/lib1funcs.S
index 67964bcfc854..6dc06487f3c3 100644
--- a/arch/arm/lib/lib1funcs.S
+++ b/arch/arm/lib/lib1funcs.S
@@ -1,7 +1,7 @@
1/* 1/*
2 * linux/arch/arm/lib/lib1funcs.S: Optimized ARM division routines 2 * linux/arch/arm/lib/lib1funcs.S: Optimized ARM division routines
3 * 3 *
4 * Author: Nicolas Pitre <nico@cam.org> 4 * Author: Nicolas Pitre <nico@fluxnic.net>
5 * - contributed to gcc-3.4 on Sep 30, 2003 5 * - contributed to gcc-3.4 on Sep 30, 2003
6 * - adapted for the Linux kernel on Oct 2, 2003 6 * - adapted for the Linux kernel on Oct 2, 2003
7 */ 7 */
diff --git a/arch/arm/lib/sha1.S b/arch/arm/lib/sha1.S
index 09b548cac1a4..eb0edb80d7b8 100644
--- a/arch/arm/lib/sha1.S
+++ b/arch/arm/lib/sha1.S
@@ -3,7 +3,7 @@
3 * 3 *
4 * SHA transform optimized for ARM 4 * SHA transform optimized for ARM
5 * 5 *
6 * Copyright: (C) 2005 by Nicolas Pitre <nico@cam.org> 6 * Copyright: (C) 2005 by Nicolas Pitre <nico@fluxnic.net>
7 * Created: September 17, 2005 7 * Created: September 17, 2005
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
diff --git a/arch/arm/mach-at91/at91cap9_devices.c b/arch/arm/mach-at91/at91cap9_devices.c
index 412aa49ad2fb..d1f775e86353 100644
--- a/arch/arm/mach-at91/at91cap9_devices.c
+++ b/arch/arm/mach-at91/at91cap9_devices.c
@@ -771,9 +771,9 @@ void __init at91_add_device_pwm(u32 mask) {}
771 * AC97 771 * AC97
772 * -------------------------------------------------------------------- */ 772 * -------------------------------------------------------------------- */
773 773
774#if defined(CONFIG_SND_AT91_AC97) || defined(CONFIG_SND_AT91_AC97_MODULE) 774#if defined(CONFIG_SND_ATMEL_AC97C) || defined(CONFIG_SND_ATMEL_AC97C_MODULE)
775static u64 ac97_dmamask = DMA_BIT_MASK(32); 775static u64 ac97_dmamask = DMA_BIT_MASK(32);
776static struct atmel_ac97_data ac97_data; 776static struct ac97c_platform_data ac97_data;
777 777
778static struct resource ac97_resources[] = { 778static struct resource ac97_resources[] = {
779 [0] = { 779 [0] = {
@@ -789,7 +789,7 @@ static struct resource ac97_resources[] = {
789}; 789};
790 790
791static struct platform_device at91cap9_ac97_device = { 791static struct platform_device at91cap9_ac97_device = {
792 .name = "ac97c", 792 .name = "atmel_ac97c",
793 .id = 1, 793 .id = 1,
794 .dev = { 794 .dev = {
795 .dma_mask = &ac97_dmamask, 795 .dma_mask = &ac97_dmamask,
@@ -800,7 +800,7 @@ static struct platform_device at91cap9_ac97_device = {
800 .num_resources = ARRAY_SIZE(ac97_resources), 800 .num_resources = ARRAY_SIZE(ac97_resources),
801}; 801};
802 802
803void __init at91_add_device_ac97(struct atmel_ac97_data *data) 803void __init at91_add_device_ac97(struct ac97c_platform_data *data)
804{ 804{
805 if (!data) 805 if (!data)
806 return; 806 return;
@@ -818,7 +818,7 @@ void __init at91_add_device_ac97(struct atmel_ac97_data *data)
818 platform_device_register(&at91cap9_ac97_device); 818 platform_device_register(&at91cap9_ac97_device);
819} 819}
820#else 820#else
821void __init at91_add_device_ac97(struct atmel_ac97_data *data) {} 821void __init at91_add_device_ac97(struct ac97c_platform_data *data) {}
822#endif 822#endif
823 823
824 824
diff --git a/arch/arm/mach-at91/board-cap9adk.c b/arch/arm/mach-at91/board-cap9adk.c
index 83a1a0fef47b..d6940870e403 100644
--- a/arch/arm/mach-at91/board-cap9adk.c
+++ b/arch/arm/mach-at91/board-cap9adk.c
@@ -364,7 +364,7 @@ static struct atmel_lcdfb_info __initdata cap9adk_lcdc_data;
364/* 364/*
365 * AC97 365 * AC97
366 */ 366 */
367static struct atmel_ac97_data cap9adk_ac97_data = { 367static struct ac97c_platform_data cap9adk_ac97_data = {
368// .reset_pin = ... not connected 368// .reset_pin = ... not connected
369}; 369};
370 370
diff --git a/arch/arm/mach-at91/board-neocore926.c b/arch/arm/mach-at91/board-neocore926.c
index 9ba7ba2cc3b1..f78a55e5ad08 100644
--- a/arch/arm/mach-at91/board-neocore926.c
+++ b/arch/arm/mach-at91/board-neocore926.c
@@ -340,7 +340,7 @@ static void __init neocore926_add_device_buttons(void) {}
340/* 340/*
341 * AC97 341 * AC97
342 */ 342 */
343static struct atmel_ac97_data neocore926_ac97_data = { 343static struct ac97c_platform_data neocore926_ac97_data = {
344 .reset_pin = AT91_PIN_PA13, 344 .reset_pin = AT91_PIN_PA13,
345}; 345};
346 346
diff --git a/arch/arm/mach-pxa/spitz.c b/arch/arm/mach-pxa/spitz.c
index f9dc59c054b3..ee8d6038ce82 100644
--- a/arch/arm/mach-pxa/spitz.c
+++ b/arch/arm/mach-pxa/spitz.c
@@ -423,6 +423,7 @@ static struct ads7846_platform_data spitz_ads7846_info = {
423 .vref_delay_usecs = 100, 423 .vref_delay_usecs = 100,
424 .x_plate_ohms = 419, 424 .x_plate_ohms = 419,
425 .y_plate_ohms = 486, 425 .y_plate_ohms = 486,
426 .pressure_max = 1024,
426 .gpio_pendown = SPITZ_GPIO_TP_INT, 427 .gpio_pendown = SPITZ_GPIO_TP_INT,
427 .wait_for_sync = spitz_wait_for_hsync, 428 .wait_for_sync = spitz_wait_for_hsync,
428}; 429};
diff --git a/arch/arm/mach-s3c2410/Kconfig b/arch/arm/mach-s3c2410/Kconfig
index d8c023d4df30..3d4e9da3fa52 100644
--- a/arch/arm/mach-s3c2410/Kconfig
+++ b/arch/arm/mach-s3c2410/Kconfig
@@ -77,6 +77,7 @@ config ARCH_H1940
77 select CPU_S3C2410 77 select CPU_S3C2410
78 select PM_H1940 if PM 78 select PM_H1940 if PM
79 select S3C_DEV_USB_HOST 79 select S3C_DEV_USB_HOST
80 select S3C_DEV_NAND
80 help 81 help
81 Say Y here if you are using the HP IPAQ H1940 82 Say Y here if you are using the HP IPAQ H1940
82 83
@@ -89,6 +90,7 @@ config MACH_N30
89 bool "Acer N30 family" 90 bool "Acer N30 family"
90 select CPU_S3C2410 91 select CPU_S3C2410
91 select S3C_DEV_USB_HOST 92 select S3C_DEV_USB_HOST
93 select S3C_DEV_NAND
92 help 94 help
93 Say Y here if you want suppt for the Acer N30, Acer N35, 95 Say Y here if you want suppt for the Acer N30, Acer N35,
94 Navman PiN570, Yakumo AlphaX or Airis NC05 PDAs. 96 Navman PiN570, Yakumo AlphaX or Airis NC05 PDAs.
@@ -103,6 +105,7 @@ config ARCH_BAST
103 select S3C24XX_DCLK 105 select S3C24XX_DCLK
104 select ISA 106 select ISA
105 select S3C_DEV_USB_HOST 107 select S3C_DEV_USB_HOST
108 select S3C_DEV_NAND
106 help 109 help
107 Say Y here if you are using the Simtec Electronics EB2410ITX 110 Say Y here if you are using the Simtec Electronics EB2410ITX
108 development board (also known as BAST) 111 development board (also known as BAST)
@@ -111,6 +114,7 @@ config MACH_OTOM
111 bool "NexVision OTOM Board" 114 bool "NexVision OTOM Board"
112 select CPU_S3C2410 115 select CPU_S3C2410
113 select S3C_DEV_USB_HOST 116 select S3C_DEV_USB_HOST
117 select S3C_DEV_NAND
114 help 118 help
115 Say Y here if you are using the Nex Vision OTOM board 119 Say Y here if you are using the Nex Vision OTOM board
116 120
@@ -154,6 +158,7 @@ config MACH_QT2410
154 bool "QT2410" 158 bool "QT2410"
155 select CPU_S3C2410 159 select CPU_S3C2410
156 select S3C_DEV_USB_HOST 160 select S3C_DEV_USB_HOST
161 select S3C_DEV_NAND
157 help 162 help
158 Say Y here if you are using the Armzone QT2410 163 Say Y here if you are using the Armzone QT2410
159 164
diff --git a/arch/arm/mach-s3c2412/Kconfig b/arch/arm/mach-s3c2412/Kconfig
index 35c1bde89cf2..c2bdc4635d12 100644
--- a/arch/arm/mach-s3c2412/Kconfig
+++ b/arch/arm/mach-s3c2412/Kconfig
@@ -48,6 +48,7 @@ config MACH_JIVE
48 bool "Logitech Jive" 48 bool "Logitech Jive"
49 select CPU_S3C2412 49 select CPU_S3C2412
50 select S3C_DEV_USB_HOST 50 select S3C_DEV_USB_HOST
51 select S3C_DEV_NAND
51 help 52 help
52 Say Y here if you are using the Logitech Jive. 53 Say Y here if you are using the Logitech Jive.
53 54
@@ -61,6 +62,7 @@ config MACH_SMDK2413
61 select MACH_S3C2413 62 select MACH_S3C2413
62 select MACH_SMDK 63 select MACH_SMDK
63 select S3C_DEV_USB_HOST 64 select S3C_DEV_USB_HOST
65 select S3C_DEV_NAND
64 help 66 help
65 Say Y here if you are using an SMDK2413 67 Say Y here if you are using an SMDK2413
66 68
@@ -84,6 +86,7 @@ config MACH_VSTMS
84 bool "VMSTMS" 86 bool "VMSTMS"
85 select CPU_S3C2412 87 select CPU_S3C2412
86 select S3C_DEV_USB_HOST 88 select S3C_DEV_USB_HOST
89 select S3C_DEV_NAND
87 help 90 help
88 Say Y here if you are using an VSTMS board 91 Say Y here if you are using an VSTMS board
89 92
diff --git a/arch/arm/mach-s3c2440/Kconfig b/arch/arm/mach-s3c2440/Kconfig
index 8ae1b288f7fa..d7bba919a77e 100644
--- a/arch/arm/mach-s3c2440/Kconfig
+++ b/arch/arm/mach-s3c2440/Kconfig
@@ -48,6 +48,7 @@ config MACH_OSIRIS
48 select S3C2440_XTAL_12000000 48 select S3C2440_XTAL_12000000
49 select S3C2410_IOTIMING if S3C2440_CPUFREQ 49 select S3C2410_IOTIMING if S3C2440_CPUFREQ
50 select S3C_DEV_USB_HOST 50 select S3C_DEV_USB_HOST
51 select S3C_DEV_NAND
51 help 52 help
52 Say Y here if you are using the Simtec IM2440D20 module, also 53 Say Y here if you are using the Simtec IM2440D20 module, also
53 known as the Osiris. 54 known as the Osiris.
@@ -57,6 +58,7 @@ config MACH_RX3715
57 select CPU_S3C2440 58 select CPU_S3C2440
58 select S3C2440_XTAL_16934400 59 select S3C2440_XTAL_16934400
59 select PM_H1940 if PM 60 select PM_H1940 if PM
61 select S3C_DEV_NAND
60 help 62 help
61 Say Y here if you are using the HP iPAQ rx3715. 63 Say Y here if you are using the HP iPAQ rx3715.
62 64
@@ -66,6 +68,7 @@ config ARCH_S3C2440
66 select S3C2440_XTAL_16934400 68 select S3C2440_XTAL_16934400
67 select MACH_SMDK 69 select MACH_SMDK
68 select S3C_DEV_USB_HOST 70 select S3C_DEV_USB_HOST
71 select S3C_DEV_NAND
69 help 72 help
70 Say Y here if you are using the SMDK2440. 73 Say Y here if you are using the SMDK2440.
71 74
@@ -74,6 +77,7 @@ config MACH_NEXCODER_2440
74 select CPU_S3C2440 77 select CPU_S3C2440
75 select S3C2440_XTAL_12000000 78 select S3C2440_XTAL_12000000
76 select S3C_DEV_USB_HOST 79 select S3C_DEV_USB_HOST
80 select S3C_DEV_NAND
77 help 81 help
78 Say Y here if you are using the Nex Vision NEXCODER 2440 Light Board 82 Say Y here if you are using the Nex Vision NEXCODER 2440 Light Board
79 83
@@ -88,6 +92,7 @@ config MACH_AT2440EVB
88 bool "Avantech AT2440EVB development board" 92 bool "Avantech AT2440EVB development board"
89 select CPU_S3C2440 93 select CPU_S3C2440
90 select S3C_DEV_USB_HOST 94 select S3C_DEV_USB_HOST
95 select S3C_DEV_NAND
91 help 96 help
92 Say Y here if you are using the AT2440EVB development board 97 Say Y here if you are using the AT2440EVB development board
93 98
@@ -97,6 +102,7 @@ config MACH_MINI2440
97 select EEPROM_AT24 102 select EEPROM_AT24
98 select LEDS_TRIGGER_BACKLIGHT 103 select LEDS_TRIGGER_BACKLIGHT
99 select SND_S3C24XX_SOC_S3C24XX_UDA134X 104 select SND_S3C24XX_SOC_S3C24XX_UDA134X
105 select S3C_DEV_NAND
100 help 106 help
101 Say Y here to select support for the MINI2440. Is a 10cm x 10cm board 107 Say Y here to select support for the MINI2440. Is a 10cm x 10cm board
102 available via various sources. It can come with a 3.5" or 7" touch LCD. 108 available via various sources. It can come with a 3.5" or 7" touch LCD.
diff --git a/arch/arm/mach-s3c6400/Kconfig b/arch/arm/mach-s3c6400/Kconfig
index f5af212066c3..770b72067e3d 100644
--- a/arch/arm/mach-s3c6400/Kconfig
+++ b/arch/arm/mach-s3c6400/Kconfig
@@ -26,6 +26,7 @@ config MACH_SMDK6400
26 bool "SMDK6400" 26 bool "SMDK6400"
27 select CPU_S3C6400 27 select CPU_S3C6400
28 select S3C_DEV_HSMMC 28 select S3C_DEV_HSMMC
29 select S3C_DEV_NAND
29 select S3C6400_SETUP_SDHCI 30 select S3C6400_SETUP_SDHCI
30 help 31 help
31 Machine support for the Samsung SMDK6400 32 Machine support for the Samsung SMDK6400
diff --git a/arch/arm/mach-s3c6410/Kconfig b/arch/arm/mach-s3c6410/Kconfig
index f9d0f09f9761..53fc3ff657f7 100644
--- a/arch/arm/mach-s3c6410/Kconfig
+++ b/arch/arm/mach-s3c6410/Kconfig
@@ -102,6 +102,7 @@ config MACH_HMT
102 bool "Airgoo HMT" 102 bool "Airgoo HMT"
103 select CPU_S3C6410 103 select CPU_S3C6410
104 select S3C_DEV_FB 104 select S3C_DEV_FB
105 select S3C_DEV_NAND
105 select S3C_DEV_USB_HOST 106 select S3C_DEV_USB_HOST
106 select S3C64XX_SETUP_FB_24BPP 107 select S3C64XX_SETUP_FB_24BPP
107 select HAVE_PWM 108 select HAVE_PWM
diff --git a/arch/arm/mach-sa1100/dma.c b/arch/arm/mach-sa1100/dma.c
index 95f9c5a6d6d5..cb4521a6f42d 100644
--- a/arch/arm/mach-sa1100/dma.c
+++ b/arch/arm/mach-sa1100/dma.c
@@ -39,7 +39,7 @@ typedef struct {
39 39
40static sa1100_dma_t dma_chan[SA1100_DMA_CHANNELS]; 40static sa1100_dma_t dma_chan[SA1100_DMA_CHANNELS];
41 41
42static spinlock_t dma_list_lock; 42static DEFINE_SPINLOCK(dma_list_lock);
43 43
44 44
45static irqreturn_t dma_irq_handler(int irq, void *dev_id) 45static irqreturn_t dma_irq_handler(int irq, void *dev_id)
diff --git a/arch/arm/mach-sa1100/include/mach/assabet.h b/arch/arm/mach-sa1100/include/mach/assabet.h
index 3959b20d5d1c..28c2cf50c259 100644
--- a/arch/arm/mach-sa1100/include/mach/assabet.h
+++ b/arch/arm/mach-sa1100/include/mach/assabet.h
@@ -1,7 +1,7 @@
1/* 1/*
2 * arch/arm/mach-sa1100/include/mach/assabet.h 2 * arch/arm/mach-sa1100/include/mach/assabet.h
3 * 3 *
4 * Created 2000/06/05 by Nicolas Pitre <nico@cam.org> 4 * Created 2000/06/05 by Nicolas Pitre <nico@fluxnic.net>
5 * 5 *
6 * This file contains the hardware specific definitions for Assabet 6 * This file contains the hardware specific definitions for Assabet
7 * Only include this file from SA1100-specific files. 7 * Only include this file from SA1100-specific files.
diff --git a/arch/arm/mach-sa1100/include/mach/hardware.h b/arch/arm/mach-sa1100/include/mach/hardware.h
index 60711822b125..99f5856d8de4 100644
--- a/arch/arm/mach-sa1100/include/mach/hardware.h
+++ b/arch/arm/mach-sa1100/include/mach/hardware.h
@@ -1,7 +1,7 @@
1/* 1/*
2 * arch/arm/mach-sa1100/include/mach/hardware.h 2 * arch/arm/mach-sa1100/include/mach/hardware.h
3 * 3 *
4 * Copyright (C) 1998 Nicolas Pitre <nico@cam.org> 4 * Copyright (C) 1998 Nicolas Pitre <nico@fluxnic.net>
5 * 5 *
6 * This file contains the hardware definitions for SA1100 architecture 6 * This file contains the hardware definitions for SA1100 architecture
7 * 7 *
diff --git a/arch/arm/mach-sa1100/include/mach/memory.h b/arch/arm/mach-sa1100/include/mach/memory.h
index e9f8eed900f5..d5277f9bee77 100644
--- a/arch/arm/mach-sa1100/include/mach/memory.h
+++ b/arch/arm/mach-sa1100/include/mach/memory.h
@@ -1,7 +1,7 @@
1/* 1/*
2 * arch/arm/mach-sa1100/include/mach/memory.h 2 * arch/arm/mach-sa1100/include/mach/memory.h
3 * 3 *
4 * Copyright (C) 1999-2000 Nicolas Pitre <nico@cam.org> 4 * Copyright (C) 1999-2000 Nicolas Pitre <nico@fluxnic.net>
5 */ 5 */
6 6
7#ifndef __ASM_ARCH_MEMORY_H 7#ifndef __ASM_ARCH_MEMORY_H
diff --git a/arch/arm/mach-sa1100/include/mach/neponset.h b/arch/arm/mach-sa1100/include/mach/neponset.h
index d3f044f92c00..ffe2bc45eed0 100644
--- a/arch/arm/mach-sa1100/include/mach/neponset.h
+++ b/arch/arm/mach-sa1100/include/mach/neponset.h
@@ -1,7 +1,7 @@
1/* 1/*
2 * arch/arm/mach-sa1100/include/mach/neponset.h 2 * arch/arm/mach-sa1100/include/mach/neponset.h
3 * 3 *
4 * Created 2000/06/05 by Nicolas Pitre <nico@cam.org> 4 * Created 2000/06/05 by Nicolas Pitre <nico@fluxnic.net>
5 * 5 *
6 * This file contains the hardware specific definitions for Assabet 6 * This file contains the hardware specific definitions for Assabet
7 * Only include this file from SA1100-specific files. 7 * Only include this file from SA1100-specific files.
diff --git a/arch/arm/mach-sa1100/include/mach/system.h b/arch/arm/mach-sa1100/include/mach/system.h
index 942b153e251d..ba9da9f7f183 100644
--- a/arch/arm/mach-sa1100/include/mach/system.h
+++ b/arch/arm/mach-sa1100/include/mach/system.h
@@ -1,7 +1,7 @@
1/* 1/*
2 * arch/arm/mach-sa1100/include/mach/system.h 2 * arch/arm/mach-sa1100/include/mach/system.h
3 * 3 *
4 * Copyright (c) 1999 Nicolas Pitre <nico@cam.org> 4 * Copyright (c) 1999 Nicolas Pitre <nico@fluxnic.net>
5 */ 5 */
6#include <mach/hardware.h> 6#include <mach/hardware.h>
7 7
diff --git a/arch/arm/mach-sa1100/include/mach/uncompress.h b/arch/arm/mach-sa1100/include/mach/uncompress.h
index 714160b03d7a..6cb39ddde656 100644
--- a/arch/arm/mach-sa1100/include/mach/uncompress.h
+++ b/arch/arm/mach-sa1100/include/mach/uncompress.h
@@ -1,7 +1,7 @@
1/* 1/*
2 * arch/arm/mach-sa1100/include/mach/uncompress.h 2 * arch/arm/mach-sa1100/include/mach/uncompress.h
3 * 3 *
4 * (C) 1999 Nicolas Pitre <nico@cam.org> 4 * (C) 1999 Nicolas Pitre <nico@fluxnic.net>
5 * 5 *
6 * Reorganised to be machine independent. 6 * Reorganised to be machine independent.
7 */ 7 */
diff --git a/arch/arm/mach-sa1100/pm.c b/arch/arm/mach-sa1100/pm.c
index 111cce67ad2f..c83fdc80edfd 100644
--- a/arch/arm/mach-sa1100/pm.c
+++ b/arch/arm/mach-sa1100/pm.c
@@ -15,7 +15,7 @@
15 * Save more value for the resume function! Support 15 * Save more value for the resume function! Support
16 * Bitsy/Assabet/Freebird board 16 * Bitsy/Assabet/Freebird board
17 * 17 *
18 * 2001-08-29: Nicolas Pitre <nico@cam.org> 18 * 2001-08-29: Nicolas Pitre <nico@fluxnic.net>
19 * Cleaned up, pushed platform dependent stuff 19 * Cleaned up, pushed platform dependent stuff
20 * in the platform specific files. 20 * in the platform specific files.
21 * 21 *
diff --git a/arch/arm/mach-sa1100/time.c b/arch/arm/mach-sa1100/time.c
index 711c0295c66f..95d92e8e56a8 100644
--- a/arch/arm/mach-sa1100/time.c
+++ b/arch/arm/mach-sa1100/time.c
@@ -4,7 +4,7 @@
4 * Copyright (C) 1998 Deborah Wallach. 4 * Copyright (C) 1998 Deborah Wallach.
5 * Twiddles (C) 1999 Hugo Fiennes <hugo@empeg.com> 5 * Twiddles (C) 1999 Hugo Fiennes <hugo@empeg.com>
6 * 6 *
7 * 2000/03/29 (C) Nicolas Pitre <nico@cam.org> 7 * 2000/03/29 (C) Nicolas Pitre <nico@fluxnic.net>
8 * Rewritten: big cleanup, much simpler, better HZ accuracy. 8 * Rewritten: big cleanup, much simpler, better HZ accuracy.
9 * 9 *
10 */ 10 */
diff --git a/arch/arm/mm/Kconfig b/arch/arm/mm/Kconfig
index 5fe595aeba69..8d43e58f9244 100644
--- a/arch/arm/mm/Kconfig
+++ b/arch/arm/mm/Kconfig
@@ -771,3 +771,8 @@ config CACHE_XSC3L2
771 select OUTER_CACHE 771 select OUTER_CACHE
772 help 772 help
773 This option enables the L2 cache on XScale3. 773 This option enables the L2 cache on XScale3.
774
775config ARM_L1_CACHE_SHIFT
776 int
777 default 6 if ARCH_OMAP3
778 default 5
diff --git a/arch/arm/mm/fault.c b/arch/arm/mm/fault.c
index cc8829d7e116..379f78556055 100644
--- a/arch/arm/mm/fault.c
+++ b/arch/arm/mm/fault.c
@@ -25,6 +25,19 @@
25 25
26#include "fault.h" 26#include "fault.h"
27 27
28/*
29 * Fault status register encodings. We steal bit 31 for our own purposes.
30 */
31#define FSR_LNX_PF (1 << 31)
32#define FSR_WRITE (1 << 11)
33#define FSR_FS4 (1 << 10)
34#define FSR_FS3_0 (15)
35
36static inline int fsr_fs(unsigned int fsr)
37{
38 return (fsr & FSR_FS3_0) | (fsr & FSR_FS4) >> 6;
39}
40
28#ifdef CONFIG_MMU 41#ifdef CONFIG_MMU
29 42
30#ifdef CONFIG_KPROBES 43#ifdef CONFIG_KPROBES
@@ -182,18 +195,35 @@ void do_bad_area(unsigned long addr, unsigned int fsr, struct pt_regs *regs)
182#define VM_FAULT_BADMAP 0x010000 195#define VM_FAULT_BADMAP 0x010000
183#define VM_FAULT_BADACCESS 0x020000 196#define VM_FAULT_BADACCESS 0x020000
184 197
185static int 198/*
199 * Check that the permissions on the VMA allow for the fault which occurred.
200 * If we encountered a write fault, we must have write permission, otherwise
201 * we allow any permission.
202 */
203static inline bool access_error(unsigned int fsr, struct vm_area_struct *vma)
204{
205 unsigned int mask = VM_READ | VM_WRITE | VM_EXEC;
206
207 if (fsr & FSR_WRITE)
208 mask = VM_WRITE;
209 if (fsr & FSR_LNX_PF)
210 mask = VM_EXEC;
211
212 return vma->vm_flags & mask ? false : true;
213}
214
215static int __kprobes
186__do_page_fault(struct mm_struct *mm, unsigned long addr, unsigned int fsr, 216__do_page_fault(struct mm_struct *mm, unsigned long addr, unsigned int fsr,
187 struct task_struct *tsk) 217 struct task_struct *tsk)
188{ 218{
189 struct vm_area_struct *vma; 219 struct vm_area_struct *vma;
190 int fault, mask; 220 int fault;
191 221
192 vma = find_vma(mm, addr); 222 vma = find_vma(mm, addr);
193 fault = VM_FAULT_BADMAP; 223 fault = VM_FAULT_BADMAP;
194 if (!vma) 224 if (unlikely(!vma))
195 goto out; 225 goto out;
196 if (vma->vm_start > addr) 226 if (unlikely(vma->vm_start > addr))
197 goto check_stack; 227 goto check_stack;
198 228
199 /* 229 /*
@@ -201,47 +231,24 @@ __do_page_fault(struct mm_struct *mm, unsigned long addr, unsigned int fsr,
201 * memory access, so we can handle it. 231 * memory access, so we can handle it.
202 */ 232 */
203good_area: 233good_area:
204 if (fsr & (1 << 11)) /* write? */ 234 if (access_error(fsr, vma)) {
205 mask = VM_WRITE; 235 fault = VM_FAULT_BADACCESS;
206 else
207 mask = VM_READ|VM_EXEC|VM_WRITE;
208
209 fault = VM_FAULT_BADACCESS;
210 if (!(vma->vm_flags & mask))
211 goto out; 236 goto out;
237 }
212 238
213 /* 239 /*
214 * If for any reason at all we couldn't handle 240 * If for any reason at all we couldn't handle the fault, make
215 * the fault, make sure we exit gracefully rather 241 * sure we exit gracefully rather than endlessly redo the fault.
216 * than endlessly redo the fault.
217 */ 242 */
218survive: 243 fault = handle_mm_fault(mm, vma, addr & PAGE_MASK, (fsr & FSR_WRITE) ? FAULT_FLAG_WRITE : 0);
219 fault = handle_mm_fault(mm, vma, addr & PAGE_MASK, (fsr & (1 << 11)) ? FAULT_FLAG_WRITE : 0); 244 if (unlikely(fault & VM_FAULT_ERROR))
220 if (unlikely(fault & VM_FAULT_ERROR)) { 245 return fault;
221 if (fault & VM_FAULT_OOM)
222 goto out_of_memory;
223 else if (fault & VM_FAULT_SIGBUS)
224 return fault;
225 BUG();
226 }
227 if (fault & VM_FAULT_MAJOR) 246 if (fault & VM_FAULT_MAJOR)
228 tsk->maj_flt++; 247 tsk->maj_flt++;
229 else 248 else
230 tsk->min_flt++; 249 tsk->min_flt++;
231 return fault; 250 return fault;
232 251
233out_of_memory:
234 if (!is_global_init(tsk))
235 goto out;
236
237 /*
238 * If we are out of memory for pid1, sleep for a while and retry
239 */
240 up_read(&mm->mmap_sem);
241 yield();
242 down_read(&mm->mmap_sem);
243 goto survive;
244
245check_stack: 252check_stack:
246 if (vma->vm_flags & VM_GROWSDOWN && !expand_stack(vma, addr)) 253 if (vma->vm_flags & VM_GROWSDOWN && !expand_stack(vma, addr))
247 goto good_area; 254 goto good_area;
@@ -278,6 +285,13 @@ do_page_fault(unsigned long addr, unsigned int fsr, struct pt_regs *regs)
278 if (!user_mode(regs) && !search_exception_tables(regs->ARM_pc)) 285 if (!user_mode(regs) && !search_exception_tables(regs->ARM_pc))
279 goto no_context; 286 goto no_context;
280 down_read(&mm->mmap_sem); 287 down_read(&mm->mmap_sem);
288 } else {
289 /*
290 * The above down_read_trylock() might have succeeded in
291 * which case, we'll have missed the might_sleep() from
292 * down_read()
293 */
294 might_sleep();
281 } 295 }
282 296
283 fault = __do_page_fault(mm, addr, fsr, tsk); 297 fault = __do_page_fault(mm, addr, fsr, tsk);
@@ -289,6 +303,16 @@ do_page_fault(unsigned long addr, unsigned int fsr, struct pt_regs *regs)
289 if (likely(!(fault & (VM_FAULT_ERROR | VM_FAULT_BADMAP | VM_FAULT_BADACCESS)))) 303 if (likely(!(fault & (VM_FAULT_ERROR | VM_FAULT_BADMAP | VM_FAULT_BADACCESS))))
290 return 0; 304 return 0;
291 305
306 if (fault & VM_FAULT_OOM) {
307 /*
308 * We ran out of memory, call the OOM killer, and return to
309 * userspace (which will retry the fault, or kill us if we
310 * got oom-killed)
311 */
312 pagefault_out_of_memory();
313 return 0;
314 }
315
292 /* 316 /*
293 * If we are in kernel mode at this point, we 317 * If we are in kernel mode at this point, we
294 * have no context to handle this fault with. 318 * have no context to handle this fault with.
@@ -296,16 +320,6 @@ do_page_fault(unsigned long addr, unsigned int fsr, struct pt_regs *regs)
296 if (!user_mode(regs)) 320 if (!user_mode(regs))
297 goto no_context; 321 goto no_context;
298 322
299 if (fault & VM_FAULT_OOM) {
300 /*
301 * We ran out of memory, or some other thing
302 * happened to us that made us unable to handle
303 * the page fault gracefully.
304 */
305 printk("VM: killing process %s\n", tsk->comm);
306 do_group_exit(SIGKILL);
307 return 0;
308 }
309 if (fault & VM_FAULT_SIGBUS) { 323 if (fault & VM_FAULT_SIGBUS) {
310 /* 324 /*
311 * We had some memory, but were unable to 325 * We had some memory, but were unable to
@@ -489,10 +503,10 @@ hook_fault_code(int nr, int (*fn)(unsigned long, unsigned int, struct pt_regs *)
489asmlinkage void __exception 503asmlinkage void __exception
490do_DataAbort(unsigned long addr, unsigned int fsr, struct pt_regs *regs) 504do_DataAbort(unsigned long addr, unsigned int fsr, struct pt_regs *regs)
491{ 505{
492 const struct fsr_info *inf = fsr_info + (fsr & 15) + ((fsr & (1 << 10)) >> 6); 506 const struct fsr_info *inf = fsr_info + fsr_fs(fsr);
493 struct siginfo info; 507 struct siginfo info;
494 508
495 if (!inf->fn(addr, fsr, regs)) 509 if (!inf->fn(addr, fsr & ~FSR_LNX_PF, regs))
496 return; 510 return;
497 511
498 printk(KERN_ALERT "Unhandled fault: %s (0x%03x) at 0x%08lx\n", 512 printk(KERN_ALERT "Unhandled fault: %s (0x%03x) at 0x%08lx\n",
@@ -508,6 +522,6 @@ do_DataAbort(unsigned long addr, unsigned int fsr, struct pt_regs *regs)
508asmlinkage void __exception 522asmlinkage void __exception
509do_PrefetchAbort(unsigned long addr, struct pt_regs *regs) 523do_PrefetchAbort(unsigned long addr, struct pt_regs *regs)
510{ 524{
511 do_translation_fault(addr, 0, regs); 525 do_translation_fault(addr, FSR_LNX_PF, regs);
512} 526}
513 527
diff --git a/arch/arm/mm/proc-xscale.S b/arch/arm/mm/proc-xscale.S
index 0cce37b93937..423394260bcb 100644
--- a/arch/arm/mm/proc-xscale.S
+++ b/arch/arm/mm/proc-xscale.S
@@ -17,7 +17,7 @@
17 * 17 *
18 * 2001 Sep 08: 18 * 2001 Sep 08:
19 * Completely revisited, many important fixes 19 * Completely revisited, many important fixes
20 * Nicolas Pitre <nico@cam.org> 20 * Nicolas Pitre <nico@fluxnic.net>
21 */ 21 */
22 22
23#include <linux/linkage.h> 23#include <linux/linkage.h>
diff --git a/arch/arm/plat-iop/setup.c b/arch/arm/plat-iop/setup.c
index 9e573e78176a..bade586fed0f 100644
--- a/arch/arm/plat-iop/setup.c
+++ b/arch/arm/plat-iop/setup.c
@@ -1,7 +1,7 @@
1/* 1/*
2 * arch/arm/plat-iop/setup.c 2 * arch/arm/plat-iop/setup.c
3 * 3 *
4 * Author: Nicolas Pitre <nico@cam.org> 4 * Author: Nicolas Pitre <nico@fluxnic.net>
5 * Copyright (C) 2001 MontaVista Software, Inc. 5 * Copyright (C) 2001 MontaVista Software, Inc.
6 * Copyright (C) 2004 Intel Corporation. 6 * Copyright (C) 2004 Intel Corporation.
7 * 7 *
diff --git a/arch/arm/plat-omap/include/mach/system.h b/arch/arm/plat-omap/include/mach/system.h
index 1060e345423b..ed8ec7477261 100644
--- a/arch/arm/plat-omap/include/mach/system.h
+++ b/arch/arm/plat-omap/include/mach/system.h
@@ -1,6 +1,6 @@
1/* 1/*
2 * Copied from arch/arm/mach-sa1100/include/mach/system.h 2 * Copied from arch/arm/mach-sa1100/include/mach/system.h
3 * Copyright (c) 1999 Nicolas Pitre <nico@cam.org> 3 * Copyright (c) 1999 Nicolas Pitre <nico@fluxnic.net>
4 */ 4 */
5#ifndef __ASM_ARCH_SYSTEM_H 5#ifndef __ASM_ARCH_SYSTEM_H
6#define __ASM_ARCH_SYSTEM_H 6#define __ASM_ARCH_SYSTEM_H
diff --git a/arch/arm/plat-s3c/gpio.c b/arch/arm/plat-s3c/gpio.c
index 260fdc6ad685..5ff24e0f9f89 100644
--- a/arch/arm/plat-s3c/gpio.c
+++ b/arch/arm/plat-s3c/gpio.c
@@ -28,7 +28,7 @@ static __init void s3c_gpiolib_track(struct s3c_gpio_chip *chip)
28 28
29 gpn = chip->chip.base; 29 gpn = chip->chip.base;
30 for (i = 0; i < chip->chip.ngpio; i++, gpn++) { 30 for (i = 0; i < chip->chip.ngpio; i++, gpn++) {
31 BUG_ON(gpn > ARRAY_SIZE(s3c_gpios)); 31 BUG_ON(gpn >= ARRAY_SIZE(s3c_gpios));
32 s3c_gpios[gpn] = chip; 32 s3c_gpios[gpn] = chip;
33 } 33 }
34} 34}
diff --git a/arch/arm/plat-s3c64xx/dma.c b/arch/arm/plat-s3c64xx/dma.c
index 67aa93dbb69e..266a10745a85 100644
--- a/arch/arm/plat-s3c64xx/dma.c
+++ b/arch/arm/plat-s3c64xx/dma.c
@@ -345,13 +345,13 @@ int s3c2410_dma_enqueue(unsigned int channel, void *id,
345 if (!chan) 345 if (!chan)
346 return -EINVAL; 346 return -EINVAL;
347 347
348 buff = kzalloc(sizeof(struct s3c64xx_dma_buff), GFP_KERNEL); 348 buff = kzalloc(sizeof(struct s3c64xx_dma_buff), GFP_ATOMIC);
349 if (!buff) { 349 if (!buff) {
350 printk(KERN_ERR "%s: no memory for buffer\n", __func__); 350 printk(KERN_ERR "%s: no memory for buffer\n", __func__);
351 return -ENOMEM; 351 return -ENOMEM;
352 } 352 }
353 353
354 lli = dma_pool_alloc(dma_pool, GFP_KERNEL, &buff->lli_dma); 354 lli = dma_pool_alloc(dma_pool, GFP_ATOMIC, &buff->lli_dma);
355 if (!lli) { 355 if (!lli) {
356 printk(KERN_ERR "%s: no memory for lli\n", __func__); 356 printk(KERN_ERR "%s: no memory for lli\n", __func__);
357 ret = -ENOMEM; 357 ret = -ENOMEM;
@@ -697,7 +697,7 @@ static int __init s3c64xx_dma_init(void)
697 697
698 printk(KERN_INFO "%s: Registering DMA channels\n", __func__); 698 printk(KERN_INFO "%s: Registering DMA channels\n", __func__);
699 699
700 dma_pool = dma_pool_create("DMA-LLI", NULL, 32, 16, 0); 700 dma_pool = dma_pool_create("DMA-LLI", NULL, sizeof(struct pl080s_lli), 16, 0);
701 if (!dma_pool) { 701 if (!dma_pool) {
702 printk(KERN_ERR "%s: failed to create pool\n", __func__); 702 printk(KERN_ERR "%s: failed to create pool\n", __func__);
703 return -ENOMEM; 703 return -ENOMEM;
diff --git a/arch/arm/plat-s3c64xx/include/plat/dma-plat.h b/arch/arm/plat-s3c64xx/include/plat/dma-plat.h
index 0c30dd986725..8f76a1e474d6 100644
--- a/arch/arm/plat-s3c64xx/include/plat/dma-plat.h
+++ b/arch/arm/plat-s3c64xx/include/plat/dma-plat.h
@@ -26,7 +26,7 @@ struct s3c64xx_dma_buff {
26 struct s3c64xx_dma_buff *next; 26 struct s3c64xx_dma_buff *next;
27 27
28 void *pw; 28 void *pw;
29 struct pl080_lli *lli; 29 struct pl080s_lli *lli;
30 dma_addr_t lli_dma; 30 dma_addr_t lli_dma;
31}; 31};
32 32
diff --git a/arch/arm/plat-s3c64xx/include/plat/irqs.h b/arch/arm/plat-s3c64xx/include/plat/irqs.h
index 743a70094d04..7956fd3bb194 100644
--- a/arch/arm/plat-s3c64xx/include/plat/irqs.h
+++ b/arch/arm/plat-s3c64xx/include/plat/irqs.h
@@ -194,9 +194,17 @@
194 194
195#define IRQ_EINT_GROUP(group, no) (IRQ_EINT_GROUP##group##_BASE + (no)) 195#define IRQ_EINT_GROUP(group, no) (IRQ_EINT_GROUP##group##_BASE + (no))
196 196
197/* Define a group of interrupts for board-specific use (eg, for MFD
198 * interrupt controllers). */
199#define IRQ_BOARD_START (IRQ_EINT_GROUP9_BASE + IRQ_EINT_GROUP9_NR + 1)
200
201#define IRQ_BOARD_NR 16
202
203#define IRQ_BOARD_END (IRQ_BOARD_START + IRQ_BOARD_NR)
204
197/* Set the default NR_IRQS */ 205/* Set the default NR_IRQS */
198 206
199#define NR_IRQS (IRQ_EINT_GROUP9_BASE + IRQ_EINT_GROUP9_NR + 1) 207#define NR_IRQS (IRQ_BOARD_END + 1)
200 208
201#endif /* __ASM_PLAT_S3C64XX_IRQS_H */ 209#endif /* __ASM_PLAT_S3C64XX_IRQS_H */
202 210
diff --git a/arch/arm/plat-s3c64xx/s3c6400-clock.c b/arch/arm/plat-s3c64xx/s3c6400-clock.c
index febac1950d8e..9745852261e0 100644
--- a/arch/arm/plat-s3c64xx/s3c6400-clock.c
+++ b/arch/arm/plat-s3c64xx/s3c6400-clock.c
@@ -302,8 +302,8 @@ static int s3c64xx_setrate_clksrc(struct clk *clk, unsigned long rate)
302 return -EINVAL; 302 return -EINVAL;
303 303
304 val = __raw_readl(reg); 304 val = __raw_readl(reg);
305 val &= ~(0xf << sclk->shift); 305 val &= ~(0xf << sclk->divider_shift);
306 val |= (div - 1) << sclk->shift; 306 val |= (div - 1) << sclk->divider_shift;
307 __raw_writel(val, reg); 307 __raw_writel(val, reg);
308 308
309 return 0; 309 return 0;
@@ -328,6 +328,8 @@ static int s3c64xx_setparent_clksrc(struct clk *clk, struct clk *parent)
328 clksrc |= src_nr << sclk->shift; 328 clksrc |= src_nr << sclk->shift;
329 329
330 __raw_writel(clksrc, S3C_CLK_SRC); 330 __raw_writel(clksrc, S3C_CLK_SRC);
331
332 clk->parent = parent;
331 return 0; 333 return 0;
332 } 334 }
333 335
@@ -343,7 +345,7 @@ static unsigned long s3c64xx_roundrate_clksrc(struct clk *clk,
343 if (rate > parent_rate) 345 if (rate > parent_rate)
344 rate = parent_rate; 346 rate = parent_rate;
345 else { 347 else {
346 div = rate / parent_rate; 348 div = parent_rate / rate;
347 349
348 if (div == 0) 350 if (div == 0)
349 div = 1; 351 div = 1;
diff --git a/arch/arm/plat-stmp3xxx/dma.c b/arch/arm/plat-stmp3xxx/dma.c
index d2f497764dce..ef88f25fb870 100644
--- a/arch/arm/plat-stmp3xxx/dma.c
+++ b/arch/arm/plat-stmp3xxx/dma.c
@@ -264,7 +264,7 @@ int stmp3xxx_dma_make_chain(int ch, struct stmp37xx_circ_dma_chain *chain,
264 stmp3xxx_dma_free_command(ch, 264 stmp3xxx_dma_free_command(ch,
265 &descriptors 265 &descriptors
266 [i]); 266 [i]);
267 } while (i-- >= 0); 267 } while (i-- > 0);
268 } 268 }
269 return err; 269 return err;
270 } 270 }
diff --git a/arch/arm/tools/mach-types b/arch/arm/tools/mach-types
index c8c55b469342..94be7bb6cb9a 100644
--- a/arch/arm/tools/mach-types
+++ b/arch/arm/tools/mach-types
@@ -12,7 +12,7 @@
12# 12#
13# http://www.arm.linux.org.uk/developer/machines/?action=new 13# http://www.arm.linux.org.uk/developer/machines/?action=new
14# 14#
15# Last update: Sat Sep 12 12:00:16 2009 15# Last update: Fri Sep 18 21:42:00 2009
16# 16#
17# machine_is_xxx CONFIG_xxxx MACH_TYPE_xxx number 17# machine_is_xxx CONFIG_xxxx MACH_TYPE_xxx number
18# 18#
@@ -1638,7 +1638,7 @@ mx35evb MACH_MX35EVB MX35EVB 1643
1638aml_m8050 MACH_AML_M8050 AML_M8050 1644 1638aml_m8050 MACH_AML_M8050 AML_M8050 1644
1639mx35_3ds MACH_MX35_3DS MX35_3DS 1645 1639mx35_3ds MACH_MX35_3DS MX35_3DS 1645
1640mars MACH_MARS MARS 1646 1640mars MACH_MARS MARS 1646
1641ntosd_644xa MACH_NTOSD_644XA NTOSD_644XA 1647 1641neuros_osd2 MACH_NEUROS_OSD2 NEUROS_OSD2 1647
1642badger MACH_BADGER BADGER 1648 1642badger MACH_BADGER BADGER 1648
1643trizeps4wl MACH_TRIZEPS4WL TRIZEPS4WL 1649 1643trizeps4wl MACH_TRIZEPS4WL TRIZEPS4WL 1649
1644trizeps5 MACH_TRIZEPS5 TRIZEPS5 1650 1644trizeps5 MACH_TRIZEPS5 TRIZEPS5 1650
@@ -1654,7 +1654,7 @@ vf10xx MACH_VF10XX VF10XX 1659
1654zoran43xx MACH_ZORAN43XX ZORAN43XX 1660 1654zoran43xx MACH_ZORAN43XX ZORAN43XX 1660
1655sonix926 MACH_SONIX926 SONIX926 1661 1655sonix926 MACH_SONIX926 SONIX926 1661
1656celestialsemi MACH_CELESTIALSEMI CELESTIALSEMI 1662 1656celestialsemi MACH_CELESTIALSEMI CELESTIALSEMI 1662
1657cc9m2443 MACH_CC9M2443 CC9M2443 1663 1657cc9m2443js MACH_CC9M2443JS CC9M2443JS 1663
1658tw5334 MACH_TW5334 TW5334 1664 1658tw5334 MACH_TW5334 TW5334 1664
1659omap_htcartemis MACH_HTCARTEMIS HTCARTEMIS 1665 1659omap_htcartemis MACH_HTCARTEMIS HTCARTEMIS 1665
1660nal_hlite MACH_NAL_HLITE NAL_HLITE 1666 1660nal_hlite MACH_NAL_HLITE NAL_HLITE 1666
@@ -1802,7 +1802,7 @@ ccw9p9215js MACH_CCW9P9215JS CCW9P9215JS 1811
1802rd88f5181l_ge MACH_RD88F5181L_GE RD88F5181L_GE 1812 1802rd88f5181l_ge MACH_RD88F5181L_GE RD88F5181L_GE 1812
1803sifmain MACH_SIFMAIN SIFMAIN 1813 1803sifmain MACH_SIFMAIN SIFMAIN 1813
1804sam9_l9261 MACH_SAM9_L9261 SAM9_L9261 1814 1804sam9_l9261 MACH_SAM9_L9261 SAM9_L9261 1814
1805cc9m2443js MACH_CC9M2443JS CC9M2443JS 1815 1805cc9m2443 MACH_CC9M2443 CC9M2443 1815
1806xaria300 MACH_XARIA300 XARIA300 1816 1806xaria300 MACH_XARIA300 XARIA300 1816
1807it9200 MACH_IT9200 IT9200 1817 1807it9200 MACH_IT9200 IT9200 1817
1808rd88f5181l_fxo MACH_RD88F5181L_FXO RD88F5181L_FXO 1818 1808rd88f5181l_fxo MACH_RD88F5181L_FXO RD88F5181L_FXO 1818
@@ -2409,3 +2409,15 @@ platypus MACH_PLATYPUS PLATYPUS 2422
2409pss2 MACH_PSS2 PSS2 2423 2409pss2 MACH_PSS2 PSS2 2423
2410davinci_apm150 MACH_DAVINCI_APM150 DAVINCI_APM150 2424 2410davinci_apm150 MACH_DAVINCI_APM150 DAVINCI_APM150 2424
2411str9100 MACH_STR9100 STR9100 2425 2411str9100 MACH_STR9100 STR9100 2425
2412net5big MACH_NET5BIG NET5BIG 2426
2413seabed9263 MACH_SEABED9263 SEABED9263 2427
2414mx51_m2id MACH_MX51_M2ID MX51_M2ID 2428
2415octvocplus_eb MACH_OCTVOCPLUS_EB OCTVOCPLUS_EB 2429
2416klk_firefox MACH_KLK_FIREFOX KLK_FIREFOX 2430
2417klk_wirma_module MACH_KLK_WIRMA_MODULE KLK_WIRMA_MODULE 2431
2418klk_wirma_mmi MACH_KLK_WIRMA_MMI KLK_WIRMA_MMI 2432
2419supersonic MACH_SUPERSONIC SUPERSONIC 2433
2420liberty MACH_LIBERTY LIBERTY 2434
2421mh355 MACH_MH355 MH355 2435
2422pc7802 MACH_PC7802 PC7802 2436
2423gnet_sgc MACH_GNET_SGC GNET_SGC 2437
diff --git a/arch/avr32/kernel/vmlinux.lds.S b/arch/avr32/kernel/vmlinux.lds.S
index 7910d41eb886..c4b56654349a 100644
--- a/arch/avr32/kernel/vmlinux.lds.S
+++ b/arch/avr32/kernel/vmlinux.lds.S
@@ -124,14 +124,11 @@ SECTIONS
124 _end = .; 124 _end = .;
125 } 125 }
126 126
127 DWARF_DEBUG
128
127 /* When something in the kernel is NOT compiled as a module, the module 129 /* When something in the kernel is NOT compiled as a module, the module
128 * cleanup code and data are put into these segments. Both can then be 130 * cleanup code and data are put into these segments. Both can then be
129 * thrown away, as cleanup code is never called unless it's a module. 131 * thrown away, as cleanup code is never called unless it's a module.
130 */ 132 */
131 /DISCARD/ : { 133 DISCARDS
132 EXIT_DATA
133 *(.exitcall.exit)
134 }
135
136 DWARF_DEBUG
137} 134}
diff --git a/arch/blackfin/Kconfig b/arch/blackfin/Kconfig
index 7faa2f554ab1..9a01d445eca8 100644
--- a/arch/blackfin/Kconfig
+++ b/arch/blackfin/Kconfig
@@ -342,8 +342,9 @@ config MEM_MT48LC64M4A2FB_7E
342config MEM_MT48LC16M16A2TG_75 342config MEM_MT48LC16M16A2TG_75
343 bool 343 bool
344 depends on (BFIN533_EZKIT || BFIN561_EZKIT \ 344 depends on (BFIN533_EZKIT || BFIN561_EZKIT \
345 || BFIN533_BLUETECHNIX_CM || BFIN537_BLUETECHNIX_CM \ 345 || BFIN533_BLUETECHNIX_CM || BFIN537_BLUETECHNIX_CM_E \
346 || H8606_HVSISTEMAS || BFIN527_BLUETECHNIX_CM) 346 || BFIN537_BLUETECHNIX_CM_U || H8606_HVSISTEMAS \
347 || BFIN527_BLUETECHNIX_CM)
347 default y 348 default y
348 349
349config MEM_MT48LC32M8A2_75 350config MEM_MT48LC32M8A2_75
@@ -459,7 +460,7 @@ config VCO_MULT
459 default "45" if BFIN533_STAMP 460 default "45" if BFIN533_STAMP
460 default "20" if (BFIN537_STAMP || BFIN527_EZKIT || BFIN548_EZKIT || BFIN548_BLUETECHNIX_CM || BFIN538_EZKIT) 461 default "20" if (BFIN537_STAMP || BFIN527_EZKIT || BFIN548_EZKIT || BFIN548_BLUETECHNIX_CM || BFIN538_EZKIT)
461 default "22" if BFIN533_BLUETECHNIX_CM 462 default "22" if BFIN533_BLUETECHNIX_CM
462 default "20" if (BFIN537_BLUETECHNIX_CM || BFIN527_BLUETECHNIX_CM || BFIN561_BLUETECHNIX_CM) 463 default "20" if (BFIN537_BLUETECHNIX_CM_E || BFIN537_BLUETECHNIX_CM_U || BFIN527_BLUETECHNIX_CM || BFIN561_BLUETECHNIX_CM)
463 default "20" if BFIN561_EZKIT 464 default "20" if BFIN561_EZKIT
464 default "16" if (H8606_HVSISTEMAS || BLACKSTAMP || BFIN526_EZBRD || BFIN518F_EZBRD) 465 default "16" if (H8606_HVSISTEMAS || BLACKSTAMP || BFIN526_EZBRD || BFIN518F_EZBRD)
465 help 466 help
@@ -574,8 +575,8 @@ config MAX_VCO_HZ
574 default 400000000 if BF514 575 default 400000000 if BF514
575 default 400000000 if BF516 576 default 400000000 if BF516
576 default 400000000 if BF518 577 default 400000000 if BF518
577 default 600000000 if BF522 578 default 400000000 if BF522
578 default 400000000 if BF523 579 default 600000000 if BF523
579 default 400000000 if BF524 580 default 400000000 if BF524
580 default 600000000 if BF525 581 default 600000000 if BF525
581 default 400000000 if BF526 582 default 400000000 if BF526
@@ -647,7 +648,7 @@ config CYCLES_CLOCKSOURCE
647 writing the registers will most likely crash the kernel. 648 writing the registers will most likely crash the kernel.
648 649
649config GPTMR0_CLOCKSOURCE 650config GPTMR0_CLOCKSOURCE
650 bool "Use GPTimer0 as a clocksource (higher rating)" 651 bool "Use GPTimer0 as a clocksource"
651 select BFIN_GPTIMERS 652 select BFIN_GPTIMERS
652 depends on GENERIC_CLOCKEVENTS 653 depends on GENERIC_CLOCKEVENTS
653 depends on !TICKSOURCE_GPTMR0 654 depends on !TICKSOURCE_GPTMR0
@@ -917,10 +918,6 @@ comment "Cache Support"
917config BFIN_ICACHE 918config BFIN_ICACHE
918 bool "Enable ICACHE" 919 bool "Enable ICACHE"
919 default y 920 default y
920config BFIN_ICACHE_LOCK
921 bool "Enable Instruction Cache Locking"
922 depends on BFIN_ICACHE
923 default n
924config BFIN_EXTMEM_ICACHEABLE 921config BFIN_EXTMEM_ICACHEABLE
925 bool "Enable ICACHE for external memory" 922 bool "Enable ICACHE for external memory"
926 depends on BFIN_ICACHE 923 depends on BFIN_ICACHE
@@ -987,7 +984,7 @@ endchoice
987config BFIN_L2_DCACHEABLE 984config BFIN_L2_DCACHEABLE
988 bool "Enable DCACHE for L2 SRAM" 985 bool "Enable DCACHE for L2 SRAM"
989 depends on BFIN_DCACHE 986 depends on BFIN_DCACHE
990 depends on BF54x || BF561 987 depends on (BF54x || BF561) && !SMP
991 default n 988 default n
992choice 989choice
993 prompt "L2 SRAM DCACHE policy" 990 prompt "L2 SRAM DCACHE policy"
@@ -995,11 +992,9 @@ choice
995 default BFIN_L2_WRITEBACK 992 default BFIN_L2_WRITEBACK
996config BFIN_L2_WRITEBACK 993config BFIN_L2_WRITEBACK
997 bool "Write back" 994 bool "Write back"
998 depends on !SMP
999 995
1000config BFIN_L2_WRITETHROUGH 996config BFIN_L2_WRITETHROUGH
1001 bool "Write through" 997 bool "Write through"
1002 depends on !SMP
1003endchoice 998endchoice
1004 999
1005 1000
@@ -1154,11 +1149,12 @@ source "fs/Kconfig.binfmt"
1154endmenu 1149endmenu
1155 1150
1156menu "Power management options" 1151menu "Power management options"
1152 depends on !SMP
1153
1157source "kernel/power/Kconfig" 1154source "kernel/power/Kconfig"
1158 1155
1159config ARCH_SUSPEND_POSSIBLE 1156config ARCH_SUSPEND_POSSIBLE
1160 def_bool y 1157 def_bool y
1161 depends on !SMP
1162 1158
1163choice 1159choice
1164 prompt "Standby Power Saving Mode" 1160 prompt "Standby Power Saving Mode"
@@ -1246,6 +1242,7 @@ config PM_BFIN_WAKE_GP
1246endmenu 1242endmenu
1247 1243
1248menu "CPU Frequency scaling" 1244menu "CPU Frequency scaling"
1245 depends on !SMP
1249 1246
1250source "drivers/cpufreq/Kconfig" 1247source "drivers/cpufreq/Kconfig"
1251 1248
diff --git a/arch/blackfin/Kconfig.debug b/arch/blackfin/Kconfig.debug
index 1fc4981d486f..87f195ee2e06 100644
--- a/arch/blackfin/Kconfig.debug
+++ b/arch/blackfin/Kconfig.debug
@@ -252,4 +252,10 @@ config ACCESS_CHECK
252 252
253 Say N here to disable that check to improve the performance. 253 Say N here to disable that check to improve the performance.
254 254
255config BFIN_ISRAM_SELF_TEST
256 bool "isram boot self tests"
257 default n
258 help
259 Run some self tests of the isram driver code at boot.
260
255endmenu 261endmenu
diff --git a/arch/blackfin/configs/BF518F-EZBRD_defconfig b/arch/blackfin/configs/BF518F-EZBRD_defconfig
index dcfb4889559a..9905b26009e5 100644
--- a/arch/blackfin/configs/BF518F-EZBRD_defconfig
+++ b/arch/blackfin/configs/BF518F-EZBRD_defconfig
@@ -358,9 +358,9 @@ CONFIG_C_AMBEN_ALL=y
358# EBIU_AMBCTL Control 358# EBIU_AMBCTL Control
359# 359#
360CONFIG_BANK_0=0x7BB0 360CONFIG_BANK_0=0x7BB0
361CONFIG_BANK_1=0x5554 361CONFIG_BANK_1=0x7BB0
362CONFIG_BANK_2=0x7BB0 362CONFIG_BANK_2=0x7BB0
363CONFIG_BANK_3=0xFFC0 363CONFIG_BANK_3=0x99B2
364 364
365# 365#
366# Bus options (PCI, PCMCIA, EISA, MCA, ISA) 366# Bus options (PCI, PCMCIA, EISA, MCA, ISA)
diff --git a/arch/blackfin/configs/BF526-EZBRD_defconfig b/arch/blackfin/configs/BF526-EZBRD_defconfig
index 48a3a7a9099c..9dc682088023 100644
--- a/arch/blackfin/configs/BF526-EZBRD_defconfig
+++ b/arch/blackfin/configs/BF526-EZBRD_defconfig
@@ -359,9 +359,9 @@ CONFIG_C_AMBEN_ALL=y
359# EBIU_AMBCTL Control 359# EBIU_AMBCTL Control
360# 360#
361CONFIG_BANK_0=0x7BB0 361CONFIG_BANK_0=0x7BB0
362CONFIG_BANK_1=0x5554 362CONFIG_BANK_1=0x7BB0
363CONFIG_BANK_2=0x7BB0 363CONFIG_BANK_2=0x7BB0
364CONFIG_BANK_3=0xFFC0 364CONFIG_BANK_3=0x99B2
365 365
366# 366#
367# Bus options (PCI, PCMCIA, EISA, MCA, ISA) 367# Bus options (PCI, PCMCIA, EISA, MCA, ISA)
diff --git a/arch/blackfin/configs/BF527-EZKIT_defconfig b/arch/blackfin/configs/BF527-EZKIT_defconfig
index dd8352791daf..77e35d4baf53 100644
--- a/arch/blackfin/configs/BF527-EZKIT_defconfig
+++ b/arch/blackfin/configs/BF527-EZKIT_defconfig
@@ -363,9 +363,9 @@ CONFIG_C_AMBEN_ALL=y
363# EBIU_AMBCTL Control 363# EBIU_AMBCTL Control
364# 364#
365CONFIG_BANK_0=0x7BB0 365CONFIG_BANK_0=0x7BB0
366CONFIG_BANK_1=0x5554 366CONFIG_BANK_1=0x7BB0
367CONFIG_BANK_2=0x7BB0 367CONFIG_BANK_2=0x7BB0
368CONFIG_BANK_3=0xFFC0 368CONFIG_BANK_3=0x99B2
369 369
370# 370#
371# Bus options (PCI, PCMCIA, EISA, MCA, ISA) 371# Bus options (PCI, PCMCIA, EISA, MCA, ISA)
diff --git a/arch/blackfin/configs/BF548-EZKIT_defconfig b/arch/blackfin/configs/BF548-EZKIT_defconfig
index b3d3cab81cfe..f773ad1155d4 100644
--- a/arch/blackfin/configs/BF548-EZKIT_defconfig
+++ b/arch/blackfin/configs/BF548-EZKIT_defconfig
@@ -400,7 +400,7 @@ CONFIG_C_AMBEN_ALL=y
400# EBIU_AMBCTL Control 400# EBIU_AMBCTL Control
401# 401#
402CONFIG_BANK_0=0x7BB0 402CONFIG_BANK_0=0x7BB0
403CONFIG_BANK_1=0x5554 403CONFIG_BANK_1=0x7BB0
404CONFIG_BANK_2=0x7BB0 404CONFIG_BANK_2=0x7BB0
405CONFIG_BANK_3=0x99B2 405CONFIG_BANK_3=0x99B2
406CONFIG_EBIU_MBSCTLVAL=0x0 406CONFIG_EBIU_MBSCTLVAL=0x0
diff --git a/arch/blackfin/include/asm/bfin-global.h b/arch/blackfin/include/asm/bfin-global.h
index e39277ea43e8..aef0594e7865 100644
--- a/arch/blackfin/include/asm/bfin-global.h
+++ b/arch/blackfin/include/asm/bfin-global.h
@@ -66,7 +66,6 @@ extern void program_IAR(void);
66 66
67extern asmlinkage void lower_to_irq14(void); 67extern asmlinkage void lower_to_irq14(void);
68extern asmlinkage void bfin_return_from_exception(void); 68extern asmlinkage void bfin_return_from_exception(void);
69extern asmlinkage void evt14_softirq(void);
70extern asmlinkage void asm_do_IRQ(unsigned int irq, struct pt_regs *regs); 69extern asmlinkage void asm_do_IRQ(unsigned int irq, struct pt_regs *regs);
71extern int bfin_internal_set_wake(unsigned int irq, unsigned int state); 70extern int bfin_internal_set_wake(unsigned int irq, unsigned int state);
72 71
@@ -100,11 +99,6 @@ extern unsigned long bfin_sic_iwr[];
100extern unsigned vr_wakeup; 99extern unsigned vr_wakeup;
101extern u16 _bfin_swrst; /* shadow for Software Reset Register (SWRST) */ 100extern u16 _bfin_swrst; /* shadow for Software Reset Register (SWRST) */
102 101
103#ifdef CONFIG_BFIN_ICACHE_LOCK
104extern void cache_grab_lock(int way);
105extern void bfin_cache_lock(int way);
106#endif
107
108#endif 102#endif
109 103
110#endif /* _BLACKFIN_H_ */ 104#endif /* _BLACKFIN_H_ */
diff --git a/arch/blackfin/include/asm/bfin5xx_spi.h b/arch/blackfin/include/asm/bfin5xx_spi.h
index aaeb4df10d57..c281c6328276 100644
--- a/arch/blackfin/include/asm/bfin5xx_spi.h
+++ b/arch/blackfin/include/asm/bfin5xx_spi.h
@@ -127,6 +127,7 @@ struct bfin5xx_spi_chip {
127 u32 cs_gpio; 127 u32 cs_gpio;
128 /* Value to send if no TX value is supplied, usually 0x0 or 0xFFFF */ 128 /* Value to send if no TX value is supplied, usually 0x0 or 0xFFFF */
129 u16 idle_tx_val; 129 u16 idle_tx_val;
130 u8 pio_interrupt; /* Enable spi data irq */
130}; 131};
131 132
132#endif /* _SPI_CHANNEL_H_ */ 133#endif /* _SPI_CHANNEL_H_ */
diff --git a/arch/blackfin/include/asm/cplb.h b/arch/blackfin/include/asm/cplb.h
index c5dacf8f8cf9..d18d16837a6d 100644
--- a/arch/blackfin/include/asm/cplb.h
+++ b/arch/blackfin/include/asm/cplb.h
@@ -125,4 +125,48 @@
125#define FAULT_USERSUPV (1 << 17) 125#define FAULT_USERSUPV (1 << 17)
126#define FAULT_CPLBBITS 0x0000ffff 126#define FAULT_CPLBBITS 0x0000ffff
127 127
128#endif /* _CPLB_H */ 128#ifndef __ASSEMBLY__
129
130static inline void _disable_cplb(u32 mmr, u32 mask)
131{
132 u32 ctrl = bfin_read32(mmr) & ~mask;
133 /* CSYNC to ensure load store ordering */
134 __builtin_bfin_csync();
135 bfin_write32(mmr, ctrl);
136 __builtin_bfin_ssync();
137}
138static inline void disable_cplb(u32 mmr, u32 mask)
139{
140 u32 ctrl = bfin_read32(mmr) & ~mask;
141 CSYNC();
142 bfin_write32(mmr, ctrl);
143 SSYNC();
144}
145#define _disable_dcplb() _disable_cplb(DMEM_CONTROL, ENDCPLB)
146#define disable_dcplb() disable_cplb(DMEM_CONTROL, ENDCPLB)
147#define _disable_icplb() _disable_cplb(IMEM_CONTROL, ENICPLB)
148#define disable_icplb() disable_cplb(IMEM_CONTROL, ENICPLB)
149
150static inline void _enable_cplb(u32 mmr, u32 mask)
151{
152 u32 ctrl = bfin_read32(mmr) | mask;
153 /* CSYNC to ensure load store ordering */
154 __builtin_bfin_csync();
155 bfin_write32(mmr, ctrl);
156 __builtin_bfin_ssync();
157}
158static inline void enable_cplb(u32 mmr, u32 mask)
159{
160 u32 ctrl = bfin_read32(mmr) | mask;
161 CSYNC();
162 bfin_write32(mmr, ctrl);
163 SSYNC();
164}
165#define _enable_dcplb() _enable_cplb(DMEM_CONTROL, ENDCPLB)
166#define enable_dcplb() enable_cplb(DMEM_CONTROL, ENDCPLB)
167#define _enable_icplb() _enable_cplb(IMEM_CONTROL, ENICPLB)
168#define enable_icplb() enable_cplb(IMEM_CONTROL, ENICPLB)
169
170#endif /* __ASSEMBLY__ */
171
172#endif /* _CPLB_H */
diff --git a/arch/blackfin/include/asm/early_printk.h b/arch/blackfin/include/asm/early_printk.h
index 110f1c1f845c..53a762b6fcd2 100644
--- a/arch/blackfin/include/asm/early_printk.h
+++ b/arch/blackfin/include/asm/early_printk.h
@@ -21,8 +21,32 @@
21 * GNU General Public License for more details. 21 * GNU General Public License for more details.
22 */ 22 */
23 23
24
25#ifndef __ASM_EARLY_PRINTK_H__
26#define __ASM_EARLY_PRINTK_H__
27
24#ifdef CONFIG_EARLY_PRINTK 28#ifdef CONFIG_EARLY_PRINTK
29/* For those that don't include it already */
30#include <linux/console.h>
31
25extern int setup_early_printk(char *); 32extern int setup_early_printk(char *);
33extern void enable_shadow_console(void);
34extern int shadow_console_enabled(void);
35extern void mark_shadow_error(void);
36extern void early_shadow_reg(unsigned long reg, unsigned int n);
37extern void early_shadow_write(struct console *con, const char *s,
38 unsigned int n) __attribute__((nonnull(2)));
39#define early_shadow_puts(str) early_shadow_write(NULL, str, strlen(str))
40#define early_shadow_stamp() \
41 do { \
42 early_shadow_puts(__FILE__ " : " __stringify(__LINE__) " ["); \
43 early_shadow_puts(__func__); \
44 early_shadow_puts("]\n"); \
45 } while (0)
26#else 46#else
27#define setup_early_printk(fmt) do { } while (0) 47#define setup_early_printk(fmt) do { } while (0)
48#define enable_shadow_console(fmt) do { } while (0)
49#define early_shadow_stamp() do { } while (0)
28#endif /* CONFIG_EARLY_PRINTK */ 50#endif /* CONFIG_EARLY_PRINTK */
51
52#endif /* __ASM_EARLY_PRINTK_H__ */
diff --git a/arch/blackfin/include/asm/elf.h b/arch/blackfin/include/asm/elf.h
index 5a87baf0659d..c823e8ebbfa1 100644
--- a/arch/blackfin/include/asm/elf.h
+++ b/arch/blackfin/include/asm/elf.h
@@ -23,7 +23,7 @@ typedef unsigned long elf_greg_t;
23#define ELF_NGREG 40 /* (sizeof(struct user_regs_struct) / sizeof(elf_greg_t)) */ 23#define ELF_NGREG 40 /* (sizeof(struct user_regs_struct) / sizeof(elf_greg_t)) */
24typedef elf_greg_t elf_gregset_t[ELF_NGREG]; 24typedef elf_greg_t elf_gregset_t[ELF_NGREG];
25 25
26typedef struct user_bfinfp_struct elf_fpregset_t; 26typedef struct { } elf_fpregset_t;
27/* 27/*
28 * This is used to ensure we don't load something for the wrong architecture. 28 * This is used to ensure we don't load something for the wrong architecture.
29 */ 29 */
diff --git a/arch/blackfin/include/asm/entry.h b/arch/blackfin/include/asm/entry.h
index ec58efc130e6..55b808fced71 100644
--- a/arch/blackfin/include/asm/entry.h
+++ b/arch/blackfin/include/asm/entry.h
@@ -36,6 +36,21 @@
36# define LOAD_IPIPE_IPEND 36# define LOAD_IPIPE_IPEND
37#endif 37#endif
38 38
39/*
40 * Workaround for anomalies 05000283 and 05000315
41 */
42#if ANOMALY_05000283 || ANOMALY_05000315
43# define ANOMALY_283_315_WORKAROUND(preg, dreg) \
44 cc = dreg == dreg; \
45 preg.h = HI(CHIPID); \
46 preg.l = LO(CHIPID); \
47 if cc jump 1f; \
48 dreg.l = W[preg]; \
491:
50#else
51# define ANOMALY_283_315_WORKAROUND(preg, dreg)
52#endif /* ANOMALY_05000283 || ANOMALY_05000315 */
53
39#ifndef CONFIG_EXACT_HWERR 54#ifndef CONFIG_EXACT_HWERR
40/* As a debugging aid - we save IPEND when DEBUG_KERNEL is on, 55/* As a debugging aid - we save IPEND when DEBUG_KERNEL is on,
41 * otherwise it is a waste of cycles. 56 * otherwise it is a waste of cycles.
@@ -88,17 +103,22 @@
88 * As you can see by the code - we actually need to do two SSYNCS - one to 103 * As you can see by the code - we actually need to do two SSYNCS - one to
89 * make sure the read/writes complete, and another to make sure the hardware 104 * make sure the read/writes complete, and another to make sure the hardware
90 * error is recognized by the core. 105 * error is recognized by the core.
106 *
107 * The extra nop before the SSYNC is to make sure we work around 05000244,
108 * since the 283/315 workaround includes a branch to the end
91 */ 109 */
92#define INTERRUPT_ENTRY(N) \ 110#define INTERRUPT_ENTRY(N) \
93 SSYNC; \
94 SSYNC; \
95 [--sp] = SYSCFG; \ 111 [--sp] = SYSCFG; \
96 [--sp] = P0; /*orig_p0*/ \ 112 [--sp] = P0; /*orig_p0*/ \
97 [--sp] = R0; /*orig_r0*/ \ 113 [--sp] = R0; /*orig_r0*/ \
98 [--sp] = (R7:0,P5:0); \ 114 [--sp] = (R7:0,P5:0); \
99 R1 = ASTAT; \ 115 R1 = ASTAT; \
116 ANOMALY_283_315_WORKAROUND(p0, r0) \
100 P0.L = LO(ILAT); \ 117 P0.L = LO(ILAT); \
101 P0.H = HI(ILAT); \ 118 P0.H = HI(ILAT); \
119 NOP; \
120 SSYNC; \
121 SSYNC; \
102 R0 = [P0]; \ 122 R0 = [P0]; \
103 CC = BITTST(R0, EVT_IVHW_P); \ 123 CC = BITTST(R0, EVT_IVHW_P); \
104 IF CC JUMP 1f; \ 124 IF CC JUMP 1f; \
@@ -118,15 +138,17 @@
118 RTI; 138 RTI;
119 139
120#define TIMER_INTERRUPT_ENTRY(N) \ 140#define TIMER_INTERRUPT_ENTRY(N) \
121 SSYNC; \
122 SSYNC; \
123 [--sp] = SYSCFG; \ 141 [--sp] = SYSCFG; \
124 [--sp] = P0; /*orig_p0*/ \ 142 [--sp] = P0; /*orig_p0*/ \
125 [--sp] = R0; /*orig_r0*/ \ 143 [--sp] = R0; /*orig_r0*/ \
126 [--sp] = (R7:0,P5:0); \ 144 [--sp] = (R7:0,P5:0); \
127 R1 = ASTAT; \ 145 R1 = ASTAT; \
146 ANOMALY_283_315_WORKAROUND(p0, r0) \
128 P0.L = LO(ILAT); \ 147 P0.L = LO(ILAT); \
129 P0.H = HI(ILAT); \ 148 P0.H = HI(ILAT); \
149 NOP; \
150 SSYNC; \
151 SSYNC; \
130 R0 = [P0]; \ 152 R0 = [P0]; \
131 CC = BITTST(R0, EVT_IVHW_P); \ 153 CC = BITTST(R0, EVT_IVHW_P); \
132 IF CC JUMP 1f; \ 154 IF CC JUMP 1f; \
diff --git a/arch/blackfin/include/asm/ftrace.h b/arch/blackfin/include/asm/ftrace.h
index 8643680f0f78..90c9b400ba6d 100644
--- a/arch/blackfin/include/asm/ftrace.h
+++ b/arch/blackfin/include/asm/ftrace.h
@@ -8,6 +8,6 @@
8#ifndef __ASM_BFIN_FTRACE_H__ 8#ifndef __ASM_BFIN_FTRACE_H__
9#define __ASM_BFIN_FTRACE_H__ 9#define __ASM_BFIN_FTRACE_H__
10 10
11#define MCOUNT_INSN_SIZE 8 /* sizeof mcount call: LINK + CALL */ 11#define MCOUNT_INSN_SIZE 6 /* sizeof "[++sp] = rets; call __mcount;" */
12 12
13#endif 13#endif
diff --git a/arch/blackfin/include/asm/ipipe.h b/arch/blackfin/include/asm/ipipe.h
index 87ba9ad399cb..4617ba66278f 100644
--- a/arch/blackfin/include/asm/ipipe.h
+++ b/arch/blackfin/include/asm/ipipe.h
@@ -145,10 +145,6 @@ void __ipipe_handle_irq(unsigned irq, struct pt_regs *regs);
145 145
146int __ipipe_get_irq_priority(unsigned irq); 146int __ipipe_get_irq_priority(unsigned irq);
147 147
148void __ipipe_stall_root_raw(void);
149
150void __ipipe_unstall_root_raw(void);
151
152void __ipipe_serial_debug(const char *fmt, ...); 148void __ipipe_serial_debug(const char *fmt, ...);
153 149
154asmlinkage void __ipipe_call_irqtail(unsigned long addr); 150asmlinkage void __ipipe_call_irqtail(unsigned long addr);
@@ -234,9 +230,6 @@ int ipipe_start_irq_thread(unsigned irq, struct irq_desc *desc);
234#define task_hijacked(p) 0 230#define task_hijacked(p) 0
235#define ipipe_trap_notify(t, r) 0 231#define ipipe_trap_notify(t, r) 0
236 232
237#define __ipipe_stall_root_raw() do { } while (0)
238#define __ipipe_unstall_root_raw() do { } while (0)
239
240#define ipipe_init_irq_threads() do { } while (0) 233#define ipipe_init_irq_threads() do { } while (0)
241#define ipipe_start_irq_thread(irq, desc) 0 234#define ipipe_start_irq_thread(irq, desc) 0
242 235
diff --git a/arch/blackfin/include/asm/irq_handler.h b/arch/blackfin/include/asm/irq_handler.h
index 139b5208f9d8..7d9e2d3bbede 100644
--- a/arch/blackfin/include/asm/irq_handler.h
+++ b/arch/blackfin/include/asm/irq_handler.h
@@ -17,6 +17,7 @@ asmlinkage void evt_evt10(void);
17asmlinkage void evt_evt11(void); 17asmlinkage void evt_evt11(void);
18asmlinkage void evt_evt12(void); 18asmlinkage void evt_evt12(void);
19asmlinkage void evt_evt13(void); 19asmlinkage void evt_evt13(void);
20asmlinkage void evt_evt14(void);
20asmlinkage void evt_soft_int1(void); 21asmlinkage void evt_soft_int1(void);
21asmlinkage void evt_system_call(void); 22asmlinkage void evt_system_call(void);
22asmlinkage void init_exception_buff(void); 23asmlinkage void init_exception_buff(void);
diff --git a/arch/blackfin/include/asm/mmu_context.h b/arch/blackfin/include/asm/mmu_context.h
index 944e29faae48..040410bb07e1 100644
--- a/arch/blackfin/include/asm/mmu_context.h
+++ b/arch/blackfin/include/asm/mmu_context.h
@@ -127,17 +127,17 @@ static inline void protect_page(struct mm_struct *mm, unsigned long addr,
127 unsigned long idx = page >> 5; 127 unsigned long idx = page >> 5;
128 unsigned long bit = 1 << (page & 31); 128 unsigned long bit = 1 << (page & 31);
129 129
130 if (flags & VM_MAYREAD) 130 if (flags & VM_READ)
131 mask[idx] |= bit; 131 mask[idx] |= bit;
132 else 132 else
133 mask[idx] &= ~bit; 133 mask[idx] &= ~bit;
134 mask += page_mask_nelts; 134 mask += page_mask_nelts;
135 if (flags & VM_MAYWRITE) 135 if (flags & VM_WRITE)
136 mask[idx] |= bit; 136 mask[idx] |= bit;
137 else 137 else
138 mask[idx] &= ~bit; 138 mask[idx] &= ~bit;
139 mask += page_mask_nelts; 139 mask += page_mask_nelts;
140 if (flags & VM_MAYEXEC) 140 if (flags & VM_EXEC)
141 mask[idx] |= bit; 141 mask[idx] |= bit;
142 else 142 else
143 mask[idx] &= ~bit; 143 mask[idx] &= ~bit;
diff --git a/arch/blackfin/include/asm/pda.h b/arch/blackfin/include/asm/pda.h
index b42555c1431c..a6f95695731d 100644
--- a/arch/blackfin/include/asm/pda.h
+++ b/arch/blackfin/include/asm/pda.h
@@ -50,6 +50,7 @@ struct blackfin_pda { /* Per-processor Data Area */
50 unsigned long ex_optr; 50 unsigned long ex_optr;
51 unsigned long ex_buf[4]; 51 unsigned long ex_buf[4];
52 unsigned long ex_imask; /* Saved imask from exception */ 52 unsigned long ex_imask; /* Saved imask from exception */
53 unsigned long ex_ipend; /* Saved IPEND from exception */
53 unsigned long *ex_stack; /* Exception stack space */ 54 unsigned long *ex_stack; /* Exception stack space */
54 55
55#ifdef ANOMALY_05000261 56#ifdef ANOMALY_05000261
@@ -60,6 +61,12 @@ struct blackfin_pda { /* Per-processor Data Area */
60 unsigned long retx; 61 unsigned long retx;
61 unsigned long seqstat; 62 unsigned long seqstat;
62 unsigned int __nmi_count; /* number of times NMI asserted on this CPU */ 63 unsigned int __nmi_count; /* number of times NMI asserted on this CPU */
64#ifdef CONFIG_DEBUG_DOUBLEFAULT
65 unsigned long dcplb_doublefault_addr;
66 unsigned long icplb_doublefault_addr;
67 unsigned long retx_doublefault;
68 unsigned long seqstat_doublefault;
69#endif
63}; 70};
64 71
65extern struct blackfin_pda cpu_pda[]; 72extern struct blackfin_pda cpu_pda[];
diff --git a/arch/blackfin/kernel/Makefile b/arch/blackfin/kernel/Makefile
index 141d9281e4b0..a8ddbc8ed5af 100644
--- a/arch/blackfin/kernel/Makefile
+++ b/arch/blackfin/kernel/Makefile
@@ -26,6 +26,7 @@ obj-$(CONFIG_MODULES) += module.o
26obj-$(CONFIG_KGDB) += kgdb.o 26obj-$(CONFIG_KGDB) += kgdb.o
27obj-$(CONFIG_KGDB_TESTS) += kgdb_test.o 27obj-$(CONFIG_KGDB_TESTS) += kgdb_test.o
28obj-$(CONFIG_EARLY_PRINTK) += early_printk.o 28obj-$(CONFIG_EARLY_PRINTK) += early_printk.o
29obj-$(CONFIG_EARLY_PRINTK) += shadow_console.o
29obj-$(CONFIG_STACKTRACE) += stacktrace.o 30obj-$(CONFIG_STACKTRACE) += stacktrace.o
30 31
31# the kgdb test puts code into L2 and without linker 32# the kgdb test puts code into L2 and without linker
diff --git a/arch/blackfin/kernel/asm-offsets.c b/arch/blackfin/kernel/asm-offsets.c
index b5df9459d6d5..f05d1b99b0ef 100644
--- a/arch/blackfin/kernel/asm-offsets.c
+++ b/arch/blackfin/kernel/asm-offsets.c
@@ -145,6 +145,7 @@ int main(void)
145 DEFINE(PDA_EXBUF, offsetof(struct blackfin_pda, ex_buf)); 145 DEFINE(PDA_EXBUF, offsetof(struct blackfin_pda, ex_buf));
146 DEFINE(PDA_EXIMASK, offsetof(struct blackfin_pda, ex_imask)); 146 DEFINE(PDA_EXIMASK, offsetof(struct blackfin_pda, ex_imask));
147 DEFINE(PDA_EXSTACK, offsetof(struct blackfin_pda, ex_stack)); 147 DEFINE(PDA_EXSTACK, offsetof(struct blackfin_pda, ex_stack));
148 DEFINE(PDA_EXIPEND, offsetof(struct blackfin_pda, ex_ipend));
148#ifdef ANOMALY_05000261 149#ifdef ANOMALY_05000261
149 DEFINE(PDA_LFRETX, offsetof(struct blackfin_pda, last_cplb_fault_retx)); 150 DEFINE(PDA_LFRETX, offsetof(struct blackfin_pda, last_cplb_fault_retx));
150#endif 151#endif
@@ -152,6 +153,12 @@ int main(void)
152 DEFINE(PDA_ICPLB, offsetof(struct blackfin_pda, icplb_fault_addr)); 153 DEFINE(PDA_ICPLB, offsetof(struct blackfin_pda, icplb_fault_addr));
153 DEFINE(PDA_RETX, offsetof(struct blackfin_pda, retx)); 154 DEFINE(PDA_RETX, offsetof(struct blackfin_pda, retx));
154 DEFINE(PDA_SEQSTAT, offsetof(struct blackfin_pda, seqstat)); 155 DEFINE(PDA_SEQSTAT, offsetof(struct blackfin_pda, seqstat));
156#ifdef CONFIG_DEBUG_DOUBLEFAULT
157 DEFINE(PDA_DF_DCPLB, offsetof(struct blackfin_pda, dcplb_doublefault_addr));
158 DEFINE(PDA_DF_ICPLB, offsetof(struct blackfin_pda, icplb_doublefault_addr));
159 DEFINE(PDA_DF_SEQSTAT, offsetof(struct blackfin_pda, seqstat_doublefault));
160 DEFINE(PDA_DF_RETX, offsetof(struct blackfin_pda, retx_doublefault));
161#endif
155#ifdef CONFIG_SMP 162#ifdef CONFIG_SMP
156 /* Inter-core lock (in L2 SRAM) */ 163 /* Inter-core lock (in L2 SRAM) */
157 DEFINE(SIZEOF_CORELOCK, sizeof(struct corelock_slot)); 164 DEFINE(SIZEOF_CORELOCK, sizeof(struct corelock_slot));
diff --git a/arch/blackfin/kernel/bfin_dma_5xx.c b/arch/blackfin/kernel/bfin_dma_5xx.c
index 9f9b82816652..384868dedac3 100644
--- a/arch/blackfin/kernel/bfin_dma_5xx.c
+++ b/arch/blackfin/kernel/bfin_dma_5xx.c
@@ -19,6 +19,7 @@
19#include <asm/cacheflush.h> 19#include <asm/cacheflush.h>
20#include <asm/dma.h> 20#include <asm/dma.h>
21#include <asm/uaccess.h> 21#include <asm/uaccess.h>
22#include <asm/early_printk.h>
22 23
23/* 24/*
24 * To make sure we work around 05000119 - we always check DMA_DONE bit, 25 * To make sure we work around 05000119 - we always check DMA_DONE bit,
@@ -146,8 +147,8 @@ EXPORT_SYMBOL(request_dma);
146 147
147int set_dma_callback(unsigned int channel, irq_handler_t callback, void *data) 148int set_dma_callback(unsigned int channel, irq_handler_t callback, void *data)
148{ 149{
149 BUG_ON(!(dma_ch[channel].chan_status != DMA_CHANNEL_FREE 150 BUG_ON(channel >= MAX_DMA_CHANNELS ||
150 && channel < MAX_DMA_CHANNELS)); 151 dma_ch[channel].chan_status == DMA_CHANNEL_FREE);
151 152
152 if (callback != NULL) { 153 if (callback != NULL) {
153 int ret; 154 int ret;
@@ -181,8 +182,8 @@ static void clear_dma_buffer(unsigned int channel)
181void free_dma(unsigned int channel) 182void free_dma(unsigned int channel)
182{ 183{
183 pr_debug("freedma() : BEGIN \n"); 184 pr_debug("freedma() : BEGIN \n");
184 BUG_ON(!(dma_ch[channel].chan_status != DMA_CHANNEL_FREE 185 BUG_ON(channel >= MAX_DMA_CHANNELS ||
185 && channel < MAX_DMA_CHANNELS)); 186 dma_ch[channel].chan_status == DMA_CHANNEL_FREE);
186 187
187 /* Halt the DMA */ 188 /* Halt the DMA */
188 disable_dma(channel); 189 disable_dma(channel);
@@ -236,6 +237,7 @@ void blackfin_dma_resume(void)
236 */ 237 */
237void __init blackfin_dma_early_init(void) 238void __init blackfin_dma_early_init(void)
238{ 239{
240 early_shadow_stamp();
239 bfin_write_MDMA_S0_CONFIG(0); 241 bfin_write_MDMA_S0_CONFIG(0);
240 bfin_write_MDMA_S1_CONFIG(0); 242 bfin_write_MDMA_S1_CONFIG(0);
241} 243}
@@ -246,6 +248,8 @@ void __init early_dma_memcpy(void *pdst, const void *psrc, size_t size)
246 unsigned long src = (unsigned long)psrc; 248 unsigned long src = (unsigned long)psrc;
247 struct dma_register *dst_ch, *src_ch; 249 struct dma_register *dst_ch, *src_ch;
248 250
251 early_shadow_stamp();
252
249 /* We assume that everything is 4 byte aligned, so include 253 /* We assume that everything is 4 byte aligned, so include
250 * a basic sanity check 254 * a basic sanity check
251 */ 255 */
@@ -300,6 +304,8 @@ void __init early_dma_memcpy(void *pdst, const void *psrc, size_t size)
300 304
301void __init early_dma_memcpy_done(void) 305void __init early_dma_memcpy_done(void)
302{ 306{
307 early_shadow_stamp();
308
303 while ((bfin_read_MDMA_S0_CONFIG() && !(bfin_read_MDMA_D0_IRQ_STATUS() & DMA_DONE)) || 309 while ((bfin_read_MDMA_S0_CONFIG() && !(bfin_read_MDMA_D0_IRQ_STATUS() & DMA_DONE)) ||
304 (bfin_read_MDMA_S1_CONFIG() && !(bfin_read_MDMA_D1_IRQ_STATUS() & DMA_DONE))) 310 (bfin_read_MDMA_S1_CONFIG() && !(bfin_read_MDMA_D1_IRQ_STATUS() & DMA_DONE)))
305 continue; 311 continue;
diff --git a/arch/blackfin/kernel/bfin_gpio.c b/arch/blackfin/kernel/bfin_gpio.c
index 6b9446271371..fc4681c0170e 100644
--- a/arch/blackfin/kernel/bfin_gpio.c
+++ b/arch/blackfin/kernel/bfin_gpio.c
@@ -722,7 +722,6 @@ void bfin_gpio_pm_hibernate_suspend(void)
722 gpio_bank_saved[bank].fer = gpio_array[bank]->port_fer; 722 gpio_bank_saved[bank].fer = gpio_array[bank]->port_fer;
723 gpio_bank_saved[bank].mux = gpio_array[bank]->port_mux; 723 gpio_bank_saved[bank].mux = gpio_array[bank]->port_mux;
724 gpio_bank_saved[bank].data = gpio_array[bank]->data; 724 gpio_bank_saved[bank].data = gpio_array[bank]->data;
725 gpio_bank_saved[bank].data = gpio_array[bank]->data;
726 gpio_bank_saved[bank].inen = gpio_array[bank]->inen; 725 gpio_bank_saved[bank].inen = gpio_array[bank]->inen;
727 gpio_bank_saved[bank].dir = gpio_array[bank]->dir_set; 726 gpio_bank_saved[bank].dir = gpio_array[bank]->dir_set;
728 } 727 }
diff --git a/arch/blackfin/kernel/cplb-mpu/Makefile b/arch/blackfin/kernel/cplb-mpu/Makefile
index 7d70d3bf3212..394d0b1b28fe 100644
--- a/arch/blackfin/kernel/cplb-mpu/Makefile
+++ b/arch/blackfin/kernel/cplb-mpu/Makefile
@@ -2,7 +2,7 @@
2# arch/blackfin/kernel/cplb-nompu/Makefile 2# arch/blackfin/kernel/cplb-nompu/Makefile
3# 3#
4 4
5obj-y := cplbinit.o cacheinit.o cplbmgr.o 5obj-y := cplbinit.o cplbmgr.o
6 6
7CFLAGS_cplbmgr.o := -ffixed-I0 -ffixed-I1 -ffixed-I2 -ffixed-I3 \ 7CFLAGS_cplbmgr.o := -ffixed-I0 -ffixed-I1 -ffixed-I2 -ffixed-I3 \
8 -ffixed-L0 -ffixed-L1 -ffixed-L2 -ffixed-L3 \ 8 -ffixed-L0 -ffixed-L1 -ffixed-L2 -ffixed-L3 \
diff --git a/arch/blackfin/kernel/cplb-mpu/cacheinit.c b/arch/blackfin/kernel/cplb-mpu/cacheinit.c
deleted file mode 100644
index d5a86c3017f7..000000000000
--- a/arch/blackfin/kernel/cplb-mpu/cacheinit.c
+++ /dev/null
@@ -1,69 +0,0 @@
1/*
2 * Copyright 2004-2007 Analog Devices Inc.
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, see the file COPYING, or write
16 * to the Free Software Foundation, Inc.,
17 * 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
18 */
19
20#include <linux/cpu.h>
21
22#include <asm/cacheflush.h>
23#include <asm/blackfin.h>
24#include <asm/cplb.h>
25#include <asm/cplbinit.h>
26
27#if defined(CONFIG_BFIN_ICACHE)
28void __cpuinit bfin_icache_init(struct cplb_entry *icplb_tbl)
29{
30 unsigned long ctrl;
31 int i;
32
33 SSYNC();
34 for (i = 0; i < MAX_CPLBS; i++) {
35 bfin_write32(ICPLB_ADDR0 + i * 4, icplb_tbl[i].addr);
36 bfin_write32(ICPLB_DATA0 + i * 4, icplb_tbl[i].data);
37 }
38 ctrl = bfin_read_IMEM_CONTROL();
39 ctrl |= IMC | ENICPLB;
40 bfin_write_IMEM_CONTROL(ctrl);
41 SSYNC();
42}
43#endif
44
45#if defined(CONFIG_BFIN_DCACHE)
46void __cpuinit bfin_dcache_init(struct cplb_entry *dcplb_tbl)
47{
48 unsigned long ctrl;
49 int i;
50
51 SSYNC();
52 for (i = 0; i < MAX_CPLBS; i++) {
53 bfin_write32(DCPLB_ADDR0 + i * 4, dcplb_tbl[i].addr);
54 bfin_write32(DCPLB_DATA0 + i * 4, dcplb_tbl[i].data);
55 }
56
57 ctrl = bfin_read_DMEM_CONTROL();
58
59 /*
60 * Anomaly notes:
61 * 05000287 - We implement workaround #2 - Change the DMEM_CONTROL
62 * register, so that the port preferences for DAG0 and DAG1 are set
63 * to port B
64 */
65 ctrl |= DMEM_CNTR | PORT_PREF0 | (ANOMALY_05000287 ? PORT_PREF1 : 0);
66 bfin_write_DMEM_CONTROL(ctrl);
67 SSYNC();
68}
69#endif
diff --git a/arch/blackfin/kernel/cplb-mpu/cplbmgr.c b/arch/blackfin/kernel/cplb-mpu/cplbmgr.c
index bcdfe9b0b71f..8e1e9e9e9632 100644
--- a/arch/blackfin/kernel/cplb-mpu/cplbmgr.c
+++ b/arch/blackfin/kernel/cplb-mpu/cplbmgr.c
@@ -22,6 +22,7 @@
22 22
23#include <asm/blackfin.h> 23#include <asm/blackfin.h>
24#include <asm/cacheflush.h> 24#include <asm/cacheflush.h>
25#include <asm/cplb.h>
25#include <asm/cplbinit.h> 26#include <asm/cplbinit.h>
26#include <asm/mmu_context.h> 27#include <asm/mmu_context.h>
27 28
@@ -41,46 +42,6 @@ int nr_dcplb_miss[NR_CPUS], nr_icplb_miss[NR_CPUS];
41int nr_icplb_supv_miss[NR_CPUS], nr_dcplb_prot[NR_CPUS]; 42int nr_icplb_supv_miss[NR_CPUS], nr_dcplb_prot[NR_CPUS];
42int nr_cplb_flush[NR_CPUS]; 43int nr_cplb_flush[NR_CPUS];
43 44
44static inline void disable_dcplb(void)
45{
46 unsigned long ctrl;
47 SSYNC();
48 ctrl = bfin_read_DMEM_CONTROL();
49 ctrl &= ~ENDCPLB;
50 bfin_write_DMEM_CONTROL(ctrl);
51 SSYNC();
52}
53
54static inline void enable_dcplb(void)
55{
56 unsigned long ctrl;
57 SSYNC();
58 ctrl = bfin_read_DMEM_CONTROL();
59 ctrl |= ENDCPLB;
60 bfin_write_DMEM_CONTROL(ctrl);
61 SSYNC();
62}
63
64static inline void disable_icplb(void)
65{
66 unsigned long ctrl;
67 SSYNC();
68 ctrl = bfin_read_IMEM_CONTROL();
69 ctrl &= ~ENICPLB;
70 bfin_write_IMEM_CONTROL(ctrl);
71 SSYNC();
72}
73
74static inline void enable_icplb(void)
75{
76 unsigned long ctrl;
77 SSYNC();
78 ctrl = bfin_read_IMEM_CONTROL();
79 ctrl |= ENICPLB;
80 bfin_write_IMEM_CONTROL(ctrl);
81 SSYNC();
82}
83
84/* 45/*
85 * Given the contents of the status register, return the index of the 46 * Given the contents of the status register, return the index of the
86 * CPLB that caused the fault. 47 * CPLB that caused the fault.
@@ -198,10 +159,10 @@ static noinline int dcplb_miss(unsigned int cpu)
198 dcplb_tbl[cpu][idx].addr = addr; 159 dcplb_tbl[cpu][idx].addr = addr;
199 dcplb_tbl[cpu][idx].data = d_data; 160 dcplb_tbl[cpu][idx].data = d_data;
200 161
201 disable_dcplb(); 162 _disable_dcplb();
202 bfin_write32(DCPLB_DATA0 + idx * 4, d_data); 163 bfin_write32(DCPLB_DATA0 + idx * 4, d_data);
203 bfin_write32(DCPLB_ADDR0 + idx * 4, addr); 164 bfin_write32(DCPLB_ADDR0 + idx * 4, addr);
204 enable_dcplb(); 165 _enable_dcplb();
205 166
206 return 0; 167 return 0;
207} 168}
@@ -288,10 +249,10 @@ static noinline int icplb_miss(unsigned int cpu)
288 icplb_tbl[cpu][idx].addr = addr; 249 icplb_tbl[cpu][idx].addr = addr;
289 icplb_tbl[cpu][idx].data = i_data; 250 icplb_tbl[cpu][idx].data = i_data;
290 251
291 disable_icplb(); 252 _disable_icplb();
292 bfin_write32(ICPLB_DATA0 + idx * 4, i_data); 253 bfin_write32(ICPLB_DATA0 + idx * 4, i_data);
293 bfin_write32(ICPLB_ADDR0 + idx * 4, addr); 254 bfin_write32(ICPLB_ADDR0 + idx * 4, addr);
294 enable_icplb(); 255 _enable_icplb();
295 256
296 return 0; 257 return 0;
297} 258}
@@ -319,7 +280,7 @@ static noinline int dcplb_protection_fault(unsigned int cpu)
319int cplb_hdr(int seqstat, struct pt_regs *regs) 280int cplb_hdr(int seqstat, struct pt_regs *regs)
320{ 281{
321 int cause = seqstat & 0x3f; 282 int cause = seqstat & 0x3f;
322 unsigned int cpu = smp_processor_id(); 283 unsigned int cpu = raw_smp_processor_id();
323 switch (cause) { 284 switch (cause) {
324 case 0x23: 285 case 0x23:
325 return dcplb_protection_fault(cpu); 286 return dcplb_protection_fault(cpu);
@@ -340,19 +301,19 @@ void flush_switched_cplbs(unsigned int cpu)
340 nr_cplb_flush[cpu]++; 301 nr_cplb_flush[cpu]++;
341 302
342 local_irq_save_hw(flags); 303 local_irq_save_hw(flags);
343 disable_icplb(); 304 _disable_icplb();
344 for (i = first_switched_icplb; i < MAX_CPLBS; i++) { 305 for (i = first_switched_icplb; i < MAX_CPLBS; i++) {
345 icplb_tbl[cpu][i].data = 0; 306 icplb_tbl[cpu][i].data = 0;
346 bfin_write32(ICPLB_DATA0 + i * 4, 0); 307 bfin_write32(ICPLB_DATA0 + i * 4, 0);
347 } 308 }
348 enable_icplb(); 309 _enable_icplb();
349 310
350 disable_dcplb(); 311 _disable_dcplb();
351 for (i = first_switched_dcplb; i < MAX_CPLBS; i++) { 312 for (i = first_switched_dcplb; i < MAX_CPLBS; i++) {
352 dcplb_tbl[cpu][i].data = 0; 313 dcplb_tbl[cpu][i].data = 0;
353 bfin_write32(DCPLB_DATA0 + i * 4, 0); 314 bfin_write32(DCPLB_DATA0 + i * 4, 0);
354 } 315 }
355 enable_dcplb(); 316 _enable_dcplb();
356 local_irq_restore_hw(flags); 317 local_irq_restore_hw(flags);
357 318
358} 319}
@@ -385,7 +346,7 @@ void set_mask_dcplbs(unsigned long *masks, unsigned int cpu)
385#endif 346#endif
386 } 347 }
387 348
388 disable_dcplb(); 349 _disable_dcplb();
389 for (i = first_mask_dcplb; i < first_switched_dcplb; i++) { 350 for (i = first_mask_dcplb; i < first_switched_dcplb; i++) {
390 dcplb_tbl[cpu][i].addr = addr; 351 dcplb_tbl[cpu][i].addr = addr;
391 dcplb_tbl[cpu][i].data = d_data; 352 dcplb_tbl[cpu][i].data = d_data;
@@ -393,6 +354,6 @@ void set_mask_dcplbs(unsigned long *masks, unsigned int cpu)
393 bfin_write32(DCPLB_ADDR0 + i * 4, addr); 354 bfin_write32(DCPLB_ADDR0 + i * 4, addr);
394 addr += PAGE_SIZE; 355 addr += PAGE_SIZE;
395 } 356 }
396 enable_dcplb(); 357 _enable_dcplb();
397 local_irq_restore_hw(flags); 358 local_irq_restore_hw(flags);
398} 359}
diff --git a/arch/blackfin/kernel/cplb-nompu/Makefile b/arch/blackfin/kernel/cplb-nompu/Makefile
index 7d70d3bf3212..394d0b1b28fe 100644
--- a/arch/blackfin/kernel/cplb-nompu/Makefile
+++ b/arch/blackfin/kernel/cplb-nompu/Makefile
@@ -2,7 +2,7 @@
2# arch/blackfin/kernel/cplb-nompu/Makefile 2# arch/blackfin/kernel/cplb-nompu/Makefile
3# 3#
4 4
5obj-y := cplbinit.o cacheinit.o cplbmgr.o 5obj-y := cplbinit.o cplbmgr.o
6 6
7CFLAGS_cplbmgr.o := -ffixed-I0 -ffixed-I1 -ffixed-I2 -ffixed-I3 \ 7CFLAGS_cplbmgr.o := -ffixed-I0 -ffixed-I1 -ffixed-I2 -ffixed-I3 \
8 -ffixed-L0 -ffixed-L1 -ffixed-L2 -ffixed-L3 \ 8 -ffixed-L0 -ffixed-L1 -ffixed-L2 -ffixed-L3 \
diff --git a/arch/blackfin/kernel/cplb-nompu/cacheinit.c b/arch/blackfin/kernel/cplb-nompu/cacheinit.c
deleted file mode 100644
index d5a86c3017f7..000000000000
--- a/arch/blackfin/kernel/cplb-nompu/cacheinit.c
+++ /dev/null
@@ -1,69 +0,0 @@
1/*
2 * Copyright 2004-2007 Analog Devices Inc.
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, see the file COPYING, or write
16 * to the Free Software Foundation, Inc.,
17 * 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
18 */
19
20#include <linux/cpu.h>
21
22#include <asm/cacheflush.h>
23#include <asm/blackfin.h>
24#include <asm/cplb.h>
25#include <asm/cplbinit.h>
26
27#if defined(CONFIG_BFIN_ICACHE)
28void __cpuinit bfin_icache_init(struct cplb_entry *icplb_tbl)
29{
30 unsigned long ctrl;
31 int i;
32
33 SSYNC();
34 for (i = 0; i < MAX_CPLBS; i++) {
35 bfin_write32(ICPLB_ADDR0 + i * 4, icplb_tbl[i].addr);
36 bfin_write32(ICPLB_DATA0 + i * 4, icplb_tbl[i].data);
37 }
38 ctrl = bfin_read_IMEM_CONTROL();
39 ctrl |= IMC | ENICPLB;
40 bfin_write_IMEM_CONTROL(ctrl);
41 SSYNC();
42}
43#endif
44
45#if defined(CONFIG_BFIN_DCACHE)
46void __cpuinit bfin_dcache_init(struct cplb_entry *dcplb_tbl)
47{
48 unsigned long ctrl;
49 int i;
50
51 SSYNC();
52 for (i = 0; i < MAX_CPLBS; i++) {
53 bfin_write32(DCPLB_ADDR0 + i * 4, dcplb_tbl[i].addr);
54 bfin_write32(DCPLB_DATA0 + i * 4, dcplb_tbl[i].data);
55 }
56
57 ctrl = bfin_read_DMEM_CONTROL();
58
59 /*
60 * Anomaly notes:
61 * 05000287 - We implement workaround #2 - Change the DMEM_CONTROL
62 * register, so that the port preferences for DAG0 and DAG1 are set
63 * to port B
64 */
65 ctrl |= DMEM_CNTR | PORT_PREF0 | (ANOMALY_05000287 ? PORT_PREF1 : 0);
66 bfin_write_DMEM_CONTROL(ctrl);
67 SSYNC();
68}
69#endif
diff --git a/arch/blackfin/kernel/cplb-nompu/cplbinit.c b/arch/blackfin/kernel/cplb-nompu/cplbinit.c
index 685f160a5a36..5d8ad503f82a 100644
--- a/arch/blackfin/kernel/cplb-nompu/cplbinit.c
+++ b/arch/blackfin/kernel/cplb-nompu/cplbinit.c
@@ -36,7 +36,7 @@ int first_switched_icplb PDT_ATTR;
36int first_switched_dcplb PDT_ATTR; 36int first_switched_dcplb PDT_ATTR;
37 37
38struct cplb_boundary dcplb_bounds[9] PDT_ATTR; 38struct cplb_boundary dcplb_bounds[9] PDT_ATTR;
39struct cplb_boundary icplb_bounds[7] PDT_ATTR; 39struct cplb_boundary icplb_bounds[9] PDT_ATTR;
40 40
41int icplb_nr_bounds PDT_ATTR; 41int icplb_nr_bounds PDT_ATTR;
42int dcplb_nr_bounds PDT_ATTR; 42int dcplb_nr_bounds PDT_ATTR;
@@ -167,14 +167,21 @@ void __init generate_cplb_tables_all(void)
167 icplb_bounds[i_i++].data = (reserved_mem_icache_on ? 167 icplb_bounds[i_i++].data = (reserved_mem_icache_on ?
168 SDRAM_IGENERIC : SDRAM_INON_CHBL); 168 SDRAM_IGENERIC : SDRAM_INON_CHBL);
169 } 169 }
170 /* Addressing hole up to the async bank. */
171 icplb_bounds[i_i].eaddr = ASYNC_BANK0_BASE;
172 icplb_bounds[i_i++].data = 0;
173 /* ASYNC banks. */
174 icplb_bounds[i_i].eaddr = ASYNC_BANK3_BASE + ASYNC_BANK3_SIZE;
175 icplb_bounds[i_i++].data = SDRAM_EBIU;
170 /* Addressing hole up to BootROM. */ 176 /* Addressing hole up to BootROM. */
171 icplb_bounds[i_i].eaddr = BOOT_ROM_START; 177 icplb_bounds[i_i].eaddr = BOOT_ROM_START;
172 icplb_bounds[i_i++].data = 0; 178 icplb_bounds[i_i++].data = 0;
173 /* BootROM -- largest one should be less than 1 meg. */ 179 /* BootROM -- largest one should be less than 1 meg. */
174 icplb_bounds[i_i].eaddr = BOOT_ROM_START + (1 * 1024 * 1024); 180 icplb_bounds[i_i].eaddr = BOOT_ROM_START + (1 * 1024 * 1024);
175 icplb_bounds[i_i++].data = SDRAM_IGENERIC; 181 icplb_bounds[i_i++].data = SDRAM_IGENERIC;
182
176 if (L2_LENGTH) { 183 if (L2_LENGTH) {
177 /* Addressing hole up to L2 SRAM, including the async bank. */ 184 /* Addressing hole up to L2 SRAM. */
178 icplb_bounds[i_i].eaddr = L2_START; 185 icplb_bounds[i_i].eaddr = L2_START;
179 icplb_bounds[i_i++].data = 0; 186 icplb_bounds[i_i++].data = 0;
180 /* L2 SRAM. */ 187 /* L2 SRAM. */
diff --git a/arch/blackfin/kernel/cplb-nompu/cplbmgr.c b/arch/blackfin/kernel/cplb-nompu/cplbmgr.c
index 12b030842fdb..d9ea46c6e41a 100644
--- a/arch/blackfin/kernel/cplb-nompu/cplbmgr.c
+++ b/arch/blackfin/kernel/cplb-nompu/cplbmgr.c
@@ -48,36 +48,13 @@ int nr_cplb_flush[NR_CPUS], nr_dcplb_prot[NR_CPUS];
48#define MGR_ATTR 48#define MGR_ATTR
49#endif 49#endif
50 50
51/*
52 * We're in an exception handler. The normal cli nop nop workaround
53 * isn't going to do very much, as the only thing that can interrupt
54 * us is an NMI, and the cli isn't going to stop that.
55 */
56#define NOWA_SSYNC __asm__ __volatile__ ("ssync;")
57
58/* Anomaly handlers provide SSYNCs, so avoid extra if anomaly is present */
59#if ANOMALY_05000125
60
61#define bfin_write_DMEM_CONTROL_SSYNC(v) bfin_write_DMEM_CONTROL(v)
62#define bfin_write_IMEM_CONTROL_SSYNC(v) bfin_write_IMEM_CONTROL(v)
63
64#else
65
66#define bfin_write_DMEM_CONTROL_SSYNC(v) \
67 do { NOWA_SSYNC; bfin_write_DMEM_CONTROL(v); NOWA_SSYNC; } while (0)
68#define bfin_write_IMEM_CONTROL_SSYNC(v) \
69 do { NOWA_SSYNC; bfin_write_IMEM_CONTROL(v); NOWA_SSYNC; } while (0)
70
71#endif
72
73static inline void write_dcplb_data(int cpu, int idx, unsigned long data, 51static inline void write_dcplb_data(int cpu, int idx, unsigned long data,
74 unsigned long addr) 52 unsigned long addr)
75{ 53{
76 unsigned long ctrl = bfin_read_DMEM_CONTROL(); 54 _disable_dcplb();
77 bfin_write_DMEM_CONTROL_SSYNC(ctrl & ~ENDCPLB);
78 bfin_write32(DCPLB_DATA0 + idx * 4, data); 55 bfin_write32(DCPLB_DATA0 + idx * 4, data);
79 bfin_write32(DCPLB_ADDR0 + idx * 4, addr); 56 bfin_write32(DCPLB_ADDR0 + idx * 4, addr);
80 bfin_write_DMEM_CONTROL_SSYNC(ctrl); 57 _enable_dcplb();
81 58
82#ifdef CONFIG_CPLB_INFO 59#ifdef CONFIG_CPLB_INFO
83 dcplb_tbl[cpu][idx].addr = addr; 60 dcplb_tbl[cpu][idx].addr = addr;
@@ -88,12 +65,10 @@ static inline void write_dcplb_data(int cpu, int idx, unsigned long data,
88static inline void write_icplb_data(int cpu, int idx, unsigned long data, 65static inline void write_icplb_data(int cpu, int idx, unsigned long data,
89 unsigned long addr) 66 unsigned long addr)
90{ 67{
91 unsigned long ctrl = bfin_read_IMEM_CONTROL(); 68 _disable_icplb();
92
93 bfin_write_IMEM_CONTROL_SSYNC(ctrl & ~ENICPLB);
94 bfin_write32(ICPLB_DATA0 + idx * 4, data); 69 bfin_write32(ICPLB_DATA0 + idx * 4, data);
95 bfin_write32(ICPLB_ADDR0 + idx * 4, addr); 70 bfin_write32(ICPLB_ADDR0 + idx * 4, addr);
96 bfin_write_IMEM_CONTROL_SSYNC(ctrl); 71 _enable_icplb();
97 72
98#ifdef CONFIG_CPLB_INFO 73#ifdef CONFIG_CPLB_INFO
99 icplb_tbl[cpu][idx].addr = addr; 74 icplb_tbl[cpu][idx].addr = addr;
@@ -227,7 +202,7 @@ MGR_ATTR static int dcplb_miss(int cpu)
227MGR_ATTR int cplb_hdr(int seqstat, struct pt_regs *regs) 202MGR_ATTR int cplb_hdr(int seqstat, struct pt_regs *regs)
228{ 203{
229 int cause = seqstat & 0x3f; 204 int cause = seqstat & 0x3f;
230 unsigned int cpu = smp_processor_id(); 205 unsigned int cpu = raw_smp_processor_id();
231 switch (cause) { 206 switch (cause) {
232 case VEC_CPLB_I_M: 207 case VEC_CPLB_I_M:
233 return icplb_miss(cpu); 208 return icplb_miss(cpu);
diff --git a/arch/blackfin/kernel/early_printk.c b/arch/blackfin/kernel/early_printk.c
index 2ab56811841c..931c78b5ea1f 100644
--- a/arch/blackfin/kernel/early_printk.c
+++ b/arch/blackfin/kernel/early_printk.c
@@ -27,6 +27,7 @@
27#include <linux/serial_core.h> 27#include <linux/serial_core.h>
28#include <linux/console.h> 28#include <linux/console.h>
29#include <linux/string.h> 29#include <linux/string.h>
30#include <linux/reboot.h>
30#include <asm/blackfin.h> 31#include <asm/blackfin.h>
31#include <asm/irq_handler.h> 32#include <asm/irq_handler.h>
32#include <asm/early_printk.h> 33#include <asm/early_printk.h>
@@ -181,6 +182,22 @@ asmlinkage void __init init_early_exception_vectors(void)
181 u32 evt; 182 u32 evt;
182 SSYNC(); 183 SSYNC();
183 184
185 /*
186 * This starts up the shadow buffer, incase anything crashes before
187 * setup arch
188 */
189 mark_shadow_error();
190 early_shadow_puts(linux_banner);
191 early_shadow_stamp();
192
193 if (CPUID != bfin_cpuid()) {
194 early_shadow_puts("Running on wrong machine type, expected");
195 early_shadow_reg(CPUID, 16);
196 early_shadow_puts(", but running on");
197 early_shadow_reg(bfin_cpuid(), 16);
198 early_shadow_puts("\n");
199 }
200
184 /* cannot program in software: 201 /* cannot program in software:
185 * evt0 - emulation (jtag) 202 * evt0 - emulation (jtag)
186 * evt1 - reset 203 * evt1 - reset
@@ -199,6 +216,7 @@ asmlinkage void __init init_early_exception_vectors(void)
199 216
200} 217}
201 218
219__attribute__((__noreturn__))
202asmlinkage void __init early_trap_c(struct pt_regs *fp, void *retaddr) 220asmlinkage void __init early_trap_c(struct pt_regs *fp, void *retaddr)
203{ 221{
204 /* This can happen before the uart is initialized, so initialize 222 /* This can happen before the uart is initialized, so initialize
@@ -210,10 +228,58 @@ asmlinkage void __init early_trap_c(struct pt_regs *fp, void *retaddr)
210 if (likely(early_console == NULL) && CPUID == bfin_cpuid()) 228 if (likely(early_console == NULL) && CPUID == bfin_cpuid())
211 setup_early_printk(DEFAULT_EARLY_PORT); 229 setup_early_printk(DEFAULT_EARLY_PORT);
212 230
213 printk(KERN_EMERG "Early panic\n"); 231 if (!shadow_console_enabled()) {
214 dump_bfin_mem(fp); 232 /* crap - we crashed before setup_arch() */
215 show_regs(fp); 233 early_shadow_puts("panic before setup_arch\n");
216 dump_bfin_trace_buffer(); 234 early_shadow_puts("IPEND:");
235 early_shadow_reg(fp->ipend, 16);
236 if (fp->seqstat & SEQSTAT_EXCAUSE) {
237 early_shadow_puts("\nEXCAUSE:");
238 early_shadow_reg(fp->seqstat & SEQSTAT_EXCAUSE, 8);
239 }
240 if (fp->seqstat & SEQSTAT_HWERRCAUSE) {
241 early_shadow_puts("\nHWERRCAUSE:");
242 early_shadow_reg(
243 (fp->seqstat & SEQSTAT_HWERRCAUSE) >> 14, 8);
244 }
245 early_shadow_puts("\nErr @");
246 if (fp->ipend & EVT_EVX)
247 early_shadow_reg(fp->retx, 32);
248 else
249 early_shadow_reg(fp->pc, 32);
250#ifdef CONFIG_DEBUG_BFIN_HWTRACE_ON
251 early_shadow_puts("\nTrace:");
252 if (likely(bfin_read_TBUFSTAT() & TBUFCNT)) {
253 while (bfin_read_TBUFSTAT() & TBUFCNT) {
254 early_shadow_puts("\nT :");
255 early_shadow_reg(bfin_read_TBUF(), 32);
256 early_shadow_puts("\n S :");
257 early_shadow_reg(bfin_read_TBUF(), 32);
258 }
259 }
260#endif
261 early_shadow_puts("\nUse bfin-elf-addr2line to determine "
262 "function names\n");
263 /*
264 * We should panic(), but we can't - since panic calls printk,
265 * and printk uses memcpy.
266 * we want to reboot, but if the machine type is different,
267 * can't due to machine specific reboot sequences
268 */
269 if (CPUID == bfin_cpuid()) {
270 early_shadow_puts("Trying to restart\n");
271 machine_restart("");
272 }
273
274 early_shadow_puts("Halting, since it is not safe to restart\n");
275 while (1)
276 asm volatile ("EMUEXCPT; IDLE;\n");
277
278 } else {
279 printk(KERN_EMERG "Early panic\n");
280 show_regs(fp);
281 dump_bfin_trace_buffer();
282 }
217 283
218 panic("Died early"); 284 panic("Died early");
219} 285}
diff --git a/arch/blackfin/kernel/entry.S b/arch/blackfin/kernel/entry.S
index a9cfba9946b5..3f8769b7db54 100644
--- a/arch/blackfin/kernel/entry.S
+++ b/arch/blackfin/kernel/entry.S
@@ -43,8 +43,28 @@
43 43
44ENTRY(_ret_from_fork) 44ENTRY(_ret_from_fork)
45#ifdef CONFIG_IPIPE 45#ifdef CONFIG_IPIPE
46 [--sp] = reti; /* IRQs on. */ 46 /*
47 SP += 4; 47 * Hw IRQs are off on entry, and we don't want the scheduling tail
48 * code to starve high priority domains from interrupts while it
49 * runs. Therefore we first stall the root stage to have the
50 * virtual interrupt state reflect IMASK.
51 */
52 p0.l = ___ipipe_root_status;
53 p0.h = ___ipipe_root_status;
54 r4 = [p0];
55 bitset(r4, 0);
56 [p0] = r4;
57 /*
58 * Then we may enable hw IRQs, allowing preemption from high
59 * priority domains. schedule_tail() will do local_irq_enable()
60 * since Blackfin does not define __ARCH_WANT_UNLOCKED_CTXSW, so
61 * there is no need to unstall the root domain by ourselves
62 * afterwards.
63 */
64 p0.l = _bfin_irq_flags;
65 p0.h = _bfin_irq_flags;
66 r4 = [p0];
67 sti r4;
48#endif /* CONFIG_IPIPE */ 68#endif /* CONFIG_IPIPE */
49 SP += -12; 69 SP += -12;
50 call _schedule_tail; 70 call _schedule_tail;
diff --git a/arch/blackfin/kernel/ftrace-entry.S b/arch/blackfin/kernel/ftrace-entry.S
index 6980b7a0615d..76dd4fbcd17a 100644
--- a/arch/blackfin/kernel/ftrace-entry.S
+++ b/arch/blackfin/kernel/ftrace-entry.S
@@ -17,8 +17,8 @@
17 * only one we can blow away. With pointer registers, we have P0-P2. 17 * only one we can blow away. With pointer registers, we have P0-P2.
18 * 18 *
19 * Upon entry, the RETS will point to the top of the current profiled 19 * Upon entry, the RETS will point to the top of the current profiled
20 * function. And since GCC setup the frame for us, the previous function 20 * function. And since GCC pushed the previous RETS for us, the previous
21 * will be waiting there. mmmm pie. 21 * function will be waiting there. mmmm pie.
22 */ 22 */
23ENTRY(__mcount) 23ENTRY(__mcount)
24 /* save third function arg early so we can do testing below */ 24 /* save third function arg early so we can do testing below */
@@ -70,14 +70,14 @@ ENTRY(__mcount)
70 /* setup the tracer function */ 70 /* setup the tracer function */
71 p0 = r3; 71 p0 = r3;
72 72
73 /* tracer(ulong frompc, ulong selfpc): 73 /* function_trace_call(unsigned long ip, unsigned long parent_ip):
74 * frompc: the pc that did the call to ... 74 * ip: this point was called by ...
75 * selfpc: ... this location 75 * parent_ip: ... this function
76 * the selfpc itself will need adjusting for the mcount call 76 * the ip itself will need adjusting for the mcount call
77 */ 77 */
78 r1 = rets; 78 r0 = rets;
79 r0 = [fp + 4]; 79 r1 = [sp + 16]; /* skip the 4 local regs on stack */
80 r1 += -MCOUNT_INSN_SIZE; 80 r0 += -MCOUNT_INSN_SIZE;
81 81
82 /* call the tracer */ 82 /* call the tracer */
83 call (p0); 83 call (p0);
@@ -106,9 +106,10 @@ ENTRY(_ftrace_graph_caller)
106 [--sp] = r1; 106 [--sp] = r1;
107 [--sp] = rets; 107 [--sp] = rets;
108 108
109 r0 = fp; 109 /* prepare_ftrace_return(unsigned long *parent, unsigned long self_addr) */
110 r0 = sp;
110 r1 = rets; 111 r1 = rets;
111 r0 += 4; 112 r0 += 16; /* skip the 4 local regs on stack */
112 r1 += -MCOUNT_INSN_SIZE; 113 r1 += -MCOUNT_INSN_SIZE;
113 call _prepare_ftrace_return; 114 call _prepare_ftrace_return;
114 115
diff --git a/arch/blackfin/kernel/ftrace.c b/arch/blackfin/kernel/ftrace.c
index 905bfc40a00b..f2c85ac6f2da 100644
--- a/arch/blackfin/kernel/ftrace.c
+++ b/arch/blackfin/kernel/ftrace.c
@@ -24,7 +24,7 @@ void prepare_ftrace_return(unsigned long *parent, unsigned long self_addr)
24 if (unlikely(atomic_read(&current->tracing_graph_pause))) 24 if (unlikely(atomic_read(&current->tracing_graph_pause)))
25 return; 25 return;
26 26
27 if (ftrace_push_return_trace(*parent, self_addr, &trace.depth) == -EBUSY) 27 if (ftrace_push_return_trace(*parent, self_addr, &trace.depth, 0) == -EBUSY)
28 return; 28 return;
29 29
30 trace.func = self_addr; 30 trace.func = self_addr;
diff --git a/arch/blackfin/kernel/ipipe.c b/arch/blackfin/kernel/ipipe.c
index b8d22034b9a6..5d7382396dc0 100644
--- a/arch/blackfin/kernel/ipipe.c
+++ b/arch/blackfin/kernel/ipipe.c
@@ -30,10 +30,10 @@
30#include <linux/slab.h> 30#include <linux/slab.h>
31#include <linux/errno.h> 31#include <linux/errno.h>
32#include <linux/kthread.h> 32#include <linux/kthread.h>
33#include <asm/unistd.h> 33#include <linux/unistd.h>
34#include <linux/io.h>
34#include <asm/system.h> 35#include <asm/system.h>
35#include <asm/atomic.h> 36#include <asm/atomic.h>
36#include <asm/io.h>
37 37
38DEFINE_PER_CPU(struct pt_regs, __ipipe_tick_regs); 38DEFINE_PER_CPU(struct pt_regs, __ipipe_tick_regs);
39 39
@@ -90,6 +90,7 @@ void __ipipe_handle_irq(unsigned irq, struct pt_regs *regs)
90 struct ipipe_percpu_domain_data *p = ipipe_root_cpudom_ptr(); 90 struct ipipe_percpu_domain_data *p = ipipe_root_cpudom_ptr();
91 struct ipipe_domain *this_domain, *next_domain; 91 struct ipipe_domain *this_domain, *next_domain;
92 struct list_head *head, *pos; 92 struct list_head *head, *pos;
93 struct ipipe_irqdesc *idesc;
93 int m_ack, s = -1; 94 int m_ack, s = -1;
94 95
95 /* 96 /*
@@ -100,17 +101,20 @@ void __ipipe_handle_irq(unsigned irq, struct pt_regs *regs)
100 */ 101 */
101 m_ack = (regs == NULL || irq == IRQ_SYSTMR || irq == IRQ_CORETMR); 102 m_ack = (regs == NULL || irq == IRQ_SYSTMR || irq == IRQ_CORETMR);
102 this_domain = __ipipe_current_domain; 103 this_domain = __ipipe_current_domain;
104 idesc = &this_domain->irqs[irq];
103 105
104 if (unlikely(test_bit(IPIPE_STICKY_FLAG, &this_domain->irqs[irq].control))) 106 if (unlikely(test_bit(IPIPE_STICKY_FLAG, &idesc->control)))
105 head = &this_domain->p_link; 107 head = &this_domain->p_link;
106 else { 108 else {
107 head = __ipipe_pipeline.next; 109 head = __ipipe_pipeline.next;
108 next_domain = list_entry(head, struct ipipe_domain, p_link); 110 next_domain = list_entry(head, struct ipipe_domain, p_link);
109 if (likely(test_bit(IPIPE_WIRED_FLAG, &next_domain->irqs[irq].control))) { 111 idesc = &next_domain->irqs[irq];
110 if (!m_ack && next_domain->irqs[irq].acknowledge != NULL) 112 if (likely(test_bit(IPIPE_WIRED_FLAG, &idesc->control))) {
111 next_domain->irqs[irq].acknowledge(irq, irq_to_desc(irq)); 113 if (!m_ack && idesc->acknowledge != NULL)
114 idesc->acknowledge(irq, irq_to_desc(irq));
112 if (test_bit(IPIPE_SYNCDEFER_FLAG, &p->status)) 115 if (test_bit(IPIPE_SYNCDEFER_FLAG, &p->status))
113 s = __test_and_set_bit(IPIPE_STALL_FLAG, &p->status); 116 s = __test_and_set_bit(IPIPE_STALL_FLAG,
117 &p->status);
114 __ipipe_dispatch_wired(next_domain, irq); 118 __ipipe_dispatch_wired(next_domain, irq);
115 goto out; 119 goto out;
116 } 120 }
@@ -121,14 +125,15 @@ void __ipipe_handle_irq(unsigned irq, struct pt_regs *regs)
121 pos = head; 125 pos = head;
122 while (pos != &__ipipe_pipeline) { 126 while (pos != &__ipipe_pipeline) {
123 next_domain = list_entry(pos, struct ipipe_domain, p_link); 127 next_domain = list_entry(pos, struct ipipe_domain, p_link);
124 if (test_bit(IPIPE_HANDLE_FLAG, &next_domain->irqs[irq].control)) { 128 idesc = &next_domain->irqs[irq];
129 if (test_bit(IPIPE_HANDLE_FLAG, &idesc->control)) {
125 __ipipe_set_irq_pending(next_domain, irq); 130 __ipipe_set_irq_pending(next_domain, irq);
126 if (!m_ack && next_domain->irqs[irq].acknowledge != NULL) { 131 if (!m_ack && idesc->acknowledge != NULL) {
127 next_domain->irqs[irq].acknowledge(irq, irq_to_desc(irq)); 132 idesc->acknowledge(irq, irq_to_desc(irq));
128 m_ack = 1; 133 m_ack = 1;
129 } 134 }
130 } 135 }
131 if (!test_bit(IPIPE_PASS_FLAG, &next_domain->irqs[irq].control)) 136 if (!test_bit(IPIPE_PASS_FLAG, &idesc->control))
132 break; 137 break;
133 pos = next_domain->p_link.next; 138 pos = next_domain->p_link.next;
134 } 139 }
@@ -159,11 +164,6 @@ out:
159 __clear_bit(IPIPE_STALL_FLAG, &p->status); 164 __clear_bit(IPIPE_STALL_FLAG, &p->status);
160} 165}
161 166
162int __ipipe_check_root(void)
163{
164 return ipipe_root_domain_p;
165}
166
167void __ipipe_enable_irqdesc(struct ipipe_domain *ipd, unsigned irq) 167void __ipipe_enable_irqdesc(struct ipipe_domain *ipd, unsigned irq)
168{ 168{
169 struct irq_desc *desc = irq_to_desc(irq); 169 struct irq_desc *desc = irq_to_desc(irq);
@@ -186,30 +186,6 @@ void __ipipe_disable_irqdesc(struct ipipe_domain *ipd, unsigned irq)
186} 186}
187EXPORT_SYMBOL(__ipipe_disable_irqdesc); 187EXPORT_SYMBOL(__ipipe_disable_irqdesc);
188 188
189void __ipipe_stall_root_raw(void)
190{
191 /*
192 * This code is called by the ins{bwl} routines (see
193 * arch/blackfin/lib/ins.S), which are heavily used by the
194 * network stack. It masks all interrupts but those handled by
195 * non-root domains, so that we keep decent network transfer
196 * rates for Linux without inducing pathological jitter for
197 * the real-time domain.
198 */
199 __asm__ __volatile__ ("sti %0;" : : "d"(__ipipe_irq_lvmask));
200
201 __set_bit(IPIPE_STALL_FLAG,
202 &ipipe_root_cpudom_var(status));
203}
204
205void __ipipe_unstall_root_raw(void)
206{
207 __clear_bit(IPIPE_STALL_FLAG,
208 &ipipe_root_cpudom_var(status));
209
210 __asm__ __volatile__ ("sti %0;" : : "d"(bfin_irq_flags));
211}
212
213int __ipipe_syscall_root(struct pt_regs *regs) 189int __ipipe_syscall_root(struct pt_regs *regs)
214{ 190{
215 struct ipipe_percpu_domain_data *p; 191 struct ipipe_percpu_domain_data *p;
@@ -333,12 +309,29 @@ asmlinkage void __ipipe_sync_root(void)
333 309
334void ___ipipe_sync_pipeline(unsigned long syncmask) 310void ___ipipe_sync_pipeline(unsigned long syncmask)
335{ 311{
336 if (__ipipe_root_domain_p) { 312 if (__ipipe_root_domain_p &&
337 if (test_bit(IPIPE_SYNCDEFER_FLAG, &ipipe_root_cpudom_var(status))) 313 test_bit(IPIPE_SYNCDEFER_FLAG, &ipipe_root_cpudom_var(status)))
338 return; 314 return;
339 }
340 315
341 __ipipe_sync_stage(syncmask); 316 __ipipe_sync_stage(syncmask);
342} 317}
343 318
344EXPORT_SYMBOL(show_stack); 319void __ipipe_disable_root_irqs_hw(void)
320{
321 /*
322 * This code is called by the ins{bwl} routines (see
323 * arch/blackfin/lib/ins.S), which are heavily used by the
324 * network stack. It masks all interrupts but those handled by
325 * non-root domains, so that we keep decent network transfer
326 * rates for Linux without inducing pathological jitter for
327 * the real-time domain.
328 */
329 bfin_sti(__ipipe_irq_lvmask);
330 __set_bit(IPIPE_STALL_FLAG, &ipipe_root_cpudom_var(status));
331}
332
333void __ipipe_enable_root_irqs_hw(void)
334{
335 __clear_bit(IPIPE_STALL_FLAG, &ipipe_root_cpudom_var(status));
336 bfin_sti(bfin_irq_flags);
337}
diff --git a/arch/blackfin/kernel/kgdb_test.c b/arch/blackfin/kernel/kgdb_test.c
index dbcf3e45cb0b..59fc42dc5d6a 100644
--- a/arch/blackfin/kernel/kgdb_test.c
+++ b/arch/blackfin/kernel/kgdb_test.c
@@ -54,7 +54,7 @@ void kgdb_l2_test(void)
54 54
55int kgdb_test(char *name, int len, int count, int z) 55int kgdb_test(char *name, int len, int count, int z)
56{ 56{
57 printk(KERN_DEBUG "kgdb name(%d): %s, %d, %d\n", len, name, count, z); 57 printk(KERN_ALERT "kgdb name(%d): %s, %d, %d\n", len, name, count, z);
58 count = z; 58 count = z;
59 return count; 59 return count;
60} 60}
diff --git a/arch/blackfin/kernel/module.c b/arch/blackfin/kernel/module.c
index d5aee3626688..67fc7a56c865 100644
--- a/arch/blackfin/kernel/module.c
+++ b/arch/blackfin/kernel/module.c
@@ -27,6 +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 pr_fmt(fmt) "module %s: " fmt
30 31
31#include <linux/moduleloader.h> 32#include <linux/moduleloader.h>
32#include <linux/elf.h> 33#include <linux/elf.h>
@@ -36,6 +37,7 @@
36#include <linux/kernel.h> 37#include <linux/kernel.h>
37#include <asm/dma.h> 38#include <asm/dma.h>
38#include <asm/cacheflush.h> 39#include <asm/cacheflush.h>
40#include <asm/uaccess.h>
39 41
40void *module_alloc(unsigned long size) 42void *module_alloc(unsigned long size)
41{ 43{
@@ -52,7 +54,7 @@ void module_free(struct module *mod, void *module_region)
52 54
53/* Transfer the section to the L1 memory */ 55/* Transfer the section to the L1 memory */
54int 56int
55module_frob_arch_sections(Elf_Ehdr * hdr, Elf_Shdr * sechdrs, 57module_frob_arch_sections(Elf_Ehdr *hdr, Elf_Shdr *sechdrs,
56 char *secstrings, struct module *mod) 58 char *secstrings, struct module *mod)
57{ 59{
58 /* 60 /*
@@ -63,126 +65,119 @@ module_frob_arch_sections(Elf_Ehdr * hdr, Elf_Shdr * sechdrs,
63 * NOTE: this breaks the semantic of mod->arch structure. 65 * NOTE: this breaks the semantic of mod->arch structure.
64 */ 66 */
65 Elf_Shdr *s, *sechdrs_end = sechdrs + hdr->e_shnum; 67 Elf_Shdr *s, *sechdrs_end = sechdrs + hdr->e_shnum;
66 void *dest = NULL; 68 void *dest;
67 69
68 for (s = sechdrs; s < sechdrs_end; ++s) { 70 for (s = sechdrs; s < sechdrs_end; ++s) {
69 if ((strcmp(".l1.text", secstrings + s->sh_name) == 0) || 71 const char *shname = secstrings + s->sh_name;
70 ((strcmp(".text", secstrings + s->sh_name) == 0) && 72
71 (hdr->e_flags & EF_BFIN_CODE_IN_L1) && (s->sh_size > 0))) { 73 if (s->sh_size == 0)
74 continue;
75
76 if (!strcmp(".l1.text", shname) ||
77 (!strcmp(".text", shname) &&
78 (hdr->e_flags & EF_BFIN_CODE_IN_L1))) {
79
72 dest = l1_inst_sram_alloc(s->sh_size); 80 dest = l1_inst_sram_alloc(s->sh_size);
73 mod->arch.text_l1 = dest; 81 mod->arch.text_l1 = dest;
74 if (dest == NULL) { 82 if (dest == NULL) {
75 printk(KERN_ERR 83 pr_err("L1 inst memory allocation failed\n",
76 "module %s: L1 instruction memory allocation failed\n", 84 mod->name);
77 mod->name);
78 return -1; 85 return -1;
79 } 86 }
80 dma_memcpy(dest, (void *)s->sh_addr, s->sh_size); 87 dma_memcpy(dest, (void *)s->sh_addr, s->sh_size);
81 s->sh_flags &= ~SHF_ALLOC; 88
82 s->sh_addr = (unsigned long)dest; 89 } else if (!strcmp(".l1.data", shname) ||
83 } 90 (!strcmp(".data", shname) &&
84 if ((strcmp(".l1.data", secstrings + s->sh_name) == 0) || 91 (hdr->e_flags & EF_BFIN_DATA_IN_L1))) {
85 ((strcmp(".data", secstrings + s->sh_name) == 0) && 92
86 (hdr->e_flags & EF_BFIN_DATA_IN_L1) && (s->sh_size > 0))) {
87 dest = l1_data_sram_alloc(s->sh_size); 93 dest = l1_data_sram_alloc(s->sh_size);
88 mod->arch.data_a_l1 = dest; 94 mod->arch.data_a_l1 = dest;
89 if (dest == NULL) { 95 if (dest == NULL) {
90 printk(KERN_ERR 96 pr_err("L1 data memory allocation failed\n",
91 "module %s: L1 data memory allocation failed\n",
92 mod->name); 97 mod->name);
93 return -1; 98 return -1;
94 } 99 }
95 memcpy(dest, (void *)s->sh_addr, s->sh_size); 100 memcpy(dest, (void *)s->sh_addr, s->sh_size);
96 s->sh_flags &= ~SHF_ALLOC; 101
97 s->sh_addr = (unsigned long)dest; 102 } else if (!strcmp(".l1.bss", shname) ||
98 } 103 (!strcmp(".bss", shname) &&
99 if (strcmp(".l1.bss", secstrings + s->sh_name) == 0 || 104 (hdr->e_flags & EF_BFIN_DATA_IN_L1))) {
100 ((strcmp(".bss", secstrings + s->sh_name) == 0) && 105
101 (hdr->e_flags & EF_BFIN_DATA_IN_L1) && (s->sh_size > 0))) { 106 dest = l1_data_sram_zalloc(s->sh_size);
102 dest = l1_data_sram_alloc(s->sh_size);
103 mod->arch.bss_a_l1 = dest; 107 mod->arch.bss_a_l1 = dest;
104 if (dest == NULL) { 108 if (dest == NULL) {
105 printk(KERN_ERR 109 pr_err("L1 data memory allocation failed\n",
106 "module %s: L1 data memory allocation failed\n",
107 mod->name); 110 mod->name);
108 return -1; 111 return -1;
109 } 112 }
110 memset(dest, 0, s->sh_size); 113
111 s->sh_flags &= ~SHF_ALLOC; 114 } else if (!strcmp(".l1.data.B", shname)) {
112 s->sh_addr = (unsigned long)dest; 115
113 }
114 if (strcmp(".l1.data.B", secstrings + s->sh_name) == 0) {
115 dest = l1_data_B_sram_alloc(s->sh_size); 116 dest = l1_data_B_sram_alloc(s->sh_size);
116 mod->arch.data_b_l1 = dest; 117 mod->arch.data_b_l1 = dest;
117 if (dest == NULL) { 118 if (dest == NULL) {
118 printk(KERN_ERR 119 pr_err("L1 data memory allocation failed\n",
119 "module %s: L1 data memory allocation failed\n",
120 mod->name); 120 mod->name);
121 return -1; 121 return -1;
122 } 122 }
123 memcpy(dest, (void *)s->sh_addr, s->sh_size); 123 memcpy(dest, (void *)s->sh_addr, s->sh_size);
124 s->sh_flags &= ~SHF_ALLOC; 124
125 s->sh_addr = (unsigned long)dest; 125 } else if (!strcmp(".l1.bss.B", shname)) {
126 } 126
127 if (strcmp(".l1.bss.B", secstrings + s->sh_name) == 0) {
128 dest = l1_data_B_sram_alloc(s->sh_size); 127 dest = l1_data_B_sram_alloc(s->sh_size);
129 mod->arch.bss_b_l1 = dest; 128 mod->arch.bss_b_l1 = dest;
130 if (dest == NULL) { 129 if (dest == NULL) {
131 printk(KERN_ERR 130 pr_err("L1 data memory allocation failed\n",
132 "module %s: L1 data memory allocation failed\n",
133 mod->name); 131 mod->name);
134 return -1; 132 return -1;
135 } 133 }
136 memset(dest, 0, s->sh_size); 134 memset(dest, 0, s->sh_size);
137 s->sh_flags &= ~SHF_ALLOC; 135
138 s->sh_addr = (unsigned long)dest; 136 } else if (!strcmp(".l2.text", shname) ||
139 } 137 (!strcmp(".text", shname) &&
140 if ((strcmp(".l2.text", secstrings + s->sh_name) == 0) || 138 (hdr->e_flags & EF_BFIN_CODE_IN_L2))) {
141 ((strcmp(".text", secstrings + s->sh_name) == 0) && 139
142 (hdr->e_flags & EF_BFIN_CODE_IN_L2) && (s->sh_size > 0))) {
143 dest = l2_sram_alloc(s->sh_size); 140 dest = l2_sram_alloc(s->sh_size);
144 mod->arch.text_l2 = dest; 141 mod->arch.text_l2 = dest;
145 if (dest == NULL) { 142 if (dest == NULL) {
146 printk(KERN_ERR 143 pr_err("L2 SRAM allocation failed\n",
147 "module %s: L2 SRAM allocation failed\n", 144 mod->name);
148 mod->name);
149 return -1; 145 return -1;
150 } 146 }
151 memcpy(dest, (void *)s->sh_addr, s->sh_size); 147 memcpy(dest, (void *)s->sh_addr, s->sh_size);
152 s->sh_flags &= ~SHF_ALLOC; 148
153 s->sh_addr = (unsigned long)dest; 149 } else if (!strcmp(".l2.data", shname) ||
154 } 150 (!strcmp(".data", shname) &&
155 if ((strcmp(".l2.data", secstrings + s->sh_name) == 0) || 151 (hdr->e_flags & EF_BFIN_DATA_IN_L2))) {
156 ((strcmp(".data", secstrings + s->sh_name) == 0) && 152
157 (hdr->e_flags & EF_BFIN_DATA_IN_L2) && (s->sh_size > 0))) {
158 dest = l2_sram_alloc(s->sh_size); 153 dest = l2_sram_alloc(s->sh_size);
159 mod->arch.data_l2 = dest; 154 mod->arch.data_l2 = dest;
160 if (dest == NULL) { 155 if (dest == NULL) {
161 printk(KERN_ERR 156 pr_err("L2 SRAM allocation failed\n",
162 "module %s: L2 SRAM allocation failed\n",
163 mod->name); 157 mod->name);
164 return -1; 158 return -1;
165 } 159 }
166 memcpy(dest, (void *)s->sh_addr, s->sh_size); 160 memcpy(dest, (void *)s->sh_addr, s->sh_size);
167 s->sh_flags &= ~SHF_ALLOC; 161
168 s->sh_addr = (unsigned long)dest; 162 } else if (!strcmp(".l2.bss", shname) ||
169 } 163 (!strcmp(".bss", shname) &&
170 if (strcmp(".l2.bss", secstrings + s->sh_name) == 0 || 164 (hdr->e_flags & EF_BFIN_DATA_IN_L2))) {
171 ((strcmp(".bss", secstrings + s->sh_name) == 0) && 165
172 (hdr->e_flags & EF_BFIN_DATA_IN_L2) && (s->sh_size > 0))) { 166 dest = l2_sram_zalloc(s->sh_size);
173 dest = l2_sram_alloc(s->sh_size);
174 mod->arch.bss_l2 = dest; 167 mod->arch.bss_l2 = dest;
175 if (dest == NULL) { 168 if (dest == NULL) {
176 printk(KERN_ERR 169 pr_err("L2 SRAM allocation failed\n",
177 "module %s: L2 SRAM allocation failed\n",
178 mod->name); 170 mod->name);
179 return -1; 171 return -1;
180 } 172 }
181 memset(dest, 0, s->sh_size); 173
182 s->sh_flags &= ~SHF_ALLOC; 174 } else
183 s->sh_addr = (unsigned long)dest; 175 continue;
184 } 176
177 s->sh_flags &= ~SHF_ALLOC;
178 s->sh_addr = (unsigned long)dest;
185 } 179 }
180
186 return 0; 181 return 0;
187} 182}
188 183
@@ -190,7 +185,7 @@ int
190apply_relocate(Elf_Shdr * sechdrs, const char *strtab, 185apply_relocate(Elf_Shdr * sechdrs, const char *strtab,
191 unsigned int symindex, unsigned int relsec, struct module *me) 186 unsigned int symindex, unsigned int relsec, struct module *me)
192{ 187{
193 printk(KERN_ERR "module %s: .rel unsupported\n", me->name); 188 pr_err(".rel unsupported\n", me->name);
194 return -ENOEXEC; 189 return -ENOEXEC;
195} 190}
196 191
@@ -205,109 +200,86 @@ apply_relocate(Elf_Shdr * sechdrs, const char *strtab,
205/* gas does not generate it. */ 200/* gas does not generate it. */
206/*************************************************************************/ 201/*************************************************************************/
207int 202int
208apply_relocate_add(Elf_Shdr * sechdrs, const char *strtab, 203apply_relocate_add(Elf_Shdr *sechdrs, const char *strtab,
209 unsigned int symindex, unsigned int relsec, 204 unsigned int symindex, unsigned int relsec,
210 struct module *mod) 205 struct module *mod)
211{ 206{
212 unsigned int i; 207 unsigned int i;
213 unsigned short tmp;
214 Elf32_Rela *rel = (void *)sechdrs[relsec].sh_addr; 208 Elf32_Rela *rel = (void *)sechdrs[relsec].sh_addr;
215 Elf32_Sym *sym; 209 Elf32_Sym *sym;
216 uint32_t *location32; 210 unsigned long location, value, size;
217 uint16_t *location16; 211
218 uint32_t value; 212 pr_debug("applying relocate section %u to %u\n", mod->name,
213 relsec, sechdrs[relsec].sh_info);
219 214
220 pr_debug("Applying relocate section %u to %u\n", relsec,
221 sechdrs[relsec].sh_info);
222 for (i = 0; i < sechdrs[relsec].sh_size / sizeof(*rel); i++) { 215 for (i = 0; i < sechdrs[relsec].sh_size / sizeof(*rel); i++) {
223 /* This is where to make the change */ 216 /* This is where to make the change */
224 location16 = 217 location = sechdrs[sechdrs[relsec].sh_info].sh_addr +
225 (uint16_t *) (sechdrs[sechdrs[relsec].sh_info].sh_addr + 218 rel[i].r_offset;
226 rel[i].r_offset); 219
227 location32 = (uint32_t *) location16;
228 /* This is the symbol it is referring to. Note that all 220 /* This is the symbol it is referring to. Note that all
229 undefined symbols have been resolved. */ 221 undefined symbols have been resolved. */
230 sym = (Elf32_Sym *) sechdrs[symindex].sh_addr 222 sym = (Elf32_Sym *) sechdrs[symindex].sh_addr
231 + ELF32_R_SYM(rel[i].r_info); 223 + ELF32_R_SYM(rel[i].r_info);
232 value = sym->st_value; 224 value = sym->st_value;
233 value += rel[i].r_addend; 225 value += rel[i].r_addend;
234 pr_debug("location is %x, value is %x type is %d \n", 226
235 (unsigned int) location32, value,
236 ELF32_R_TYPE(rel[i].r_info));
237#ifdef CONFIG_SMP 227#ifdef CONFIG_SMP
238 if ((unsigned long)location16 >= COREB_L1_DATA_A_START) { 228 if (location >= COREB_L1_DATA_A_START) {
239 printk(KERN_ERR "module %s: cannot relocate in L1: %u (SMP kernel)", 229 pr_err("cannot relocate in L1: %u (SMP kernel)",
240 mod->name, ELF32_R_TYPE(rel[i].r_info)); 230 mod->name, ELF32_R_TYPE(rel[i].r_info));
241 return -ENOEXEC; 231 return -ENOEXEC;
242 } 232 }
243#endif 233#endif
234
235 pr_debug("location is %lx, value is %lx type is %d\n",
236 mod->name, location, value, ELF32_R_TYPE(rel[i].r_info));
237
244 switch (ELF32_R_TYPE(rel[i].r_info)) { 238 switch (ELF32_R_TYPE(rel[i].r_info)) {
245 239
240 case R_BFIN_HUIMM16:
241 value >>= 16;
242 case R_BFIN_LUIMM16:
243 case R_BFIN_RIMM16:
244 size = 2;
245 break;
246 case R_BFIN_BYTE4_DATA:
247 size = 4;
248 break;
249
246 case R_BFIN_PCREL24: 250 case R_BFIN_PCREL24:
247 case R_BFIN_PCREL24_JUMP_L: 251 case R_BFIN_PCREL24_JUMP_L:
248 /* Add the value, subtract its postition */
249 location16 =
250 (uint16_t *) (sechdrs[sechdrs[relsec].sh_info].
251 sh_addr + rel[i].r_offset - 2);
252 location32 = (uint32_t *) location16;
253 value -= (uint32_t) location32;
254 value >>= 1;
255 if ((value & 0xFF000000) != 0 &&
256 (value & 0xFF000000) != 0xFF000000) {
257 printk(KERN_ERR "module %s: relocation overflow\n",
258 mod->name);
259 return -ENOEXEC;
260 }
261 pr_debug("value is %x, before %x-%x after %x-%x\n", value,
262 *location16, *(location16 + 1),
263 (*location16 & 0xff00) | (value >> 16 & 0x00ff),
264 value & 0xffff);
265 *location16 =
266 (*location16 & 0xff00) | (value >> 16 & 0x00ff);
267 *(location16 + 1) = value & 0xffff;
268 break;
269 case R_BFIN_PCREL12_JUMP: 252 case R_BFIN_PCREL12_JUMP:
270 case R_BFIN_PCREL12_JUMP_S: 253 case R_BFIN_PCREL12_JUMP_S:
271 value -= (uint32_t) location32;
272 value >>= 1;
273 *location16 = (value & 0xfff);
274 break;
275 case R_BFIN_PCREL10: 254 case R_BFIN_PCREL10:
276 value -= (uint32_t) location32; 255 pr_err("unsupported relocation: %u (no -mlong-calls?)\n",
277 value >>= 1; 256 mod->name, ELF32_R_TYPE(rel[i].r_info));
278 *location16 = (value & 0x3ff); 257 return -ENOEXEC;
279 break; 258
280 case R_BFIN_LUIMM16: 259 default:
281 pr_debug("before %x after %x\n", *location16, 260 pr_err("unknown relocation: %u\n", mod->name,
282 (value & 0xffff)); 261 ELF32_R_TYPE(rel[i].r_info));
283 tmp = (value & 0xffff); 262 return -ENOEXEC;
284 if ((unsigned long)location16 >= L1_CODE_START) { 263 }
285 dma_memcpy(location16, &tmp, 2); 264
286 } else 265 switch (bfin_mem_access_type(location, size)) {
287 *location16 = tmp; 266 case BFIN_MEM_ACCESS_CORE:
288 break; 267 case BFIN_MEM_ACCESS_CORE_ONLY:
289 case R_BFIN_HUIMM16: 268 memcpy((void *)location, &value, size);
290 pr_debug("before %x after %x\n", *location16,
291 ((value >> 16) & 0xffff));
292 tmp = ((value >> 16) & 0xffff);
293 if ((unsigned long)location16 >= L1_CODE_START) {
294 dma_memcpy(location16, &tmp, 2);
295 } else
296 *location16 = tmp;
297 break; 269 break;
298 case R_BFIN_RIMM16: 270 case BFIN_MEM_ACCESS_DMA:
299 *location16 = (value & 0xffff); 271 dma_memcpy((void *)location, &value, size);
300 break; 272 break;
301 case R_BFIN_BYTE4_DATA: 273 case BFIN_MEM_ACCESS_ITEST:
302 pr_debug("before %x after %x\n", *location32, value); 274 isram_memcpy((void *)location, &value, size);
303 *location32 = value;
304 break; 275 break;
305 default: 276 default:
306 printk(KERN_ERR "module %s: Unknown relocation: %u\n", 277 pr_err("invalid relocation for %#lx\n",
307 mod->name, ELF32_R_TYPE(rel[i].r_info)); 278 mod->name, location);
308 return -ENOEXEC; 279 return -ENOEXEC;
309 } 280 }
310 } 281 }
282
311 return 0; 283 return 0;
312} 284}
313 285
@@ -332,22 +304,28 @@ module_finalize(const Elf_Ehdr * hdr,
332 for (i = 1; i < hdr->e_shnum; i++) { 304 for (i = 1; i < hdr->e_shnum; i++) {
333 const char *strtab = (char *)sechdrs[strindex].sh_addr; 305 const char *strtab = (char *)sechdrs[strindex].sh_addr;
334 unsigned int info = sechdrs[i].sh_info; 306 unsigned int info = sechdrs[i].sh_info;
307 const char *shname = secstrings + sechdrs[i].sh_name;
335 308
336 /* Not a valid relocation section? */ 309 /* Not a valid relocation section? */
337 if (info >= hdr->e_shnum) 310 if (info >= hdr->e_shnum)
338 continue; 311 continue;
339 312
340 if ((sechdrs[i].sh_type == SHT_RELA) && 313 /* Only support RELA relocation types */
341 ((strcmp(".rela.l2.text", secstrings + sechdrs[i].sh_name) == 0) || 314 if (sechdrs[i].sh_type != SHT_RELA)
342 (strcmp(".rela.l1.text", secstrings + sechdrs[i].sh_name) == 0) || 315 continue;
343 ((strcmp(".rela.text", secstrings + sechdrs[i].sh_name) == 0) && 316
344 (hdr->e_flags & (EF_BFIN_CODE_IN_L1|EF_BFIN_CODE_IN_L2))))) { 317 if (!strcmp(".rela.l2.text", shname) ||
318 !strcmp(".rela.l1.text", shname) ||
319 (!strcmp(".rela.text", shname) &&
320 (hdr->e_flags & (EF_BFIN_CODE_IN_L1 | EF_BFIN_CODE_IN_L2)))) {
321
345 err = apply_relocate_add((Elf_Shdr *) sechdrs, strtab, 322 err = apply_relocate_add((Elf_Shdr *) sechdrs, strtab,
346 symindex, i, mod); 323 symindex, i, mod);
347 if (err < 0) 324 if (err < 0)
348 return -ENOEXEC; 325 return -ENOEXEC;
349 } 326 }
350 } 327 }
328
351 return 0; 329 return 0;
352} 330}
353 331
diff --git a/arch/blackfin/kernel/process.c b/arch/blackfin/kernel/process.c
index 9da36bab7ccb..f5b286189647 100644
--- a/arch/blackfin/kernel/process.c
+++ b/arch/blackfin/kernel/process.c
@@ -282,25 +282,19 @@ void finish_atomic_sections (struct pt_regs *regs)
282{ 282{
283 int __user *up0 = (int __user *)regs->p0; 283 int __user *up0 = (int __user *)regs->p0;
284 284
285 if (regs->pc < ATOMIC_SEQS_START || regs->pc >= ATOMIC_SEQS_END)
286 return;
287
288 switch (regs->pc) { 285 switch (regs->pc) {
289 case ATOMIC_XCHG32 + 2: 286 case ATOMIC_XCHG32 + 2:
290 put_user(regs->r1, up0); 287 put_user(regs->r1, up0);
291 regs->pc += 2; 288 regs->pc = ATOMIC_XCHG32 + 4;
292 break; 289 break;
293 290
294 case ATOMIC_CAS32 + 2: 291 case ATOMIC_CAS32 + 2:
295 case ATOMIC_CAS32 + 4: 292 case ATOMIC_CAS32 + 4:
296 if (regs->r0 == regs->r1) 293 if (regs->r0 == regs->r1)
294 case ATOMIC_CAS32 + 6:
297 put_user(regs->r2, up0); 295 put_user(regs->r2, up0);
298 regs->pc = ATOMIC_CAS32 + 8; 296 regs->pc = ATOMIC_CAS32 + 8;
299 break; 297 break;
300 case ATOMIC_CAS32 + 6:
301 put_user(regs->r2, up0);
302 regs->pc += 2;
303 break;
304 298
305 case ATOMIC_ADD32 + 2: 299 case ATOMIC_ADD32 + 2:
306 regs->r0 = regs->r1 + regs->r0; 300 regs->r0 = regs->r1 + regs->r0;
diff --git a/arch/blackfin/kernel/ptrace.c b/arch/blackfin/kernel/ptrace.c
index 6a387eec6b65..30f4828277ad 100644
--- a/arch/blackfin/kernel/ptrace.c
+++ b/arch/blackfin/kernel/ptrace.c
@@ -206,6 +206,7 @@ long arch_ptrace(struct task_struct *child, long request, long addr, long data)
206{ 206{
207 int ret; 207 int ret;
208 unsigned long __user *datap = (unsigned long __user *)data; 208 unsigned long __user *datap = (unsigned long __user *)data;
209 void *paddr = (void *)addr;
209 210
210 switch (request) { 211 switch (request) {
211 /* when I and D space are separate, these will need to be fixed. */ 212 /* when I and D space are separate, these will need to be fixed. */
@@ -215,42 +216,49 @@ long arch_ptrace(struct task_struct *child, long request, long addr, long data)
215 case PTRACE_PEEKTEXT: /* read word at location addr. */ 216 case PTRACE_PEEKTEXT: /* read word at location addr. */
216 { 217 {
217 unsigned long tmp = 0; 218 unsigned long tmp = 0;
218 int copied; 219 int copied = 0, to_copy = sizeof(tmp);
219 220
220 ret = -EIO; 221 ret = -EIO;
221 pr_debug("ptrace: PEEKTEXT at addr 0x%08lx + %ld\n", addr, sizeof(data)); 222 pr_debug("ptrace: PEEKTEXT at addr 0x%08lx + %i\n", addr, to_copy);
222 if (is_user_addr_valid(child, addr, sizeof(tmp)) < 0) 223 if (is_user_addr_valid(child, addr, to_copy) < 0)
223 break; 224 break;
224 pr_debug("ptrace: user address is valid\n"); 225 pr_debug("ptrace: user address is valid\n");
225 226
226 if (L1_CODE_LENGTH != 0 && addr >= get_l1_code_start() 227 switch (bfin_mem_access_type(addr, to_copy)) {
227 && addr + sizeof(tmp) <= get_l1_code_start() + L1_CODE_LENGTH) { 228 case BFIN_MEM_ACCESS_CORE:
228 safe_dma_memcpy (&tmp, (const void *)(addr), sizeof(tmp)); 229 case BFIN_MEM_ACCESS_CORE_ONLY:
229 copied = sizeof(tmp);
230
231 } else if (L1_DATA_A_LENGTH != 0 && addr >= L1_DATA_A_START
232 && addr + sizeof(tmp) <= L1_DATA_A_START + L1_DATA_A_LENGTH) {
233 memcpy(&tmp, (const void *)(addr), sizeof(tmp));
234 copied = sizeof(tmp);
235
236 } else if (L1_DATA_B_LENGTH != 0 && addr >= L1_DATA_B_START
237 && addr + sizeof(tmp) <= L1_DATA_B_START + L1_DATA_B_LENGTH) {
238 memcpy(&tmp, (const void *)(addr), sizeof(tmp));
239 copied = sizeof(tmp);
240
241 } else if (addr >= FIXED_CODE_START
242 && addr + sizeof(tmp) <= FIXED_CODE_END) {
243 copy_from_user_page(0, 0, 0, &tmp, (const void *)(addr), sizeof(tmp));
244 copied = sizeof(tmp);
245
246 } else
247 copied = access_process_vm(child, addr, &tmp, 230 copied = access_process_vm(child, addr, &tmp,
248 sizeof(tmp), 0); 231 to_copy, 0);
232 if (copied)
233 break;
234
235 /* hrm, why didn't that work ... maybe no mapping */
236 if (addr >= FIXED_CODE_START &&
237 addr + to_copy <= FIXED_CODE_END) {
238 copy_from_user_page(0, 0, 0, &tmp, paddr, to_copy);
239 copied = to_copy;
240 } else if (addr >= BOOT_ROM_START) {
241 memcpy(&tmp, paddr, to_copy);
242 copied = to_copy;
243 }
249 244
250 pr_debug("ptrace: copied size %d [0x%08lx]\n", copied, tmp);
251 if (copied != sizeof(tmp))
252 break; 245 break;
253 ret = put_user(tmp, datap); 246 case BFIN_MEM_ACCESS_DMA:
247 if (safe_dma_memcpy(&tmp, paddr, to_copy))
248 copied = to_copy;
249 break;
250 case BFIN_MEM_ACCESS_ITEST:
251 if (isram_memcpy(&tmp, paddr, to_copy))
252 copied = to_copy;
253 break;
254 default:
255 copied = 0;
256 break;
257 }
258
259 pr_debug("ptrace: copied size %d [0x%08lx]\n", copied, tmp);
260 if (copied == to_copy)
261 ret = put_user(tmp, datap);
254 break; 262 break;
255 } 263 }
256 264
@@ -277,9 +285,9 @@ long arch_ptrace(struct task_struct *child, long request, long addr, long data)
277 tmp = child->mm->start_data; 285 tmp = child->mm->start_data;
278#ifdef CONFIG_BINFMT_ELF_FDPIC 286#ifdef CONFIG_BINFMT_ELF_FDPIC
279 } else if (addr == (sizeof(struct pt_regs) + 12)) { 287 } else if (addr == (sizeof(struct pt_regs) + 12)) {
280 tmp = child->mm->context.exec_fdpic_loadmap; 288 goto case_PTRACE_GETFDPIC_EXEC;
281 } else if (addr == (sizeof(struct pt_regs) + 16)) { 289 } else if (addr == (sizeof(struct pt_regs) + 16)) {
282 tmp = child->mm->context.interp_fdpic_loadmap; 290 goto case_PTRACE_GETFDPIC_INTERP;
283#endif 291#endif
284 } else { 292 } else {
285 tmp = get_reg(child, addr); 293 tmp = get_reg(child, addr);
@@ -288,49 +296,78 @@ long arch_ptrace(struct task_struct *child, long request, long addr, long data)
288 break; 296 break;
289 } 297 }
290 298
299#ifdef CONFIG_BINFMT_ELF_FDPIC
300 case PTRACE_GETFDPIC: {
301 unsigned long tmp = 0;
302
303 switch (addr) {
304 case_PTRACE_GETFDPIC_EXEC:
305 case PTRACE_GETFDPIC_EXEC:
306 tmp = child->mm->context.exec_fdpic_loadmap;
307 break;
308 case_PTRACE_GETFDPIC_INTERP:
309 case PTRACE_GETFDPIC_INTERP:
310 tmp = child->mm->context.interp_fdpic_loadmap;
311 break;
312 default:
313 break;
314 }
315
316 ret = put_user(tmp, datap);
317 break;
318 }
319#endif
320
291 /* when I and D space are separate, this will have to be fixed. */ 321 /* when I and D space are separate, this will have to be fixed. */
292 case PTRACE_POKEDATA: 322 case PTRACE_POKEDATA:
293 pr_debug("ptrace: PTRACE_PEEKDATA\n"); 323 pr_debug("ptrace: PTRACE_PEEKDATA\n");
294 /* fall through */ 324 /* fall through */
295 case PTRACE_POKETEXT: /* write the word at location addr. */ 325 case PTRACE_POKETEXT: /* write the word at location addr. */
296 { 326 {
297 int copied; 327 int copied = 0, to_copy = sizeof(data);
298 328
299 ret = -EIO; 329 ret = -EIO;
300 pr_debug("ptrace: POKETEXT at addr 0x%08lx + %ld bytes %lx\n", 330 pr_debug("ptrace: POKETEXT at addr 0x%08lx + %i bytes %lx\n",
301 addr, sizeof(data), data); 331 addr, to_copy, data);
302 if (is_user_addr_valid(child, addr, sizeof(data)) < 0) 332 if (is_user_addr_valid(child, addr, to_copy) < 0)
303 break; 333 break;
304 pr_debug("ptrace: user address is valid\n"); 334 pr_debug("ptrace: user address is valid\n");
305 335
306 if (L1_CODE_LENGTH != 0 && addr >= get_l1_code_start() 336 switch (bfin_mem_access_type(addr, to_copy)) {
307 && addr + sizeof(data) <= get_l1_code_start() + L1_CODE_LENGTH) { 337 case BFIN_MEM_ACCESS_CORE:
308 safe_dma_memcpy ((void *)(addr), &data, sizeof(data)); 338 case BFIN_MEM_ACCESS_CORE_ONLY:
309 copied = sizeof(data);
310
311 } else if (L1_DATA_A_LENGTH != 0 && addr >= L1_DATA_A_START
312 && addr + sizeof(data) <= L1_DATA_A_START + L1_DATA_A_LENGTH) {
313 memcpy((void *)(addr), &data, sizeof(data));
314 copied = sizeof(data);
315
316 } else if (L1_DATA_B_LENGTH != 0 && addr >= L1_DATA_B_START
317 && addr + sizeof(data) <= L1_DATA_B_START + L1_DATA_B_LENGTH) {
318 memcpy((void *)(addr), &data, sizeof(data));
319 copied = sizeof(data);
320
321 } else if (addr >= FIXED_CODE_START
322 && addr + sizeof(data) <= FIXED_CODE_END) {
323 copy_to_user_page(0, 0, 0, (void *)(addr), &data, sizeof(data));
324 copied = sizeof(data);
325
326 } else
327 copied = access_process_vm(child, addr, &data, 339 copied = access_process_vm(child, addr, &data,
328 sizeof(data), 1); 340 to_copy, 0);
341 if (copied)
342 break;
343
344 /* hrm, why didn't that work ... maybe no mapping */
345 if (addr >= FIXED_CODE_START &&
346 addr + to_copy <= FIXED_CODE_END) {
347 copy_to_user_page(0, 0, 0, paddr, &data, to_copy);
348 copied = to_copy;
349 } else if (addr >= BOOT_ROM_START) {
350 memcpy(paddr, &data, to_copy);
351 copied = to_copy;
352 }
329 353
330 pr_debug("ptrace: copied size %d\n", copied);
331 if (copied != sizeof(data))
332 break; 354 break;
333 ret = 0; 355 case BFIN_MEM_ACCESS_DMA:
356 if (safe_dma_memcpy(paddr, &data, to_copy))
357 copied = to_copy;
358 break;
359 case BFIN_MEM_ACCESS_ITEST:
360 if (isram_memcpy(paddr, &data, to_copy))
361 copied = to_copy;
362 break;
363 default:
364 copied = 0;
365 break;
366 }
367
368 pr_debug("ptrace: copied size %d\n", copied);
369 if (copied == to_copy)
370 ret = 0;
334 break; 371 break;
335 } 372 }
336 373
diff --git a/arch/blackfin/kernel/setup.c b/arch/blackfin/kernel/setup.c
index 6225edae488e..369535b61ed1 100644
--- a/arch/blackfin/kernel/setup.c
+++ b/arch/blackfin/kernel/setup.c
@@ -112,7 +112,7 @@ void __cpuinit bfin_setup_caches(unsigned int cpu)
112 /* 112 /*
113 * In cache coherence emulation mode, we need to have the 113 * In cache coherence emulation mode, we need to have the
114 * D-cache enabled before running any atomic operation which 114 * D-cache enabled before running any atomic operation which
115 * might invove cache invalidation (i.e. spinlock, rwlock). 115 * might involve cache invalidation (i.e. spinlock, rwlock).
116 * So printk's are deferred until then. 116 * So printk's are deferred until then.
117 */ 117 */
118#ifdef CONFIG_BFIN_ICACHE 118#ifdef CONFIG_BFIN_ICACHE
@@ -187,6 +187,8 @@ void __init bfin_relocate_l1_mem(void)
187 unsigned long l1_data_b_length; 187 unsigned long l1_data_b_length;
188 unsigned long l2_length; 188 unsigned long l2_length;
189 189
190 early_shadow_stamp();
191
190 /* 192 /*
191 * due to the ALIGN(4) in the arch/blackfin/kernel/vmlinux.lds.S 193 * due to the ALIGN(4) in the arch/blackfin/kernel/vmlinux.lds.S
192 * we know that everything about l1 text/data is nice and aligned, 194 * we know that everything about l1 text/data is nice and aligned,
@@ -511,6 +513,7 @@ static __init void memory_setup(void)
511#ifdef CONFIG_MTD_UCLINUX 513#ifdef CONFIG_MTD_UCLINUX
512 unsigned long mtd_phys = 0; 514 unsigned long mtd_phys = 0;
513#endif 515#endif
516 unsigned long max_mem;
514 517
515 _rambase = (unsigned long)_stext; 518 _rambase = (unsigned long)_stext;
516 _ramstart = (unsigned long)_end; 519 _ramstart = (unsigned long)_end;
@@ -520,7 +523,22 @@ static __init void memory_setup(void)
520 panic("DMA region exceeds memory limit: %lu.", 523 panic("DMA region exceeds memory limit: %lu.",
521 _ramend - _ramstart); 524 _ramend - _ramstart);
522 } 525 }
523 memory_end = _ramend - DMA_UNCACHED_REGION; 526 max_mem = memory_end = _ramend - DMA_UNCACHED_REGION;
527
528#if (defined(CONFIG_BFIN_EXTMEM_ICACHEABLE) && ANOMALY_05000263)
529 /* Due to a Hardware Anomaly we need to limit the size of usable
530 * instruction memory to max 60MB, 56 if HUNT_FOR_ZERO is on
531 * 05000263 - Hardware loop corrupted when taking an ICPLB exception
532 */
533# if (defined(CONFIG_DEBUG_HUNT_FOR_ZERO))
534 if (max_mem >= 56 * 1024 * 1024)
535 max_mem = 56 * 1024 * 1024;
536# else
537 if (max_mem >= 60 * 1024 * 1024)
538 max_mem = 60 * 1024 * 1024;
539# endif /* CONFIG_DEBUG_HUNT_FOR_ZERO */
540#endif /* ANOMALY_05000263 */
541
524 542
525#ifdef CONFIG_MPU 543#ifdef CONFIG_MPU
526 /* Round up to multiple of 4MB */ 544 /* Round up to multiple of 4MB */
@@ -549,22 +567,16 @@ static __init void memory_setup(void)
549 567
550# if defined(CONFIG_ROMFS_FS) 568# if defined(CONFIG_ROMFS_FS)
551 if (((unsigned long *)mtd_phys)[0] == ROMSB_WORD0 569 if (((unsigned long *)mtd_phys)[0] == ROMSB_WORD0
552 && ((unsigned long *)mtd_phys)[1] == ROMSB_WORD1) 570 && ((unsigned long *)mtd_phys)[1] == ROMSB_WORD1) {
553 mtd_size = 571 mtd_size =
554 PAGE_ALIGN(be32_to_cpu(((unsigned long *)mtd_phys)[2])); 572 PAGE_ALIGN(be32_to_cpu(((unsigned long *)mtd_phys)[2]));
555# if (defined(CONFIG_BFIN_EXTMEM_ICACHEABLE) && ANOMALY_05000263) 573
556 /* Due to a Hardware Anomaly we need to limit the size of usable 574 /* ROM_FS is XIP, so if we found it, we need to limit memory */
557 * instruction memory to max 60MB, 56 if HUNT_FOR_ZERO is on 575 if (memory_end > max_mem) {
558 * 05000263 - Hardware loop corrupted when taking an ICPLB exception 576 pr_info("Limiting kernel memory to %liMB due to anomaly 05000263\n", max_mem >> 20);
559 */ 577 memory_end = max_mem;
560# if (defined(CONFIG_DEBUG_HUNT_FOR_ZERO)) 578 }
561 if (memory_end >= 56 * 1024 * 1024) 579 }
562 memory_end = 56 * 1024 * 1024;
563# else
564 if (memory_end >= 60 * 1024 * 1024)
565 memory_end = 60 * 1024 * 1024;
566# endif /* CONFIG_DEBUG_HUNT_FOR_ZERO */
567# endif /* ANOMALY_05000263 */
568# endif /* CONFIG_ROMFS_FS */ 580# endif /* CONFIG_ROMFS_FS */
569 581
570 /* Since the default MTD_UCLINUX has no magic number, we just blindly 582 /* Since the default MTD_UCLINUX has no magic number, we just blindly
@@ -586,20 +598,14 @@ static __init void memory_setup(void)
586 } 598 }
587#endif /* CONFIG_MTD_UCLINUX */ 599#endif /* CONFIG_MTD_UCLINUX */
588 600
589#if (defined(CONFIG_BFIN_EXTMEM_ICACHEABLE) && ANOMALY_05000263) 601 /* We need lo limit memory, since everything could have a text section
590 /* Due to a Hardware Anomaly we need to limit the size of usable 602 * of userspace in it, and expose anomaly 05000263. If the anomaly
591 * instruction memory to max 60MB, 56 if HUNT_FOR_ZERO is on 603 * doesn't exist, or we don't need to - then dont.
592 * 05000263 - Hardware loop corrupted when taking an ICPLB exception
593 */ 604 */
594#if (defined(CONFIG_DEBUG_HUNT_FOR_ZERO)) 605 if (memory_end > max_mem) {
595 if (memory_end >= 56 * 1024 * 1024) 606 pr_info("Limiting kernel memory to %liMB due to anomaly 05000263\n", max_mem >> 20);
596 memory_end = 56 * 1024 * 1024; 607 memory_end = max_mem;
597#else 608 }
598 if (memory_end >= 60 * 1024 * 1024)
599 memory_end = 60 * 1024 * 1024;
600#endif /* CONFIG_DEBUG_HUNT_FOR_ZERO */
601 printk(KERN_NOTICE "Warning: limiting memory to %liMB due to hardware anomaly 05000263\n", memory_end >> 20);
602#endif /* ANOMALY_05000263 */
603 609
604#ifdef CONFIG_MPU 610#ifdef CONFIG_MPU
605 page_mask_nelts = ((_ramend >> PAGE_SHIFT) + 31) / 32; 611 page_mask_nelts = ((_ramend >> PAGE_SHIFT) + 31) / 32;
@@ -693,7 +699,7 @@ static __init void setup_bootmem_allocator(void)
693 sanitize_memmap(bfin_memmap.map, &bfin_memmap.nr_map); 699 sanitize_memmap(bfin_memmap.map, &bfin_memmap.nr_map);
694 print_memory_map("boot memmap"); 700 print_memory_map("boot memmap");
695 701
696 /* intialize globals in linux/bootmem.h */ 702 /* initialize globals in linux/bootmem.h */
697 find_min_max_pfn(); 703 find_min_max_pfn();
698 /* pfn of the last usable page frame */ 704 /* pfn of the last usable page frame */
699 if (max_pfn > memory_end >> PAGE_SHIFT) 705 if (max_pfn > memory_end >> PAGE_SHIFT)
@@ -806,6 +812,8 @@ void __init setup_arch(char **cmdline_p)
806{ 812{
807 unsigned long sclk, cclk; 813 unsigned long sclk, cclk;
808 814
815 enable_shadow_console();
816
809 /* Check to make sure we are running on the right processor */ 817 /* Check to make sure we are running on the right processor */
810 if (unlikely(CPUID != bfin_cpuid())) 818 if (unlikely(CPUID != bfin_cpuid()))
811 printk(KERN_ERR "ERROR: Not running on ADSP-%s: unknown CPUID 0x%04x Rev 0.%d\n", 819 printk(KERN_ERR "ERROR: Not running on ADSP-%s: unknown CPUID 0x%04x Rev 0.%d\n",
@@ -1230,57 +1238,6 @@ static int show_cpuinfo(struct seq_file *m, void *v)
1230#ifdef __ARCH_SYNC_CORE_ICACHE 1238#ifdef __ARCH_SYNC_CORE_ICACHE
1231 seq_printf(m, "SMP Icache Flushes\t: %lu\n\n", cpudata->icache_invld_count); 1239 seq_printf(m, "SMP Icache Flushes\t: %lu\n\n", cpudata->icache_invld_count);
1232#endif 1240#endif
1233#ifdef CONFIG_BFIN_ICACHE_LOCK
1234 switch ((cpudata->imemctl >> 3) & WAYALL_L) {
1235 case WAY0_L:
1236 seq_printf(m, "Way0 Locked-Down\n");
1237 break;
1238 case WAY1_L:
1239 seq_printf(m, "Way1 Locked-Down\n");
1240 break;
1241 case WAY01_L:
1242 seq_printf(m, "Way0,Way1 Locked-Down\n");
1243 break;
1244 case WAY2_L:
1245 seq_printf(m, "Way2 Locked-Down\n");
1246 break;
1247 case WAY02_L:
1248 seq_printf(m, "Way0,Way2 Locked-Down\n");
1249 break;
1250 case WAY12_L:
1251 seq_printf(m, "Way1,Way2 Locked-Down\n");
1252 break;
1253 case WAY012_L:
1254 seq_printf(m, "Way0,Way1 & Way2 Locked-Down\n");
1255 break;
1256 case WAY3_L:
1257 seq_printf(m, "Way3 Locked-Down\n");
1258 break;
1259 case WAY03_L:
1260 seq_printf(m, "Way0,Way3 Locked-Down\n");
1261 break;
1262 case WAY13_L:
1263 seq_printf(m, "Way1,Way3 Locked-Down\n");
1264 break;
1265 case WAY013_L:
1266 seq_printf(m, "Way 0,Way1,Way3 Locked-Down\n");
1267 break;
1268 case WAY32_L:
1269 seq_printf(m, "Way3,Way2 Locked-Down\n");
1270 break;
1271 case WAY320_L:
1272 seq_printf(m, "Way3,Way2,Way0 Locked-Down\n");
1273 break;
1274 case WAY321_L:
1275 seq_printf(m, "Way3,Way2,Way1 Locked-Down\n");
1276 break;
1277 case WAYALL_L:
1278 seq_printf(m, "All Ways are locked\n");
1279 break;
1280 default:
1281 seq_printf(m, "No Ways are locked\n");
1282 }
1283#endif
1284 1241
1285 if (cpu_num != num_possible_cpus() - 1) 1242 if (cpu_num != num_possible_cpus() - 1)
1286 return 0; 1243 return 0;
@@ -1346,6 +1303,7 @@ const struct seq_operations cpuinfo_op = {
1346 1303
1347void __init cmdline_init(const char *r0) 1304void __init cmdline_init(const char *r0)
1348{ 1305{
1306 early_shadow_stamp();
1349 if (r0) 1307 if (r0)
1350 strncpy(command_line, r0, COMMAND_LINE_SIZE); 1308 strncpy(command_line, r0, COMMAND_LINE_SIZE);
1351} 1309}
diff --git a/arch/blackfin/kernel/shadow_console.c b/arch/blackfin/kernel/shadow_console.c
new file mode 100644
index 000000000000..8b8c7107a162
--- /dev/null
+++ b/arch/blackfin/kernel/shadow_console.c
@@ -0,0 +1,113 @@
1/*
2 * manage a small early shadow of the log buffer which we can pass between the
3 * bootloader so early crash messages are communicated properly and easily
4 *
5 * Copyright 2009 Analog Devices Inc.
6 *
7 * Enter bugs at http://blackfin.uclinux.org/
8 *
9 * Licensed under the GPL-2 or later.
10 */
11
12#include <linux/kernel.h>
13#include <linux/init.h>
14#include <linux/console.h>
15#include <linux/string.h>
16#include <asm/blackfin.h>
17#include <asm/irq_handler.h>
18#include <asm/early_printk.h>
19
20#define SHADOW_CONSOLE_START (0x500)
21#define SHADOW_CONSOLE_END (0x1000)
22#define SHADOW_CONSOLE_MAGIC_LOC (0x4F0)
23#define SHADOW_CONSOLE_MAGIC (0xDEADBEEF)
24
25static __initdata char *shadow_console_buffer = (char *)SHADOW_CONSOLE_START;
26
27__init void early_shadow_write(struct console *con, const char *s,
28 unsigned int n)
29{
30 unsigned int i;
31 /*
32 * save 2 bytes for the double null at the end
33 * once we fail on a long line, make sure we don't write a short line afterwards
34 */
35 if ((shadow_console_buffer + n) <= (char *)(SHADOW_CONSOLE_END - 2)) {
36 /* can't use memcpy - it may not be relocated yet */
37 for (i = 0; i <= n; i++)
38 shadow_console_buffer[i] = s[i];
39 shadow_console_buffer += n;
40 shadow_console_buffer[0] = 0;
41 shadow_console_buffer[1] = 0;
42 } else
43 shadow_console_buffer = (char *)SHADOW_CONSOLE_END;
44}
45
46static __initdata struct console early_shadow_console = {
47 .name = "early_shadow",
48 .write = early_shadow_write,
49 .flags = CON_BOOT | CON_PRINTBUFFER,
50 .index = -1,
51 .device = 0,
52};
53
54__init int shadow_console_enabled(void)
55{
56 return early_shadow_console.flags & CON_ENABLED;
57}
58
59__init void mark_shadow_error(void)
60{
61 int *loc = (int *)SHADOW_CONSOLE_MAGIC_LOC;
62 loc[0] = SHADOW_CONSOLE_MAGIC;
63 loc[1] = SHADOW_CONSOLE_START;
64}
65
66__init void enable_shadow_console(void)
67{
68 if (!shadow_console_enabled()) {
69 register_console(&early_shadow_console);
70 /* for now, assume things are going to fail */
71 mark_shadow_error();
72 }
73}
74
75static __init int disable_shadow_console(void)
76{
77 /*
78 * by the time pure_initcall runs, the standard console is enabled,
79 * and the early_console is off, so unset the magic numbers
80 * unregistering the console is taken care of in common code (See
81 * ./kernel/printk:disable_boot_consoles() )
82 */
83 int *loc = (int *)SHADOW_CONSOLE_MAGIC_LOC;
84
85 loc[0] = 0;
86
87 return 0;
88}
89pure_initcall(disable_shadow_console);
90
91/*
92 * since we can't use printk, dump numbers (as hex), n = # bits
93 */
94__init void early_shadow_reg(unsigned long reg, unsigned int n)
95{
96 /*
97 * can't use any "normal" kernel features, since thay
98 * may not be relocated to their execute address yet
99 */
100 int i;
101 char ascii[11] = " 0x";
102
103 n = n / 4;
104 reg = reg << ((8 - n) * 4);
105 n += 3;
106
107 for (i = 3; i <= n ; i++) {
108 ascii[i] = hex_asc_lo(reg >> 28);
109 reg <<= 4;
110 }
111 early_shadow_write(NULL, ascii, n);
112
113}
diff --git a/arch/blackfin/kernel/time-ts.c b/arch/blackfin/kernel/time-ts.c
index 0791eba40d9f..f9715764383e 100644
--- a/arch/blackfin/kernel/time-ts.c
+++ b/arch/blackfin/kernel/time-ts.c
@@ -66,7 +66,7 @@ static cycle_t bfin_read_cycles(struct clocksource *cs)
66 66
67static struct clocksource bfin_cs_cycles = { 67static struct clocksource bfin_cs_cycles = {
68 .name = "bfin_cs_cycles", 68 .name = "bfin_cs_cycles",
69 .rating = 350, 69 .rating = 400,
70 .read = bfin_read_cycles, 70 .read = bfin_read_cycles,
71 .mask = CLOCKSOURCE_MASK(64), 71 .mask = CLOCKSOURCE_MASK(64),
72 .shift = 22, 72 .shift = 22,
@@ -115,7 +115,7 @@ static cycle_t bfin_read_gptimer0(void)
115 115
116static struct clocksource bfin_cs_gptimer0 = { 116static struct clocksource bfin_cs_gptimer0 = {
117 .name = "bfin_cs_gptimer0", 117 .name = "bfin_cs_gptimer0",
118 .rating = 400, 118 .rating = 350,
119 .read = bfin_read_gptimer0, 119 .read = bfin_read_gptimer0,
120 .mask = CLOCKSOURCE_MASK(32), 120 .mask = CLOCKSOURCE_MASK(32),
121 .shift = 22, 121 .shift = 22,
diff --git a/arch/blackfin/kernel/traps.c b/arch/blackfin/kernel/traps.c
index bf2b2d1f8ae5..56464cb8edf3 100644
--- a/arch/blackfin/kernel/traps.c
+++ b/arch/blackfin/kernel/traps.c
@@ -100,7 +100,11 @@ static void decode_address(char *buf, unsigned long address)
100 char *modname; 100 char *modname;
101 char *delim = ":"; 101 char *delim = ":";
102 char namebuf[128]; 102 char namebuf[128];
103#endif
104
105 buf += sprintf(buf, "<0x%08lx> ", address);
103 106
107#ifdef CONFIG_KALLSYMS
104 /* look up the address and see if we are in kernel space */ 108 /* look up the address and see if we are in kernel space */
105 symname = kallsyms_lookup(address, &symsize, &offset, &modname, namebuf); 109 symname = kallsyms_lookup(address, &symsize, &offset, &modname, namebuf);
106 110
@@ -108,23 +112,33 @@ static void decode_address(char *buf, unsigned long address)
108 /* yeah! kernel space! */ 112 /* yeah! kernel space! */
109 if (!modname) 113 if (!modname)
110 modname = delim = ""; 114 modname = delim = "";
111 sprintf(buf, "<0x%p> { %s%s%s%s + 0x%lx }", 115 sprintf(buf, "{ %s%s%s%s + 0x%lx }",
112 (void *)address, delim, modname, delim, symname, 116 delim, modname, delim, symname,
113 (unsigned long)offset); 117 (unsigned long)offset);
114 return; 118 return;
115
116 } 119 }
117#endif 120#endif
118 121
119 /* Problem in fixed code section? */
120 if (address >= FIXED_CODE_START && address < FIXED_CODE_END) { 122 if (address >= FIXED_CODE_START && address < FIXED_CODE_END) {
121 sprintf(buf, "<0x%p> /* Maybe fixed code section */", (void *)address); 123 /* Problem in fixed code section? */
124 strcat(buf, "/* Maybe fixed code section */");
125 return;
126
127 } else if (address < CONFIG_BOOT_LOAD) {
128 /* Problem somewhere before the kernel start address */
129 strcat(buf, "/* Maybe null pointer? */");
130 return;
131
132 } else if (address >= COREMMR_BASE) {
133 strcat(buf, "/* core mmrs */");
122 return; 134 return;
123 }
124 135
125 /* Problem somewhere before the kernel start address */ 136 } else if (address >= SYSMMR_BASE) {
126 if (address < CONFIG_BOOT_LOAD) { 137 strcat(buf, "/* system mmrs */");
127 sprintf(buf, "<0x%p> /* Maybe null pointer? */", (void *)address); 138 return;
139
140 } else if (address >= L1_ROM_START && address < L1_ROM_START + L1_ROM_LENGTH) {
141 strcat(buf, "/* on-chip L1 ROM */");
128 return; 142 return;
129 } 143 }
130 144
@@ -172,18 +186,16 @@ static void decode_address(char *buf, unsigned long address)
172 offset = (address - vma->vm_start) + 186 offset = (address - vma->vm_start) +
173 (vma->vm_pgoff << PAGE_SHIFT); 187 (vma->vm_pgoff << PAGE_SHIFT);
174 188
175 sprintf(buf, "<0x%p> [ %s + 0x%lx ]", 189 sprintf(buf, "[ %s + 0x%lx ]", name, offset);
176 (void *)address, name, offset);
177 } else 190 } else
178 sprintf(buf, "<0x%p> [ %s vma:0x%lx-0x%lx]", 191 sprintf(buf, "[ %s vma:0x%lx-0x%lx]",
179 (void *)address, name, 192 name, vma->vm_start, vma->vm_end);
180 vma->vm_start, vma->vm_end);
181 193
182 if (!in_atomic) 194 if (!in_atomic)
183 mmput(mm); 195 mmput(mm);
184 196
185 if (!strlen(buf)) 197 if (buf[0] == '\0')
186 sprintf(buf, "<0x%p> [ %s ] dynamic memory", (void *)address, name); 198 sprintf(buf, "[ %s ] dynamic memory", name);
187 199
188 goto done; 200 goto done;
189 } 201 }
@@ -193,7 +205,7 @@ static void decode_address(char *buf, unsigned long address)
193 } 205 }
194 206
195 /* we were unable to find this address anywhere */ 207 /* we were unable to find this address anywhere */
196 sprintf(buf, "<0x%p> /* kernel dynamic memory */", (void *)address); 208 sprintf(buf, "/* kernel dynamic memory */");
197 209
198done: 210done:
199 write_unlock_irqrestore(&tasklist_lock, flags); 211 write_unlock_irqrestore(&tasklist_lock, flags);
@@ -215,14 +227,14 @@ asmlinkage void double_fault_c(struct pt_regs *fp)
215 printk(KERN_EMERG "Double Fault\n"); 227 printk(KERN_EMERG "Double Fault\n");
216#ifdef CONFIG_DEBUG_DOUBLEFAULT_PRINT 228#ifdef CONFIG_DEBUG_DOUBLEFAULT_PRINT
217 if (((long)fp->seqstat & SEQSTAT_EXCAUSE) == VEC_UNCOV) { 229 if (((long)fp->seqstat & SEQSTAT_EXCAUSE) == VEC_UNCOV) {
218 unsigned int cpu = smp_processor_id(); 230 unsigned int cpu = raw_smp_processor_id();
219 char buf[150]; 231 char buf[150];
220 decode_address(buf, cpu_pda[cpu].retx); 232 decode_address(buf, cpu_pda[cpu].retx_doublefault);
221 printk(KERN_EMERG "While handling exception (EXCAUSE = 0x%x) at %s:\n", 233 printk(KERN_EMERG "While handling exception (EXCAUSE = 0x%x) at %s:\n",
222 (unsigned int)cpu_pda[cpu].seqstat & SEQSTAT_EXCAUSE, buf); 234 (unsigned int)cpu_pda[cpu].seqstat_doublefault & SEQSTAT_EXCAUSE, buf);
223 decode_address(buf, cpu_pda[cpu].dcplb_fault_addr); 235 decode_address(buf, cpu_pda[cpu].dcplb_doublefault_addr);
224 printk(KERN_NOTICE " DCPLB_FAULT_ADDR: %s\n", buf); 236 printk(KERN_NOTICE " DCPLB_FAULT_ADDR: %s\n", buf);
225 decode_address(buf, cpu_pda[cpu].icplb_fault_addr); 237 decode_address(buf, cpu_pda[cpu].icplb_doublefault_addr);
226 printk(KERN_NOTICE " ICPLB_FAULT_ADDR: %s\n", buf); 238 printk(KERN_NOTICE " ICPLB_FAULT_ADDR: %s\n", buf);
227 239
228 decode_address(buf, fp->retx); 240 decode_address(buf, fp->retx);
@@ -245,13 +257,13 @@ static int kernel_mode_regs(struct pt_regs *regs)
245 return regs->ipend & 0xffc0; 257 return regs->ipend & 0xffc0;
246} 258}
247 259
248asmlinkage void trap_c(struct pt_regs *fp) 260asmlinkage notrace void trap_c(struct pt_regs *fp)
249{ 261{
250#ifdef CONFIG_DEBUG_BFIN_HWTRACE_ON 262#ifdef CONFIG_DEBUG_BFIN_HWTRACE_ON
251 int j; 263 int j;
252#endif 264#endif
253#ifdef CONFIG_DEBUG_HUNT_FOR_ZERO 265#ifdef CONFIG_DEBUG_HUNT_FOR_ZERO
254 unsigned int cpu = smp_processor_id(); 266 unsigned int cpu = raw_smp_processor_id();
255#endif 267#endif
256 const char *strerror = NULL; 268 const char *strerror = NULL;
257 int sig = 0; 269 int sig = 0;
@@ -267,11 +279,6 @@ asmlinkage void trap_c(struct pt_regs *fp)
267 * double faults if the stack has become corrupt 279 * double faults if the stack has become corrupt
268 */ 280 */
269 281
270#ifndef CONFIG_KGDB
271 /* IPEND is skipped if KGDB isn't enabled (see entry code) */
272 fp->ipend = bfin_read_IPEND();
273#endif
274
275 /* trap_c() will be called for exceptions. During exceptions 282 /* trap_c() will be called for exceptions. During exceptions
276 * processing, the pc value should be set with retx value. 283 * processing, the pc value should be set with retx value.
277 * With this change we can cleanup some code in signal.c- TODO 284 * With this change we can cleanup some code in signal.c- TODO
@@ -404,7 +411,7 @@ asmlinkage void trap_c(struct pt_regs *fp)
404 /* 0x23 - Data CPLB protection violation, handled here */ 411 /* 0x23 - Data CPLB protection violation, handled here */
405 case VEC_CPLB_VL: 412 case VEC_CPLB_VL:
406 info.si_code = ILL_CPLB_VI; 413 info.si_code = ILL_CPLB_VI;
407 sig = SIGBUS; 414 sig = SIGSEGV;
408 strerror = KERN_NOTICE EXC_0x23(KERN_NOTICE); 415 strerror = KERN_NOTICE EXC_0x23(KERN_NOTICE);
409 CHK_DEBUGGER_TRAP_MAYBE(); 416 CHK_DEBUGGER_TRAP_MAYBE();
410 break; 417 break;
@@ -904,7 +911,7 @@ void show_stack(struct task_struct *task, unsigned long *stack)
904 frame_no = 0; 911 frame_no = 0;
905 912
906 for (addr = (unsigned int *)((unsigned int)stack & ~0xF), i = 0; 913 for (addr = (unsigned int *)((unsigned int)stack & ~0xF), i = 0;
907 addr <= endstack; addr++, i++) { 914 addr < endstack; addr++, i++) {
908 915
909 ret_addr = 0; 916 ret_addr = 0;
910 if (!j && i % 8 == 0) 917 if (!j && i % 8 == 0)
@@ -949,6 +956,7 @@ void show_stack(struct task_struct *task, unsigned long *stack)
949 } 956 }
950#endif 957#endif
951} 958}
959EXPORT_SYMBOL(show_stack);
952 960
953void dump_stack(void) 961void dump_stack(void)
954{ 962{
@@ -1090,7 +1098,7 @@ void show_regs(struct pt_regs *fp)
1090 struct irqaction *action; 1098 struct irqaction *action;
1091 unsigned int i; 1099 unsigned int i;
1092 unsigned long flags = 0; 1100 unsigned long flags = 0;
1093 unsigned int cpu = smp_processor_id(); 1101 unsigned int cpu = raw_smp_processor_id();
1094 unsigned char in_atomic = (bfin_read_IPEND() & 0x10) || in_atomic(); 1102 unsigned char in_atomic = (bfin_read_IPEND() & 0x10) || in_atomic();
1095 1103
1096 verbose_printk(KERN_NOTICE "\n"); 1104 verbose_printk(KERN_NOTICE "\n");
@@ -1116,10 +1124,16 @@ void show_regs(struct pt_regs *fp)
1116 1124
1117 verbose_printk(KERN_NOTICE "%s", linux_banner); 1125 verbose_printk(KERN_NOTICE "%s", linux_banner);
1118 1126
1119 verbose_printk(KERN_NOTICE "\nSEQUENCER STATUS:\t\t%s\n", 1127 verbose_printk(KERN_NOTICE "\nSEQUENCER STATUS:\t\t%s\n", print_tainted());
1120 print_tainted()); 1128 verbose_printk(KERN_NOTICE " SEQSTAT: %08lx IPEND: %04lx IMASK: %04lx SYSCFG: %04lx\n",
1121 verbose_printk(KERN_NOTICE " SEQSTAT: %08lx IPEND: %04lx SYSCFG: %04lx\n", 1129 (long)fp->seqstat, fp->ipend, cpu_pda[raw_smp_processor_id()].ex_imask, fp->syscfg);
1122 (long)fp->seqstat, fp->ipend, fp->syscfg); 1130 if (fp->ipend & EVT_IRPTEN)
1131 verbose_printk(KERN_NOTICE " Global Interrupts Disabled (IPEND[4])\n");
1132 if (!(cpu_pda[raw_smp_processor_id()].ex_imask & (EVT_IVG13 | EVT_IVG12 | EVT_IVG11 |
1133 EVT_IVG10 | EVT_IVG9 | EVT_IVG8 | EVT_IVG7 | EVT_IVTMR)))
1134 verbose_printk(KERN_NOTICE " Peripheral interrupts masked off\n");
1135 if (!(cpu_pda[raw_smp_processor_id()].ex_imask & (EVT_IVG15 | EVT_IVG14)))
1136 verbose_printk(KERN_NOTICE " Kernel interrupts masked off\n");
1123 if ((fp->seqstat & SEQSTAT_EXCAUSE) == VEC_HWERR) { 1137 if ((fp->seqstat & SEQSTAT_EXCAUSE) == VEC_HWERR) {
1124 verbose_printk(KERN_NOTICE " HWERRCAUSE: 0x%lx\n", 1138 verbose_printk(KERN_NOTICE " HWERRCAUSE: 0x%lx\n",
1125 (fp->seqstat & SEQSTAT_HWERRCAUSE) >> 14); 1139 (fp->seqstat & SEQSTAT_HWERRCAUSE) >> 14);
diff --git a/arch/blackfin/kernel/vmlinux.lds.S b/arch/blackfin/kernel/vmlinux.lds.S
index 6ac307ca0d80..21ac7c26079e 100644
--- a/arch/blackfin/kernel/vmlinux.lds.S
+++ b/arch/blackfin/kernel/vmlinux.lds.S
@@ -221,7 +221,7 @@ SECTIONS
221 . = ALIGN(4); 221 . = ALIGN(4);
222 __ebss_l1 = .; 222 __ebss_l1 = .;
223 } 223 }
224 ASSERT (SIZEOF(.data_a_l1) <= L1_DATA_A_LENGTH, "L1 data A overflow!") 224 ASSERT (SIZEOF(.data_l1) <= L1_DATA_A_LENGTH, "L1 data A overflow!")
225 225
226 .data_b_l1 L1_DATA_B_START : AT(LOADADDR(.data_l1) + SIZEOF(.data_l1)) 226 .data_b_l1 L1_DATA_B_START : AT(LOADADDR(.data_l1) + SIZEOF(.data_l1))
227 { 227 {
@@ -262,7 +262,7 @@ SECTIONS
262 . = ALIGN(4); 262 . = ALIGN(4);
263 __ebss_l2 = .; 263 __ebss_l2 = .;
264 } 264 }
265 ASSERT (SIZEOF(.text_data_l1) <= L2_LENGTH, "L2 overflow!") 265 ASSERT (SIZEOF(.text_data_l2) <= L2_LENGTH, "L2 overflow!")
266 266
267 /* Force trailing alignment of our init section so that when we 267 /* Force trailing alignment of our init section so that when we
268 * free our init memory, we don't leave behind a partial page. 268 * free our init memory, we don't leave behind a partial page.
@@ -277,8 +277,5 @@ SECTIONS
277 277
278 DWARF_DEBUG 278 DWARF_DEBUG
279 279
280 /DISCARD/ : 280 DISCARDS
281 {
282 *(.exitcall.exit)
283 }
284} 281}
diff --git a/arch/blackfin/lib/ins.S b/arch/blackfin/lib/ins.S
index 1863a6ba507c..3edbd8db6598 100644
--- a/arch/blackfin/lib/ins.S
+++ b/arch/blackfin/lib/ins.S
@@ -16,7 +16,7 @@
16 [--sp] = rets; \ 16 [--sp] = rets; \
17 [--sp] = (P5:0); \ 17 [--sp] = (P5:0); \
18 sp += -12; \ 18 sp += -12; \
19 call ___ipipe_stall_root_raw; \ 19 call ___ipipe_disable_root_irqs_hw; \
20 sp += 12; \ 20 sp += 12; \
21 (P5:0) = [sp++]; 21 (P5:0) = [sp++];
22# define CLI_INNER_NOP 22# define CLI_INNER_NOP
@@ -28,7 +28,7 @@
28#ifdef CONFIG_IPIPE 28#ifdef CONFIG_IPIPE
29# define DO_STI \ 29# define DO_STI \
30 sp += -12; \ 30 sp += -12; \
31 call ___ipipe_unstall_root_raw; \ 31 call ___ipipe_enable_root_irqs_hw; \
32 sp += 12; \ 32 sp += 12; \
332: rets = [sp++]; 332: rets = [sp++];
34#else 34#else
diff --git a/arch/blackfin/mach-bf518/boards/ezbrd.c b/arch/blackfin/mach-bf518/boards/ezbrd.c
index 809be268e42d..03e4a9941f01 100644
--- a/arch/blackfin/mach-bf518/boards/ezbrd.c
+++ b/arch/blackfin/mach-bf518/boards/ezbrd.c
@@ -199,15 +199,6 @@ static struct bfin5xx_spi_chip mmc_spi_chip_info = {
199}; 199};
200#endif 200#endif
201 201
202#if defined(CONFIG_PBX)
203static struct bfin5xx_spi_chip spi_si3xxx_chip_info = {
204 .ctl_reg = 0x4, /* send zero */
205 .enable_dma = 0,
206 .bits_per_word = 8,
207 .cs_change_per_word = 1,
208};
209#endif
210
211#if defined(CONFIG_TOUCHSCREEN_AD7877) || defined(CONFIG_TOUCHSCREEN_AD7877_MODULE) 202#if defined(CONFIG_TOUCHSCREEN_AD7877) || defined(CONFIG_TOUCHSCREEN_AD7877_MODULE)
212static struct bfin5xx_spi_chip spi_ad7877_chip_info = { 203static struct bfin5xx_spi_chip spi_ad7877_chip_info = {
213 .enable_dma = 0, 204 .enable_dma = 0,
@@ -296,24 +287,6 @@ static struct spi_board_info bfin_spi_board_info[] __initdata = {
296 .mode = SPI_MODE_3, 287 .mode = SPI_MODE_3,
297 }, 288 },
298#endif 289#endif
299#if defined(CONFIG_PBX)
300 {
301 .modalias = "fxs-spi",
302 .max_speed_hz = 12500000, /* max spi clock (SCK) speed in HZ */
303 .bus_num = 0,
304 .chip_select = 8 - CONFIG_J11_JUMPER,
305 .controller_data = &spi_si3xxx_chip_info,
306 .mode = SPI_MODE_3,
307 },
308 {
309 .modalias = "fxo-spi",
310 .max_speed_hz = 12500000, /* max spi clock (SCK) speed in HZ */
311 .bus_num = 0,
312 .chip_select = 8 - CONFIG_J19_JUMPER,
313 .controller_data = &spi_si3xxx_chip_info,
314 .mode = SPI_MODE_3,
315 },
316#endif
317#if defined(CONFIG_TOUCHSCREEN_AD7877) || defined(CONFIG_TOUCHSCREEN_AD7877_MODULE) 290#if defined(CONFIG_TOUCHSCREEN_AD7877) || defined(CONFIG_TOUCHSCREEN_AD7877_MODULE)
318 { 291 {
319 .modalias = "ad7877", 292 .modalias = "ad7877",
@@ -539,7 +512,7 @@ static struct i2c_board_info __initdata bfin_i2c_board_info[] = {
539 I2C_BOARD_INFO("pcf8574_lcd", 0x22), 512 I2C_BOARD_INFO("pcf8574_lcd", 0x22),
540 }, 513 },
541#endif 514#endif
542#if defined(CONFIG_TWI_KEYPAD) || defined(CONFIG_TWI_KEYPAD_MODULE) 515#if defined(CONFIG_INPUT_PCF8574) || defined(CONFIG_INPUT_PCF8574_MODULE)
543 { 516 {
544 I2C_BOARD_INFO("pcf8574_keypad", 0x27), 517 I2C_BOARD_INFO("pcf8574_keypad", 0x27),
545 .irq = IRQ_PF8, 518 .irq = IRQ_PF8,
diff --git a/arch/blackfin/mach-bf518/include/mach/anomaly.h b/arch/blackfin/mach-bf518/include/mach/anomaly.h
index 753ed810e1c6..e9c65390edd1 100644
--- a/arch/blackfin/mach-bf518/include/mach/anomaly.h
+++ b/arch/blackfin/mach-bf518/include/mach/anomaly.h
@@ -124,6 +124,7 @@
124#define ANOMALY_05000386 (0) 124#define ANOMALY_05000386 (0)
125#define ANOMALY_05000389 (0) 125#define ANOMALY_05000389 (0)
126#define ANOMALY_05000400 (0) 126#define ANOMALY_05000400 (0)
127#define ANOMALY_05000402 (0)
127#define ANOMALY_05000412 (0) 128#define ANOMALY_05000412 (0)
128#define ANOMALY_05000432 (0) 129#define ANOMALY_05000432 (0)
129#define ANOMALY_05000447 (0) 130#define ANOMALY_05000447 (0)
diff --git a/arch/blackfin/mach-bf518/include/mach/blackfin.h b/arch/blackfin/mach-bf518/include/mach/blackfin.h
index e8e14c2769ed..83421d393148 100644
--- a/arch/blackfin/mach-bf518/include/mach/blackfin.h
+++ b/arch/blackfin/mach-bf518/include/mach/blackfin.h
@@ -68,11 +68,6 @@
68#endif 68#endif
69#endif 69#endif
70 70
71/* UART_IIR Register */
72#define STATUS(x) ((x << 1) & 0x06)
73#define STATUS_P1 0x02
74#define STATUS_P0 0x01
75
76#define BFIN_UART_NR_PORTS 2 71#define BFIN_UART_NR_PORTS 2
77 72
78#define OFFSET_THR 0x00 /* Transmit Holding register */ 73#define OFFSET_THR 0x00 /* Transmit Holding register */
@@ -88,11 +83,6 @@
88#define OFFSET_SCR 0x1C /* SCR Scratch Register */ 83#define OFFSET_SCR 0x1C /* SCR Scratch Register */
89#define OFFSET_GCTL 0x24 /* Global Control Register */ 84#define OFFSET_GCTL 0x24 /* Global Control Register */
90 85
91/* DPMC*/
92#define bfin_read_STOPCK_OFF() bfin_read_STOPCK()
93#define bfin_write_STOPCK_OFF(val) bfin_write_STOPCK(val)
94#define STOPCK_OFF STOPCK
95
96/* PLL_DIV Masks */ 86/* PLL_DIV Masks */
97#define CCLK_DIV1 CSEL_DIV1 /* CCLK = VCO / 1 */ 87#define CCLK_DIV1 CSEL_DIV1 /* CCLK = VCO / 1 */
98#define CCLK_DIV2 CSEL_DIV2 /* CCLK = VCO / 2 */ 88#define CCLK_DIV2 CSEL_DIV2 /* CCLK = VCO / 2 */
diff --git a/arch/blackfin/mach-bf527/boards/cm_bf527.c b/arch/blackfin/mach-bf527/boards/cm_bf527.c
index b09484f538f4..08a3f01c9886 100644
--- a/arch/blackfin/mach-bf527/boards/cm_bf527.c
+++ b/arch/blackfin/mach-bf527/boards/cm_bf527.c
@@ -151,46 +151,6 @@ static struct platform_device musb_device = {
151}; 151};
152#endif 152#endif
153 153
154#if defined(CONFIG_MTD_PHYSMAP) || defined(CONFIG_MTD_PHYSMAP_MODULE)
155static struct mtd_partition ezkit_partitions[] = {
156 {
157 .name = "bootloader(nor)",
158 .size = 0x40000,
159 .offset = 0,
160 }, {
161 .name = "linux kernel(nor)",
162 .size = 0x1C0000,
163 .offset = MTDPART_OFS_APPEND,
164 }, {
165 .name = "file system(nor)",
166 .size = MTDPART_SIZ_FULL,
167 .offset = MTDPART_OFS_APPEND,
168 }
169};
170
171static struct physmap_flash_data ezkit_flash_data = {
172 .width = 2,
173 .parts = ezkit_partitions,
174 .nr_parts = ARRAY_SIZE(ezkit_partitions),
175};
176
177static struct resource ezkit_flash_resource = {
178 .start = 0x20000000,
179 .end = 0x201fffff,
180 .flags = IORESOURCE_MEM,
181};
182
183static struct platform_device ezkit_flash_device = {
184 .name = "physmap-flash",
185 .id = 0,
186 .dev = {
187 .platform_data = &ezkit_flash_data,
188 },
189 .num_resources = 1,
190 .resource = &ezkit_flash_resource,
191};
192#endif
193
194#if defined(CONFIG_MTD_NAND_BF5XX) || defined(CONFIG_MTD_NAND_BF5XX_MODULE) 154#if defined(CONFIG_MTD_NAND_BF5XX) || defined(CONFIG_MTD_NAND_BF5XX_MODULE)
195static struct mtd_partition partition_info[] = { 155static struct mtd_partition partition_info[] = {
196 { 156 {
@@ -275,6 +235,14 @@ static struct platform_device rtc_device = {
275#endif 235#endif
276 236
277#if defined(CONFIG_SMC91X) || defined(CONFIG_SMC91X_MODULE) 237#if defined(CONFIG_SMC91X) || defined(CONFIG_SMC91X_MODULE)
238#include <linux/smc91x.h>
239
240static struct smc91x_platdata smc91x_info = {
241 .flags = SMC91X_USE_16BIT | SMC91X_NOWAIT,
242 .leda = RPC_LED_100_10,
243 .ledb = RPC_LED_TX_RX,
244};
245
278static struct resource smc91x_resources[] = { 246static struct resource smc91x_resources[] = {
279 { 247 {
280 .name = "smc91x-regs", 248 .name = "smc91x-regs",
@@ -293,6 +261,9 @@ static struct platform_device smc91x_device = {
293 .id = 0, 261 .id = 0,
294 .num_resources = ARRAY_SIZE(smc91x_resources), 262 .num_resources = ARRAY_SIZE(smc91x_resources),
295 .resource = smc91x_resources, 263 .resource = smc91x_resources,
264 .dev = {
265 .platform_data = &smc91x_info,
266 },
296}; 267};
297#endif 268#endif
298 269
@@ -300,10 +271,15 @@ static struct platform_device smc91x_device = {
300static struct resource dm9000_resources[] = { 271static struct resource dm9000_resources[] = {
301 [0] = { 272 [0] = {
302 .start = 0x203FB800, 273 .start = 0x203FB800,
303 .end = 0x203FB800 + 8, 274 .end = 0x203FB800 + 1,
304 .flags = IORESOURCE_MEM, 275 .flags = IORESOURCE_MEM,
305 }, 276 },
306 [1] = { 277 [1] = {
278 .start = 0x203FB804,
279 .end = 0x203FB804 + 1,
280 .flags = IORESOURCE_MEM,
281 },
282 [2] = {
307 .start = IRQ_PF9, 283 .start = IRQ_PF9,
308 .end = IRQ_PF9, 284 .end = IRQ_PF9,
309 .flags = (IORESOURCE_IRQ | IORESOURCE_IRQ_HIGHEDGE), 285 .flags = (IORESOURCE_IRQ | IORESOURCE_IRQ_HIGHEDGE),
@@ -479,13 +455,6 @@ static struct bfin5xx_spi_chip ad1836_spi_chip_info = {
479}; 455};
480#endif 456#endif
481 457
482#if defined(CONFIG_AD9960) || defined(CONFIG_AD9960_MODULE)
483static struct bfin5xx_spi_chip ad9960_spi_chip_info = {
484 .enable_dma = 0,
485 .bits_per_word = 16,
486};
487#endif
488
489#if defined(CONFIG_MMC_SPI) || defined(CONFIG_MMC_SPI_MODULE) 458#if defined(CONFIG_MMC_SPI) || defined(CONFIG_MMC_SPI_MODULE)
490static struct bfin5xx_spi_chip mmc_spi_chip_info = { 459static struct bfin5xx_spi_chip mmc_spi_chip_info = {
491 .enable_dma = 0, 460 .enable_dma = 0,
@@ -493,15 +462,6 @@ static struct bfin5xx_spi_chip mmc_spi_chip_info = {
493}; 462};
494#endif 463#endif
495 464
496#if defined(CONFIG_PBX)
497static struct bfin5xx_spi_chip spi_si3xxx_chip_info = {
498 .ctl_reg = 0x4, /* send zero */
499 .enable_dma = 0,
500 .bits_per_word = 8,
501 .cs_change_per_word = 1,
502};
503#endif
504
505#if defined(CONFIG_TOUCHSCREEN_AD7877) || defined(CONFIG_TOUCHSCREEN_AD7877_MODULE) 465#if defined(CONFIG_TOUCHSCREEN_AD7877) || defined(CONFIG_TOUCHSCREEN_AD7877_MODULE)
506static struct bfin5xx_spi_chip spi_ad7877_chip_info = { 466static struct bfin5xx_spi_chip spi_ad7877_chip_info = {
507 .enable_dma = 0, 467 .enable_dma = 0,
@@ -568,22 +528,13 @@ static struct spi_board_info bfin_spi_board_info[] __initdata = {
568#if defined(CONFIG_SND_BLACKFIN_AD1836) \ 528#if defined(CONFIG_SND_BLACKFIN_AD1836) \
569 || defined(CONFIG_SND_BLACKFIN_AD1836_MODULE) 529 || defined(CONFIG_SND_BLACKFIN_AD1836_MODULE)
570 { 530 {
571 .modalias = "ad1836-spi", 531 .modalias = "ad1836",
572 .max_speed_hz = 3125000, /* max spi clock (SCK) speed in HZ */ 532 .max_speed_hz = 3125000, /* max spi clock (SCK) speed in HZ */
573 .bus_num = 0, 533 .bus_num = 0,
574 .chip_select = CONFIG_SND_BLACKFIN_SPI_PFBIT, 534 .chip_select = CONFIG_SND_BLACKFIN_SPI_PFBIT,
575 .controller_data = &ad1836_spi_chip_info, 535 .controller_data = &ad1836_spi_chip_info,
576 }, 536 },
577#endif 537#endif
578#if defined(CONFIG_AD9960) || defined(CONFIG_AD9960_MODULE)
579 {
580 .modalias = "ad9960-spi",
581 .max_speed_hz = 10000000, /* max spi clock (SCK) speed in HZ */
582 .bus_num = 0,
583 .chip_select = 1,
584 .controller_data = &ad9960_spi_chip_info,
585 },
586#endif
587#if defined(CONFIG_MMC_SPI) || defined(CONFIG_MMC_SPI_MODULE) 538#if defined(CONFIG_MMC_SPI) || defined(CONFIG_MMC_SPI_MODULE)
588 { 539 {
589 .modalias = "mmc_spi", 540 .modalias = "mmc_spi",
@@ -594,24 +545,6 @@ static struct spi_board_info bfin_spi_board_info[] __initdata = {
594 .mode = SPI_MODE_3, 545 .mode = SPI_MODE_3,
595 }, 546 },
596#endif 547#endif
597#if defined(CONFIG_PBX)
598 {
599 .modalias = "fxs-spi",
600 .max_speed_hz = 12500000, /* max spi clock (SCK) speed in HZ */
601 .bus_num = 0,
602 .chip_select = 8 - CONFIG_J11_JUMPER,
603 .controller_data = &spi_si3xxx_chip_info,
604 .mode = SPI_MODE_3,
605 },
606 {
607 .modalias = "fxo-spi",
608 .max_speed_hz = 12500000, /* max spi clock (SCK) speed in HZ */
609 .bus_num = 0,
610 .chip_select = 8 - CONFIG_J19_JUMPER,
611 .controller_data = &spi_si3xxx_chip_info,
612 .mode = SPI_MODE_3,
613 },
614#endif
615#if defined(CONFIG_TOUCHSCREEN_AD7877) || defined(CONFIG_TOUCHSCREEN_AD7877_MODULE) 548#if defined(CONFIG_TOUCHSCREEN_AD7877) || defined(CONFIG_TOUCHSCREEN_AD7877_MODULE)
616 { 549 {
617 .modalias = "ad7877", 550 .modalias = "ad7877",
@@ -689,6 +622,55 @@ static struct platform_device bfin_fb_adv7393_device = {
689}; 622};
690#endif 623#endif
691 624
625#if defined(CONFIG_MTD_GPIO_ADDR) || defined(CONFIG_MTD_GPIO_ADDR_MODULE)
626static struct mtd_partition cm_partitions[] = {
627 {
628 .name = "bootloader(nor)",
629 .size = 0x40000,
630 .offset = 0,
631 }, {
632 .name = "linux kernel(nor)",
633 .size = 0x100000,
634 .offset = MTDPART_OFS_APPEND,
635 }, {
636 .name = "file system(nor)",
637 .size = MTDPART_SIZ_FULL,
638 .offset = MTDPART_OFS_APPEND,
639 }
640};
641
642static struct physmap_flash_data cm_flash_data = {
643 .width = 2,
644 .parts = cm_partitions,
645 .nr_parts = ARRAY_SIZE(cm_partitions),
646};
647
648static unsigned cm_flash_gpios[] = { GPIO_PH9, GPIO_PG11 };
649
650static struct resource cm_flash_resource[] = {
651 {
652 .name = "cfi_probe",
653 .start = 0x20000000,
654 .end = 0x201fffff,
655 .flags = IORESOURCE_MEM,
656 }, {
657 .start = (unsigned long)cm_flash_gpios,
658 .end = ARRAY_SIZE(cm_flash_gpios),
659 .flags = IORESOURCE_IRQ,
660 }
661};
662
663static struct platform_device cm_flash_device = {
664 .name = "gpio-addr-flash",
665 .id = 0,
666 .dev = {
667 .platform_data = &cm_flash_data,
668 },
669 .num_resources = ARRAY_SIZE(cm_flash_resource),
670 .resource = cm_flash_resource,
671};
672#endif
673
692#if defined(CONFIG_SERIAL_BFIN) || defined(CONFIG_SERIAL_BFIN_MODULE) 674#if defined(CONFIG_SERIAL_BFIN) || defined(CONFIG_SERIAL_BFIN_MODULE)
693static struct resource bfin_uart_resources[] = { 675static struct resource bfin_uart_resources[] = {
694#ifdef CONFIG_SERIAL_BFIN_UART0 676#ifdef CONFIG_SERIAL_BFIN_UART0
@@ -796,13 +778,11 @@ static struct i2c_board_info __initdata bfin_i2c_board_info[] = {
796#if defined(CONFIG_BFIN_TWI_LCD) || defined(CONFIG_BFIN_TWI_LCD_MODULE) 778#if defined(CONFIG_BFIN_TWI_LCD) || defined(CONFIG_BFIN_TWI_LCD_MODULE)
797 { 779 {
798 I2C_BOARD_INFO("pcf8574_lcd", 0x22), 780 I2C_BOARD_INFO("pcf8574_lcd", 0x22),
799 .type = "pcf8574_lcd",
800 }, 781 },
801#endif 782#endif
802#if defined(CONFIG_TWI_KEYPAD) || defined(CONFIG_TWI_KEYPAD_MODULE) 783#if defined(CONFIG_INPUT_PCF8574) || defined(CONFIG_INPUT_PCF8574_MODULE)
803 { 784 {
804 I2C_BOARD_INFO("pcf8574_keypad", 0x27), 785 I2C_BOARD_INFO("pcf8574_keypad", 0x27),
805 .type = "pcf8574_keypad",
806 .irq = IRQ_PF8, 786 .irq = IRQ_PF8,
807 }, 787 },
808#endif 788#endif
@@ -876,7 +856,7 @@ static struct platform_device bfin_dpmc = {
876 }, 856 },
877}; 857};
878 858
879static struct platform_device *stamp_devices[] __initdata = { 859static struct platform_device *cmbf527_devices[] __initdata = {
880 860
881 &bfin_dpmc, 861 &bfin_dpmc,
882 862
@@ -959,8 +939,8 @@ static struct platform_device *stamp_devices[] __initdata = {
959 &bfin_device_gpiokeys, 939 &bfin_device_gpiokeys,
960#endif 940#endif
961 941
962#if defined(CONFIG_MTD_PHYSMAP) || defined(CONFIG_MTD_PHYSMAP_MODULE) 942#if defined(CONFIG_MTD_GPIO_ADDR) || defined(CONFIG_MTD_GPIO_ADDR_MODULE)
963 &ezkit_flash_device, 943 &cm_flash_device,
964#endif 944#endif
965 945
966 &bfin_gpios_device, 946 &bfin_gpios_device,
@@ -971,7 +951,7 @@ static int __init cm_init(void)
971 printk(KERN_INFO "%s(): registering device resources\n", __func__); 951 printk(KERN_INFO "%s(): registering device resources\n", __func__);
972 i2c_register_board_info(0, bfin_i2c_board_info, 952 i2c_register_board_info(0, bfin_i2c_board_info,
973 ARRAY_SIZE(bfin_i2c_board_info)); 953 ARRAY_SIZE(bfin_i2c_board_info));
974 platform_add_devices(stamp_devices, ARRAY_SIZE(stamp_devices)); 954 platform_add_devices(cmbf527_devices, ARRAY_SIZE(cmbf527_devices));
975 spi_register_board_info(bfin_spi_board_info, ARRAY_SIZE(bfin_spi_board_info)); 955 spi_register_board_info(bfin_spi_board_info, ARRAY_SIZE(bfin_spi_board_info));
976 return 0; 956 return 0;
977} 957}
diff --git a/arch/blackfin/mach-bf527/boards/ezbrd.c b/arch/blackfin/mach-bf527/boards/ezbrd.c
index 2ad68cd10ae6..68b4c804364c 100644
--- a/arch/blackfin/mach-bf527/boards/ezbrd.c
+++ b/arch/blackfin/mach-bf527/boards/ezbrd.c
@@ -263,15 +263,6 @@ static struct bfin5xx_spi_chip mmc_spi_chip_info = {
263}; 263};
264#endif 264#endif
265 265
266#if defined(CONFIG_PBX)
267static struct bfin5xx_spi_chip spi_si3xxx_chip_info = {
268 .ctl_reg = 0x4, /* send zero */
269 .enable_dma = 0,
270 .bits_per_word = 8,
271 .cs_change_per_word = 1,
272};
273#endif
274
275#if defined(CONFIG_TOUCHSCREEN_AD7877) || defined(CONFIG_TOUCHSCREEN_AD7877_MODULE) 266#if defined(CONFIG_TOUCHSCREEN_AD7877) || defined(CONFIG_TOUCHSCREEN_AD7877_MODULE)
276static struct bfin5xx_spi_chip spi_ad7877_chip_info = { 267static struct bfin5xx_spi_chip spi_ad7877_chip_info = {
277 .enable_dma = 0, 268 .enable_dma = 0,
@@ -376,24 +367,6 @@ static struct spi_board_info bfin_spi_board_info[] __initdata = {
376 .mode = SPI_MODE_3, 367 .mode = SPI_MODE_3,
377 }, 368 },
378#endif 369#endif
379#if defined(CONFIG_PBX)
380 {
381 .modalias = "fxs-spi",
382 .max_speed_hz = 12500000, /* max spi clock (SCK) speed in HZ */
383 .bus_num = 0,
384 .chip_select = 8 - CONFIG_J11_JUMPER,
385 .controller_data = &spi_si3xxx_chip_info,
386 .mode = SPI_MODE_3,
387 },
388 {
389 .modalias = "fxo-spi",
390 .max_speed_hz = 12500000, /* max spi clock (SCK) speed in HZ */
391 .bus_num = 0,
392 .chip_select = 8 - CONFIG_J19_JUMPER,
393 .controller_data = &spi_si3xxx_chip_info,
394 .mode = SPI_MODE_3,
395 },
396#endif
397#if defined(CONFIG_TOUCHSCREEN_AD7877) || defined(CONFIG_TOUCHSCREEN_AD7877_MODULE) 370#if defined(CONFIG_TOUCHSCREEN_AD7877) || defined(CONFIG_TOUCHSCREEN_AD7877_MODULE)
398 { 371 {
399 .modalias = "ad7877", 372 .modalias = "ad7877",
@@ -596,7 +569,7 @@ static struct i2c_board_info __initdata bfin_i2c_board_info[] = {
596 I2C_BOARD_INFO("pcf8574_lcd", 0x22), 569 I2C_BOARD_INFO("pcf8574_lcd", 0x22),
597 }, 570 },
598#endif 571#endif
599#if defined(CONFIG_TWI_KEYPAD) || defined(CONFIG_TWI_KEYPAD_MODULE) 572#if defined(CONFIG_INPUT_PCF8574) || defined(CONFIG_INPUT_PCF8574_MODULE)
600 { 573 {
601 I2C_BOARD_INFO("pcf8574_keypad", 0x27), 574 I2C_BOARD_INFO("pcf8574_keypad", 0x27),
602 .irq = IRQ_PF8, 575 .irq = IRQ_PF8,
diff --git a/arch/blackfin/mach-bf527/boards/ezkit.c b/arch/blackfin/mach-bf527/boards/ezkit.c
index 75e563d3f9d4..2849b09abe99 100644
--- a/arch/blackfin/mach-bf527/boards/ezkit.c
+++ b/arch/blackfin/mach-bf527/boards/ezkit.c
@@ -292,6 +292,14 @@ static struct platform_device rtc_device = {
292#endif 292#endif
293 293
294#if defined(CONFIG_SMC91X) || defined(CONFIG_SMC91X_MODULE) 294#if defined(CONFIG_SMC91X) || defined(CONFIG_SMC91X_MODULE)
295#include <linux/smc91x.h>
296
297static struct smc91x_platdata smc91x_info = {
298 .flags = SMC91X_USE_16BIT | SMC91X_NOWAIT,
299 .leda = RPC_LED_100_10,
300 .ledb = RPC_LED_TX_RX,
301};
302
295static struct resource smc91x_resources[] = { 303static struct resource smc91x_resources[] = {
296 { 304 {
297 .name = "smc91x-regs", 305 .name = "smc91x-regs",
@@ -310,6 +318,9 @@ static struct platform_device smc91x_device = {
310 .id = 0, 318 .id = 0,
311 .num_resources = ARRAY_SIZE(smc91x_resources), 319 .num_resources = ARRAY_SIZE(smc91x_resources),
312 .resource = smc91x_resources, 320 .resource = smc91x_resources,
321 .dev = {
322 .platform_data = &smc91x_info,
323 },
313}; 324};
314#endif 325#endif
315 326
@@ -501,13 +512,6 @@ static struct bfin5xx_spi_chip ad1836_spi_chip_info = {
501}; 512};
502#endif 513#endif
503 514
504#if defined(CONFIG_AD9960) || defined(CONFIG_AD9960_MODULE)
505static struct bfin5xx_spi_chip ad9960_spi_chip_info = {
506 .enable_dma = 0,
507 .bits_per_word = 16,
508};
509#endif
510
511#if defined(CONFIG_MMC_SPI) || defined(CONFIG_MMC_SPI_MODULE) 515#if defined(CONFIG_MMC_SPI) || defined(CONFIG_MMC_SPI_MODULE)
512static struct bfin5xx_spi_chip mmc_spi_chip_info = { 516static struct bfin5xx_spi_chip mmc_spi_chip_info = {
513 .enable_dma = 0, 517 .enable_dma = 0,
@@ -515,15 +519,6 @@ static struct bfin5xx_spi_chip mmc_spi_chip_info = {
515}; 519};
516#endif 520#endif
517 521
518#if defined(CONFIG_PBX)
519static struct bfin5xx_spi_chip spi_si3xxx_chip_info = {
520 .ctl_reg = 0x4, /* send zero */
521 .enable_dma = 0,
522 .bits_per_word = 8,
523 .cs_change_per_word = 1,
524};
525#endif
526
527#if defined(CONFIG_TOUCHSCREEN_AD7877) || defined(CONFIG_TOUCHSCREEN_AD7877_MODULE) 522#if defined(CONFIG_TOUCHSCREEN_AD7877) || defined(CONFIG_TOUCHSCREEN_AD7877_MODULE)
528static struct bfin5xx_spi_chip spi_ad7877_chip_info = { 523static struct bfin5xx_spi_chip spi_ad7877_chip_info = {
529 .enable_dma = 0, 524 .enable_dma = 0,
@@ -614,22 +609,13 @@ static struct spi_board_info bfin_spi_board_info[] __initdata = {
614#if defined(CONFIG_SND_BLACKFIN_AD1836) \ 609#if defined(CONFIG_SND_BLACKFIN_AD1836) \
615 || defined(CONFIG_SND_BLACKFIN_AD1836_MODULE) 610 || defined(CONFIG_SND_BLACKFIN_AD1836_MODULE)
616 { 611 {
617 .modalias = "ad1836-spi", 612 .modalias = "ad1836",
618 .max_speed_hz = 3125000, /* max spi clock (SCK) speed in HZ */ 613 .max_speed_hz = 3125000, /* max spi clock (SCK) speed in HZ */
619 .bus_num = 0, 614 .bus_num = 0,
620 .chip_select = CONFIG_SND_BLACKFIN_SPI_PFBIT, 615 .chip_select = CONFIG_SND_BLACKFIN_SPI_PFBIT,
621 .controller_data = &ad1836_spi_chip_info, 616 .controller_data = &ad1836_spi_chip_info,
622 }, 617 },
623#endif 618#endif
624#if defined(CONFIG_AD9960) || defined(CONFIG_AD9960_MODULE)
625 {
626 .modalias = "ad9960-spi",
627 .max_speed_hz = 10000000, /* max spi clock (SCK) speed in HZ */
628 .bus_num = 0,
629 .chip_select = 1,
630 .controller_data = &ad9960_spi_chip_info,
631 },
632#endif
633#if defined(CONFIG_MMC_SPI) || defined(CONFIG_MMC_SPI_MODULE) 619#if defined(CONFIG_MMC_SPI) || defined(CONFIG_MMC_SPI_MODULE)
634 { 620 {
635 .modalias = "mmc_spi", 621 .modalias = "mmc_spi",
@@ -641,24 +627,6 @@ static struct spi_board_info bfin_spi_board_info[] __initdata = {
641 }, 627 },
642#endif 628#endif
643 629
644#if defined(CONFIG_PBX)
645 {
646 .modalias = "fxs-spi",
647 .max_speed_hz = 12500000, /* max spi clock (SCK) speed in HZ */
648 .bus_num = 0,
649 .chip_select = 8 - CONFIG_J11_JUMPER,
650 .controller_data = &spi_si3xxx_chip_info,
651 .mode = SPI_MODE_3,
652 },
653 {
654 .modalias = "fxo-spi",
655 .max_speed_hz = 12500000, /* max spi clock (SCK) speed in HZ */
656 .bus_num = 0,
657 .chip_select = 8 - CONFIG_J19_JUMPER,
658 .controller_data = &spi_si3xxx_chip_info,
659 .mode = SPI_MODE_3,
660 },
661#endif
662#if defined(CONFIG_TOUCHSCREEN_AD7877) || defined(CONFIG_TOUCHSCREEN_AD7877_MODULE) 630#if defined(CONFIG_TOUCHSCREEN_AD7877) || defined(CONFIG_TOUCHSCREEN_AD7877_MODULE)
663 { 631 {
664 .modalias = "ad7877", 632 .modalias = "ad7877",
@@ -863,7 +831,7 @@ static struct i2c_board_info __initdata bfin_i2c_board_info[] = {
863 I2C_BOARD_INFO("pcf8574_lcd", 0x22), 831 I2C_BOARD_INFO("pcf8574_lcd", 0x22),
864 }, 832 },
865#endif 833#endif
866#if defined(CONFIG_TWI_KEYPAD) || defined(CONFIG_TWI_KEYPAD_MODULE) 834#if defined(CONFIG_INPUT_PCF8574) || defined(CONFIG_INPUT_PCF8574_MODULE)
867 { 835 {
868 I2C_BOARD_INFO("pcf8574_keypad", 0x27), 836 I2C_BOARD_INFO("pcf8574_keypad", 0x27),
869 .irq = IRQ_PF8, 837 .irq = IRQ_PF8,
diff --git a/arch/blackfin/mach-bf527/include/mach/anomaly.h b/arch/blackfin/mach-bf527/include/mach/anomaly.h
index c438ca89d8c9..3f9052687fa8 100644
--- a/arch/blackfin/mach-bf527/include/mach/anomaly.h
+++ b/arch/blackfin/mach-bf527/include/mach/anomaly.h
@@ -7,7 +7,7 @@
7 */ 7 */
8 8
9/* This file should be up to date with: 9/* This file should be up to date with:
10 * - Revision C, 03/13/2009; ADSP-BF526 Blackfin Processor Anomaly List 10 * - Revision D, 08/14/2009; ADSP-BF526 Blackfin Processor Anomaly List
11 * - Revision F, 03/03/2009; ADSP-BF527 Blackfin Processor Anomaly List 11 * - Revision F, 03/03/2009; ADSP-BF527 Blackfin Processor Anomaly List
12 */ 12 */
13 13
@@ -176,7 +176,7 @@
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 */ 179/* USB DMA Mode 1 Short Packet Data Corruption */
180#define ANOMALY_05000450 (1) 180#define ANOMALY_05000450 (1)
181/* 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 */
182#define ANOMALY_05000451 (1) 182#define ANOMALY_05000451 (1)
@@ -186,12 +186,20 @@
186#define ANOMALY_05000456 (1) 186#define ANOMALY_05000456 (1)
187/* Host DMA Port Responds to Certain Bus Activity Without HOST_CE Assertion */ 187/* Host DMA Port Responds to Certain Bus Activity Without HOST_CE Assertion */
188#define ANOMALY_05000457 (1) 188#define ANOMALY_05000457 (1)
189/* USB DMA Mode 1 Failure When Multiple USB DMA Channels Are Concurrently Enabled */
190#define ANOMALY_05000460 (1)
189/* False Hardware Error when RETI Points to Invalid Memory */ 191/* False Hardware Error when RETI Points to Invalid Memory */
190#define ANOMALY_05000461 (1) 192#define ANOMALY_05000461 (1)
193/* Synchronization Problem at Startup May Cause SPORT Transmit Channels to Misalign */
194#define ANOMALY_05000462 (1)
191/* USB Rx DMA hang */ 195/* USB Rx DMA hang */
192#define ANOMALY_05000465 (1) 196#define ANOMALY_05000465 (1)
197/* TxPktRdy Bit Not Set for Transmit Endpoint When Core and DMA Access USB Endpoint FIFOs Simultaneously */
198#define ANOMALY_05000466 (1)
193/* Possible RX data corruption when control & data EP FIFOs are accessed via the core */ 199/* Possible RX data corruption when control & data EP FIFOs are accessed via the core */
194#define ANOMALY_05000467 (1) 200#define ANOMALY_05000467 (1)
201/* PLL Latches Incorrect Settings During Reset */
202#define ANOMALY_05000469 (1)
195 203
196/* Anomalies that don't exist on this proc */ 204/* Anomalies that don't exist on this proc */
197#define ANOMALY_05000099 (0) 205#define ANOMALY_05000099 (0)
@@ -238,6 +246,7 @@
238#define ANOMALY_05000362 (1) 246#define ANOMALY_05000362 (1)
239#define ANOMALY_05000363 (0) 247#define ANOMALY_05000363 (0)
240#define ANOMALY_05000400 (0) 248#define ANOMALY_05000400 (0)
249#define ANOMALY_05000402 (0)
241#define ANOMALY_05000412 (0) 250#define ANOMALY_05000412 (0)
242#define ANOMALY_05000447 (0) 251#define ANOMALY_05000447 (0)
243#define ANOMALY_05000448 (0) 252#define ANOMALY_05000448 (0)
diff --git a/arch/blackfin/mach-bf527/include/mach/blackfin.h b/arch/blackfin/mach-bf527/include/mach/blackfin.h
index 03665a8e16be..ea9cb0fef8bc 100644
--- a/arch/blackfin/mach-bf527/include/mach/blackfin.h
+++ b/arch/blackfin/mach-bf527/include/mach/blackfin.h
@@ -56,11 +56,6 @@
56#endif 56#endif
57#endif 57#endif
58 58
59/* UART_IIR Register */
60#define STATUS(x) ((x << 1) & 0x06)
61#define STATUS_P1 0x02
62#define STATUS_P0 0x01
63
64#define BFIN_UART_NR_PORTS 2 59#define BFIN_UART_NR_PORTS 2
65 60
66#define OFFSET_THR 0x00 /* Transmit Holding register */ 61#define OFFSET_THR 0x00 /* Transmit Holding register */
@@ -76,11 +71,6 @@
76#define OFFSET_SCR 0x1C /* SCR Scratch Register */ 71#define OFFSET_SCR 0x1C /* SCR Scratch Register */
77#define OFFSET_GCTL 0x24 /* Global Control Register */ 72#define OFFSET_GCTL 0x24 /* Global Control Register */
78 73
79/* DPMC*/
80#define bfin_read_STOPCK_OFF() bfin_read_STOPCK()
81#define bfin_write_STOPCK_OFF(val) bfin_write_STOPCK(val)
82#define STOPCK_OFF STOPCK
83
84/* PLL_DIV Masks */ 74/* PLL_DIV Masks */
85#define CCLK_DIV1 CSEL_DIV1 /* CCLK = VCO / 1 */ 75#define CCLK_DIV1 CSEL_DIV1 /* CCLK = VCO / 1 */
86#define CCLK_DIV2 CSEL_DIV2 /* CCLK = VCO / 2 */ 76#define CCLK_DIV2 CSEL_DIV2 /* CCLK = VCO / 2 */
diff --git a/arch/blackfin/mach-bf533/boards/H8606.c b/arch/blackfin/mach-bf533/boards/H8606.c
index 38cf8ffd6d74..6c2b47fe4fe4 100644
--- a/arch/blackfin/mach-bf533/boards/H8606.c
+++ b/arch/blackfin/mach-bf533/boards/H8606.c
@@ -88,6 +88,14 @@ static struct platform_device dm9000_device = {
88#endif 88#endif
89 89
90#if defined(CONFIG_SMC91X) || defined(CONFIG_SMC91X_MODULE) 90#if defined(CONFIG_SMC91X) || defined(CONFIG_SMC91X_MODULE)
91#include <linux/smc91x.h>
92
93static struct smc91x_platdata smc91x_info = {
94 .flags = SMC91X_USE_16BIT | SMC91X_NOWAIT,
95 .leda = RPC_LED_100_10,
96 .ledb = RPC_LED_TX_RX,
97};
98
91static struct resource smc91x_resources[] = { 99static struct resource smc91x_resources[] = {
92 { 100 {
93 .name = "smc91x-regs", 101 .name = "smc91x-regs",
@@ -110,6 +118,9 @@ static struct platform_device smc91x_device = {
110 .id = 0, 118 .id = 0,
111 .num_resources = ARRAY_SIZE(smc91x_resources), 119 .num_resources = ARRAY_SIZE(smc91x_resources),
112 .resource = smc91x_resources, 120 .resource = smc91x_resources,
121 .dev = {
122 .platform_data = &smc91x_info,
123 },
113}; 124};
114#endif 125#endif
115 126
@@ -190,15 +201,6 @@ static struct bfin5xx_spi_chip ad1836_spi_chip_info = {
190}; 201};
191#endif 202#endif
192 203
193#if defined(CONFIG_PBX)
194static struct bfin5xx_spi_chip spi_si3xxx_chip_info = {
195 .ctl_reg = 0x1c04,
196 .enable_dma = 0,
197 .bits_per_word = 8,
198 .cs_change_per_word = 1,
199};
200#endif
201
202/* Notice: for blackfin, the speed_hz is the value of register 204/* Notice: for blackfin, the speed_hz is the value of register
203 * SPI_BAUD, not the real baudrate */ 205 * SPI_BAUD, not the real baudrate */
204static struct spi_board_info bfin_spi_board_info[] __initdata = { 206static struct spi_board_info bfin_spi_board_info[] __initdata = {
@@ -229,7 +231,7 @@ static struct spi_board_info bfin_spi_board_info[] __initdata = {
229 231
230#if defined(CONFIG_SND_BLACKFIN_AD1836) || defined(CONFIG_SND_BLACKFIN_AD1836_MODULE) 232#if defined(CONFIG_SND_BLACKFIN_AD1836) || defined(CONFIG_SND_BLACKFIN_AD1836_MODULE)
231 { 233 {
232 .modalias = "ad1836-spi", 234 .modalias = "ad1836",
233 .max_speed_hz = 16, 235 .max_speed_hz = 16,
234 .bus_num = 1, 236 .bus_num = 1,
235 .chip_select = CONFIG_SND_BLACKFIN_SPI_PFBIT, 237 .chip_select = CONFIG_SND_BLACKFIN_SPI_PFBIT,
@@ -237,23 +239,6 @@ static struct spi_board_info bfin_spi_board_info[] __initdata = {
237 }, 239 },
238#endif 240#endif
239 241
240#if defined(CONFIG_PBX)
241 {
242 .modalias = "fxs-spi",
243 .max_speed_hz = 4,
244 .bus_num = 1,
245 .chip_select = 3,
246 .controller_data = &spi_si3xxx_chip_info,
247 },
248
249 {
250 .modalias = "fxo-spi",
251 .max_speed_hz = 4,
252 .bus_num = 1,
253 .chip_select = 2,
254 .controller_data = &spi_si3xxx_chip_info,
255 },
256#endif
257}; 242};
258 243
259/* SPI (0) */ 244/* SPI (0) */
diff --git a/arch/blackfin/mach-bf533/boards/blackstamp.c b/arch/blackfin/mach-bf533/boards/blackstamp.c
index 9ecdc361fa6d..8208d67e2c97 100644
--- a/arch/blackfin/mach-bf533/boards/blackstamp.c
+++ b/arch/blackfin/mach-bf533/boards/blackstamp.c
@@ -48,6 +48,14 @@ static struct platform_device rtc_device = {
48 * Driver needs to know address, irq and flag pin. 48 * Driver needs to know address, irq and flag pin.
49 */ 49 */
50#if defined(CONFIG_SMC91X) || defined(CONFIG_SMC91X_MODULE) 50#if defined(CONFIG_SMC91X) || defined(CONFIG_SMC91X_MODULE)
51#include <linux/smc91x.h>
52
53static struct smc91x_platdata smc91x_info = {
54 .flags = SMC91X_USE_16BIT | SMC91X_NOWAIT,
55 .leda = RPC_LED_100_10,
56 .ledb = RPC_LED_TX_RX,
57};
58
51static struct resource smc91x_resources[] = { 59static struct resource smc91x_resources[] = {
52 { 60 {
53 .name = "smc91x-regs", 61 .name = "smc91x-regs",
@@ -66,6 +74,9 @@ static struct platform_device smc91x_device = {
66 .id = 0, 74 .id = 0,
67 .num_resources = ARRAY_SIZE(smc91x_resources), 75 .num_resources = ARRAY_SIZE(smc91x_resources),
68 .resource = smc91x_resources, 76 .resource = smc91x_resources,
77 .dev = {
78 .platform_data = &smc91x_info,
79 },
69}; 80};
70#endif 81#endif
71 82
diff --git a/arch/blackfin/mach-bf533/boards/cm_bf533.c b/arch/blackfin/mach-bf533/boards/cm_bf533.c
index 1443e92d8b62..7443b26c80c5 100644
--- a/arch/blackfin/mach-bf533/boards/cm_bf533.c
+++ b/arch/blackfin/mach-bf533/boards/cm_bf533.c
@@ -31,8 +31,10 @@
31#include <linux/platform_device.h> 31#include <linux/platform_device.h>
32#include <linux/mtd/mtd.h> 32#include <linux/mtd/mtd.h>
33#include <linux/mtd/partitions.h> 33#include <linux/mtd/partitions.h>
34#include <linux/mtd/physmap.h>
34#include <linux/spi/spi.h> 35#include <linux/spi/spi.h>
35#include <linux/spi/flash.h> 36#include <linux/spi/flash.h>
37#include <linux/spi/mmc_spi.h>
36#if defined(CONFIG_USB_ISP1362_HCD) || defined(CONFIG_USB_ISP1362_HCD_MODULE) 38#if defined(CONFIG_USB_ISP1362_HCD) || defined(CONFIG_USB_ISP1362_HCD_MODULE)
37#include <linux/usb/isp1362.h> 39#include <linux/usb/isp1362.h>
38#endif 40#endif
@@ -130,7 +132,7 @@ static struct spi_board_info bfin_spi_board_info[] __initdata = {
130 132
131#if defined(CONFIG_SND_BLACKFIN_AD1836) || defined(CONFIG_SND_BLACKFIN_AD1836_MODULE) 133#if defined(CONFIG_SND_BLACKFIN_AD1836) || defined(CONFIG_SND_BLACKFIN_AD1836_MODULE)
132 { 134 {
133 .modalias = "ad1836-spi", 135 .modalias = "ad1836",
134 .max_speed_hz = 3125000, /* max spi clock (SCK) speed in HZ */ 136 .max_speed_hz = 3125000, /* max spi clock (SCK) speed in HZ */
135 .bus_num = 0, 137 .bus_num = 0,
136 .chip_select = CONFIG_SND_BLACKFIN_SPI_PFBIT, 138 .chip_select = CONFIG_SND_BLACKFIN_SPI_PFBIT,
@@ -141,9 +143,9 @@ static struct spi_board_info bfin_spi_board_info[] __initdata = {
141#if defined(CONFIG_MMC_SPI) || defined(CONFIG_MMC_SPI_MODULE) 143#if defined(CONFIG_MMC_SPI) || defined(CONFIG_MMC_SPI_MODULE)
142 { 144 {
143 .modalias = "mmc_spi", 145 .modalias = "mmc_spi",
144 .max_speed_hz = 25000000, /* max spi clock (SCK) speed in HZ */ 146 .max_speed_hz = 20000000, /* max spi clock (SCK) speed in HZ */
145 .bus_num = 0, 147 .bus_num = 0,
146 .chip_select = 5, 148 .chip_select = 1,
147 .controller_data = &mmc_spi_chip_info, 149 .controller_data = &mmc_spi_chip_info,
148 .mode = SPI_MODE_3, 150 .mode = SPI_MODE_3,
149 }, 151 },
@@ -195,6 +197,14 @@ static struct platform_device rtc_device = {
195#endif 197#endif
196 198
197#if defined(CONFIG_SMC91X) || defined(CONFIG_SMC91X_MODULE) 199#if defined(CONFIG_SMC91X) || defined(CONFIG_SMC91X_MODULE)
200#include <linux/smc91x.h>
201
202static struct smc91x_platdata smc91x_info = {
203 .flags = SMC91X_USE_16BIT | SMC91X_NOWAIT,
204 .leda = RPC_LED_100_10,
205 .ledb = RPC_LED_TX_RX,
206};
207
198static struct resource smc91x_resources[] = { 208static struct resource smc91x_resources[] = {
199 { 209 {
200 .start = 0x20200300, 210 .start = 0x20200300,
@@ -211,6 +221,43 @@ static struct platform_device smc91x_device = {
211 .id = 0, 221 .id = 0,
212 .num_resources = ARRAY_SIZE(smc91x_resources), 222 .num_resources = ARRAY_SIZE(smc91x_resources),
213 .resource = smc91x_resources, 223 .resource = smc91x_resources,
224 .dev = {
225 .platform_data = &smc91x_info,
226 },
227};
228#endif
229
230#if defined(CONFIG_SMSC911X) || defined(CONFIG_SMSC911X_MODULE)
231#include <linux/smsc911x.h>
232
233static struct resource smsc911x_resources[] = {
234 {
235 .name = "smsc911x-memory",
236 .start = 0x20308000,
237 .end = 0x20308000 + 0xFF,
238 .flags = IORESOURCE_MEM,
239 }, {
240 .start = IRQ_PF8,
241 .end = IRQ_PF8,
242 .flags = IORESOURCE_IRQ | IORESOURCE_IRQ_LOWLEVEL,
243 },
244};
245
246static struct smsc911x_platform_config smsc911x_config = {
247 .flags = SMSC911X_USE_16BIT,
248 .irq_polarity = SMSC911X_IRQ_POLARITY_ACTIVE_LOW,
249 .irq_type = SMSC911X_IRQ_TYPE_OPEN_DRAIN,
250 .phy_interface = PHY_INTERFACE_MODE_MII,
251};
252
253static struct platform_device smsc911x_device = {
254 .name = "smsc911x",
255 .id = 0,
256 .num_resources = ARRAY_SIZE(smsc911x_resources),
257 .resource = smsc911x_resources,
258 .dev = {
259 .platform_data = &smsc911x_config,
260 },
214}; 261};
215#endif 262#endif
216 263
@@ -324,6 +371,68 @@ static struct platform_device isp1362_hcd_device = {
324}; 371};
325#endif 372#endif
326 373
374
375#if defined(CONFIG_USB_NET2272) || defined(CONFIG_USB_NET2272_MODULE)
376static struct resource net2272_bfin_resources[] = {
377 {
378 .start = 0x20300000,
379 .end = 0x20300000 + 0x100,
380 .flags = IORESOURCE_MEM,
381 }, {
382 .start = IRQ_PF6,
383 .end = IRQ_PF6,
384 .flags = IORESOURCE_IRQ | IORESOURCE_IRQ_HIGHLEVEL,
385 },
386};
387
388static struct platform_device net2272_bfin_device = {
389 .name = "net2272",
390 .id = -1,
391 .num_resources = ARRAY_SIZE(net2272_bfin_resources),
392 .resource = net2272_bfin_resources,
393};
394#endif
395
396
397
398#if defined(CONFIG_MTD_PHYSMAP) || defined(CONFIG_MTD_PHYSMAP_MODULE)
399static struct mtd_partition para_partitions[] = {
400 {
401 .name = "bootloader(nor)",
402 .size = 0x40000,
403 .offset = 0,
404 }, {
405 .name = "linux+rootfs(nor)",
406 .size = MTDPART_SIZ_FULL,
407 .offset = MTDPART_OFS_APPEND,
408 },
409};
410
411static struct physmap_flash_data para_flash_data = {
412 .width = 2,
413 .parts = para_partitions,
414 .nr_parts = ARRAY_SIZE(para_partitions),
415};
416
417static struct resource para_flash_resource = {
418 .start = 0x20000000,
419 .end = 0x201fffff,
420 .flags = IORESOURCE_MEM,
421};
422
423static struct platform_device para_flash_device = {
424 .name = "physmap-flash",
425 .id = 0,
426 .dev = {
427 .platform_data = &para_flash_data,
428 },
429 .num_resources = 1,
430 .resource = &para_flash_resource,
431};
432#endif
433
434
435
327static const unsigned int cclk_vlev_datasheet[] = 436static const unsigned int cclk_vlev_datasheet[] =
328{ 437{
329 VRPAIR(VLEV_085, 250000000), 438 VRPAIR(VLEV_085, 250000000),
@@ -382,10 +491,22 @@ static struct platform_device *cm_bf533_devices[] __initdata = {
382 &smc91x_device, 491 &smc91x_device,
383#endif 492#endif
384 493
494#if defined(CONFIG_SMSC911X) || defined(CONFIG_SMSC911X_MODULE)
495 &smsc911x_device,
496#endif
497
498#if defined(CONFIG_USB_NET2272) || defined(CONFIG_USB_NET2272_MODULE)
499 &net2272_bfin_device,
500#endif
501
385#if defined(CONFIG_SPI_BFIN) || defined(CONFIG_SPI_BFIN_MODULE) 502#if defined(CONFIG_SPI_BFIN) || defined(CONFIG_SPI_BFIN_MODULE)
386 &bfin_spi0_device, 503 &bfin_spi0_device,
387#endif 504#endif
388 505
506#if defined(CONFIG_MTD_PHYSMAP) || defined(CONFIG_MTD_PHYSMAP_MODULE)
507 &para_flash_device,
508#endif
509
389 &bfin_gpios_device, 510 &bfin_gpios_device,
390}; 511};
391 512
diff --git a/arch/blackfin/mach-bf533/boards/ezkit.c b/arch/blackfin/mach-bf533/boards/ezkit.c
index 4e3e511bf146..fd518e383b79 100644
--- a/arch/blackfin/mach-bf533/boards/ezkit.c
+++ b/arch/blackfin/mach-bf533/boards/ezkit.c
@@ -67,6 +67,14 @@ static struct platform_device bfin_fb_adv7393_device = {
67 * Driver needs to know address, irq and flag pin. 67 * Driver needs to know address, irq and flag pin.
68 */ 68 */
69#if defined(CONFIG_SMC91X) || defined(CONFIG_SMC91X_MODULE) 69#if defined(CONFIG_SMC91X) || defined(CONFIG_SMC91X_MODULE)
70#include <linux/smc91x.h>
71
72static struct smc91x_platdata smc91x_info = {
73 .flags = SMC91X_USE_16BIT | SMC91X_NOWAIT,
74 .leda = RPC_LED_100_10,
75 .ledb = RPC_LED_TX_RX,
76};
77
70static struct resource smc91x_resources[] = { 78static struct resource smc91x_resources[] = {
71 { 79 {
72 .name = "smc91x-regs", 80 .name = "smc91x-regs",
@@ -84,6 +92,9 @@ static struct platform_device smc91x_device = {
84 .id = 0, 92 .id = 0,
85 .num_resources = ARRAY_SIZE(smc91x_resources), 93 .num_resources = ARRAY_SIZE(smc91x_resources),
86 .resource = smc91x_resources, 94 .resource = smc91x_resources,
95 .dev = {
96 .platform_data = &smc91x_info,
97 },
87}; 98};
88#endif 99#endif
89 100
@@ -263,7 +274,7 @@ static struct spi_board_info bfin_spi_board_info[] __initdata = {
263 274
264#if defined(CONFIG_SND_BLACKFIN_AD1836) || defined(CONFIG_SND_BLACKFIN_AD1836_MODULE) 275#if defined(CONFIG_SND_BLACKFIN_AD1836) || defined(CONFIG_SND_BLACKFIN_AD1836_MODULE)
265 { 276 {
266 .modalias = "ad1836-spi", 277 .modalias = "ad1836",
267 .max_speed_hz = 3125000, /* max spi clock (SCK) speed in HZ */ 278 .max_speed_hz = 3125000, /* max spi clock (SCK) speed in HZ */
268 .bus_num = 0, 279 .bus_num = 0,
269 .chip_select = CONFIG_SND_BLACKFIN_SPI_PFBIT, 280 .chip_select = CONFIG_SND_BLACKFIN_SPI_PFBIT,
diff --git a/arch/blackfin/mach-bf533/boards/stamp.c b/arch/blackfin/mach-bf533/boards/stamp.c
index 3d743ccaff6a..729fd7c26336 100644
--- a/arch/blackfin/mach-bf533/boards/stamp.c
+++ b/arch/blackfin/mach-bf533/boards/stamp.c
@@ -35,6 +35,7 @@
35#include <linux/mtd/physmap.h> 35#include <linux/mtd/physmap.h>
36#include <linux/spi/spi.h> 36#include <linux/spi/spi.h>
37#include <linux/spi/flash.h> 37#include <linux/spi/flash.h>
38#include <linux/spi/mmc_spi.h>
38#if defined(CONFIG_USB_ISP1362_HCD) || defined(CONFIG_USB_ISP1362_HCD_MODULE) 39#if defined(CONFIG_USB_ISP1362_HCD) || defined(CONFIG_USB_ISP1362_HCD_MODULE)
39#include <linux/usb/isp1362.h> 40#include <linux/usb/isp1362.h>
40#endif 41#endif
@@ -62,6 +63,14 @@ static struct platform_device rtc_device = {
62 * Driver needs to know address, irq and flag pin. 63 * Driver needs to know address, irq and flag pin.
63 */ 64 */
64#if defined(CONFIG_SMC91X) || defined(CONFIG_SMC91X_MODULE) 65#if defined(CONFIG_SMC91X) || defined(CONFIG_SMC91X_MODULE)
66#include <linux/smc91x.h>
67
68static struct smc91x_platdata smc91x_info = {
69 .flags = SMC91X_USE_16BIT | SMC91X_NOWAIT,
70 .leda = RPC_LED_100_10,
71 .ledb = RPC_LED_TX_RX,
72};
73
65static struct resource smc91x_resources[] = { 74static struct resource smc91x_resources[] = {
66 { 75 {
67 .name = "smc91x-regs", 76 .name = "smc91x-regs",
@@ -80,6 +89,9 @@ static struct platform_device smc91x_device = {
80 .id = 0, 89 .id = 0,
81 .num_resources = ARRAY_SIZE(smc91x_resources), 90 .num_resources = ARRAY_SIZE(smc91x_resources),
82 .resource = smc91x_resources, 91 .resource = smc91x_resources,
92 .dev = {
93 .platform_data = &smc91x_info,
94 },
83}; 95};
84#endif 96#endif
85 97
@@ -207,19 +219,38 @@ static struct bfin5xx_spi_chip ad1836_spi_chip_info = {
207}; 219};
208#endif 220#endif
209 221
210#if defined(CONFIG_PBX) 222#if defined(CONFIG_SPI_SPIDEV) || defined(CONFIG_SPI_SPIDEV_MODULE)
211static struct bfin5xx_spi_chip spi_si3xxx_chip_info = { 223static struct bfin5xx_spi_chip spidev_chip_info = {
212 .ctl_reg = 0x4, /* send zero */ 224 .enable_dma = 0,
213 .enable_dma = 0, 225 .bits_per_word = 8,
214 .bits_per_word = 8,
215 .cs_change_per_word = 1,
216}; 226};
217#endif 227#endif
218 228
219#if defined(CONFIG_SPI_SPIDEV) || defined(CONFIG_SPI_SPIDEV_MODULE) 229#if defined(CONFIG_MMC_SPI) || defined(CONFIG_MMC_SPI_MODULE)
220static struct bfin5xx_spi_chip spidev_chip_info = { 230#define MMC_SPI_CARD_DETECT_INT IRQ_PF5
231static int bfin_mmc_spi_init(struct device *dev,
232 irqreturn_t (*detect_int)(int, void *), void *data)
233{
234 return request_irq(MMC_SPI_CARD_DETECT_INT, detect_int,
235 IRQF_TRIGGER_FALLING | IRQF_TRIGGER_RISING,
236 "mmc-spi-detect", data);
237}
238
239static void bfin_mmc_spi_exit(struct device *dev, void *data)
240{
241 free_irq(MMC_SPI_CARD_DETECT_INT, data);
242}
243
244static struct mmc_spi_platform_data bfin_mmc_spi_pdata = {
245 .init = bfin_mmc_spi_init,
246 .exit = bfin_mmc_spi_exit,
247 .detect_delay = 100, /* msecs */
248};
249
250static struct bfin5xx_spi_chip mmc_spi_chip_info = {
221 .enable_dma = 0, 251 .enable_dma = 0,
222 .bits_per_word = 8, 252 .bits_per_word = 8,
253 .pio_interrupt = 0,
223}; 254};
224#endif 255#endif
225 256
@@ -250,33 +281,14 @@ static struct spi_board_info bfin_spi_board_info[] __initdata = {
250 281
251#if defined(CONFIG_SND_BLACKFIN_AD1836) || defined(CONFIG_SND_BLACKFIN_AD1836_MODULE) 282#if defined(CONFIG_SND_BLACKFIN_AD1836) || defined(CONFIG_SND_BLACKFIN_AD1836_MODULE)
252 { 283 {
253 .modalias = "ad1836-spi", 284 .modalias = "ad1836",
254 .max_speed_hz = 31250000, /* max spi clock (SCK) speed in HZ */ 285 .max_speed_hz = 3125000, /* max spi clock (SCK) speed in HZ */
255 .bus_num = 0, 286 .bus_num = 0,
256 .chip_select = CONFIG_SND_BLACKFIN_SPI_PFBIT, 287 .chip_select = CONFIG_SND_BLACKFIN_SPI_PFBIT,
257 .controller_data = &ad1836_spi_chip_info, 288 .controller_data = &ad1836_spi_chip_info,
258 }, 289 },
259#endif 290#endif
260 291
261#if defined(CONFIG_PBX)
262 {
263 .modalias = "fxs-spi",
264 .max_speed_hz = 12500000, /* max spi clock (SCK) speed in HZ */
265 .bus_num = 0,
266 .chip_select = 8 - CONFIG_J11_JUMPER,
267 .controller_data = &spi_si3xxx_chip_info,
268 .mode = SPI_MODE_3,
269 },
270 {
271 .modalias = "fxo-spi",
272 .max_speed_hz = 12500000, /* max spi clock (SCK) speed in HZ */
273 .bus_num = 0,
274 .chip_select = 8 - CONFIG_J19_JUMPER,
275 .controller_data = &spi_si3xxx_chip_info,
276 .mode = SPI_MODE_3,
277 },
278#endif
279
280#if defined(CONFIG_SPI_SPIDEV) || defined(CONFIG_SPI_SPIDEV_MODULE) 292#if defined(CONFIG_SPI_SPIDEV) || defined(CONFIG_SPI_SPIDEV_MODULE)
281 { 293 {
282 .modalias = "spidev", 294 .modalias = "spidev",
@@ -286,6 +298,17 @@ static struct spi_board_info bfin_spi_board_info[] __initdata = {
286 .controller_data = &spidev_chip_info, 298 .controller_data = &spidev_chip_info,
287 }, 299 },
288#endif 300#endif
301#if defined(CONFIG_MMC_SPI) || defined(CONFIG_MMC_SPI_MODULE)
302 {
303 .modalias = "mmc_spi",
304 .max_speed_hz = 20000000, /* max spi clock (SCK) speed in HZ */
305 .bus_num = 0,
306 .chip_select = 4,
307 .platform_data = &bfin_mmc_spi_pdata,
308 .controller_data = &mmc_spi_chip_info,
309 .mode = SPI_MODE_3,
310 },
311#endif
289}; 312};
290 313
291#if defined(CONFIG_SPI_BFIN) || defined(CONFIG_SPI_BFIN_MODULE) 314#if defined(CONFIG_SPI_BFIN) || defined(CONFIG_SPI_BFIN_MODULE)
@@ -458,7 +481,7 @@ static struct i2c_board_info __initdata bfin_i2c_board_info[] = {
458 I2C_BOARD_INFO("pcf8574_lcd", 0x22), 481 I2C_BOARD_INFO("pcf8574_lcd", 0x22),
459 }, 482 },
460#endif 483#endif
461#if defined(CONFIG_TWI_KEYPAD) || defined(CONFIG_TWI_KEYPAD_MODULE) 484#if defined(CONFIG_INPUT_PCF8574) || defined(CONFIG_INPUT_PCF8574_MODULE)
462 { 485 {
463 I2C_BOARD_INFO("pcf8574_keypad", 0x27), 486 I2C_BOARD_INFO("pcf8574_keypad", 0x27),
464 .irq = 39, 487 .irq = 39,
diff --git a/arch/blackfin/mach-bf533/dma.c b/arch/blackfin/mach-bf533/dma.c
index 0a6eb8f24d98..7a443c37fb9f 100644
--- a/arch/blackfin/mach-bf533/dma.c
+++ b/arch/blackfin/mach-bf533/dma.c
@@ -76,12 +76,12 @@ int channel2irq(unsigned int channel)
76 ret_irq = IRQ_SPI; 76 ret_irq = IRQ_SPI;
77 break; 77 break;
78 78
79 case CH_UART_RX: 79 case CH_UART0_RX:
80 ret_irq = IRQ_UART_RX; 80 ret_irq = IRQ_UART0_RX;
81 break; 81 break;
82 82
83 case CH_UART_TX: 83 case CH_UART0_TX:
84 ret_irq = IRQ_UART_TX; 84 ret_irq = IRQ_UART0_TX;
85 break; 85 break;
86 86
87 case CH_MEM_STREAM0_SRC: 87 case CH_MEM_STREAM0_SRC:
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 4062e24e759b..6965b4088c44 100644
--- a/arch/blackfin/mach-bf533/include/mach/bfin_serial_5xx.h
+++ b/arch/blackfin/mach-bf533/include/mach/bfin_serial_5xx.h
@@ -131,11 +131,11 @@ struct bfin_serial_res {
131struct bfin_serial_res bfin_serial_resource[] = { 131struct bfin_serial_res bfin_serial_resource[] = {
132 { 132 {
133 0xFFC00400, 133 0xFFC00400,
134 IRQ_UART_RX, 134 IRQ_UART0_RX,
135 IRQ_UART_ERROR, 135 IRQ_UART0_ERROR,
136#ifdef CONFIG_SERIAL_BFIN_DMA 136#ifdef CONFIG_SERIAL_BFIN_DMA
137 CH_UART_TX, 137 CH_UART0_TX,
138 CH_UART_RX, 138 CH_UART0_RX,
139#endif 139#endif
140#ifdef CONFIG_SERIAL_BFIN_CTSRTS 140#ifdef CONFIG_SERIAL_BFIN_CTSRTS
141 CONFIG_UART0_CTS_PIN, 141 CONFIG_UART0_CTS_PIN,
diff --git a/arch/blackfin/mach-bf533/include/mach/blackfin.h b/arch/blackfin/mach-bf533/include/mach/blackfin.h
index 39aa175f19f5..499e897a4f4f 100644
--- a/arch/blackfin/mach-bf533/include/mach/blackfin.h
+++ b/arch/blackfin/mach-bf533/include/mach/blackfin.h
@@ -43,13 +43,6 @@
43 43
44#define BFIN_UART_NR_PORTS 1 44#define BFIN_UART_NR_PORTS 1
45 45
46#define CH_UART_RX CH_UART0_RX
47#define CH_UART_TX CH_UART0_TX
48
49#define IRQ_UART_ERROR IRQ_UART0_ERROR
50#define IRQ_UART_RX IRQ_UART0_RX
51#define IRQ_UART_TX IRQ_UART0_TX
52
53#define OFFSET_THR 0x00 /* Transmit Holding register */ 46#define OFFSET_THR 0x00 /* Transmit Holding register */
54#define OFFSET_RBR 0x00 /* Receive Buffer register */ 47#define OFFSET_RBR 0x00 /* Receive Buffer register */
55#define OFFSET_DLL 0x00 /* Divisor Latch (Low-Byte) */ 48#define OFFSET_DLL 0x00 /* Divisor Latch (Low-Byte) */
diff --git a/arch/blackfin/mach-bf537/boards/Kconfig b/arch/blackfin/mach-bf537/boards/Kconfig
index 77c59da87e85..44132fda63be 100644
--- a/arch/blackfin/mach-bf537/boards/Kconfig
+++ b/arch/blackfin/mach-bf537/boards/Kconfig
@@ -9,11 +9,17 @@ config BFIN537_STAMP
9 help 9 help
10 BF537-STAMP board support. 10 BF537-STAMP board support.
11 11
12config BFIN537_BLUETECHNIX_CM 12config BFIN537_BLUETECHNIX_CM_E
13 bool "Bluetechnix CM-BF537" 13 bool "Bluetechnix CM-BF537E"
14 depends on (BF537) 14 depends on (BF537)
15 help 15 help
16 CM-BF537 support for EVAL- and DEV-Board. 16 CM-BF537E support for EVAL- and DEV-Board.
17
18config BFIN537_BLUETECHNIX_CM_U
19 bool "Bluetechnix CM-BF537U"
20 depends on (BF537)
21 help
22 CM-BF537U support for EVAL- and DEV-Board.
17 23
18config BFIN537_BLUETECHNIX_TCM 24config BFIN537_BLUETECHNIX_TCM
19 bool "Bluetechnix TCM-BF537" 25 bool "Bluetechnix TCM-BF537"
diff --git a/arch/blackfin/mach-bf537/boards/Makefile b/arch/blackfin/mach-bf537/boards/Makefile
index 68b98a7af6a6..7e6aa4e5b205 100644
--- a/arch/blackfin/mach-bf537/boards/Makefile
+++ b/arch/blackfin/mach-bf537/boards/Makefile
@@ -3,7 +3,8 @@
3# 3#
4 4
5obj-$(CONFIG_BFIN537_STAMP) += stamp.o 5obj-$(CONFIG_BFIN537_STAMP) += stamp.o
6obj-$(CONFIG_BFIN537_BLUETECHNIX_CM) += cm_bf537.o 6obj-$(CONFIG_BFIN537_BLUETECHNIX_CM_E) += cm_bf537e.o
7obj-$(CONFIG_BFIN537_BLUETECHNIX_CM_U) += cm_bf537u.o
7obj-$(CONFIG_BFIN537_BLUETECHNIX_TCM) += tcm_bf537.o 8obj-$(CONFIG_BFIN537_BLUETECHNIX_TCM) += tcm_bf537.o
8obj-$(CONFIG_PNAV10) += pnav10.o 9obj-$(CONFIG_PNAV10) += pnav10.o
9obj-$(CONFIG_CAMSIG_MINOTAUR) += minotaur.o 10obj-$(CONFIG_CAMSIG_MINOTAUR) += minotaur.o
diff --git a/arch/blackfin/mach-bf537/boards/cm_bf537e.c b/arch/blackfin/mach-bf537/boards/cm_bf537e.c
new file mode 100644
index 000000000000..87acb7dd2df3
--- /dev/null
+++ b/arch/blackfin/mach-bf537/boards/cm_bf537e.c
@@ -0,0 +1,727 @@
1/*
2 * File: arch/blackfin/mach-bf537/boards/cm_bf537.c
3 * Based on: arch/blackfin/mach-bf533/boards/ezkit.c
4 * Author: Aidan Williams <aidan@nicta.com.au>
5 *
6 * Created: 2005
7 * Description: Board description file
8 *
9 * Modified:
10 * Copyright 2005 National ICT Australia (NICTA)
11 * Copyright 2004-2006 Analog Devices Inc.
12 *
13 * Bugs: Enter bugs at http://blackfin.uclinux.org/
14 *
15 * This program is free software; you can redistribute it and/or modify
16 * it under the terms of the GNU General Public License as published by
17 * the Free Software Foundation; either version 2 of the License, or
18 * (at your option) any later version.
19 *
20 * This program is distributed in the hope that it will be useful,
21 * but WITHOUT ANY WARRANTY; without even the implied warranty of
22 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
23 * GNU General Public License for more details.
24 *
25 * You should have received a copy of the GNU General Public License
26 * along with this program; if not, see the file COPYING, or write
27 * to the Free Software Foundation, Inc.,
28 * 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
29 */
30
31#include <linux/device.h>
32#include <linux/etherdevice.h>
33#include <linux/platform_device.h>
34#include <linux/mtd/mtd.h>
35#include <linux/mtd/partitions.h>
36#include <linux/mtd/physmap.h>
37#include <linux/spi/spi.h>
38#include <linux/spi/flash.h>
39#if defined(CONFIG_USB_ISP1362_HCD) || defined(CONFIG_USB_ISP1362_HCD_MODULE)
40#include <linux/usb/isp1362.h>
41#endif
42#include <linux/ata_platform.h>
43#include <linux/irq.h>
44#include <asm/dma.h>
45#include <asm/bfin5xx_spi.h>
46#include <asm/portmux.h>
47#include <asm/dpmc.h>
48
49/*
50 * Name the Board for the /proc/cpuinfo
51 */
52const char bfin_board_name[] = "Bluetechnix CM BF537E";
53
54#if defined(CONFIG_SPI_BFIN) || defined(CONFIG_SPI_BFIN_MODULE)
55/* all SPI peripherals info goes here */
56
57#if defined(CONFIG_MTD_M25P80) || defined(CONFIG_MTD_M25P80_MODULE)
58static struct mtd_partition bfin_spi_flash_partitions[] = {
59 {
60 .name = "bootloader(spi)",
61 .size = 0x00020000,
62 .offset = 0,
63 .mask_flags = MTD_CAP_ROM
64 }, {
65 .name = "linux kernel(spi)",
66 .size = 0xe0000,
67 .offset = 0x20000
68 }, {
69 .name = "file system(spi)",
70 .size = 0x700000,
71 .offset = 0x00100000,
72 }
73};
74
75static struct flash_platform_data bfin_spi_flash_data = {
76 .name = "m25p80",
77 .parts = bfin_spi_flash_partitions,
78 .nr_parts = ARRAY_SIZE(bfin_spi_flash_partitions),
79 .type = "m25p64",
80};
81
82/* SPI flash chip (m25p64) */
83static struct bfin5xx_spi_chip spi_flash_chip_info = {
84 .enable_dma = 0, /* use dma transfer with this chip*/
85 .bits_per_word = 8,
86};
87#endif
88
89#if defined(CONFIG_BFIN_SPI_ADC) || defined(CONFIG_BFIN_SPI_ADC_MODULE)
90/* SPI ADC chip */
91static struct bfin5xx_spi_chip spi_adc_chip_info = {
92 .enable_dma = 1, /* use dma transfer with this chip*/
93 .bits_per_word = 16,
94};
95#endif
96
97#if defined(CONFIG_SND_BLACKFIN_AD1836) || defined(CONFIG_SND_BLACKFIN_AD1836_MODULE)
98static struct bfin5xx_spi_chip ad1836_spi_chip_info = {
99 .enable_dma = 0,
100 .bits_per_word = 16,
101};
102#endif
103
104#if defined(CONFIG_MMC_SPI) || defined(CONFIG_MMC_SPI_MODULE)
105static struct bfin5xx_spi_chip mmc_spi_chip_info = {
106 .enable_dma = 0,
107 .bits_per_word = 8,
108};
109#endif
110
111static struct spi_board_info bfin_spi_board_info[] __initdata = {
112#if defined(CONFIG_MTD_M25P80) || defined(CONFIG_MTD_M25P80_MODULE)
113 {
114 /* the modalias must be the same as spi device driver name */
115 .modalias = "m25p80", /* Name of spi_driver for this device */
116 .max_speed_hz = 25000000, /* max spi clock (SCK) speed in HZ */
117 .bus_num = 0, /* Framework bus number */
118 .chip_select = 1, /* Framework chip select. On STAMP537 it is SPISSEL1*/
119 .platform_data = &bfin_spi_flash_data,
120 .controller_data = &spi_flash_chip_info,
121 .mode = SPI_MODE_3,
122 },
123#endif
124
125#if defined(CONFIG_BFIN_SPI_ADC) || defined(CONFIG_BFIN_SPI_ADC_MODULE)
126 {
127 .modalias = "bfin_spi_adc", /* Name of spi_driver for this device */
128 .max_speed_hz = 6250000, /* max spi clock (SCK) speed in HZ */
129 .bus_num = 0, /* Framework bus number */
130 .chip_select = 1, /* Framework chip select. */
131 .platform_data = NULL, /* No spi_driver specific config */
132 .controller_data = &spi_adc_chip_info,
133 },
134#endif
135
136#if defined(CONFIG_SND_BLACKFIN_AD1836) || defined(CONFIG_SND_BLACKFIN_AD1836_MODULE)
137 {
138 .modalias = "ad1836",
139 .max_speed_hz = 3125000, /* max spi clock (SCK) speed in HZ */
140 .bus_num = 0,
141 .chip_select = CONFIG_SND_BLACKFIN_SPI_PFBIT,
142 .controller_data = &ad1836_spi_chip_info,
143 },
144#endif
145
146#if defined(CONFIG_MMC_SPI) || defined(CONFIG_MMC_SPI_MODULE)
147 {
148 .modalias = "mmc_spi",
149 .max_speed_hz = 20000000, /* max spi clock (SCK) speed in HZ */
150 .bus_num = 0,
151 .chip_select = 1,
152 .controller_data = &mmc_spi_chip_info,
153 .mode = SPI_MODE_3,
154 },
155#endif
156};
157
158/* SPI (0) */
159static struct resource bfin_spi0_resource[] = {
160 [0] = {
161 .start = SPI0_REGBASE,
162 .end = SPI0_REGBASE + 0xFF,
163 .flags = IORESOURCE_MEM,
164 },
165 [1] = {
166 .start = CH_SPI,
167 .end = CH_SPI,
168 .flags = IORESOURCE_DMA,
169 },
170 [2] = {
171 .start = IRQ_SPI,
172 .end = IRQ_SPI,
173 .flags = IORESOURCE_IRQ,
174 },
175};
176
177/* SPI controller data */
178static struct bfin5xx_spi_master bfin_spi0_info = {
179 .num_chipselect = 8,
180 .enable_dma = 1, /* master has the ability to do dma transfer */
181 .pin_req = {P_SPI0_SCK, P_SPI0_MISO, P_SPI0_MOSI, 0},
182};
183
184static struct platform_device bfin_spi0_device = {
185 .name = "bfin-spi",
186 .id = 0, /* Bus number */
187 .num_resources = ARRAY_SIZE(bfin_spi0_resource),
188 .resource = bfin_spi0_resource,
189 .dev = {
190 .platform_data = &bfin_spi0_info, /* Passed to driver */
191 },
192};
193#endif /* spi master and devices */
194
195#if defined(CONFIG_RTC_DRV_BFIN) || defined(CONFIG_RTC_DRV_BFIN_MODULE)
196static struct platform_device rtc_device = {
197 .name = "rtc-bfin",
198 .id = -1,
199};
200#endif
201
202#if defined(CONFIG_FB_HITACHI_TX09) || defined(CONFIG_FB_HITACHI_TX09_MODULE)
203static struct platform_device hitachi_fb_device = {
204 .name = "hitachi-tx09",
205};
206#endif
207
208#if defined(CONFIG_SMC91X) || defined(CONFIG_SMC91X_MODULE)
209#include <linux/smc91x.h>
210
211static struct smc91x_platdata smc91x_info = {
212 .flags = SMC91X_USE_16BIT | SMC91X_NOWAIT,
213 .leda = RPC_LED_100_10,
214 .ledb = RPC_LED_TX_RX,
215};
216
217static struct resource smc91x_resources[] = {
218 {
219 .start = 0x20200300,
220 .end = 0x20200300 + 16,
221 .flags = IORESOURCE_MEM,
222 }, {
223 .start = IRQ_PF14,
224 .end = IRQ_PF14,
225 .flags = IORESOURCE_IRQ | IORESOURCE_IRQ_HIGHLEVEL,
226 },
227};
228
229static struct platform_device smc91x_device = {
230 .name = "smc91x",
231 .id = 0,
232 .num_resources = ARRAY_SIZE(smc91x_resources),
233 .resource = smc91x_resources,
234 .dev = {
235 .platform_data = &smc91x_info,
236 },
237};
238#endif
239
240#if defined(CONFIG_USB_ISP1362_HCD) || defined(CONFIG_USB_ISP1362_HCD_MODULE)
241static struct resource isp1362_hcd_resources[] = {
242 {
243 .start = 0x20308000,
244 .end = 0x20308000,
245 .flags = IORESOURCE_MEM,
246 }, {
247 .start = 0x20308004,
248 .end = 0x20308004,
249 .flags = IORESOURCE_MEM,
250 }, {
251 .start = IRQ_PG15,
252 .end = IRQ_PG15,
253 .flags = IORESOURCE_IRQ | IORESOURCE_IRQ_HIGHLEVEL,
254 },
255};
256
257static struct isp1362_platform_data isp1362_priv = {
258 .sel15Kres = 1,
259 .clknotstop = 0,
260 .oc_enable = 0,
261 .int_act_high = 0,
262 .int_edge_triggered = 0,
263 .remote_wakeup_connected = 0,
264 .no_power_switching = 1,
265 .power_switching_mode = 0,
266};
267
268static struct platform_device isp1362_hcd_device = {
269 .name = "isp1362-hcd",
270 .id = 0,
271 .dev = {
272 .platform_data = &isp1362_priv,
273 },
274 .num_resources = ARRAY_SIZE(isp1362_hcd_resources),
275 .resource = isp1362_hcd_resources,
276};
277#endif
278
279#if defined(CONFIG_USB_NET2272) || defined(CONFIG_USB_NET2272_MODULE)
280static struct resource net2272_bfin_resources[] = {
281 {
282 .start = 0x20300000,
283 .end = 0x20300000 + 0x100,
284 .flags = IORESOURCE_MEM,
285 }, {
286 .start = IRQ_PG13,
287 .end = IRQ_PG13,
288 .flags = IORESOURCE_IRQ | IORESOURCE_IRQ_HIGHLEVEL,
289 },
290};
291
292static struct platform_device net2272_bfin_device = {
293 .name = "net2272",
294 .id = -1,
295 .num_resources = ARRAY_SIZE(net2272_bfin_resources),
296 .resource = net2272_bfin_resources,
297};
298#endif
299
300static struct resource bfin_gpios_resources = {
301 .start = 0,
302 .end = MAX_BLACKFIN_GPIOS - 1,
303 .flags = IORESOURCE_IRQ,
304};
305
306static struct platform_device bfin_gpios_device = {
307 .name = "simple-gpio",
308 .id = -1,
309 .num_resources = 1,
310 .resource = &bfin_gpios_resources,
311};
312
313#if defined(CONFIG_MTD_GPIO_ADDR) || defined(CONFIG_MTD_GPIO_ADDR_MODULE)
314static struct mtd_partition cm_partitions[] = {
315 {
316 .name = "bootloader(nor)",
317 .size = 0x40000,
318 .offset = 0,
319 }, {
320 .name = "linux kernel(nor)",
321 .size = 0x100000,
322 .offset = MTDPART_OFS_APPEND,
323 }, {
324 .name = "file system(nor)",
325 .size = MTDPART_SIZ_FULL,
326 .offset = MTDPART_OFS_APPEND,
327 }
328};
329
330static struct physmap_flash_data cm_flash_data = {
331 .width = 2,
332 .parts = cm_partitions,
333 .nr_parts = ARRAY_SIZE(cm_partitions),
334};
335
336static unsigned cm_flash_gpios[] = { GPIO_PF4 };
337
338static struct resource cm_flash_resource[] = {
339 {
340 .name = "cfi_probe",
341 .start = 0x20000000,
342 .end = 0x201fffff,
343 .flags = IORESOURCE_MEM,
344 }, {
345 .start = (unsigned long)cm_flash_gpios,
346 .end = ARRAY_SIZE(cm_flash_gpios),
347 .flags = IORESOURCE_IRQ,
348 }
349};
350
351static struct platform_device cm_flash_device = {
352 .name = "gpio-addr-flash",
353 .id = 0,
354 .dev = {
355 .platform_data = &cm_flash_data,
356 },
357 .num_resources = ARRAY_SIZE(cm_flash_resource),
358 .resource = cm_flash_resource,
359};
360#endif
361
362#if defined(CONFIG_SERIAL_BFIN) || defined(CONFIG_SERIAL_BFIN_MODULE)
363#ifdef CONFIG_SERIAL_BFIN_UART0
364static struct resource bfin_uart0_resources[] = {
365 {
366 .start = 0xFFC00400,
367 .end = 0xFFC004FF,
368 .flags = IORESOURCE_MEM,
369 },
370 {
371 .start = IRQ_UART0_RX,
372 .end = IRQ_UART0_RX+1,
373 .flags = IORESOURCE_IRQ,
374 },
375 {
376 .start = IRQ_UART0_ERROR,
377 .end = IRQ_UART0_ERROR,
378 .flags = IORESOURCE_IRQ,
379 },
380 {
381 .start = CH_UART0_TX,
382 .end = CH_UART0_TX,
383 .flags = IORESOURCE_DMA,
384 },
385 {
386 .start = CH_UART0_RX,
387 .end = CH_UART0_RX,
388 .flags = IORESOURCE_DMA,
389 },
390#ifdef CONFIG_BFIN_UART0_CTSRTS
391 {
392 /*
393 * Refer to arch/blackfin/mach-xxx/include/mach/gpio.h for the GPIO map.
394 */
395 .start = -1,
396 .end = -1,
397 .flags = IORESOURCE_IO,
398 },
399 {
400 /*
401 * Refer to arch/blackfin/mach-xxx/include/mach/gpio.h for the GPIO map.
402 */
403 .start = -1,
404 .end = -1,
405 .flags = IORESOURCE_IO,
406 },
407#endif
408};
409
410static struct platform_device bfin_uart0_device = {
411 .name = "bfin-uart",
412 .id = 0,
413 .num_resources = ARRAY_SIZE(bfin_uart0_resources),
414 .resource = bfin_uart0_resources,
415};
416#endif
417#ifdef CONFIG_SERIAL_BFIN_UART1
418static struct resource bfin_uart1_resources[] = {
419 {
420 .start = 0xFFC02000,
421 .end = 0xFFC020FF,
422 .flags = IORESOURCE_MEM,
423 },
424 {
425 .start = IRQ_UART1_RX,
426 .end = IRQ_UART1_RX+1,
427 .flags = IORESOURCE_IRQ,
428 },
429 {
430 .start = IRQ_UART1_ERROR,
431 .end = IRQ_UART1_ERROR,
432 .flags = IORESOURCE_IRQ,
433 },
434 {
435 .start = CH_UART1_TX,
436 .end = CH_UART1_TX,
437 .flags = IORESOURCE_DMA,
438 },
439 {
440 .start = CH_UART1_RX,
441 .end = CH_UART1_RX,
442 .flags = IORESOURCE_DMA,
443 },
444#ifdef CONFIG_BFIN_UART1_CTSRTS
445 {
446 /*
447 * Refer to arch/blackfin/mach-xxx/include/mach/gpio.h for the GPIO map.
448 */
449 .start = -1,
450 .end = -1,
451 .flags = IORESOURCE_IO,
452 },
453 {
454 /*
455 * Refer to arch/blackfin/mach-xxx/include/mach/gpio.h for the GPIO map.
456 */
457 .start = -1,
458 .end = -1,
459 .flags = IORESOURCE_IO,
460 },
461#endif
462};
463
464static struct platform_device bfin_uart1_device = {
465 .name = "bfin-uart",
466 .id = 1,
467 .num_resources = ARRAY_SIZE(bfin_uart1_resources),
468 .resource = bfin_uart1_resources,
469};
470#endif
471#endif
472
473#if defined(CONFIG_BFIN_SIR) || defined(CONFIG_BFIN_SIR_MODULE)
474#ifdef CONFIG_BFIN_SIR0
475static struct resource bfin_sir0_resources[] = {
476 {
477 .start = 0xFFC00400,
478 .end = 0xFFC004FF,
479 .flags = IORESOURCE_MEM,
480 },
481 {
482 .start = IRQ_UART0_RX,
483 .end = IRQ_UART0_RX+1,
484 .flags = IORESOURCE_IRQ,
485 },
486 {
487 .start = CH_UART0_RX,
488 .end = CH_UART0_RX+1,
489 .flags = IORESOURCE_DMA,
490 },
491};
492static struct platform_device bfin_sir0_device = {
493 .name = "bfin_sir",
494 .id = 0,
495 .num_resources = ARRAY_SIZE(bfin_sir0_resources),
496 .resource = bfin_sir0_resources,
497};
498#endif
499#ifdef CONFIG_BFIN_SIR1
500static struct resource bfin_sir1_resources[] = {
501 {
502 .start = 0xFFC02000,
503 .end = 0xFFC020FF,
504 .flags = IORESOURCE_MEM,
505 },
506 {
507 .start = IRQ_UART1_RX,
508 .end = IRQ_UART1_RX+1,
509 .flags = IORESOURCE_IRQ,
510 },
511 {
512 .start = CH_UART1_RX,
513 .end = CH_UART1_RX+1,
514 .flags = IORESOURCE_DMA,
515 },
516};
517static struct platform_device bfin_sir1_device = {
518 .name = "bfin_sir",
519 .id = 1,
520 .num_resources = ARRAY_SIZE(bfin_sir1_resources),
521 .resource = bfin_sir1_resources,
522};
523#endif
524#endif
525
526#if defined(CONFIG_I2C_BLACKFIN_TWI) || defined(CONFIG_I2C_BLACKFIN_TWI_MODULE)
527static struct resource bfin_twi0_resource[] = {
528 [0] = {
529 .start = TWI0_REGBASE,
530 .end = TWI0_REGBASE,
531 .flags = IORESOURCE_MEM,
532 },
533 [1] = {
534 .start = IRQ_TWI,
535 .end = IRQ_TWI,
536 .flags = IORESOURCE_IRQ,
537 },
538};
539
540static struct platform_device i2c_bfin_twi_device = {
541 .name = "i2c-bfin-twi",
542 .id = 0,
543 .num_resources = ARRAY_SIZE(bfin_twi0_resource),
544 .resource = bfin_twi0_resource,
545};
546#endif
547
548#if defined(CONFIG_SERIAL_BFIN_SPORT) || defined(CONFIG_SERIAL_BFIN_SPORT_MODULE)
549static struct platform_device bfin_sport0_uart_device = {
550 .name = "bfin-sport-uart",
551 .id = 0,
552};
553
554static struct platform_device bfin_sport1_uart_device = {
555 .name = "bfin-sport-uart",
556 .id = 1,
557};
558#endif
559
560#if defined(CONFIG_BFIN_MAC) || defined(CONFIG_BFIN_MAC_MODULE)
561static struct platform_device bfin_mii_bus = {
562 .name = "bfin_mii_bus",
563};
564
565static struct platform_device bfin_mac_device = {
566 .name = "bfin_mac",
567 .dev.platform_data = &bfin_mii_bus,
568};
569#endif
570
571#if defined(CONFIG_PATA_PLATFORM) || defined(CONFIG_PATA_PLATFORM_MODULE)
572#define PATA_INT IRQ_PF14
573
574static struct pata_platform_info bfin_pata_platform_data = {
575 .ioport_shift = 2,
576 .irq_type = IRQF_TRIGGER_HIGH | IRQF_DISABLED,
577};
578
579static struct resource bfin_pata_resources[] = {
580 {
581 .start = 0x2030C000,
582 .end = 0x2030C01F,
583 .flags = IORESOURCE_MEM,
584 },
585 {
586 .start = 0x2030D018,
587 .end = 0x2030D01B,
588 .flags = IORESOURCE_MEM,
589 },
590 {
591 .start = PATA_INT,
592 .end = PATA_INT,
593 .flags = IORESOURCE_IRQ,
594 },
595};
596
597static struct platform_device bfin_pata_device = {
598 .name = "pata_platform",
599 .id = -1,
600 .num_resources = ARRAY_SIZE(bfin_pata_resources),
601 .resource = bfin_pata_resources,
602 .dev = {
603 .platform_data = &bfin_pata_platform_data,
604 }
605};
606#endif
607
608static const unsigned int cclk_vlev_datasheet[] =
609{
610 VRPAIR(VLEV_085, 250000000),
611 VRPAIR(VLEV_090, 376000000),
612 VRPAIR(VLEV_095, 426000000),
613 VRPAIR(VLEV_100, 426000000),
614 VRPAIR(VLEV_105, 476000000),
615 VRPAIR(VLEV_110, 476000000),
616 VRPAIR(VLEV_115, 476000000),
617 VRPAIR(VLEV_120, 500000000),
618 VRPAIR(VLEV_125, 533000000),
619 VRPAIR(VLEV_130, 600000000),
620};
621
622static struct bfin_dpmc_platform_data bfin_dmpc_vreg_data = {
623 .tuple_tab = cclk_vlev_datasheet,
624 .tabsize = ARRAY_SIZE(cclk_vlev_datasheet),
625 .vr_settling_time = 25 /* us */,
626};
627
628static struct platform_device bfin_dpmc = {
629 .name = "bfin dpmc",
630 .dev = {
631 .platform_data = &bfin_dmpc_vreg_data,
632 },
633};
634
635static struct platform_device *cm_bf537e_devices[] __initdata = {
636
637 &bfin_dpmc,
638
639#if defined(CONFIG_FB_HITACHI_TX09) || defined(CONFIG_FB_HITACHI_TX09_MODULE)
640 &hitachi_fb_device,
641#endif
642
643#if defined(CONFIG_RTC_DRV_BFIN) || defined(CONFIG_RTC_DRV_BFIN_MODULE)
644 &rtc_device,
645#endif
646
647#if defined(CONFIG_SERIAL_BFIN) || defined(CONFIG_SERIAL_BFIN_MODULE)
648#ifdef CONFIG_SERIAL_BFIN_UART0
649 &bfin_uart0_device,
650#endif
651#ifdef CONFIG_SERIAL_BFIN_UART1
652 &bfin_uart1_device,
653#endif
654#endif
655
656#if defined(CONFIG_BFIN_SIR) || defined(CONFIG_BFIN_SIR_MODULE)
657#ifdef CONFIG_BFIN_SIR0
658 &bfin_sir0_device,
659#endif
660#ifdef CONFIG_BFIN_SIR1
661 &bfin_sir1_device,
662#endif
663#endif
664
665#if defined(CONFIG_I2C_BLACKFIN_TWI) || defined(CONFIG_I2C_BLACKFIN_TWI_MODULE)
666 &i2c_bfin_twi_device,
667#endif
668
669#if defined(CONFIG_SERIAL_BFIN_SPORT) || defined(CONFIG_SERIAL_BFIN_SPORT_MODULE)
670 &bfin_sport0_uart_device,
671 &bfin_sport1_uart_device,
672#endif
673
674#if defined(CONFIG_USB_ISP1362_HCD) || defined(CONFIG_USB_ISP1362_HCD_MODULE)
675 &isp1362_hcd_device,
676#endif
677
678#if defined(CONFIG_SMC91X) || defined(CONFIG_SMC91X_MODULE)
679 &smc91x_device,
680#endif
681
682#if defined(CONFIG_BFIN_MAC) || defined(CONFIG_BFIN_MAC_MODULE)
683 &bfin_mii_bus,
684 &bfin_mac_device,
685#endif
686
687#if defined(CONFIG_USB_NET2272) || defined(CONFIG_USB_NET2272_MODULE)
688 &net2272_bfin_device,
689#endif
690
691#if defined(CONFIG_SPI_BFIN) || defined(CONFIG_SPI_BFIN_MODULE)
692 &bfin_spi0_device,
693#endif
694
695#if defined(CONFIG_PATA_PLATFORM) || defined(CONFIG_PATA_PLATFORM_MODULE)
696 &bfin_pata_device,
697#endif
698
699#if defined(CONFIG_MTD_GPIO_ADDR) || defined(CONFIG_MTD_GPIO_ADDR_MODULE)
700 &cm_flash_device,
701#endif
702
703 &bfin_gpios_device,
704};
705
706static int __init cm_bf537e_init(void)
707{
708 printk(KERN_INFO "%s(): registering device resources\n", __func__);
709 platform_add_devices(cm_bf537e_devices, ARRAY_SIZE(cm_bf537e_devices));
710#if defined(CONFIG_SPI_BFIN) || defined(CONFIG_SPI_BFIN_MODULE)
711 spi_register_board_info(bfin_spi_board_info, ARRAY_SIZE(bfin_spi_board_info));
712#endif
713
714#if defined(CONFIG_PATA_PLATFORM) || defined(CONFIG_PATA_PLATFORM_MODULE)
715 irq_desc[PATA_INT].status |= IRQ_NOAUTOEN;
716#endif
717 return 0;
718}
719
720arch_initcall(cm_bf537e_init);
721
722void bfin_get_ether_addr(char *addr)
723{
724 random_ether_addr(addr);
725 printk(KERN_WARNING "%s:%s: Setting Ethernet MAC to a random one\n", __FILE__, __func__);
726}
727EXPORT_SYMBOL(bfin_get_ether_addr);
diff --git a/arch/blackfin/mach-bf537/boards/cm_bf537.c b/arch/blackfin/mach-bf537/boards/cm_bf537u.c
index 2a87d1cfcd06..8219dc3d65bd 100644
--- a/arch/blackfin/mach-bf537/boards/cm_bf537.c
+++ b/arch/blackfin/mach-bf537/boards/cm_bf537u.c
@@ -1,5 +1,5 @@
1/* 1/*
2 * File: arch/blackfin/mach-bf537/boards/cm_bf537.c 2 * File: arch/blackfin/mach-bf537/boards/cm_bf537u.c
3 * Based on: arch/blackfin/mach-bf533/boards/ezkit.c 3 * Based on: arch/blackfin/mach-bf533/boards/ezkit.c
4 * Author: Aidan Williams <aidan@nicta.com.au> 4 * Author: Aidan Williams <aidan@nicta.com.au>
5 * 5 *
@@ -45,11 +45,12 @@
45#include <asm/bfin5xx_spi.h> 45#include <asm/bfin5xx_spi.h>
46#include <asm/portmux.h> 46#include <asm/portmux.h>
47#include <asm/dpmc.h> 47#include <asm/dpmc.h>
48#include <linux/spi/mmc_spi.h>
48 49
49/* 50/*
50 * Name the Board for the /proc/cpuinfo 51 * Name the Board for the /proc/cpuinfo
51 */ 52 */
52const char bfin_board_name[] = "Bluetechnix CM BF537"; 53const char bfin_board_name[] = "Bluetechnix CM BF537U";
53 54
54#if defined(CONFIG_SPI_BFIN) || defined(CONFIG_SPI_BFIN_MODULE) 55#if defined(CONFIG_SPI_BFIN) || defined(CONFIG_SPI_BFIN_MODULE)
55/* all SPI peripherals info goes here */ 56/* all SPI peripherals info goes here */
@@ -101,13 +102,6 @@ static struct bfin5xx_spi_chip ad1836_spi_chip_info = {
101}; 102};
102#endif 103#endif
103 104
104#if defined(CONFIG_AD9960) || defined(CONFIG_AD9960_MODULE)
105static struct bfin5xx_spi_chip ad9960_spi_chip_info = {
106 .enable_dma = 0,
107 .bits_per_word = 16,
108};
109#endif
110
111#if defined(CONFIG_MMC_SPI) || defined(CONFIG_MMC_SPI_MODULE) 105#if defined(CONFIG_MMC_SPI) || defined(CONFIG_MMC_SPI_MODULE)
112static struct bfin5xx_spi_chip mmc_spi_chip_info = { 106static struct bfin5xx_spi_chip mmc_spi_chip_info = {
113 .enable_dma = 0, 107 .enable_dma = 0,
@@ -142,7 +136,7 @@ static struct spi_board_info bfin_spi_board_info[] __initdata = {
142 136
143#if defined(CONFIG_SND_BLACKFIN_AD1836) || defined(CONFIG_SND_BLACKFIN_AD1836_MODULE) 137#if defined(CONFIG_SND_BLACKFIN_AD1836) || defined(CONFIG_SND_BLACKFIN_AD1836_MODULE)
144 { 138 {
145 .modalias = "ad1836-spi", 139 .modalias = "ad1836",
146 .max_speed_hz = 3125000, /* max spi clock (SCK) speed in HZ */ 140 .max_speed_hz = 3125000, /* max spi clock (SCK) speed in HZ */
147 .bus_num = 0, 141 .bus_num = 0,
148 .chip_select = CONFIG_SND_BLACKFIN_SPI_PFBIT, 142 .chip_select = CONFIG_SND_BLACKFIN_SPI_PFBIT,
@@ -150,16 +144,6 @@ static struct spi_board_info bfin_spi_board_info[] __initdata = {
150 }, 144 },
151#endif 145#endif
152 146
153#if defined(CONFIG_AD9960) || defined(CONFIG_AD9960_MODULE)
154 {
155 .modalias = "ad9960-spi",
156 .max_speed_hz = 10000000, /* max spi clock (SCK) speed in HZ */
157 .bus_num = 0,
158 .chip_select = 1,
159 .controller_data = &ad9960_spi_chip_info,
160 },
161#endif
162
163#if defined(CONFIG_MMC_SPI) || defined(CONFIG_MMC_SPI_MODULE) 147#if defined(CONFIG_MMC_SPI) || defined(CONFIG_MMC_SPI_MODULE)
164 { 148 {
165 .modalias = "mmc_spi", 149 .modalias = "mmc_spi",
@@ -223,6 +207,14 @@ static struct platform_device hitachi_fb_device = {
223#endif 207#endif
224 208
225#if defined(CONFIG_SMC91X) || defined(CONFIG_SMC91X_MODULE) 209#if defined(CONFIG_SMC91X) || defined(CONFIG_SMC91X_MODULE)
210#include <linux/smc91x.h>
211
212static struct smc91x_platdata smc91x_info = {
213 .flags = SMC91X_USE_16BIT | SMC91X_NOWAIT,
214 .leda = RPC_LED_100_10,
215 .ledb = RPC_LED_TX_RX,
216};
217
226static struct resource smc91x_resources[] = { 218static struct resource smc91x_resources[] = {
227 { 219 {
228 .start = 0x20200300, 220 .start = 0x20200300,
@@ -240,6 +232,9 @@ static struct platform_device smc91x_device = {
240 .id = 0, 232 .id = 0,
241 .num_resources = ARRAY_SIZE(smc91x_resources), 233 .num_resources = ARRAY_SIZE(smc91x_resources),
242 .resource = smc91x_resources, 234 .resource = smc91x_resources,
235 .dev = {
236 .platform_data = &smc91x_info,
237 },
243}; 238};
244#endif 239#endif
245 240
@@ -324,7 +319,7 @@ static struct mtd_partition cm_partitions[] = {
324 .offset = 0, 319 .offset = 0,
325 }, { 320 }, {
326 .name = "linux kernel(nor)", 321 .name = "linux kernel(nor)",
327 .size = 0xE0000, 322 .size = 0x100000,
328 .offset = MTDPART_OFS_APPEND, 323 .offset = MTDPART_OFS_APPEND,
329 }, { 324 }, {
330 .name = "file system(nor)", 325 .name = "file system(nor)",
@@ -339,7 +334,7 @@ static struct physmap_flash_data cm_flash_data = {
339 .nr_parts = ARRAY_SIZE(cm_partitions), 334 .nr_parts = ARRAY_SIZE(cm_partitions),
340}; 335};
341 336
342static unsigned cm_flash_gpios[] = { GPIO_PF4 }; 337static unsigned cm_flash_gpios[] = { GPIO_PH0 };
343 338
344static struct resource cm_flash_resource[] = { 339static struct resource cm_flash_resource[] = {
345 { 340 {
@@ -548,7 +543,7 @@ static struct platform_device bfin_dpmc = {
548 }, 543 },
549}; 544};
550 545
551static struct platform_device *cm_bf537_devices[] __initdata = { 546static struct platform_device *cm_bf537u_devices[] __initdata = {
552 547
553 &bfin_dpmc, 548 &bfin_dpmc,
554 549
@@ -614,10 +609,10 @@ static struct platform_device *cm_bf537_devices[] __initdata = {
614 &bfin_gpios_device, 609 &bfin_gpios_device,
615}; 610};
616 611
617static int __init cm_bf537_init(void) 612static int __init cm_bf537u_init(void)
618{ 613{
619 printk(KERN_INFO "%s(): registering device resources\n", __func__); 614 printk(KERN_INFO "%s(): registering device resources\n", __func__);
620 platform_add_devices(cm_bf537_devices, ARRAY_SIZE(cm_bf537_devices)); 615 platform_add_devices(cm_bf537u_devices, ARRAY_SIZE(cm_bf537u_devices));
621#if defined(CONFIG_SPI_BFIN) || defined(CONFIG_SPI_BFIN_MODULE) 616#if defined(CONFIG_SPI_BFIN) || defined(CONFIG_SPI_BFIN_MODULE)
622 spi_register_board_info(bfin_spi_board_info, ARRAY_SIZE(bfin_spi_board_info)); 617 spi_register_board_info(bfin_spi_board_info, ARRAY_SIZE(bfin_spi_board_info));
623#endif 618#endif
@@ -628,7 +623,7 @@ static int __init cm_bf537_init(void)
628 return 0; 623 return 0;
629} 624}
630 625
631arch_initcall(cm_bf537_init); 626arch_initcall(cm_bf537u_init);
632 627
633void bfin_get_ether_addr(char *addr) 628void bfin_get_ether_addr(char *addr)
634{ 629{
diff --git a/arch/blackfin/mach-bf537/boards/pnav10.c b/arch/blackfin/mach-bf537/boards/pnav10.c
index 838240f151f5..10b35b838bac 100644
--- a/arch/blackfin/mach-bf537/boards/pnav10.c
+++ b/arch/blackfin/mach-bf537/boards/pnav10.c
@@ -92,6 +92,14 @@ static struct platform_device rtc_device = {
92#endif 92#endif
93 93
94#if defined(CONFIG_SMC91X) || defined(CONFIG_SMC91X_MODULE) 94#if defined(CONFIG_SMC91X) || defined(CONFIG_SMC91X_MODULE)
95#include <linux/smc91x.h>
96
97static struct smc91x_platdata smc91x_info = {
98 .flags = SMC91X_USE_16BIT | SMC91X_NOWAIT,
99 .leda = RPC_LED_100_10,
100 .ledb = RPC_LED_TX_RX,
101};
102
95static struct resource smc91x_resources[] = { 103static struct resource smc91x_resources[] = {
96 { 104 {
97 .name = "smc91x-regs", 105 .name = "smc91x-regs",
@@ -110,6 +118,9 @@ static struct platform_device smc91x_device = {
110 .id = 0, 118 .id = 0,
111 .num_resources = ARRAY_SIZE(smc91x_resources), 119 .num_resources = ARRAY_SIZE(smc91x_resources),
112 .resource = smc91x_resources, 120 .resource = smc91x_resources,
121 .dev = {
122 .platform_data = &smc91x_info,
123 },
113}; 124};
114#endif 125#endif
115 126
@@ -282,13 +293,6 @@ static struct bfin5xx_spi_chip ad1836_spi_chip_info = {
282}; 293};
283#endif 294#endif
284 295
285#if defined(CONFIG_AD9960) || defined(CONFIG_AD9960_MODULE)
286static struct bfin5xx_spi_chip ad9960_spi_chip_info = {
287 .enable_dma = 0,
288 .bits_per_word = 16,
289};
290#endif
291
292#if defined(CONFIG_MMC_SPI) || defined(CONFIG_MMC_SPI_MODULE) 296#if defined(CONFIG_MMC_SPI) || defined(CONFIG_MMC_SPI_MODULE)
293static struct bfin5xx_spi_chip mmc_spi_chip_info = { 297static struct bfin5xx_spi_chip mmc_spi_chip_info = {
294 .enable_dma = 0, 298 .enable_dma = 0,
@@ -348,22 +352,13 @@ static struct spi_board_info bfin_spi_board_info[] __initdata = {
348#if defined(CONFIG_SND_BLACKFIN_AD1836) \ 352#if defined(CONFIG_SND_BLACKFIN_AD1836) \
349 || defined(CONFIG_SND_BLACKFIN_AD1836_MODULE) 353 || defined(CONFIG_SND_BLACKFIN_AD1836_MODULE)
350 { 354 {
351 .modalias = "ad1836-spi", 355 .modalias = "ad1836",
352 .max_speed_hz = 3125000, /* max spi clock (SCK) speed in HZ */ 356 .max_speed_hz = 3125000, /* max spi clock (SCK) speed in HZ */
353 .bus_num = 0, 357 .bus_num = 0,
354 .chip_select = CONFIG_SND_BLACKFIN_SPI_PFBIT, 358 .chip_select = CONFIG_SND_BLACKFIN_SPI_PFBIT,
355 .controller_data = &ad1836_spi_chip_info, 359 .controller_data = &ad1836_spi_chip_info,
356 }, 360 },
357#endif 361#endif
358#if defined(CONFIG_AD9960) || defined(CONFIG_AD9960_MODULE)
359 {
360 .modalias = "ad9960-spi",
361 .max_speed_hz = 10000000, /* max spi clock (SCK) speed in HZ */
362 .bus_num = 0,
363 .chip_select = 1,
364 .controller_data = &ad9960_spi_chip_info,
365 },
366#endif
367#if defined(CONFIG_MMC_SPI) || defined(CONFIG_MMC_SPI_MODULE) 362#if defined(CONFIG_MMC_SPI) || defined(CONFIG_MMC_SPI_MODULE)
368 { 363 {
369 .modalias = "mmc_spi", 364 .modalias = "mmc_spi",
diff --git a/arch/blackfin/mach-bf537/boards/stamp.c b/arch/blackfin/mach-bf537/boards/stamp.c
index bd656907b8c0..9db6b40743e0 100644
--- a/arch/blackfin/mach-bf537/boards/stamp.c
+++ b/arch/blackfin/mach-bf537/boards/stamp.c
@@ -171,6 +171,14 @@ static struct platform_device rtc_device = {
171#endif 171#endif
172 172
173#if defined(CONFIG_SMC91X) || defined(CONFIG_SMC91X_MODULE) 173#if defined(CONFIG_SMC91X) || defined(CONFIG_SMC91X_MODULE)
174#include <linux/smc91x.h>
175
176static struct smc91x_platdata smc91x_info = {
177 .flags = SMC91X_USE_16BIT | SMC91X_NOWAIT,
178 .leda = RPC_LED_100_10,
179 .ledb = RPC_LED_TX_RX,
180};
181
174static struct resource smc91x_resources[] = { 182static struct resource smc91x_resources[] = {
175 { 183 {
176 .name = "smc91x-regs", 184 .name = "smc91x-regs",
@@ -189,6 +197,9 @@ static struct platform_device smc91x_device = {
189 .id = 0, 197 .id = 0,
190 .num_resources = ARRAY_SIZE(smc91x_resources), 198 .num_resources = ARRAY_SIZE(smc91x_resources),
191 .resource = smc91x_resources, 199 .resource = smc91x_resources,
200 .dev = {
201 .platform_data = &smc91x_info,
202 },
192}; 203};
193#endif 204#endif
194 205
@@ -196,10 +207,15 @@ static struct platform_device smc91x_device = {
196static struct resource dm9000_resources[] = { 207static struct resource dm9000_resources[] = {
197 [0] = { 208 [0] = {
198 .start = 0x203FB800, 209 .start = 0x203FB800,
199 .end = 0x203FB800 + 8, 210 .end = 0x203FB800 + 1,
200 .flags = IORESOURCE_MEM, 211 .flags = IORESOURCE_MEM,
201 }, 212 },
202 [1] = { 213 [1] = {
214 .start = 0x203FB804,
215 .end = 0x203FB804 + 1,
216 .flags = IORESOURCE_MEM,
217 },
218 [2] = {
203 .start = IRQ_PF9, 219 .start = IRQ_PF9,
204 .end = IRQ_PF9, 220 .end = IRQ_PF9,
205 .flags = (IORESOURCE_IRQ | IORESOURCE_IRQ_HIGHEDGE), 221 .flags = (IORESOURCE_IRQ | IORESOURCE_IRQ_HIGHEDGE),
@@ -516,19 +532,135 @@ static struct bfin5xx_spi_chip spi_adc_chip_info = {
516}; 532};
517#endif 533#endif
518 534
519#if defined(CONFIG_SND_BLACKFIN_AD1836) \ 535#if defined(CONFIG_SND_BF5XX_SOC_AD1836) \
520 || defined(CONFIG_SND_BLACKFIN_AD1836_MODULE) 536 || defined(CONFIG_SND_BF5XX_SOC_AD1836_MODULE)
521static struct bfin5xx_spi_chip ad1836_spi_chip_info = { 537static struct bfin5xx_spi_chip ad1836_spi_chip_info = {
522 .enable_dma = 0, 538 .enable_dma = 0,
523 .bits_per_word = 16, 539 .bits_per_word = 16,
524}; 540};
525#endif 541#endif
526 542
527#if defined(CONFIG_AD9960) || defined(CONFIG_AD9960_MODULE) 543#if defined(CONFIG_SND_BF5XX_SOC_AD1938) \
528static struct bfin5xx_spi_chip ad9960_spi_chip_info = { 544 || defined(CONFIG_SND_BF5XX_SOC_AD1938_MODULE)
545static struct bfin5xx_spi_chip ad1938_spi_chip_info = {
546 .enable_dma = 0,
547 .bits_per_word = 8,
548 .cs_gpio = GPIO_PF5,
549};
550#endif
551
552#if defined(CONFIG_INPUT_EVAL_AD7147EBZ)
553#include <linux/input.h>
554#include <linux/input/ad714x.h>
555static struct bfin5xx_spi_chip ad7147_spi_chip_info = {
529 .enable_dma = 0, 556 .enable_dma = 0,
530 .bits_per_word = 16, 557 .bits_per_word = 16,
531}; 558};
559
560static struct ad714x_slider_plat slider_plat[] = {
561 {
562 .start_stage = 0,
563 .end_stage = 7,
564 .max_coord = 128,
565 },
566};
567
568static struct ad714x_button_plat button_plat[] = {
569 {
570 .keycode = BTN_FORWARD,
571 .l_mask = 0,
572 .h_mask = 0x600,
573 },
574 {
575 .keycode = BTN_LEFT,
576 .l_mask = 0,
577 .h_mask = 0x500,
578 },
579 {
580 .keycode = BTN_MIDDLE,
581 .l_mask = 0,
582 .h_mask = 0x800,
583 },
584 {
585 .keycode = BTN_RIGHT,
586 .l_mask = 0x100,
587 .h_mask = 0x400,
588 },
589 {
590 .keycode = BTN_BACK,
591 .l_mask = 0x200,
592 .h_mask = 0x400,
593 },
594};
595static struct ad714x_platform_data ad7147_platfrom_data = {
596 .slider_num = 1,
597 .button_num = 5,
598 .slider = slider_plat,
599 .button = button_plat,
600 .stage_cfg_reg = {
601 {0xFBFF, 0x1FFF, 0, 0x2626, 1600, 1600, 1600, 1600},
602 {0xEFFF, 0x1FFF, 0, 0x2626, 1650, 1650, 1650, 1650},
603 {0xFFFF, 0x1FFE, 0, 0x2626, 1650, 1650, 1650, 1650},
604 {0xFFFF, 0x1FFB, 0, 0x2626, 1650, 1650, 1650, 1650},
605 {0xFFFF, 0x1FEF, 0, 0x2626, 1650, 1650, 1650, 1650},
606 {0xFFFF, 0x1FBF, 0, 0x2626, 1650, 1650, 1650, 1650},
607 {0xFFFF, 0x1EFF, 0, 0x2626, 1650, 1650, 1650, 1650},
608 {0xFFFF, 0x1BFF, 0, 0x2626, 1600, 1600, 1600, 1600},
609 {0xFF7B, 0x3FFF, 0x506, 0x2626, 1100, 1100, 1150, 1150},
610 {0xFDFE, 0x3FFF, 0x606, 0x2626, 1100, 1100, 1150, 1150},
611 {0xFEBA, 0x1FFF, 0x1400, 0x2626, 1200, 1200, 1300, 1300},
612 {0xFFEF, 0x1FFF, 0x0, 0x2626, 1100, 1100, 1150, 1150},
613 },
614 .sys_cfg_reg = {0x2B2, 0x0, 0x3233, 0x819, 0x832, 0xCFF, 0xCFF, 0x0},
615};
616#endif
617
618#if defined(CONFIG_INPUT_EVAL_AD7142EB)
619#include <linux/input.h>
620#include <linux/input/ad714x.h>
621static struct ad714x_button_plat button_plat[] = {
622 {
623 .keycode = BTN_1,
624 .l_mask = 0,
625 .h_mask = 0x1,
626 },
627 {
628 .keycode = BTN_2,
629 .l_mask = 0,
630 .h_mask = 0x2,
631 },
632 {
633 .keycode = BTN_3,
634 .l_mask = 0,
635 .h_mask = 0x4,
636 },
637 {
638 .keycode = BTN_4,
639 .l_mask = 0x0,
640 .h_mask = 0x8,
641 },
642};
643static struct ad714x_platform_data ad7142_platfrom_data = {
644 .button_num = 4,
645 .button = button_plat,
646 .stage_cfg_reg = {
647 /* fixme: figure out right setting for all comoponent according
648 * to hardware feature of EVAL-AD7142EB board */
649 {0xE7FF, 0x3FFF, 0x0005, 0x2626, 0x01F4, 0x01F4, 0x028A, 0x028A},
650 {0xFDBF, 0x3FFF, 0x0001, 0x2626, 0x01F4, 0x01F4, 0x028A, 0x028A},
651 {0xFFFF, 0x2DFF, 0x0001, 0x2626, 0x01F4, 0x01F4, 0x028A, 0x028A},
652 {0xFFFF, 0x37BF, 0x0001, 0x2626, 0x01F4, 0x01F4, 0x028A, 0x028A},
653 {0xFFFF, 0x3FFF, 0x0000, 0x0606, 0x01F4, 0x01F4, 0x0320, 0x0320},
654 {0xFFFF, 0x3FFF, 0x0000, 0x0606, 0x01F4, 0x01F4, 0x0320, 0x0320},
655 {0xFFFF, 0x3FFF, 0x0000, 0x0606, 0x01F4, 0x01F4, 0x0320, 0x0320},
656 {0xFFFF, 0x3FFF, 0x0000, 0x0606, 0x01F4, 0x01F4, 0x0320, 0x0320},
657 {0xFFFF, 0x3FFF, 0x0000, 0x0606, 0x01F4, 0x01F4, 0x0320, 0x0320},
658 {0xFFFF, 0x3FFF, 0x0000, 0x0606, 0x01F4, 0x01F4, 0x0320, 0x0320},
659 {0xFFFF, 0x3FFF, 0x0000, 0x0606, 0x01F4, 0x01F4, 0x0320, 0x0320},
660 {0xFFFF, 0x3FFF, 0x0000, 0x0606, 0x01F4, 0x01F4, 0x0320, 0x0320},
661 },
662 .sys_cfg_reg = {0x0B2, 0x0, 0x690, 0x664, 0x290F, 0xF, 0xF, 0x0},
663};
532#endif 664#endif
533 665
534#if defined(CONFIG_MMC_SPI) || defined(CONFIG_MMC_SPI_MODULE) 666#if defined(CONFIG_MMC_SPI) || defined(CONFIG_MMC_SPI_MODULE)
@@ -555,15 +687,7 @@ static struct mmc_spi_platform_data bfin_mmc_spi_pdata = {
555static struct bfin5xx_spi_chip mmc_spi_chip_info = { 687static struct bfin5xx_spi_chip mmc_spi_chip_info = {
556 .enable_dma = 0, 688 .enable_dma = 0,
557 .bits_per_word = 8, 689 .bits_per_word = 8,
558}; 690 .pio_interrupt = 0,
559#endif
560
561#if defined(CONFIG_PBX)
562static struct bfin5xx_spi_chip spi_si3xxx_chip_info = {
563 .ctl_reg = 0x4, /* send zero */
564 .enable_dma = 0,
565 .bits_per_word = 8,
566 .cs_change_per_word = 1,
567}; 691};
568#endif 692#endif
569 693
@@ -743,25 +867,42 @@ static struct spi_board_info bfin_spi_board_info[] __initdata = {
743 }, 867 },
744#endif 868#endif
745 869
746#if defined(CONFIG_SND_BLACKFIN_AD1836) \ 870#if defined(CONFIG_SND_BF5XX_SOC_AD1836) \
747 || defined(CONFIG_SND_BLACKFIN_AD1836_MODULE) 871 || defined(CONFIG_SND_BF5XX_SOC_AD1836_MODULE)
748 { 872 {
749 .modalias = "ad1836-spi", 873 .modalias = "ad1836",
750 .max_speed_hz = 3125000, /* max spi clock (SCK) speed in HZ */ 874 .max_speed_hz = 3125000, /* max spi clock (SCK) speed in HZ */
751 .bus_num = 0, 875 .bus_num = 0,
752 .chip_select = CONFIG_SND_BLACKFIN_SPI_PFBIT, 876 .chip_select = 4,/* CONFIG_SND_BLACKFIN_SPI_PFBIT */
753 .controller_data = &ad1836_spi_chip_info, 877 .controller_data = &ad1836_spi_chip_info,
878 .mode = SPI_MODE_3,
754 }, 879 },
755#endif 880#endif
756#if defined(CONFIG_AD9960) || defined(CONFIG_AD9960_MODULE) 881
882#if defined(CONFIG_SND_BF5XX_SOC_AD1938) || defined(CONFIG_SND_BF5XX_SOC_AD1938_MODULE)
757 { 883 {
758 .modalias = "ad9960-spi", 884 .modalias = "ad1938",
759 .max_speed_hz = 10000000, /* max spi clock (SCK) speed in HZ */ 885 .max_speed_hz = 3125000, /* max spi clock (SCK) speed in HZ */
760 .bus_num = 0, 886 .bus_num = 0,
761 .chip_select = 1, 887 .chip_select = 0,/* CONFIG_SND_BLACKFIN_SPI_PFBIT */
762 .controller_data = &ad9960_spi_chip_info, 888 .controller_data = &ad1938_spi_chip_info,
889 .mode = SPI_MODE_3,
763 }, 890 },
764#endif 891#endif
892
893#if defined(CONFIG_INPUT_EVAL_AD7147EBZ)
894 {
895 .modalias = "ad714x_captouch",
896 .max_speed_hz = 1000000, /* max spi clock (SCK) speed in HZ */
897 .irq = IRQ_PF4,
898 .bus_num = 0,
899 .chip_select = 5,
900 .mode = SPI_MODE_3,
901 .platform_data = &ad7147_platfrom_data,
902 .controller_data = &ad7147_spi_chip_info,
903 },
904#endif
905
765#if defined(CONFIG_MMC_SPI) || defined(CONFIG_MMC_SPI_MODULE) 906#if defined(CONFIG_MMC_SPI) || defined(CONFIG_MMC_SPI_MODULE)
766 { 907 {
767 .modalias = "mmc_spi", 908 .modalias = "mmc_spi",
@@ -773,24 +914,6 @@ static struct spi_board_info bfin_spi_board_info[] __initdata = {
773 .mode = SPI_MODE_3, 914 .mode = SPI_MODE_3,
774 }, 915 },
775#endif 916#endif
776#if defined(CONFIG_PBX)
777 {
778 .modalias = "fxs-spi",
779 .max_speed_hz = 12500000, /* max spi clock (SCK) speed in HZ */
780 .bus_num = 0,
781 .chip_select = 8 - CONFIG_J11_JUMPER,
782 .controller_data = &spi_si3xxx_chip_info,
783 .mode = SPI_MODE_3,
784 },
785 {
786 .modalias = "fxo-spi",
787 .max_speed_hz = 12500000, /* max spi clock (SCK) speed in HZ */
788 .bus_num = 0,
789 .chip_select = 8 - CONFIG_J19_JUMPER,
790 .controller_data = &spi_si3xxx_chip_info,
791 .mode = SPI_MODE_3,
792 },
793#endif
794#if defined(CONFIG_TOUCHSCREEN_AD7877) || defined(CONFIG_TOUCHSCREEN_AD7877_MODULE) 917#if defined(CONFIG_TOUCHSCREEN_AD7877) || defined(CONFIG_TOUCHSCREEN_AD7877_MODULE)
795 { 918 {
796 .modalias = "ad7877", 919 .modalias = "ad7877",
@@ -864,6 +987,11 @@ static struct resource bfin_spi0_resource[] = {
864 [1] = { 987 [1] = {
865 .start = CH_SPI, 988 .start = CH_SPI,
866 .end = CH_SPI, 989 .end = CH_SPI,
990 .flags = IORESOURCE_DMA,
991 },
992 [2] = {
993 .start = IRQ_SPI,
994 .end = IRQ_SPI,
867 .flags = IORESOURCE_IRQ, 995 .flags = IORESOURCE_IRQ,
868 }, 996 },
869}; 997};
@@ -1089,7 +1217,7 @@ static struct platform_device i2c_bfin_twi_device = {
1089 1217
1090#if defined(CONFIG_KEYBOARD_ADP5588) || defined(CONFIG_KEYBOARD_ADP5588_MODULE) 1218#if defined(CONFIG_KEYBOARD_ADP5588) || defined(CONFIG_KEYBOARD_ADP5588_MODULE)
1091#include <linux/input.h> 1219#include <linux/input.h>
1092#include <linux/i2c/adp5588_keys.h> 1220#include <linux/i2c/adp5588.h>
1093static const unsigned short adp5588_keymap[ADP5588_KEYMAPSIZE] = { 1221static const unsigned short adp5588_keymap[ADP5588_KEYMAPSIZE] = {
1094 [0] = KEY_GRAVE, 1222 [0] = KEY_GRAVE,
1095 [1] = KEY_1, 1223 [1] = KEY_1,
@@ -1309,11 +1437,20 @@ static struct adp5520_platform_data adp5520_pdev_data = {
1309 1437
1310#endif 1438#endif
1311 1439
1440#if defined(CONFIG_GPIO_ADP5588) || defined(CONFIG_GPIO_ADP5588_MODULE)
1441#include <linux/i2c/adp5588.h>
1442static struct adp5588_gpio_platfrom_data adp5588_gpio_data = {
1443 .gpio_start = 50,
1444 .pullup_dis_mask = 0,
1445};
1446#endif
1447
1312static struct i2c_board_info __initdata bfin_i2c_board_info[] = { 1448static struct i2c_board_info __initdata bfin_i2c_board_info[] = {
1313#if defined(CONFIG_JOYSTICK_AD7142) || defined(CONFIG_JOYSTICK_AD7142_MODULE) 1449#if defined(CONFIG_INPUT_EVAL_AD7142EB)
1314 { 1450 {
1315 I2C_BOARD_INFO("ad7142_joystick", 0x2C), 1451 I2C_BOARD_INFO("ad7142_captouch", 0x2C),
1316 .irq = IRQ_PG5, 1452 .irq = IRQ_PG5,
1453 .platform_data = (void *)&ad7142_platfrom_data,
1317 }, 1454 },
1318#endif 1455#endif
1319#if defined(CONFIG_BFIN_TWI_LCD) || defined(CONFIG_BFIN_TWI_LCD_MODULE) 1456#if defined(CONFIG_BFIN_TWI_LCD) || defined(CONFIG_BFIN_TWI_LCD_MODULE)
@@ -1321,7 +1458,7 @@ static struct i2c_board_info __initdata bfin_i2c_board_info[] = {
1321 I2C_BOARD_INFO("pcf8574_lcd", 0x22), 1458 I2C_BOARD_INFO("pcf8574_lcd", 0x22),
1322 }, 1459 },
1323#endif 1460#endif
1324#if defined(CONFIG_TWI_KEYPAD) || defined(CONFIG_TWI_KEYPAD_MODULE) 1461#if defined(CONFIG_INPUT_PCF8574) || defined(CONFIG_INPUT_PCF8574_MODULE)
1325 { 1462 {
1326 I2C_BOARD_INFO("pcf8574_keypad", 0x27), 1463 I2C_BOARD_INFO("pcf8574_keypad", 0x27),
1327 .irq = IRQ_PG6, 1464 .irq = IRQ_PG6,
@@ -1355,6 +1492,12 @@ static struct i2c_board_info __initdata bfin_i2c_board_info[] = {
1355 .platform_data = (void *)&adxl34x_info, 1492 .platform_data = (void *)&adxl34x_info,
1356 }, 1493 },
1357#endif 1494#endif
1495#if defined(CONFIG_GPIO_ADP5588) || defined(CONFIG_GPIO_ADP5588_MODULE)
1496 {
1497 I2C_BOARD_INFO("adp5588-gpio", 0x34),
1498 .platform_data = (void *)&adp5588_gpio_data,
1499 },
1500#endif
1358}; 1501};
1359 1502
1360#if defined(CONFIG_SERIAL_BFIN_SPORT) || defined(CONFIG_SERIAL_BFIN_SPORT_MODULE) 1503#if defined(CONFIG_SERIAL_BFIN_SPORT) || defined(CONFIG_SERIAL_BFIN_SPORT_MODULE)
@@ -1456,6 +1599,13 @@ static struct platform_device bfin_dpmc = {
1456 }, 1599 },
1457}; 1600};
1458 1601
1602#if defined(CONFIG_SND_BF5XX_TDM) || defined(CONFIG_SND_BF5XX_TDM_MODULE)
1603static struct platform_device bfin_tdm = {
1604 .name = "bfin-tdm",
1605 /* TODO: add platform data here */
1606};
1607#endif
1608
1459static struct platform_device *stamp_devices[] __initdata = { 1609static struct platform_device *stamp_devices[] __initdata = {
1460 1610
1461 &bfin_dpmc, 1611 &bfin_dpmc,
@@ -1561,6 +1711,10 @@ static struct platform_device *stamp_devices[] __initdata = {
1561#if defined(CONFIG_MTD_PHYSMAP) || defined(CONFIG_MTD_PHYSMAP_MODULE) 1711#if defined(CONFIG_MTD_PHYSMAP) || defined(CONFIG_MTD_PHYSMAP_MODULE)
1562 &stamp_flash_device, 1712 &stamp_flash_device,
1563#endif 1713#endif
1714
1715#if defined(CONFIG_SND_BF5XX_TDM) || defined(CONFIG_SND_BF5XX_TDM_MODULE)
1716 &bfin_tdm,
1717#endif
1564}; 1718};
1565 1719
1566static int __init stamp_init(void) 1720static int __init stamp_init(void)
@@ -1572,11 +1726,6 @@ static int __init stamp_init(void)
1572 platform_add_devices(stamp_devices, ARRAY_SIZE(stamp_devices)); 1726 platform_add_devices(stamp_devices, ARRAY_SIZE(stamp_devices));
1573 spi_register_board_info(bfin_spi_board_info, ARRAY_SIZE(bfin_spi_board_info)); 1727 spi_register_board_info(bfin_spi_board_info, ARRAY_SIZE(bfin_spi_board_info));
1574 1728
1575#if (defined(CONFIG_PATA_PLATFORM) || defined(CONFIG_PATA_PLATFORM_MODULE)) \
1576 && defined(PATA_INT)
1577 irq_desc[PATA_INT].status |= IRQ_NOAUTOEN;
1578#endif
1579
1580 return 0; 1729 return 0;
1581} 1730}
1582 1731
diff --git a/arch/blackfin/mach-bf537/boards/tcm_bf537.c b/arch/blackfin/mach-bf537/boards/tcm_bf537.c
index e523e6e610d0..61353f7bcb9e 100644
--- a/arch/blackfin/mach-bf537/boards/tcm_bf537.c
+++ b/arch/blackfin/mach-bf537/boards/tcm_bf537.c
@@ -45,6 +45,7 @@
45#include <asm/bfin5xx_spi.h> 45#include <asm/bfin5xx_spi.h>
46#include <asm/portmux.h> 46#include <asm/portmux.h>
47#include <asm/dpmc.h> 47#include <asm/dpmc.h>
48#include <linux/spi/mmc_spi.h>
48 49
49/* 50/*
50 * Name the Board for the /proc/cpuinfo 51 * Name the Board for the /proc/cpuinfo
@@ -101,13 +102,6 @@ static struct bfin5xx_spi_chip ad1836_spi_chip_info = {
101}; 102};
102#endif 103#endif
103 104
104#if defined(CONFIG_AD9960) || defined(CONFIG_AD9960_MODULE)
105static struct bfin5xx_spi_chip ad9960_spi_chip_info = {
106 .enable_dma = 0,
107 .bits_per_word = 16,
108};
109#endif
110
111#if defined(CONFIG_MMC_SPI) || defined(CONFIG_MMC_SPI_MODULE) 105#if defined(CONFIG_MMC_SPI) || defined(CONFIG_MMC_SPI_MODULE)
112static struct bfin5xx_spi_chip mmc_spi_chip_info = { 106static struct bfin5xx_spi_chip mmc_spi_chip_info = {
113 .enable_dma = 0, 107 .enable_dma = 0,
@@ -142,7 +136,7 @@ static struct spi_board_info bfin_spi_board_info[] __initdata = {
142 136
143#if defined(CONFIG_SND_BLACKFIN_AD1836) || defined(CONFIG_SND_BLACKFIN_AD1836_MODULE) 137#if defined(CONFIG_SND_BLACKFIN_AD1836) || defined(CONFIG_SND_BLACKFIN_AD1836_MODULE)
144 { 138 {
145 .modalias = "ad1836-spi", 139 .modalias = "ad1836",
146 .max_speed_hz = 3125000, /* max spi clock (SCK) speed in HZ */ 140 .max_speed_hz = 3125000, /* max spi clock (SCK) speed in HZ */
147 .bus_num = 0, 141 .bus_num = 0,
148 .chip_select = CONFIG_SND_BLACKFIN_SPI_PFBIT, 142 .chip_select = CONFIG_SND_BLACKFIN_SPI_PFBIT,
@@ -150,22 +144,12 @@ static struct spi_board_info bfin_spi_board_info[] __initdata = {
150 }, 144 },
151#endif 145#endif
152 146
153#if defined(CONFIG_AD9960) || defined(CONFIG_AD9960_MODULE)
154 {
155 .modalias = "ad9960-spi",
156 .max_speed_hz = 10000000, /* max spi clock (SCK) speed in HZ */
157 .bus_num = 0,
158 .chip_select = 1,
159 .controller_data = &ad9960_spi_chip_info,
160 },
161#endif
162
163#if defined(CONFIG_MMC_SPI) || defined(CONFIG_MMC_SPI_MODULE) 147#if defined(CONFIG_MMC_SPI) || defined(CONFIG_MMC_SPI_MODULE)
164 { 148 {
165 .modalias = "mmc_spi", 149 .modalias = "mmc_spi",
166 .max_speed_hz = 25000000, /* max spi clock (SCK) speed in HZ */ 150 .max_speed_hz = 25000000, /* max spi clock (SCK) speed in HZ */
167 .bus_num = 0, 151 .bus_num = 0,
168 .chip_select = 5, 152 .chip_select = 1,
169 .controller_data = &mmc_spi_chip_info, 153 .controller_data = &mmc_spi_chip_info,
170 .mode = SPI_MODE_3, 154 .mode = SPI_MODE_3,
171 }, 155 },
@@ -223,6 +207,14 @@ static struct platform_device hitachi_fb_device = {
223#endif 207#endif
224 208
225#if defined(CONFIG_SMC91X) || defined(CONFIG_SMC91X_MODULE) 209#if defined(CONFIG_SMC91X) || defined(CONFIG_SMC91X_MODULE)
210#include <linux/smc91x.h>
211
212static struct smc91x_platdata smc91x_info = {
213 .flags = SMC91X_USE_16BIT | SMC91X_NOWAIT,
214 .leda = RPC_LED_100_10,
215 .ledb = RPC_LED_TX_RX,
216};
217
226static struct resource smc91x_resources[] = { 218static struct resource smc91x_resources[] = {
227 { 219 {
228 .start = 0x20200300, 220 .start = 0x20200300,
@@ -240,6 +232,9 @@ static struct platform_device smc91x_device = {
240 .id = 0, 232 .id = 0,
241 .num_resources = ARRAY_SIZE(smc91x_resources), 233 .num_resources = ARRAY_SIZE(smc91x_resources),
242 .resource = smc91x_resources, 234 .resource = smc91x_resources,
235 .dev = {
236 .platform_data = &smc91x_info,
237 },
243}; 238};
244#endif 239#endif
245 240
@@ -285,12 +280,12 @@ static struct platform_device isp1362_hcd_device = {
285#if defined(CONFIG_USB_NET2272) || defined(CONFIG_USB_NET2272_MODULE) 280#if defined(CONFIG_USB_NET2272) || defined(CONFIG_USB_NET2272_MODULE)
286static struct resource net2272_bfin_resources[] = { 281static struct resource net2272_bfin_resources[] = {
287 { 282 {
288 .start = 0x20200000, 283 .start = 0x20300000,
289 .end = 0x20200000 + 0x100, 284 .end = 0x20300000 + 0x100,
290 .flags = IORESOURCE_MEM, 285 .flags = IORESOURCE_MEM,
291 }, { 286 }, {
292 .start = IRQ_PH14, 287 .start = IRQ_PG13,
293 .end = IRQ_PH14, 288 .end = IRQ_PG13,
294 .flags = IORESOURCE_IRQ | IORESOURCE_IRQ_HIGHLEVEL, 289 .flags = IORESOURCE_IRQ | IORESOURCE_IRQ_HIGHLEVEL,
295 }, 290 },
296}; 291};
@@ -324,7 +319,7 @@ static struct mtd_partition cm_partitions[] = {
324 .offset = 0, 319 .offset = 0,
325 }, { 320 }, {
326 .name = "linux kernel(nor)", 321 .name = "linux kernel(nor)",
327 .size = 0xE0000, 322 .size = 0x100000,
328 .offset = MTDPART_OFS_APPEND, 323 .offset = MTDPART_OFS_APPEND,
329 }, { 324 }, {
330 .name = "file system(nor)", 325 .name = "file system(nor)",
diff --git a/arch/blackfin/mach-bf537/dma.c b/arch/blackfin/mach-bf537/dma.c
index 81185051de91..d23fc0edf2b9 100644
--- a/arch/blackfin/mach-bf537/dma.c
+++ b/arch/blackfin/mach-bf537/dma.c
@@ -96,12 +96,12 @@ int channel2irq(unsigned int channel)
96 ret_irq = IRQ_SPI; 96 ret_irq = IRQ_SPI;
97 break; 97 break;
98 98
99 case CH_UART_RX: 99 case CH_UART0_RX:
100 ret_irq = IRQ_UART_RX; 100 ret_irq = IRQ_UART0_RX;
101 break; 101 break;
102 102
103 case CH_UART_TX: 103 case CH_UART0_TX:
104 ret_irq = IRQ_UART_TX; 104 ret_irq = IRQ_UART0_TX;
105 break; 105 break;
106 106
107 case CH_MEM_STREAM0_SRC: 107 case CH_MEM_STREAM0_SRC:
diff --git a/arch/blackfin/mach-bf537/include/mach/anomaly.h b/arch/blackfin/mach-bf537/include/mach/anomaly.h
index e66aa131f517..f091ad2d8ea8 100644
--- a/arch/blackfin/mach-bf537/include/mach/anomaly.h
+++ b/arch/blackfin/mach-bf537/include/mach/anomaly.h
@@ -143,7 +143,7 @@
143/* Possible RETS Register Corruption when Subroutine Is under 5 Cycles in Duration */ 143/* Possible RETS Register Corruption when Subroutine Is under 5 Cycles in Duration */
144#define ANOMALY_05000371 (1) 144#define ANOMALY_05000371 (1)
145/* SSYNC Stalls Processor when Executed from Non-Cacheable Memory */ 145/* SSYNC Stalls Processor when Executed from Non-Cacheable Memory */
146#define ANOMALY_05000402 (__SILICON_REVISION__ >= 5) 146#define ANOMALY_05000402 (__SILICON_REVISION__ == 2)
147/* Level-Sensitive External GPIO Wakeups May Cause Indefinite Stall */ 147/* Level-Sensitive External GPIO Wakeups May Cause Indefinite Stall */
148#define ANOMALY_05000403 (1) 148#define ANOMALY_05000403 (1)
149/* Speculative Fetches Can Cause Undesired External FIFO Operations */ 149/* Speculative Fetches Can Cause Undesired External FIFO Operations */
diff --git a/arch/blackfin/mach-bf537/include/mach/blackfin.h b/arch/blackfin/mach-bf537/include/mach/blackfin.h
index f5e5015ad831..9ee8834c8f1a 100644
--- a/arch/blackfin/mach-bf537/include/mach/blackfin.h
+++ b/arch/blackfin/mach-bf537/include/mach/blackfin.h
@@ -45,96 +45,11 @@
45#if !defined(__ASSEMBLY__) 45#if !defined(__ASSEMBLY__)
46#include "cdefBF534.h" 46#include "cdefBF534.h"
47 47
48/* UART 0*/
49#define bfin_read_UART_THR() bfin_read_UART0_THR()
50#define bfin_write_UART_THR(val) bfin_write_UART0_THR(val)
51#define bfin_read_UART_RBR() bfin_read_UART0_RBR()
52#define bfin_write_UART_RBR(val) bfin_write_UART0_RBR(val)
53#define bfin_read_UART_DLL() bfin_read_UART0_DLL()
54#define bfin_write_UART_DLL(val) bfin_write_UART0_DLL(val)
55#define bfin_read_UART_IER() bfin_read_UART0_IER()
56#define bfin_write_UART_IER(val) bfin_write_UART0_IER(val)
57#define bfin_read_UART_DLH() bfin_read_UART0_DLH()
58#define bfin_write_UART_DLH(val) bfin_write_UART0_DLH(val)
59#define bfin_read_UART_IIR() bfin_read_UART0_IIR()
60#define bfin_write_UART_IIR(val) bfin_write_UART0_IIR(val)
61#define bfin_read_UART_LCR() bfin_read_UART0_LCR()
62#define bfin_write_UART_LCR(val) bfin_write_UART0_LCR(val)
63#define bfin_read_UART_MCR() bfin_read_UART0_MCR()
64#define bfin_write_UART_MCR(val) bfin_write_UART0_MCR(val)
65#define bfin_read_UART_LSR() bfin_read_UART0_LSR()
66#define bfin_write_UART_LSR(val) bfin_write_UART0_LSR(val)
67#define bfin_read_UART_SCR() bfin_read_UART0_SCR()
68#define bfin_write_UART_SCR(val) bfin_write_UART0_SCR(val)
69#define bfin_read_UART_GCTL() bfin_read_UART0_GCTL()
70#define bfin_write_UART_GCTL(val) bfin_write_UART0_GCTL(val)
71
72#if defined(CONFIG_BF537) || defined(CONFIG_BF536) 48#if defined(CONFIG_BF537) || defined(CONFIG_BF536)
73#include "cdefBF537.h" 49#include "cdefBF537.h"
74#endif 50#endif
75#endif 51#endif
76 52
77/* MAP used DEFINES from BF533 to BF537 - so we don't need to change them in the driver, kernel, etc. */
78
79/* UART_IIR Register */
80#define STATUS(x) ((x << 1) & 0x06)
81#define STATUS_P1 0x02
82#define STATUS_P0 0x01
83
84/* DMA Channel */
85#define bfin_read_CH_UART_RX() bfin_read_CH_UART0_RX()
86#define bfin_write_CH_UART_RX(val) bfin_write_CH_UART0_RX(val)
87#define CH_UART_RX CH_UART0_RX
88#define bfin_read_CH_UART_TX() bfin_read_CH_UART0_TX()
89#define bfin_write_CH_UART_TX(val) bfin_write_CH_UART0_TX(val)
90#define CH_UART_TX CH_UART0_TX
91
92/* System Interrupt Controller */
93#define bfin_read_IRQ_UART_RX() bfin_read_IRQ_UART0_RX()
94#define bfin_write_IRQ_UART_RX(val) bfin_write_IRQ_UART0_RX(val)
95#define IRQ_UART_RX IRQ_UART0_RX
96#define bfin_read_IRQ_UART_TX() bfin_read_IRQ_UART0_TX()
97#define bfin_write_IRQ_UART_TX(val) bfin_write_IRQ_UART0_TX(val)
98#define IRQ_UART_TX IRQ_UART0_TX
99#define bfin_read_IRQ_UART_ERROR() bfin_read_IRQ_UART0_ERROR()
100#define bfin_write_IRQ_UART_ERROR(val) bfin_write_IRQ_UART0_ERROR(val)
101#define IRQ_UART_ERROR IRQ_UART0_ERROR
102
103/* MMR Registers*/
104#define bfin_read_UART_THR() bfin_read_UART0_THR()
105#define bfin_write_UART_THR(val) bfin_write_UART0_THR(val)
106#define BFIN_UART_THR UART0_THR
107#define bfin_read_UART_RBR() bfin_read_UART0_RBR()
108#define bfin_write_UART_RBR(val) bfin_write_UART0_RBR(val)
109#define BFIN_UART_RBR UART0_RBR
110#define bfin_read_UART_DLL() bfin_read_UART0_DLL()
111#define bfin_write_UART_DLL(val) bfin_write_UART0_DLL(val)
112#define BFIN_UART_DLL UART0_DLL
113#define bfin_read_UART_IER() bfin_read_UART0_IER()
114#define bfin_write_UART_IER(val) bfin_write_UART0_IER(val)
115#define BFIN_UART_IER UART0_IER
116#define bfin_read_UART_DLH() bfin_read_UART0_DLH()
117#define bfin_write_UART_DLH(val) bfin_write_UART0_DLH(val)
118#define BFIN_UART_DLH UART0_DLH
119#define bfin_read_UART_IIR() bfin_read_UART0_IIR()
120#define bfin_write_UART_IIR(val) bfin_write_UART0_IIR(val)
121#define BFIN_UART_IIR UART0_IIR
122#define bfin_read_UART_LCR() bfin_read_UART0_LCR()
123#define bfin_write_UART_LCR(val) bfin_write_UART0_LCR(val)
124#define BFIN_UART_LCR UART0_LCR
125#define bfin_read_UART_MCR() bfin_read_UART0_MCR()
126#define bfin_write_UART_MCR(val) bfin_write_UART0_MCR(val)
127#define BFIN_UART_MCR UART0_MCR
128#define bfin_read_UART_LSR() bfin_read_UART0_LSR()
129#define bfin_write_UART_LSR(val) bfin_write_UART0_LSR(val)
130#define BFIN_UART_LSR UART0_LSR
131#define bfin_read_UART_SCR() bfin_read_UART0_SCR()
132#define bfin_write_UART_SCR(val) bfin_write_UART0_SCR(val)
133#define BFIN_UART_SCR UART0_SCR
134#define bfin_read_UART_GCTL() bfin_read_UART0_GCTL()
135#define bfin_write_UART_GCTL(val) bfin_write_UART0_GCTL(val)
136#define BFIN_UART_GCTL UART0_GCTL
137
138#define BFIN_UART_NR_PORTS 2 53#define BFIN_UART_NR_PORTS 2
139 54
140#define OFFSET_THR 0x00 /* Transmit Holding register */ 55#define OFFSET_THR 0x00 /* Transmit Holding register */
@@ -150,11 +65,6 @@
150#define OFFSET_SCR 0x1C /* SCR Scratch Register */ 65#define OFFSET_SCR 0x1C /* SCR Scratch Register */
151#define OFFSET_GCTL 0x24 /* Global Control Register */ 66#define OFFSET_GCTL 0x24 /* Global Control Register */
152 67
153/* DPMC*/
154#define bfin_read_STOPCK_OFF() bfin_read_STOPCK()
155#define bfin_write_STOPCK_OFF(val) bfin_write_STOPCK(val)
156#define STOPCK_OFF STOPCK
157
158/* PLL_DIV Masks */ 68/* PLL_DIV Masks */
159#define CCLK_DIV1 CSEL_DIV1 /* CCLK = VCO / 1 */ 69#define CCLK_DIV1 CSEL_DIV1 /* CCLK = VCO / 1 */
160#define CCLK_DIV2 CSEL_DIV2 /* CCLK = VCO / 2 */ 70#define CCLK_DIV2 CSEL_DIV2 /* CCLK = VCO / 2 */
diff --git a/arch/blackfin/mach-bf538/boards/ezkit.c b/arch/blackfin/mach-bf538/boards/ezkit.c
index 57695b4c3c09..f2ac3b0ebf24 100644
--- a/arch/blackfin/mach-bf538/boards/ezkit.c
+++ b/arch/blackfin/mach-bf538/boards/ezkit.c
@@ -31,6 +31,7 @@
31#include <linux/device.h> 31#include <linux/device.h>
32#include <linux/platform_device.h> 32#include <linux/platform_device.h>
33#include <linux/mtd/mtd.h> 33#include <linux/mtd/mtd.h>
34#include <linux/mtd/physmap.h>
34#include <linux/mtd/partitions.h> 35#include <linux/mtd/partitions.h>
35#include <linux/spi/spi.h> 36#include <linux/spi/spi.h>
36#include <linux/spi/flash.h> 37#include <linux/spi/flash.h>
@@ -177,6 +178,14 @@ static struct platform_device bfin_sir2_device = {
177 * Driver needs to know address, irq and flag pin. 178 * Driver needs to know address, irq and flag pin.
178 */ 179 */
179#if defined(CONFIG_SMC91X) || defined(CONFIG_SMC91X_MODULE) 180#if defined(CONFIG_SMC91X) || defined(CONFIG_SMC91X_MODULE)
181#include <linux/smc91x.h>
182
183static struct smc91x_platdata smc91x_info = {
184 .flags = SMC91X_USE_16BIT | SMC91X_NOWAIT,
185 .leda = RPC_LED_100_10,
186 .ledb = RPC_LED_TX_RX,
187};
188
180static struct resource smc91x_resources[] = { 189static struct resource smc91x_resources[] = {
181 { 190 {
182 .name = "smc91x-regs", 191 .name = "smc91x-regs",
@@ -194,6 +203,9 @@ static struct platform_device smc91x_device = {
194 .id = 0, 203 .id = 0,
195 .num_resources = ARRAY_SIZE(smc91x_resources), 204 .num_resources = ARRAY_SIZE(smc91x_resources),
196 .resource = smc91x_resources, 205 .resource = smc91x_resources,
206 .dev = {
207 .platform_data = &smc91x_info,
208 },
197}; 209};
198#endif 210#endif
199 211
@@ -390,6 +402,11 @@ static struct resource bfin_spi2_resource[] = {
390 [1] = { 402 [1] = {
391 .start = CH_SPI2, 403 .start = CH_SPI2,
392 .end = CH_SPI2, 404 .end = CH_SPI2,
405 .flags = IORESOURCE_DMA,
406 },
407 [2] = {
408 .start = IRQ_SPI2,
409 .end = IRQ_SPI2,
393 .flags = IORESOURCE_IRQ, 410 .flags = IORESOURCE_IRQ,
394 } 411 }
395}; 412};
@@ -550,6 +567,50 @@ static struct platform_device bfin_dpmc = {
550 }, 567 },
551}; 568};
552 569
570#if defined(CONFIG_MTD_PHYSMAP) || defined(CONFIG_MTD_PHYSMAP_MODULE)
571static struct mtd_partition ezkit_partitions[] = {
572 {
573 .name = "bootloader(nor)",
574 .size = 0x40000,
575 .offset = 0,
576 }, {
577 .name = "linux kernel(nor)",
578 .size = 0x180000,
579 .offset = MTDPART_OFS_APPEND,
580 }, {
581 .name = "file system(nor)",
582 .size = MTDPART_SIZ_FULL,
583 .offset = MTDPART_OFS_APPEND,
584 }
585};
586
587static struct physmap_flash_data ezkit_flash_data = {
588 .width = 2,
589 .parts = ezkit_partitions,
590 .nr_parts = ARRAY_SIZE(ezkit_partitions),
591};
592
593static struct resource ezkit_flash_resource = {
594 .start = 0x20000000,
595#if defined(CONFIG_SMC91X) || defined(CONFIG_SMC91X_MODULE)
596 .end = 0x202fffff,
597#else
598 .end = 0x203fffff,
599#endif
600 .flags = IORESOURCE_MEM,
601};
602
603static struct platform_device ezkit_flash_device = {
604 .name = "physmap-flash",
605 .id = 0,
606 .dev = {
607 .platform_data = &ezkit_flash_data,
608 },
609 .num_resources = 1,
610 .resource = &ezkit_flash_resource,
611};
612#endif
613
553static struct platform_device *cm_bf538_devices[] __initdata = { 614static struct platform_device *cm_bf538_devices[] __initdata = {
554 615
555 &bfin_dpmc, 616 &bfin_dpmc,
@@ -598,6 +659,10 @@ static struct platform_device *cm_bf538_devices[] __initdata = {
598#endif 659#endif
599 660
600 &bfin_gpios_device, 661 &bfin_gpios_device,
662
663#if defined(CONFIG_MTD_PHYSMAP) || defined(CONFIG_MTD_PHYSMAP_MODULE)
664 &ezkit_flash_device,
665#endif
601}; 666};
602 667
603static int __init ezkit_init(void) 668static int __init ezkit_init(void)
diff --git a/arch/blackfin/mach-bf538/include/mach/anomaly.h b/arch/blackfin/mach-bf538/include/mach/anomaly.h
index 451cf8a82a42..26b76083e14c 100644
--- a/arch/blackfin/mach-bf538/include/mach/anomaly.h
+++ b/arch/blackfin/mach-bf538/include/mach/anomaly.h
@@ -113,7 +113,7 @@
113/* GPIO Pins PC1 and PC4 Can Function as Normal Outputs */ 113/* GPIO Pins PC1 and PC4 Can Function as Normal Outputs */
114#define ANOMALY_05000375 (__SILICON_REVISION__ < 4) 114#define ANOMALY_05000375 (__SILICON_REVISION__ < 4)
115/* SSYNC Stalls Processor when Executed from Non-Cacheable Memory */ 115/* SSYNC Stalls Processor when Executed from Non-Cacheable Memory */
116#define ANOMALY_05000402 (__SILICON_REVISION__ < 4) 116#define ANOMALY_05000402 (__SILICON_REVISION__ == 3)
117/* Level-Sensitive External GPIO Wakeups May Cause Indefinite Stall */ 117/* Level-Sensitive External GPIO Wakeups May Cause Indefinite Stall */
118#define ANOMALY_05000403 (1) 118#define ANOMALY_05000403 (1)
119/* Speculative Fetches Can Cause Undesired External FIFO Operations */ 119/* Speculative Fetches Can Cause Undesired External FIFO Operations */
diff --git a/arch/blackfin/mach-bf538/include/mach/blackfin.h b/arch/blackfin/mach-bf538/include/mach/blackfin.h
index 9496196ac164..5ecee1690957 100644
--- a/arch/blackfin/mach-bf538/include/mach/blackfin.h
+++ b/arch/blackfin/mach-bf538/include/mach/blackfin.h
@@ -47,11 +47,6 @@
47#endif 47#endif
48#endif 48#endif
49 49
50/* UART_IIR Register */
51#define STATUS(x) ((x << 1) & 0x06)
52#define STATUS_P1 0x02
53#define STATUS_P0 0x01
54
55#define BFIN_UART_NR_PORTS 3 50#define BFIN_UART_NR_PORTS 3
56 51
57#define OFFSET_THR 0x00 /* Transmit Holding register */ 52#define OFFSET_THR 0x00 /* Transmit Holding register */
@@ -67,11 +62,6 @@
67#define OFFSET_SCR 0x1C /* SCR Scratch Register */ 62#define OFFSET_SCR 0x1C /* SCR Scratch Register */
68#define OFFSET_GCTL 0x24 /* Global Control Register */ 63#define OFFSET_GCTL 0x24 /* Global Control Register */
69 64
70/* DPMC*/
71#define bfin_read_STOPCK_OFF() bfin_read_STOPCK()
72#define bfin_write_STOPCK_OFF(val) bfin_write_STOPCK(val)
73#define STOPCK_OFF STOPCK
74
75/* PLL_DIV Masks */ 65/* PLL_DIV Masks */
76#define CCLK_DIV1 CSEL_DIV1 /* CCLK = VCO / 1 */ 66#define CCLK_DIV1 CSEL_DIV1 /* CCLK = VCO / 1 */
77#define CCLK_DIV2 CSEL_DIV2 /* CCLK = VCO / 2 */ 67#define CCLK_DIV2 CSEL_DIV2 /* CCLK = VCO / 2 */
diff --git a/arch/blackfin/mach-bf538/include/mach/cdefBF538.h b/arch/blackfin/mach-bf538/include/mach/cdefBF538.h
index 99ca3f4305e2..1de67515dc9d 100644
--- a/arch/blackfin/mach-bf538/include/mach/cdefBF538.h
+++ b/arch/blackfin/mach-bf538/include/mach/cdefBF538.h
@@ -1310,6 +1310,7 @@
1310#define bfin_write_PPI_CONTROL(val) bfin_write16(PPI_CONTROL, val) 1310#define bfin_write_PPI_CONTROL(val) bfin_write16(PPI_CONTROL, val)
1311#define bfin_read_PPI_STATUS() bfin_read16(PPI_STATUS) 1311#define bfin_read_PPI_STATUS() bfin_read16(PPI_STATUS)
1312#define bfin_write_PPI_STATUS(val) bfin_write16(PPI_STATUS, val) 1312#define bfin_write_PPI_STATUS(val) bfin_write16(PPI_STATUS, val)
1313#define bfin_clear_PPI_STATUS() bfin_read_PPI_STATUS()
1313#define bfin_read_PPI_DELAY() bfin_read16(PPI_DELAY) 1314#define bfin_read_PPI_DELAY() bfin_read16(PPI_DELAY)
1314#define bfin_write_PPI_DELAY(val) bfin_write16(PPI_DELAY, val) 1315#define bfin_write_PPI_DELAY(val) bfin_write16(PPI_DELAY, val)
1315#define bfin_read_PPI_COUNT() bfin_read16(PPI_COUNT) 1316#define bfin_read_PPI_COUNT() bfin_read16(PPI_COUNT)
diff --git a/arch/blackfin/mach-bf548/boards/cm_bf548.c b/arch/blackfin/mach-bf548/boards/cm_bf548.c
index f5a3c30a41bd..e565aae11d72 100644
--- a/arch/blackfin/mach-bf548/boards/cm_bf548.c
+++ b/arch/blackfin/mach-bf548/boards/cm_bf548.c
@@ -291,6 +291,8 @@ static struct platform_device bfin_sir3_device = {
291#endif 291#endif
292 292
293#if defined(CONFIG_SMSC911X) || defined(CONFIG_SMSC911X_MODULE) 293#if defined(CONFIG_SMSC911X) || defined(CONFIG_SMSC911X_MODULE)
294#include <linux/smsc911x.h>
295
294static struct resource smsc911x_resources[] = { 296static struct resource smsc911x_resources[] = {
295 { 297 {
296 .name = "smsc911x-memory", 298 .name = "smsc911x-memory",
@@ -304,11 +306,22 @@ static struct resource smsc911x_resources[] = {
304 .flags = IORESOURCE_IRQ | IORESOURCE_IRQ_LOWLEVEL, 306 .flags = IORESOURCE_IRQ | IORESOURCE_IRQ_LOWLEVEL,
305 }, 307 },
306}; 308};
309
310static struct smsc911x_platform_config smsc911x_config = {
311 .flags = SMSC911X_USE_16BIT,
312 .irq_polarity = SMSC911X_IRQ_POLARITY_ACTIVE_LOW,
313 .irq_type = SMSC911X_IRQ_TYPE_OPEN_DRAIN,
314 .phy_interface = PHY_INTERFACE_MODE_MII,
315};
316
307static struct platform_device smsc911x_device = { 317static struct platform_device smsc911x_device = {
308 .name = "smsc911x", 318 .name = "smsc911x",
309 .id = 0, 319 .id = 0,
310 .num_resources = ARRAY_SIZE(smsc911x_resources), 320 .num_resources = ARRAY_SIZE(smsc911x_resources),
311 .resource = smsc911x_resources, 321 .resource = smsc911x_resources,
322 .dev = {
323 .platform_data = &smsc911x_config,
324 },
312}; 325};
313#endif 326#endif
314 327
@@ -473,7 +486,7 @@ static struct mtd_partition para_partitions[] = {
473 .offset = 0, 486 .offset = 0,
474 }, { 487 }, {
475 .name = "linux kernel(nor)", 488 .name = "linux kernel(nor)",
476 .size = 0x400000, 489 .size = 0x100000,
477 .offset = MTDPART_OFS_APPEND, 490 .offset = MTDPART_OFS_APPEND,
478 }, { 491 }, {
479 .name = "file system(nor)", 492 .name = "file system(nor)",
@@ -642,7 +655,7 @@ static struct resource bfin_spi1_resource[] = {
642 655
643/* SPI controller data */ 656/* SPI controller data */
644static struct bfin5xx_spi_master bf54x_spi_master_info0 = { 657static struct bfin5xx_spi_master bf54x_spi_master_info0 = {
645 .num_chipselect = 8, 658 .num_chipselect = 3,
646 .enable_dma = 1, /* master has the ability to do dma transfer */ 659 .enable_dma = 1, /* master has the ability to do dma transfer */
647 .pin_req = {P_SPI0_SCK, P_SPI0_MISO, P_SPI0_MOSI, 0}, 660 .pin_req = {P_SPI0_SCK, P_SPI0_MISO, P_SPI0_MOSI, 0},
648}; 661};
@@ -658,7 +671,7 @@ static struct platform_device bf54x_spi_master0 = {
658}; 671};
659 672
660static struct bfin5xx_spi_master bf54x_spi_master_info1 = { 673static struct bfin5xx_spi_master bf54x_spi_master_info1 = {
661 .num_chipselect = 8, 674 .num_chipselect = 3,
662 .enable_dma = 1, /* master has the ability to do dma transfer */ 675 .enable_dma = 1, /* master has the ability to do dma transfer */
663 .pin_req = {P_SPI1_SCK, P_SPI1_MISO, P_SPI1_MOSI, 0}, 676 .pin_req = {P_SPI1_SCK, P_SPI1_MISO, P_SPI1_MOSI, 0},
664}; 677};
diff --git a/arch/blackfin/mach-bf548/boards/ezkit.c b/arch/blackfin/mach-bf548/boards/ezkit.c
index dc0dd9b2bcef..c66f3801274f 100644
--- a/arch/blackfin/mach-bf548/boards/ezkit.c
+++ b/arch/blackfin/mach-bf548/boards/ezkit.c
@@ -99,8 +99,8 @@ static struct platform_device bfin_isp1760_device = {
99#include <mach/bf54x-lq043.h> 99#include <mach/bf54x-lq043.h>
100 100
101static struct bfin_bf54xfb_mach_info bf54x_lq043_data = { 101static struct bfin_bf54xfb_mach_info bf54x_lq043_data = {
102 .width = 480, 102 .width = 95,
103 .height = 272, 103 .height = 54,
104 .xres = {480, 480, 480}, 104 .xres = {480, 480, 480},
105 .yres = {272, 272, 272}, 105 .yres = {272, 272, 272},
106 .bpp = {24, 24, 24}, 106 .bpp = {24, 24, 24},
@@ -702,7 +702,7 @@ static struct spi_board_info bfin_spi_board_info[] __initdata = {
702#if defined(CONFIG_SND_BLACKFIN_AD1836) \ 702#if defined(CONFIG_SND_BLACKFIN_AD1836) \
703 || defined(CONFIG_SND_BLACKFIN_AD1836_MODULE) 703 || defined(CONFIG_SND_BLACKFIN_AD1836_MODULE)
704 { 704 {
705 .modalias = "ad1836-spi", 705 .modalias = "ad1836",
706 .max_speed_hz = 3125000, /* max spi clock (SCK) speed in HZ */ 706 .max_speed_hz = 3125000, /* max spi clock (SCK) speed in HZ */
707 .bus_num = 1, 707 .bus_num = 1,
708 .chip_select = CONFIG_SND_BLACKFIN_SPI_PFBIT, 708 .chip_select = CONFIG_SND_BLACKFIN_SPI_PFBIT,
@@ -783,7 +783,7 @@ static struct resource bfin_spi1_resource[] = {
783 783
784/* SPI controller data */ 784/* SPI controller data */
785static struct bfin5xx_spi_master bf54x_spi_master_info0 = { 785static struct bfin5xx_spi_master bf54x_spi_master_info0 = {
786 .num_chipselect = 8, 786 .num_chipselect = 3,
787 .enable_dma = 1, /* master has the ability to do dma transfer */ 787 .enable_dma = 1, /* master has the ability to do dma transfer */
788 .pin_req = {P_SPI0_SCK, P_SPI0_MISO, P_SPI0_MOSI, 0}, 788 .pin_req = {P_SPI0_SCK, P_SPI0_MISO, P_SPI0_MOSI, 0},
789}; 789};
@@ -799,7 +799,7 @@ static struct platform_device bf54x_spi_master0 = {
799}; 799};
800 800
801static struct bfin5xx_spi_master bf54x_spi_master_info1 = { 801static struct bfin5xx_spi_master bf54x_spi_master_info1 = {
802 .num_chipselect = 8, 802 .num_chipselect = 3,
803 .enable_dma = 1, /* master has the ability to do dma transfer */ 803 .enable_dma = 1, /* master has the ability to do dma transfer */
804 .pin_req = {P_SPI1_SCK, P_SPI1_MISO, P_SPI1_MOSI, 0}, 804 .pin_req = {P_SPI1_SCK, P_SPI1_MISO, P_SPI1_MOSI, 0},
805}; 805};
@@ -869,7 +869,7 @@ static struct i2c_board_info __initdata bfin_i2c_board_info1[] = {
869 I2C_BOARD_INFO("pcf8574_lcd", 0x22), 869 I2C_BOARD_INFO("pcf8574_lcd", 0x22),
870 }, 870 },
871#endif 871#endif
872#if defined(CONFIG_TWI_KEYPAD) || defined(CONFIG_TWI_KEYPAD_MODULE) 872#if defined(CONFIG_INPUT_PCF8574) || defined(CONFIG_INPUT_PCF8574_MODULE)
873 { 873 {
874 I2C_BOARD_INFO("pcf8574_keypad", 0x27), 874 I2C_BOARD_INFO("pcf8574_keypad", 0x27),
875 .irq = 212, 875 .irq = 212,
diff --git a/arch/blackfin/mach-bf548/dma.c b/arch/blackfin/mach-bf548/dma.c
index 535980652bf6..d9239bc05dd4 100644
--- a/arch/blackfin/mach-bf548/dma.c
+++ b/arch/blackfin/mach-bf548/dma.c
@@ -91,16 +91,16 @@ int channel2irq(unsigned int channel)
91 ret_irq = IRQ_SPI1; 91 ret_irq = IRQ_SPI1;
92 break; 92 break;
93 case CH_UART0_RX: 93 case CH_UART0_RX:
94 ret_irq = IRQ_UART_RX; 94 ret_irq = IRQ_UART0_RX;
95 break; 95 break;
96 case CH_UART0_TX: 96 case CH_UART0_TX:
97 ret_irq = IRQ_UART_TX; 97 ret_irq = IRQ_UART0_TX;
98 break; 98 break;
99 case CH_UART1_RX: 99 case CH_UART1_RX:
100 ret_irq = IRQ_UART_RX; 100 ret_irq = IRQ_UART1_RX;
101 break; 101 break;
102 case CH_UART1_TX: 102 case CH_UART1_TX:
103 ret_irq = IRQ_UART_TX; 103 ret_irq = IRQ_UART1_TX;
104 break; 104 break;
105 case CH_EPPI0: 105 case CH_EPPI0:
106 ret_irq = IRQ_EPPI0; 106 ret_irq = IRQ_EPPI0;
diff --git a/arch/blackfin/mach-bf548/include/mach/anomaly.h b/arch/blackfin/mach-bf548/include/mach/anomaly.h
index cd040fe0bc5c..52b116ae522a 100644
--- a/arch/blackfin/mach-bf548/include/mach/anomaly.h
+++ b/arch/blackfin/mach-bf548/include/mach/anomaly.h
@@ -7,7 +7,7 @@
7 */ 7 */
8 8
9/* This file should be up to date with: 9/* This file should be up to date with:
10 * - Revision H, 01/16/2009; ADSP-BF542/BF544/BF547/BF548/BF549 Blackfin Processor Anomaly List 10 * - Revision I, 07/23/2009; ADSP-BF542/BF544/BF547/BF548/BF549 Blackfin Processor Anomaly List
11 */ 11 */
12 12
13#ifndef _MACH_ANOMALY_H_ 13#ifndef _MACH_ANOMALY_H_
@@ -162,6 +162,8 @@
162#define ANOMALY_05000430 (__SILICON_REVISION__ >= 2) 162#define ANOMALY_05000430 (__SILICON_REVISION__ >= 2)
163/* Incorrect Use of Stack in Lockbox Firmware During Authentication */ 163/* Incorrect Use of Stack in Lockbox Firmware During Authentication */
164#define ANOMALY_05000431 (__SILICON_REVISION__ < 3) 164#define ANOMALY_05000431 (__SILICON_REVISION__ < 3)
165/* SW Breakpoints Ignored Upon Return From Lockbox Authentication */
166#define ANOMALY_05000434 (1)
165/* OTP Write Accesses Not Supported */ 167/* OTP Write Accesses Not Supported */
166#define ANOMALY_05000442 (__SILICON_REVISION__ < 1) 168#define ANOMALY_05000442 (__SILICON_REVISION__ < 1)
167/* IFLUSH Instruction at End of Hardware Loop Causes Infinite Stall */ 169/* IFLUSH Instruction at End of Hardware Loop Causes Infinite Stall */
@@ -176,12 +178,26 @@
176#define ANOMALY_05000449 (__SILICON_REVISION__ == 1) 178#define ANOMALY_05000449 (__SILICON_REVISION__ == 1)
177/* USB DMA Mode 1 Short Packet Data Corruption */ 179/* USB DMA Mode 1 Short Packet Data Corruption */
178#define ANOMALY_05000450 (1) 180#define ANOMALY_05000450 (1)
181/* Incorrect Default Hysteresis Setting for RESET, NMI, and BMODE Signals */
182#define ANOMALY_05000452 (__SILICON_REVISION__ < 1)
179/* USB Receive Interrupt Is Not Generated in DMA Mode 1 */ 183/* USB Receive Interrupt Is Not Generated in DMA Mode 1 */
180#define ANOMALY_05000456 (__SILICON_REVISION__ < 3) 184#define ANOMALY_05000456 (1)
185/* Host DMA Port Responds to Certain Bus Activity Without HOST_CE Assertion */
186#define ANOMALY_05000457 (1)
187/* USB DMA Mode 1 Failure When Multiple USB DMA Channels Are Concurrently Enabled */
188#define ANOMALY_05000460 (1)
181/* False Hardware Error when RETI Points to Invalid Memory */ 189/* False Hardware Error when RETI Points to Invalid Memory */
182#define ANOMALY_05000461 (1) 190#define ANOMALY_05000461 (1)
191/* Synchronization Problem at Startup May Cause SPORT Transmit Channels to Misalign */
192#define ANOMALY_05000462 (1)
193/* USB DMA RX Data Corruption */
194#define ANOMALY_05000463 (1)
195/* USB TX DMA Hang */
196#define ANOMALY_05000464 (1)
183/* USB Rx DMA hang */ 197/* USB Rx DMA hang */
184#define ANOMALY_05000465 (1) 198#define ANOMALY_05000465 (1)
199/* TxPktRdy Bit Not Set for Transmit Endpoint When Core and DMA Access USB Endpoint FIFOs Simultaneously */
200#define ANOMALY_05000466 (1)
185/* Possible RX data corruption when control & data EP FIFOs are accessed via the core */ 201/* Possible RX data corruption when control & data EP FIFOs are accessed via the core */
186#define ANOMALY_05000467 (1) 202#define ANOMALY_05000467 (1)
187 203
@@ -230,6 +246,7 @@
230#define ANOMALY_05000364 (0) 246#define ANOMALY_05000364 (0)
231#define ANOMALY_05000380 (0) 247#define ANOMALY_05000380 (0)
232#define ANOMALY_05000400 (0) 248#define ANOMALY_05000400 (0)
249#define ANOMALY_05000402 (0)
233#define ANOMALY_05000412 (0) 250#define ANOMALY_05000412 (0)
234#define ANOMALY_05000432 (0) 251#define ANOMALY_05000432 (0)
235#define ANOMALY_05000435 (0) 252#define ANOMALY_05000435 (0)
diff --git a/arch/blackfin/mach-bf548/include/mach/blackfin.h b/arch/blackfin/mach-bf548/include/mach/blackfin.h
index 6b97396d817f..318667b2f036 100644
--- a/arch/blackfin/mach-bf548/include/mach/blackfin.h
+++ b/arch/blackfin/mach-bf548/include/mach/blackfin.h
@@ -72,97 +72,8 @@
72#include "cdefBF549.h" 72#include "cdefBF549.h"
73#endif 73#endif
74 74
75/* UART 1*/
76#define bfin_read_UART_THR() bfin_read_UART1_THR()
77#define bfin_write_UART_THR(val) bfin_write_UART1_THR(val)
78#define bfin_read_UART_RBR() bfin_read_UART1_RBR()
79#define bfin_write_UART_RBR(val) bfin_write_UART1_RBR(val)
80#define bfin_read_UART_DLL() bfin_read_UART1_DLL()
81#define bfin_write_UART_DLL(val) bfin_write_UART1_DLL(val)
82#define bfin_read_UART_IER() bfin_read_UART1_IER()
83#define bfin_write_UART_IER(val) bfin_write_UART1_IER(val)
84#define bfin_read_UART_DLH() bfin_read_UART1_DLH()
85#define bfin_write_UART_DLH(val) bfin_write_UART1_DLH(val)
86#define bfin_read_UART_IIR() bfin_read_UART1_IIR()
87#define bfin_write_UART_IIR(val) bfin_write_UART1_IIR(val)
88#define bfin_read_UART_LCR() bfin_read_UART1_LCR()
89#define bfin_write_UART_LCR(val) bfin_write_UART1_LCR(val)
90#define bfin_read_UART_MCR() bfin_read_UART1_MCR()
91#define bfin_write_UART_MCR(val) bfin_write_UART1_MCR(val)
92#define bfin_read_UART_LSR() bfin_read_UART1_LSR()
93#define bfin_write_UART_LSR(val) bfin_write_UART1_LSR(val)
94#define bfin_read_UART_SCR() bfin_read_UART1_SCR()
95#define bfin_write_UART_SCR(val) bfin_write_UART1_SCR(val)
96#define bfin_read_UART_GCTL() bfin_read_UART1_GCTL()
97#define bfin_write_UART_GCTL(val) bfin_write_UART1_GCTL(val)
98
99#endif 75#endif
100 76
101/* MAP used DEFINES from BF533 to BF54x - so we don't need to change
102 * them in the driver, kernel, etc. */
103
104/* UART_IIR Register */
105#define STATUS(x) ((x << 1) & 0x06)
106#define STATUS_P1 0x02
107#define STATUS_P0 0x01
108
109/* UART 0*/
110
111/* DMA Channel */
112#define bfin_read_CH_UART_RX() bfin_read_CH_UART1_RX()
113#define bfin_write_CH_UART_RX(val) bfin_write_CH_UART1_RX(val)
114#define bfin_read_CH_UART_TX() bfin_read_CH_UART1_TX()
115#define bfin_write_CH_UART_TX(val) bfin_write_CH_UART1_TX(val)
116#define CH_UART_RX CH_UART1_RX
117#define CH_UART_TX CH_UART1_TX
118
119/* System Interrupt Controller */
120#define bfin_read_IRQ_UART_RX() bfin_read_IRQ_UART1_RX()
121#define bfin_write_IRQ_UART_RX(val) bfin_write_IRQ_UART1_RX(val)
122#define bfin_read_IRQ_UART_TX() bfin_read_IRQ_UART1_TX()
123#define bfin_write_IRQ_UART_TX(val) bfin_write_IRQ_UART1_TX(val)
124#define bfin_read_IRQ_UART_ERROR() bfin_read_IRQ_UART1_ERROR()
125#define bfin_write_IRQ_UART_ERROR(val) bfin_write_IRQ_UART1_ERROR(val)
126#define IRQ_UART_RX IRQ_UART1_RX
127#define IRQ_UART_TX IRQ_UART1_TX
128#define IRQ_UART_ERROR IRQ_UART1_ERROR
129
130/* MMR Registers*/
131#define bfin_read_UART_THR() bfin_read_UART1_THR()
132#define bfin_write_UART_THR(val) bfin_write_UART1_THR(val)
133#define bfin_read_UART_RBR() bfin_read_UART1_RBR()
134#define bfin_write_UART_RBR(val) bfin_write_UART1_RBR(val)
135#define bfin_read_UART_DLL() bfin_read_UART1_DLL()
136#define bfin_write_UART_DLL(val) bfin_write_UART1_DLL(val)
137#define bfin_read_UART_IER() bfin_read_UART1_IER()
138#define bfin_write_UART_IER(val) bfin_write_UART1_IER(val)
139#define bfin_read_UART_DLH() bfin_read_UART1_DLH()
140#define bfin_write_UART_DLH(val) bfin_write_UART1_DLH(val)
141#define bfin_read_UART_IIR() bfin_read_UART1_IIR()
142#define bfin_write_UART_IIR(val) bfin_write_UART1_IIR(val)
143#define bfin_read_UART_LCR() bfin_read_UART1_LCR()
144#define bfin_write_UART_LCR(val) bfin_write_UART1_LCR(val)
145#define bfin_read_UART_MCR() bfin_read_UART1_MCR()
146#define bfin_write_UART_MCR(val) bfin_write_UART1_MCR(val)
147#define bfin_read_UART_LSR() bfin_read_UART1_LSR()
148#define bfin_write_UART_LSR(val) bfin_write_UART1_LSR(val)
149#define bfin_read_UART_SCR() bfin_read_UART1_SCR()
150#define bfin_write_UART_SCR(val) bfin_write_UART1_SCR(val)
151#define bfin_read_UART_GCTL() bfin_read_UART1_GCTL()
152#define bfin_write_UART_GCTL(val) bfin_write_UART1_GCTL(val)
153
154#define BFIN_UART_THR UART1_THR
155#define BFIN_UART_RBR UART1_RBR
156#define BFIN_UART_DLL UART1_DLL
157#define BFIN_UART_IER UART1_IER
158#define BFIN_UART_DLH UART1_DLH
159#define BFIN_UART_IIR UART1_IIR
160#define BFIN_UART_LCR UART1_LCR
161#define BFIN_UART_MCR UART1_MCR
162#define BFIN_UART_LSR UART1_LSR
163#define BFIN_UART_SCR UART1_SCR
164#define BFIN_UART_GCTL UART1_GCTL
165
166#define BFIN_UART_NR_PORTS 4 77#define BFIN_UART_NR_PORTS 4
167 78
168#define OFFSET_DLL 0x00 /* Divisor Latch (Low-Byte) */ 79#define OFFSET_DLL 0x00 /* Divisor Latch (Low-Byte) */
diff --git a/arch/blackfin/mach-bf561/boards/cm_bf561.c b/arch/blackfin/mach-bf561/boards/cm_bf561.c
index 0c9d72c5f5ba..6577ecfcf11e 100644
--- a/arch/blackfin/mach-bf561/boards/cm_bf561.c
+++ b/arch/blackfin/mach-bf561/boards/cm_bf561.c
@@ -42,6 +42,7 @@
42#include <asm/bfin5xx_spi.h> 42#include <asm/bfin5xx_spi.h>
43#include <asm/portmux.h> 43#include <asm/portmux.h>
44#include <asm/dpmc.h> 44#include <asm/dpmc.h>
45#include <linux/mtd/physmap.h>
45 46
46/* 47/*
47 * Name the Board for the /proc/cpuinfo 48 * Name the Board for the /proc/cpuinfo
@@ -98,13 +99,6 @@ static struct bfin5xx_spi_chip ad1836_spi_chip_info = {
98}; 99};
99#endif 100#endif
100 101
101#if defined(CONFIG_AD9960) || defined(CONFIG_AD9960_MODULE)
102static struct bfin5xx_spi_chip ad9960_spi_chip_info = {
103 .enable_dma = 0,
104 .bits_per_word = 16,
105};
106#endif
107
108#if defined(CONFIG_MMC_SPI) || defined(CONFIG_MMC_SPI_MODULE) 102#if defined(CONFIG_MMC_SPI) || defined(CONFIG_MMC_SPI_MODULE)
109static struct bfin5xx_spi_chip mmc_spi_chip_info = { 103static struct bfin5xx_spi_chip mmc_spi_chip_info = {
110 .enable_dma = 0, 104 .enable_dma = 0,
@@ -139,28 +133,19 @@ static struct spi_board_info bfin_spi_board_info[] __initdata = {
139 133
140#if defined(CONFIG_SND_BLACKFIN_AD1836) || defined(CONFIG_SND_BLACKFIN_AD1836_MODULE) 134#if defined(CONFIG_SND_BLACKFIN_AD1836) || defined(CONFIG_SND_BLACKFIN_AD1836_MODULE)
141 { 135 {
142 .modalias = "ad1836-spi", 136 .modalias = "ad1836",
143 .max_speed_hz = 3125000, /* max spi clock (SCK) speed in HZ */ 137 .max_speed_hz = 3125000, /* max spi clock (SCK) speed in HZ */
144 .bus_num = 0, 138 .bus_num = 0,
145 .chip_select = CONFIG_SND_BLACKFIN_SPI_PFBIT, 139 .chip_select = CONFIG_SND_BLACKFIN_SPI_PFBIT,
146 .controller_data = &ad1836_spi_chip_info, 140 .controller_data = &ad1836_spi_chip_info,
147 }, 141 },
148#endif 142#endif
149#if defined(CONFIG_AD9960) || defined(CONFIG_AD9960_MODULE)
150 {
151 .modalias = "ad9960-spi",
152 .max_speed_hz = 10000000, /* max spi clock (SCK) speed in HZ */
153 .bus_num = 0,
154 .chip_select = 1,
155 .controller_data = &ad9960_spi_chip_info,
156 },
157#endif
158#if defined(CONFIG_MMC_SPI) || defined(CONFIG_MMC_SPI_MODULE) 143#if defined(CONFIG_MMC_SPI) || defined(CONFIG_MMC_SPI_MODULE)
159 { 144 {
160 .modalias = "mmc_spi", 145 .modalias = "mmc_spi",
161 .max_speed_hz = 25000000, /* max spi clock (SCK) speed in HZ */ 146 .max_speed_hz = 20000000, /* max spi clock (SCK) speed in HZ */
162 .bus_num = 0, 147 .bus_num = 0,
163 .chip_select = 5, 148 .chip_select = 1,
164 .controller_data = &mmc_spi_chip_info, 149 .controller_data = &mmc_spi_chip_info,
165 .mode = SPI_MODE_3, 150 .mode = SPI_MODE_3,
166 }, 151 },
@@ -213,6 +198,13 @@ static struct platform_device hitachi_fb_device = {
213 198
214 199
215#if defined(CONFIG_SMC91X) || defined(CONFIG_SMC91X_MODULE) 200#if defined(CONFIG_SMC91X) || defined(CONFIG_SMC91X_MODULE)
201#include <linux/smc91x.h>
202
203static struct smc91x_platdata smc91x_info = {
204 .flags = SMC91X_USE_32BIT | SMC91X_NOWAIT,
205 .leda = RPC_LED_100_10,
206 .ledb = RPC_LED_TX_RX,
207};
216 208
217static struct resource smc91x_resources[] = { 209static struct resource smc91x_resources[] = {
218 { 210 {
@@ -231,6 +223,65 @@ static struct platform_device smc91x_device = {
231 .id = 0, 223 .id = 0,
232 .num_resources = ARRAY_SIZE(smc91x_resources), 224 .num_resources = ARRAY_SIZE(smc91x_resources),
233 .resource = smc91x_resources, 225 .resource = smc91x_resources,
226 .dev = {
227 .platform_data = &smc91x_info,
228 },
229};
230#endif
231
232#if defined(CONFIG_SMSC911X) || defined(CONFIG_SMSC911X_MODULE)
233#include <linux/smsc911x.h>
234
235static struct resource smsc911x_resources[] = {
236 {
237 .name = "smsc911x-memory",
238 .start = 0x24008000,
239 .end = 0x24008000 + 0xFF,
240 .flags = IORESOURCE_MEM,
241 },
242 {
243 .start = IRQ_PF43,
244 .end = IRQ_PF43,
245 .flags = IORESOURCE_IRQ | IORESOURCE_IRQ_LOWLEVEL,
246 },
247};
248
249static struct smsc911x_platform_config smsc911x_config = {
250 .flags = SMSC911X_USE_16BIT,
251 .irq_polarity = SMSC911X_IRQ_POLARITY_ACTIVE_LOW,
252 .irq_type = SMSC911X_IRQ_TYPE_OPEN_DRAIN,
253 .phy_interface = PHY_INTERFACE_MODE_MII,
254};
255
256static struct platform_device smsc911x_device = {
257 .name = "smsc911x",
258 .id = 0,
259 .num_resources = ARRAY_SIZE(smsc911x_resources),
260 .resource = smsc911x_resources,
261 .dev = {
262 .platform_data = &smsc911x_config,
263 },
264};
265#endif
266
267#if defined(CONFIG_USB_NET2272) || defined(CONFIG_USB_NET2272_MODULE)
268static struct resource net2272_bfin_resources[] = {
269 {
270 .start = 0x24000000,
271 .end = 0x24000000 + 0x100,
272 .flags = IORESOURCE_MEM,
273 }, {
274 .start = IRQ_PF45,
275 .end = IRQ_PF45,
276 .flags = IORESOURCE_IRQ | IORESOURCE_IRQ_HIGHLEVEL,
277 },
278};
279
280static struct platform_device net2272_bfin_device = {
281 .name = "net2272",
282 .id = -1,
283 .num_resources = ARRAY_SIZE(net2272_bfin_resources),
284 .resource = net2272_bfin_resources,
234}; 285};
235#endif 286#endif
236 287
@@ -369,6 +420,46 @@ static struct platform_device bfin_pata_device = {
369}; 420};
370#endif 421#endif
371 422
423#if defined(CONFIG_MTD_PHYSMAP) || defined(CONFIG_MTD_PHYSMAP_MODULE)
424static struct mtd_partition para_partitions[] = {
425 {
426 .name = "bootloader(nor)",
427 .size = 0x40000,
428 .offset = 0,
429 }, {
430 .name = "linux kernel(nor)",
431 .size = 0x100000,
432 .offset = MTDPART_OFS_APPEND,
433 }, {
434 .name = "file system(nor)",
435 .size = MTDPART_SIZ_FULL,
436 .offset = MTDPART_OFS_APPEND,
437 }
438};
439
440static struct physmap_flash_data para_flash_data = {
441 .width = 2,
442 .parts = para_partitions,
443 .nr_parts = ARRAY_SIZE(para_partitions),
444};
445
446static struct resource para_flash_resource = {
447 .start = 0x20000000,
448 .end = 0x207fffff,
449 .flags = IORESOURCE_MEM,
450};
451
452static struct platform_device para_flash_device = {
453 .name = "physmap-flash",
454 .id = 0,
455 .dev = {
456 .platform_data = &para_flash_data,
457 },
458 .num_resources = 1,
459 .resource = &para_flash_resource,
460};
461#endif
462
372static const unsigned int cclk_vlev_datasheet[] = 463static const unsigned int cclk_vlev_datasheet[] =
373{ 464{
374 VRPAIR(VLEV_085, 250000000), 465 VRPAIR(VLEV_085, 250000000),
@@ -422,6 +513,14 @@ static struct platform_device *cm_bf561_devices[] __initdata = {
422 &smc91x_device, 513 &smc91x_device,
423#endif 514#endif
424 515
516#if defined(CONFIG_SMSC911X) || defined(CONFIG_SMSC911X_MODULE)
517 &smsc911x_device,
518#endif
519
520#if defined(CONFIG_USB_NET2272) || defined(CONFIG_USB_NET2272_MODULE)
521 &net2272_bfin_device,
522#endif
523
425#if defined(CONFIG_SPI_BFIN) || defined(CONFIG_SPI_BFIN_MODULE) 524#if defined(CONFIG_SPI_BFIN) || defined(CONFIG_SPI_BFIN_MODULE)
426 &bfin_spi0_device, 525 &bfin_spi0_device,
427#endif 526#endif
@@ -430,6 +529,10 @@ static struct platform_device *cm_bf561_devices[] __initdata = {
430 &bfin_pata_device, 529 &bfin_pata_device,
431#endif 530#endif
432 531
532#if defined(CONFIG_MTD_PHYSMAP) || defined(CONFIG_MTD_PHYSMAP_MODULE)
533 &para_flash_device,
534#endif
535
433 &bfin_gpios_device, 536 &bfin_gpios_device,
434}; 537};
435 538
diff --git a/arch/blackfin/mach-bf561/boards/ezkit.c b/arch/blackfin/mach-bf561/boards/ezkit.c
index 4df904f9e90a..caed96bb957e 100644
--- a/arch/blackfin/mach-bf561/boards/ezkit.c
+++ b/arch/blackfin/mach-bf561/boards/ezkit.c
@@ -147,6 +147,14 @@ static struct platform_device net2272_bfin_device = {
147 * Driver needs to know address, irq and flag pin. 147 * Driver needs to know address, irq and flag pin.
148 */ 148 */
149#if defined(CONFIG_SMC91X) || defined(CONFIG_SMC91X_MODULE) 149#if defined(CONFIG_SMC91X) || defined(CONFIG_SMC91X_MODULE)
150#include <linux/smc91x.h>
151
152static struct smc91x_platdata smc91x_info = {
153 .flags = SMC91X_USE_32BIT | SMC91X_NOWAIT,
154 .leda = RPC_LED_100_10,
155 .ledb = RPC_LED_TX_RX,
156};
157
150static struct resource smc91x_resources[] = { 158static struct resource smc91x_resources[] = {
151 { 159 {
152 .name = "smc91x-regs", 160 .name = "smc91x-regs",
@@ -166,6 +174,9 @@ static struct platform_device smc91x_device = {
166 .id = 0, 174 .id = 0,
167 .num_resources = ARRAY_SIZE(smc91x_resources), 175 .num_resources = ARRAY_SIZE(smc91x_resources),
168 .resource = smc91x_resources, 176 .resource = smc91x_resources,
177 .dev = {
178 .platform_data = &smc91x_info,
179 },
169}; 180};
170#endif 181#endif
171 182
@@ -334,7 +345,7 @@ static struct spi_board_info bfin_spi_board_info[] __initdata = {
334#if defined(CONFIG_SND_BLACKFIN_AD1836) \ 345#if defined(CONFIG_SND_BLACKFIN_AD1836) \
335 || defined(CONFIG_SND_BLACKFIN_AD1836_MODULE) 346 || defined(CONFIG_SND_BLACKFIN_AD1836_MODULE)
336 { 347 {
337 .modalias = "ad1836-spi", 348 .modalias = "ad1836",
338 .max_speed_hz = 3125000, /* max spi clock (SCK) speed in HZ */ 349 .max_speed_hz = 3125000, /* max spi clock (SCK) speed in HZ */
339 .bus_num = 0, 350 .bus_num = 0,
340 .chip_select = CONFIG_SND_BLACKFIN_SPI_PFBIT, 351 .chip_select = CONFIG_SND_BLACKFIN_SPI_PFBIT,
diff --git a/arch/blackfin/mach-bf561/include/mach/anomaly.h b/arch/blackfin/mach-bf561/include/mach/anomaly.h
index a5312b2d267e..70da495c9665 100644
--- a/arch/blackfin/mach-bf561/include/mach/anomaly.h
+++ b/arch/blackfin/mach-bf561/include/mach/anomaly.h
@@ -262,6 +262,8 @@
262#define ANOMALY_05000366 (1) 262#define ANOMALY_05000366 (1)
263/* Possible RETS Register Corruption when Subroutine Is under 5 Cycles in Duration */ 263/* Possible RETS Register Corruption when Subroutine Is under 5 Cycles in Duration */
264#define ANOMALY_05000371 (1) 264#define ANOMALY_05000371 (1)
265/* SSYNC Stalls Processor when Executed from Non-Cacheable Memory */
266#define ANOMALY_05000402 (__SILICON_REVISION__ == 4)
265/* Level-Sensitive External GPIO Wakeups May Cause Indefinite Stall */ 267/* Level-Sensitive External GPIO Wakeups May Cause Indefinite Stall */
266#define ANOMALY_05000403 (1) 268#define ANOMALY_05000403 (1)
267/* TESTSET Instruction Causes Data Corruption with Writeback Data Cache Enabled */ 269/* TESTSET Instruction Causes Data Corruption with Writeback Data Cache Enabled */
diff --git a/arch/blackfin/mach-bf561/secondary.S b/arch/blackfin/mach-bf561/secondary.S
index 35280f06b7b6..f72a6af20c4f 100644
--- a/arch/blackfin/mach-bf561/secondary.S
+++ b/arch/blackfin/mach-bf561/secondary.S
@@ -85,16 +85,10 @@ ENTRY(_coreb_trampoline_start)
85 R0 = ~ENICPLB; 85 R0 = ~ENICPLB;
86 R0 = R0 & R1; 86 R0 = R0 & R1;
87 87
88 /* Anomaly 05000125 */ 88 /* Disabling of CPLBs should be proceeded by a CSYNC */
89#ifdef ANOMALY_05000125 89 CSYNC;
90 CLI R2;
91 SSYNC;
92#endif
93 [p0] = R0; 90 [p0] = R0;
94 SSYNC; 91 SSYNC;
95#ifdef ANOMALY_05000125
96 STI R2;
97#endif
98 92
99 /* Turn off the dcache */ 93 /* Turn off the dcache */
100 p0.l = LO(DMEM_CONTROL); 94 p0.l = LO(DMEM_CONTROL);
@@ -103,16 +97,10 @@ ENTRY(_coreb_trampoline_start)
103 R0 = ~ENDCPLB; 97 R0 = ~ENDCPLB;
104 R0 = R0 & R1; 98 R0 = R0 & R1;
105 99
106 /* Anomaly 05000125 */ 100 /* Disabling of CPLBs should be proceeded by a CSYNC */
107#ifdef ANOMALY_05000125 101 CSYNC;
108 CLI R2;
109 SSYNC;
110#endif
111 [p0] = R0; 102 [p0] = R0;
112 SSYNC; 103 SSYNC;
113#ifdef ANOMALY_05000125
114 STI R2;
115#endif
116 104
117 /* in case of double faults, save a few things */ 105 /* in case of double faults, save a few things */
118 p0.l = _init_retx_coreb; 106 p0.l = _init_retx_coreb;
@@ -126,22 +114,22 @@ ENTRY(_coreb_trampoline_start)
126 * below 114 * below
127 */ 115 */
128 GET_PDA(p0, r0); 116 GET_PDA(p0, r0);
129 r7 = [p0 + PDA_RETX]; 117 r7 = [p0 + PDA_DF_RETX];
130 p1.l = _init_saved_retx_coreb; 118 p1.l = _init_saved_retx_coreb;
131 p1.h = _init_saved_retx_coreb; 119 p1.h = _init_saved_retx_coreb;
132 [p1] = r7; 120 [p1] = r7;
133 121
134 r7 = [p0 + PDA_DCPLB]; 122 r7 = [p0 + PDA_DF_DCPLB];
135 p1.l = _init_saved_dcplb_fault_addr_coreb; 123 p1.l = _init_saved_dcplb_fault_addr_coreb;
136 p1.h = _init_saved_dcplb_fault_addr_coreb; 124 p1.h = _init_saved_dcplb_fault_addr_coreb;
137 [p1] = r7; 125 [p1] = r7;
138 126
139 r7 = [p0 + PDA_ICPLB]; 127 r7 = [p0 + PDA_DF_ICPLB];
140 p1.l = _init_saved_icplb_fault_addr_coreb; 128 p1.l = _init_saved_icplb_fault_addr_coreb;
141 p1.h = _init_saved_icplb_fault_addr_coreb; 129 p1.h = _init_saved_icplb_fault_addr_coreb;
142 [p1] = r7; 130 [p1] = r7;
143 131
144 r7 = [p0 + PDA_SEQSTAT]; 132 r7 = [p0 + PDA_DF_SEQSTAT];
145 p1.l = _init_saved_seqstat_coreb; 133 p1.l = _init_saved_seqstat_coreb;
146 p1.h = _init_saved_seqstat_coreb; 134 p1.h = _init_saved_seqstat_coreb;
147 [p1] = r7; 135 [p1] = r7;
diff --git a/arch/blackfin/mach-common/Makefile b/arch/blackfin/mach-common/Makefile
index dd8b2dc97f56..814cb483853b 100644
--- a/arch/blackfin/mach-common/Makefile
+++ b/arch/blackfin/mach-common/Makefile
@@ -6,7 +6,6 @@ obj-y := \
6 cache.o cache-c.o entry.o head.o \ 6 cache.o cache-c.o entry.o head.o \
7 interrupt.o arch_checks.o ints-priority.o 7 interrupt.o arch_checks.o ints-priority.o
8 8
9obj-$(CONFIG_BFIN_ICACHE_LOCK) += lock.o
10obj-$(CONFIG_PM) += pm.o dpmc_modes.o 9obj-$(CONFIG_PM) += pm.o dpmc_modes.o
11obj-$(CONFIG_CPU_FREQ) += cpufreq.o 10obj-$(CONFIG_CPU_FREQ) += cpufreq.o
12obj-$(CONFIG_CPU_VOLTAGE) += dpmc.o 11obj-$(CONFIG_CPU_VOLTAGE) += dpmc.o
diff --git a/arch/blackfin/mach-common/cache-c.c b/arch/blackfin/mach-common/cache-c.c
index b59ce3cb3807..4ebbd78db3a4 100644
--- a/arch/blackfin/mach-common/cache-c.c
+++ b/arch/blackfin/mach-common/cache-c.c
@@ -1,14 +1,16 @@
1/* 1/*
2 * Blackfin cache control code (simpler control-style functions) 2 * Blackfin cache control code (simpler control-style functions)
3 * 3 *
4 * Copyright 2004-2008 Analog Devices Inc. 4 * Copyright 2004-2009 Analog Devices Inc.
5 * 5 *
6 * Enter bugs at http://blackfin.uclinux.org/ 6 * Enter bugs at http://blackfin.uclinux.org/
7 * 7 *
8 * Licensed under the GPL-2 or later. 8 * Licensed under the GPL-2 or later.
9 */ 9 */
10 10
11#include <linux/init.h>
11#include <asm/blackfin.h> 12#include <asm/blackfin.h>
13#include <asm/cplbinit.h>
12 14
13/* Invalidate the Entire Data cache by 15/* Invalidate the Entire Data cache by
14 * clearing DMC[1:0] bits 16 * clearing DMC[1:0] bits
@@ -34,3 +36,43 @@ void blackfin_invalidate_entire_icache(void)
34 SSYNC(); 36 SSYNC();
35} 37}
36 38
39#if defined(CONFIG_BFIN_ICACHE) || defined(CONFIG_BFIN_DCACHE)
40
41static void
42bfin_cache_init(struct cplb_entry *cplb_tbl, unsigned long cplb_addr,
43 unsigned long cplb_data, unsigned long mem_control,
44 unsigned long mem_mask)
45{
46 int i;
47
48 for (i = 0; i < MAX_CPLBS; i++) {
49 bfin_write32(cplb_addr + i * 4, cplb_tbl[i].addr);
50 bfin_write32(cplb_data + i * 4, cplb_tbl[i].data);
51 }
52
53 _enable_cplb(mem_control, mem_mask);
54}
55
56#ifdef CONFIG_BFIN_ICACHE
57void __cpuinit bfin_icache_init(struct cplb_entry *icplb_tbl)
58{
59 bfin_cache_init(icplb_tbl, ICPLB_ADDR0, ICPLB_DATA0, IMEM_CONTROL,
60 (IMC | ENICPLB));
61}
62#endif
63
64#ifdef CONFIG_BFIN_DCACHE
65void __cpuinit bfin_dcache_init(struct cplb_entry *dcplb_tbl)
66{
67 /*
68 * Anomaly notes:
69 * 05000287 - We implement workaround #2 - Change the DMEM_CONTROL
70 * register, so that the port preferences for DAG0 and DAG1 are set
71 * to port B
72 */
73 bfin_cache_init(dcplb_tbl, DCPLB_ADDR0, DCPLB_DATA0, DMEM_CONTROL,
74 (DMEM_CNTR | PORT_PREF0 | (ANOMALY_05000287 ? PORT_PREF1 : 0)));
75}
76#endif
77
78#endif
diff --git a/arch/blackfin/mach-common/entry.S b/arch/blackfin/mach-common/entry.S
index fb1795d5be2a..01af24cde362 100644
--- a/arch/blackfin/mach-common/entry.S
+++ b/arch/blackfin/mach-common/entry.S
@@ -301,27 +301,31 @@ ENTRY(_ex_replaceable)
301 nop; 301 nop;
302 302
303ENTRY(_ex_trap_c) 303ENTRY(_ex_trap_c)
304 /* The only thing that has been saved in this context is
305 * (R7:6,P5:4), ASTAT & SP - don't use anything else
306 */
307
308 GET_PDA(p5, r6);
309
304 /* Make sure we are not in a double fault */ 310 /* Make sure we are not in a double fault */
305 p4.l = lo(IPEND); 311 p4.l = lo(IPEND);
306 p4.h = hi(IPEND); 312 p4.h = hi(IPEND);
307 r7 = [p4]; 313 r7 = [p4];
308 CC = BITTST (r7, 5); 314 CC = BITTST (r7, 5);
309 if CC jump _double_fault; 315 if CC jump _double_fault;
316 [p5 + PDA_EXIPEND] = r7;
310 317
311 /* Call C code (trap_c) to handle the exception, which most 318 /* Call C code (trap_c) to handle the exception, which most
312 * likely involves sending a signal to the current process. 319 * likely involves sending a signal to the current process.
313 * To avoid double faults, lower our priority to IRQ5 first. 320 * To avoid double faults, lower our priority to IRQ5 first.
314 */ 321 */
315 P5.h = _exception_to_level5; 322 r7.h = _exception_to_level5;
316 P5.l = _exception_to_level5; 323 r7.l = _exception_to_level5;
317 p4.l = lo(EVT5); 324 p4.l = lo(EVT5);
318 p4.h = hi(EVT5); 325 p4.h = hi(EVT5);
319 [p4] = p5; 326 [p4] = r7;
320 csync; 327 csync;
321 328
322 GET_PDA(p5, r6);
323#ifndef CONFIG_DEBUG_DOUBLEFAULT
324
325 /* 329 /*
326 * Save these registers, as they are only valid in exception context 330 * Save these registers, as they are only valid in exception context
327 * (where we are now - as soon as we defer to IRQ5, they can change) 331 * (where we are now - as soon as we defer to IRQ5, they can change)
@@ -341,7 +345,10 @@ ENTRY(_ex_trap_c)
341 345
342 r6 = retx; 346 r6 = retx;
343 [p5 + PDA_RETX] = r6; 347 [p5 + PDA_RETX] = r6;
344#endif 348
349 r6 = SEQSTAT;
350 [p5 + PDA_SEQSTAT] = r6;
351
345 /* Save the state of single stepping */ 352 /* Save the state of single stepping */
346 r6 = SYSCFG; 353 r6 = SYSCFG;
347 [p5 + PDA_SYSCFG] = r6; 354 [p5 + PDA_SYSCFG] = r6;
@@ -349,8 +356,7 @@ ENTRY(_ex_trap_c)
349 BITCLR(r6, SYSCFG_SSSTEP_P); 356 BITCLR(r6, SYSCFG_SSSTEP_P);
350 SYSCFG = r6; 357 SYSCFG = r6;
351 358
352 /* Disable all interrupts, but make sure level 5 is enabled so 359 /* Save the current IMASK, since we change in order to jump to level 5 */
353 * we can switch to that level. Save the old mask. */
354 cli r6; 360 cli r6;
355 [p5 + PDA_EXIMASK] = r6; 361 [p5 + PDA_EXIMASK] = r6;
356 362
@@ -358,9 +364,21 @@ ENTRY(_ex_trap_c)
358 p4.h = hi(SAFE_USER_INSTRUCTION); 364 p4.h = hi(SAFE_USER_INSTRUCTION);
359 retx = p4; 365 retx = p4;
360 366
367 /* Disable all interrupts, but make sure level 5 is enabled so
368 * we can switch to that level.
369 */
361 r6 = 0x3f; 370 r6 = 0x3f;
362 sti r6; 371 sti r6;
363 372
373 /* In case interrupts are disabled IPEND[4] (global interrupt disable bit)
374 * clear it (re-enabling interrupts again) by the special sequence of pushing
375 * RETI onto the stack. This way we can lower ourselves to IVG5 even if the
376 * exception was taken after the interrupt handler was called but before it
377 * got a chance to enable global interrupts itself.
378 */
379 [--sp] = reti;
380 sp += 4;
381
364 raise 5; 382 raise 5;
365 jump.s _bfin_return_from_exception; 383 jump.s _bfin_return_from_exception;
366ENDPROC(_ex_trap_c) 384ENDPROC(_ex_trap_c)
@@ -379,8 +397,7 @@ ENTRY(_double_fault)
379 397
380 R5 = [P4]; /* Control Register*/ 398 R5 = [P4]; /* Control Register*/
381 BITCLR(R5,ENICPLB_P); 399 BITCLR(R5,ENICPLB_P);
382 SSYNC; /* SSYNC required before writing to IMEM_CONTROL. */ 400 CSYNC; /* Disabling of CPLBs should be proceeded by a CSYNC */
383 .align 8;
384 [P4] = R5; 401 [P4] = R5;
385 SSYNC; 402 SSYNC;
386 403
@@ -388,8 +405,7 @@ ENTRY(_double_fault)
388 P4.H = HI(DMEM_CONTROL); 405 P4.H = HI(DMEM_CONTROL);
389 R5 = [P4]; 406 R5 = [P4];
390 BITCLR(R5,ENDCPLB_P); 407 BITCLR(R5,ENDCPLB_P);
391 SSYNC; /* SSYNC required before writing to DMEM_CONTROL. */ 408 CSYNC; /* Disabling of CPLBs should be proceeded by a CSYNC */
392 .align 8;
393 [P4] = R5; 409 [P4] = R5;
394 SSYNC; 410 SSYNC;
395 411
@@ -420,47 +436,55 @@ ENDPROC(_double_fault)
420ENTRY(_exception_to_level5) 436ENTRY(_exception_to_level5)
421 SAVE_ALL_SYS 437 SAVE_ALL_SYS
422 438
423 GET_PDA(p4, r7); /* Fetch current PDA */ 439 GET_PDA(p5, r7); /* Fetch current PDA */
424 r6 = [p4 + PDA_RETX]; 440 r6 = [p5 + PDA_RETX];
425 [sp + PT_PC] = r6; 441 [sp + PT_PC] = r6;
426 442
427 r6 = [p4 + PDA_SYSCFG]; 443 r6 = [p5 + PDA_SYSCFG];
428 [sp + PT_SYSCFG] = r6; 444 [sp + PT_SYSCFG] = r6;
429 445
430 /* Restore interrupt mask. We haven't pushed RETI, so this 446 r6 = [p5 + PDA_SEQSTAT]; /* Read back seqstat */
431 * doesn't enable interrupts until we return from this handler. */ 447 [sp + PT_SEQSTAT] = r6;
432 r6 = [p4 + PDA_EXIMASK];
433 sti r6;
434 448
435 /* Restore the hardware error vector. */ 449 /* Restore the hardware error vector. */
436 P5.h = _evt_ivhw; 450 r7.h = _evt_ivhw;
437 P5.l = _evt_ivhw; 451 r7.l = _evt_ivhw;
438 p4.l = lo(EVT5); 452 p4.l = lo(EVT5);
439 p4.h = hi(EVT5); 453 p4.h = hi(EVT5);
440 [p4] = p5; 454 [p4] = r7;
441 csync; 455 csync;
442 456
443 p2.l = lo(IPEND); 457#ifdef CONFIG_DEBUG_DOUBLEFAULT
444 p2.h = hi(IPEND); 458 /* Now that we have the hardware error vector programmed properly
445 csync; 459 * we can re-enable interrupts (IPEND[4]), so if the _trap_c causes
446 r0 = [p2]; /* Read current IPEND */ 460 * another hardware error, we can catch it (self-nesting).
447 [sp + PT_IPEND] = r0; /* Store IPEND */ 461 */
462 [--sp] = reti;
463 sp += 4;
464#endif
465
466 r7 = [p5 + PDA_EXIPEND] /* Read the IPEND from the Exception state */
467 [sp + PT_IPEND] = r7; /* Store IPEND onto the stack */
448 468
449 r0 = sp; /* stack frame pt_regs pointer argument ==> r0 */ 469 r0 = sp; /* stack frame pt_regs pointer argument ==> r0 */
450 SP += -12; 470 SP += -12;
451 call _trap_c; 471 call _trap_c;
452 SP += 12; 472 SP += 12;
453 473
454#ifdef CONFIG_DEBUG_DOUBLEFAULT 474 /* If interrupts were off during the exception (IPEND[4] = 1), turn them off
455 /* Grab ILAT */ 475 * before we return.
456 p2.l = lo(ILAT); 476 */
457 p2.h = hi(ILAT); 477 CC = BITTST(r7, EVT_IRPTEN_P)
458 r0 = [p2]; 478 if !CC jump 1f;
459 r1 = 0x20; /* Did I just cause anther HW error? */ 479 /* this will load a random value into the reti register - but that is OK,
460 r0 = r0 & r1; 480 * since we do restore it to the correct value in the 'RESTORE_ALL_SYS' macro
461 CC = R0 == R1; 481 */
462 if CC JUMP _double_fault; 482 sp += -4;
463#endif 483 reti = [sp++];
4841:
485 /* restore the interrupt mask (IMASK) */
486 r6 = [p5 + PDA_EXIMASK];
487 sti r6;
464 488
465 call _ret_from_exception; 489 call _ret_from_exception;
466 RESTORE_ALL_SYS 490 RESTORE_ALL_SYS
@@ -474,7 +498,7 @@ ENTRY(_trap) /* Exception: 4th entry into system event table(supervisor mode)*/
474 */ 498 */
475 EX_SCRATCH_REG = sp; 499 EX_SCRATCH_REG = sp;
476 GET_PDA_SAFE(sp); 500 GET_PDA_SAFE(sp);
477 sp = [sp + PDA_EXSTACK] 501 sp = [sp + PDA_EXSTACK];
478 /* Try to deal with syscalls quickly. */ 502 /* Try to deal with syscalls quickly. */
479 [--sp] = ASTAT; 503 [--sp] = ASTAT;
480 [--sp] = (R7:6,P5:4); 504 [--sp] = (R7:6,P5:4);
@@ -489,14 +513,7 @@ ENTRY(_trap) /* Exception: 4th entry into system event table(supervisor mode)*/
489 ssync; 513 ssync;
490#endif 514#endif
491 515
492#if ANOMALY_05000283 || ANOMALY_05000315 516 ANOMALY_283_315_WORKAROUND(p5, r7)
493 cc = r7 == r7;
494 p5.h = HI(CHIPID);
495 p5.l = LO(CHIPID);
496 if cc jump 1f;
497 r7.l = W[p5];
4981:
499#endif
500 517
501#ifdef CONFIG_DEBUG_DOUBLEFAULT 518#ifdef CONFIG_DEBUG_DOUBLEFAULT
502 /* 519 /*
@@ -510,18 +527,18 @@ ENTRY(_trap) /* Exception: 4th entry into system event table(supervisor mode)*/
510 p4.l = lo(DCPLB_FAULT_ADDR); 527 p4.l = lo(DCPLB_FAULT_ADDR);
511 p4.h = hi(DCPLB_FAULT_ADDR); 528 p4.h = hi(DCPLB_FAULT_ADDR);
512 r7 = [p4]; 529 r7 = [p4];
513 [p5 + PDA_DCPLB] = r7; 530 [p5 + PDA_DF_DCPLB] = r7;
514 531
515 p4.l = lo(ICPLB_FAULT_ADDR); 532 p4.l = lo(ICPLB_FAULT_ADDR);
516 p4.h = hi(ICPLB_FAULT_ADDR); 533 p4.h = hi(ICPLB_FAULT_ADDR);
517 r7 = [p4]; 534 r7 = [p4];
518 [p5 + PDA_ICPLB] = r7; 535 [p5 + PDA_DF_ICPLB] = r7;
519 536
520 r6 = retx; 537 r7 = retx;
521 [p5 + PDA_RETX] = r6; 538 [p5 + PDA_DF_RETX] = r7;
522 539
523 r7 = SEQSTAT; /* reason code is in bit 5:0 */ 540 r7 = SEQSTAT; /* reason code is in bit 5:0 */
524 [p5 + PDA_SEQSTAT] = r7; 541 [p5 + PDA_DF_SEQSTAT] = r7;
525#else 542#else
526 r7 = SEQSTAT; /* reason code is in bit 5:0 */ 543 r7 = SEQSTAT; /* reason code is in bit 5:0 */
527#endif 544#endif
@@ -686,8 +703,14 @@ ENTRY(_system_call)
686#ifdef CONFIG_IPIPE 703#ifdef CONFIG_IPIPE
687 cc = BITTST(r7, TIF_IRQ_SYNC); 704 cc = BITTST(r7, TIF_IRQ_SYNC);
688 if !cc jump .Lsyscall_no_irqsync; 705 if !cc jump .Lsyscall_no_irqsync;
706 /*
707 * Clear IPEND[4] manually to undo what resume_userspace_1 just did;
708 * we need this so that high priority domain interrupts may still
709 * preempt the current domain while the pipeline log is being played
710 * back.
711 */
689 [--sp] = reti; 712 [--sp] = reti;
690 r0 = [sp++]; 713 SP += 4; /* don't merge with next insn to keep the pattern obvious */
691 SP += -12; 714 SP += -12;
692 call ___ipipe_sync_root; 715 call ___ipipe_sync_root;
693 SP += 12; 716 SP += 12;
@@ -699,7 +722,7 @@ ENTRY(_system_call)
699 722
700 /* Reenable interrupts. */ 723 /* Reenable interrupts. */
701 [--sp] = reti; 724 [--sp] = reti;
702 r0 = [sp++]; 725 sp += 4;
703 726
704 SP += -12; 727 SP += -12;
705 call _schedule; 728 call _schedule;
@@ -715,7 +738,7 @@ ENTRY(_system_call)
715.Lsyscall_do_signals: 738.Lsyscall_do_signals:
716 /* Reenable interrupts. */ 739 /* Reenable interrupts. */
717 [--sp] = reti; 740 [--sp] = reti;
718 r0 = [sp++]; 741 sp += 4;
719 742
720 r0 = sp; 743 r0 = sp;
721 SP += -12; 744 SP += -12;
@@ -725,10 +748,6 @@ ENTRY(_system_call)
725.Lsyscall_really_exit: 748.Lsyscall_really_exit:
726 r5 = [sp + PT_RESERVED]; 749 r5 = [sp + PT_RESERVED];
727 rets = r5; 750 rets = r5;
728#ifdef CONFIG_IPIPE
729 [--sp] = reti;
730 r5 = [sp++];
731#endif /* CONFIG_IPIPE */
732 rts; 751 rts;
733ENDPROC(_system_call) 752ENDPROC(_system_call)
734 753
@@ -816,13 +835,13 @@ ENDPROC(_resume)
816 835
817ENTRY(_ret_from_exception) 836ENTRY(_ret_from_exception)
818#ifdef CONFIG_IPIPE 837#ifdef CONFIG_IPIPE
819 [--sp] = rets; 838 p2.l = _per_cpu__ipipe_percpu_domain;
820 SP += -12; 839 p2.h = _per_cpu__ipipe_percpu_domain;
821 call ___ipipe_check_root 840 r0.l = _ipipe_root;
822 SP += 12 841 r0.h = _ipipe_root;
823 rets = [sp++]; 842 r2 = [p2];
824 cc = r0 == 0; 843 cc = r0 == r2;
825 if cc jump 4f; /* not on behalf of Linux, get out */ 844 if !cc jump 4f; /* not on behalf of the root domain, get out */
826#endif /* CONFIG_IPIPE */ 845#endif /* CONFIG_IPIPE */
827 p2.l = lo(IPEND); 846 p2.l = lo(IPEND);
828 p2.h = hi(IPEND); 847 p2.h = hi(IPEND);
@@ -882,14 +901,9 @@ ENDPROC(_ret_from_exception)
882 901
883#ifdef CONFIG_IPIPE 902#ifdef CONFIG_IPIPE
884 903
885_sync_root_irqs:
886 [--sp] = reti; /* Reenable interrupts */
887 r0 = [sp++];
888 jump.l ___ipipe_sync_root
889
890_resume_kernel_from_int: 904_resume_kernel_from_int:
891 r0.l = _sync_root_irqs 905 r0.l = ___ipipe_sync_root;
892 r0.h = _sync_root_irqs 906 r0.h = ___ipipe_sync_root;
893 [--sp] = rets; 907 [--sp] = rets;
894 [--sp] = ( r7:4, p5:3 ); 908 [--sp] = ( r7:4, p5:3 );
895 SP += -12; 909 SP += -12;
@@ -953,10 +967,10 @@ ENTRY(_lower_to_irq14)
953#endif 967#endif
954 968
955#ifdef CONFIG_DEBUG_HWERR 969#ifdef CONFIG_DEBUG_HWERR
956 /* enable irq14 & hwerr interrupt, until we transition to _evt14_softirq */ 970 /* enable irq14 & hwerr interrupt, until we transition to _evt_evt14 */
957 r0 = (EVT_IVG14 | EVT_IVHW | EVT_IRPTEN | EVT_EVX | EVT_NMI | EVT_RST | EVT_EMU); 971 r0 = (EVT_IVG14 | EVT_IVHW | EVT_IRPTEN | EVT_EVX | EVT_NMI | EVT_RST | EVT_EMU);
958#else 972#else
959 /* Only enable irq14 interrupt, until we transition to _evt14_softirq */ 973 /* Only enable irq14 interrupt, until we transition to _evt_evt14 */
960 r0 = (EVT_IVG14 | EVT_IRPTEN | EVT_EVX | EVT_NMI | EVT_RST | EVT_EMU); 974 r0 = (EVT_IVG14 | EVT_IRPTEN | EVT_EVX | EVT_NMI | EVT_RST | EVT_EMU);
961#endif 975#endif
962 sti r0; 976 sti r0;
@@ -964,7 +978,7 @@ ENTRY(_lower_to_irq14)
964 rti; 978 rti;
965ENDPROC(_lower_to_irq14) 979ENDPROC(_lower_to_irq14)
966 980
967ENTRY(_evt14_softirq) 981ENTRY(_evt_evt14)
968#ifdef CONFIG_DEBUG_HWERR 982#ifdef CONFIG_DEBUG_HWERR
969 r0 = (EVT_IVHW | EVT_IRPTEN | EVT_EVX | EVT_NMI | EVT_RST | EVT_EMU); 983 r0 = (EVT_IVHW | EVT_IRPTEN | EVT_EVX | EVT_NMI | EVT_RST | EVT_EMU);
970 sti r0; 984 sti r0;
@@ -974,7 +988,7 @@ ENTRY(_evt14_softirq)
974 [--sp] = RETI; 988 [--sp] = RETI;
975 SP += 4; 989 SP += 4;
976 rts; 990 rts;
977ENDPROC(_evt14_softirq) 991ENDPROC(_evt_evt14)
978 992
979ENTRY(_schedule_and_signal_from_int) 993ENTRY(_schedule_and_signal_from_int)
980 /* To end up here, vector 15 was changed - so we have to change it 994 /* To end up here, vector 15 was changed - so we have to change it
@@ -1004,6 +1018,12 @@ ENTRY(_schedule_and_signal_from_int)
1004#endif 1018#endif
1005 sti r0; 1019 sti r0;
1006 1020
1021 /* finish the userspace "atomic" functions for it */
1022 r1 = FIXED_CODE_END;
1023 r2 = [sp + PT_PC];
1024 cc = r1 <= r2;
1025 if cc jump .Lresume_userspace (bp);
1026
1007 r0 = sp; 1027 r0 = sp;
1008 sp += -12; 1028 sp += -12;
1009 call _finish_atomic_sections; 1029 call _finish_atomic_sections;
@@ -1107,14 +1127,7 @@ ENTRY(_early_trap)
1107 SAVE_ALL_SYS 1127 SAVE_ALL_SYS
1108 trace_buffer_stop(p0,r0); 1128 trace_buffer_stop(p0,r0);
1109 1129
1110#if ANOMALY_05000283 || ANOMALY_05000315 1130 ANOMALY_283_315_WORKAROUND(p4, r5)
1111 cc = r5 == r5;
1112 p4.h = HI(CHIPID);
1113 p4.l = LO(CHIPID);
1114 if cc jump 1f;
1115 r5.l = W[p4];
11161:
1117#endif
1118 1131
1119 /* Turn caches off, to ensure we don't get double exceptions */ 1132 /* Turn caches off, to ensure we don't get double exceptions */
1120 1133
@@ -1123,9 +1136,7 @@ ENTRY(_early_trap)
1123 1136
1124 R5 = [P4]; /* Control Register*/ 1137 R5 = [P4]; /* Control Register*/
1125 BITCLR(R5,ENICPLB_P); 1138 BITCLR(R5,ENICPLB_P);
1126 CLI R1; 1139 CSYNC; /* Disabling of CPLBs should be proceeded by a CSYNC */
1127 SSYNC; /* SSYNC required before writing to IMEM_CONTROL. */
1128 .align 8;
1129 [P4] = R5; 1140 [P4] = R5;
1130 SSYNC; 1141 SSYNC;
1131 1142
@@ -1133,11 +1144,9 @@ ENTRY(_early_trap)
1133 P4.H = HI(DMEM_CONTROL); 1144 P4.H = HI(DMEM_CONTROL);
1134 R5 = [P4]; 1145 R5 = [P4];
1135 BITCLR(R5,ENDCPLB_P); 1146 BITCLR(R5,ENDCPLB_P);
1136 SSYNC; /* SSYNC required before writing to DMEM_CONTROL. */ 1147 CSYNC; /* Disabling of CPLBs should be proceeded by a CSYNC */
1137 .align 8;
1138 [P4] = R5; 1148 [P4] = R5;
1139 SSYNC; 1149 SSYNC;
1140 STI R1;
1141 1150
1142 r0 = sp; /* stack frame pt_regs pointer argument ==> r0 */ 1151 r0 = sp; /* stack frame pt_regs pointer argument ==> r0 */
1143 r1 = RETX; 1152 r1 = RETX;
diff --git a/arch/blackfin/mach-common/head.S b/arch/blackfin/mach-common/head.S
index f826f6b9f917..9c79dfea2a53 100644
--- a/arch/blackfin/mach-common/head.S
+++ b/arch/blackfin/mach-common/head.S
@@ -124,22 +124,22 @@ ENTRY(__start)
124 * below 124 * below
125 */ 125 */
126 GET_PDA(p0, r0); 126 GET_PDA(p0, r0);
127 r6 = [p0 + PDA_RETX]; 127 r6 = [p0 + PDA_DF_RETX];
128 p1.l = _init_saved_retx; 128 p1.l = _init_saved_retx;
129 p1.h = _init_saved_retx; 129 p1.h = _init_saved_retx;
130 [p1] = r6; 130 [p1] = r6;
131 131
132 r6 = [p0 + PDA_DCPLB]; 132 r6 = [p0 + PDA_DF_DCPLB];
133 p1.l = _init_saved_dcplb_fault_addr; 133 p1.l = _init_saved_dcplb_fault_addr;
134 p1.h = _init_saved_dcplb_fault_addr; 134 p1.h = _init_saved_dcplb_fault_addr;
135 [p1] = r6; 135 [p1] = r6;
136 136
137 r6 = [p0 + PDA_ICPLB]; 137 r6 = [p0 + PDA_DF_ICPLB];
138 p1.l = _init_saved_icplb_fault_addr; 138 p1.l = _init_saved_icplb_fault_addr;
139 p1.h = _init_saved_icplb_fault_addr; 139 p1.h = _init_saved_icplb_fault_addr;
140 [p1] = r6; 140 [p1] = r6;
141 141
142 r6 = [p0 + PDA_SEQSTAT]; 142 r6 = [p0 + PDA_DF_SEQSTAT];
143 p1.l = _init_saved_seqstat; 143 p1.l = _init_saved_seqstat;
144 p1.h = _init_saved_seqstat; 144 p1.h = _init_saved_seqstat;
145 [p1] = r6; 145 [p1] = r6;
@@ -153,6 +153,8 @@ ENTRY(__start)
153 153
154#ifdef CONFIG_EARLY_PRINTK 154#ifdef CONFIG_EARLY_PRINTK
155 call _init_early_exception_vectors; 155 call _init_early_exception_vectors;
156 r0 = (EVT_IVHW | EVT_IRPTEN | EVT_EVX | EVT_NMI | EVT_RST | EVT_EMU);
157 sti r0;
156#endif 158#endif
157 159
158 r0 = 0 (x); 160 r0 = 0 (x);
@@ -212,12 +214,21 @@ ENTRY(__start)
212 [p0] = p1; 214 [p0] = p1;
213 csync; 215 csync;
214 216
217#ifdef CONFIG_EARLY_PRINTK
218 r0 = (EVT_IVG15 | EVT_IVHW | EVT_IRPTEN | EVT_EVX | EVT_NMI | EVT_RST | EVT_EMU) (z);
219#else
215 r0 = EVT_IVG15 (z); 220 r0 = EVT_IVG15 (z);
221#endif
216 sti r0; 222 sti r0;
217 223
218 raise 15; 224 raise 15;
225#ifdef CONFIG_EARLY_PRINTK
226 p0.l = _early_trap;
227 p0.h = _early_trap;
228#else
219 p0.l = .LWAIT_HERE; 229 p0.l = .LWAIT_HERE;
220 p0.h = .LWAIT_HERE; 230 p0.h = .LWAIT_HERE;
231#endif
221 reti = p0; 232 reti = p0;
222#if ANOMALY_05000281 233#if ANOMALY_05000281
223 nop; nop; nop; 234 nop; nop; nop;
diff --git a/arch/blackfin/mach-common/interrupt.S b/arch/blackfin/mach-common/interrupt.S
index 9c46680186e4..82d417ef4b5b 100644
--- a/arch/blackfin/mach-common/interrupt.S
+++ b/arch/blackfin/mach-common/interrupt.S
@@ -119,14 +119,8 @@ __common_int_entry:
119 fp = 0; 119 fp = 0;
120#endif 120#endif
121 121
122#if ANOMALY_05000283 || ANOMALY_05000315 122 ANOMALY_283_315_WORKAROUND(p5, r7)
123 cc = r7 == r7; 123
124 p5.h = HI(CHIPID);
125 p5.l = LO(CHIPID);
126 if cc jump 1f;
127 r7.l = W[p5];
1281:
129#endif
130 r1 = sp; 124 r1 = sp;
131 SP += -12; 125 SP += -12;
132#ifdef CONFIG_IPIPE 126#ifdef CONFIG_IPIPE
@@ -158,14 +152,7 @@ ENTRY(_evt_ivhw)
158 fp = 0; 152 fp = 0;
159#endif 153#endif
160 154
161#if ANOMALY_05000283 || ANOMALY_05000315 155 ANOMALY_283_315_WORKAROUND(p5, r7)
162 cc = r7 == r7;
163 p5.h = HI(CHIPID);
164 p5.l = LO(CHIPID);
165 if cc jump 1f;
166 r7.l = W[p5];
1671:
168#endif
169 156
170 /* Handle all stacked hardware errors 157 /* Handle all stacked hardware errors
171 * To make sure we don't hang forever, only do it 10 times 158 * To make sure we don't hang forever, only do it 10 times
@@ -261,6 +248,31 @@ ENTRY(_evt_system_call)
261ENDPROC(_evt_system_call) 248ENDPROC(_evt_system_call)
262 249
263#ifdef CONFIG_IPIPE 250#ifdef CONFIG_IPIPE
251/*
252 * __ipipe_call_irqtail: lowers the current priority level to EVT15
253 * before running a user-defined routine, then raises the priority
254 * level to EVT14 to prepare the caller for a normal interrupt
255 * return through RTI.
256 *
257 * We currently use this facility in two occasions:
258 *
259 * - to branch to __ipipe_irq_tail_hook as requested by a high
260 * priority domain after the pipeline delivered an interrupt,
261 * e.g. such as Xenomai, in order to start its rescheduling
262 * procedure, since we may not switch tasks when IRQ levels are
263 * nested on the Blackfin, so we have to fake an interrupt return
264 * so that we may reschedule immediately.
265 *
266 * - to branch to sync_root_irqs, in order to play any interrupt
267 * pending for the root domain (i.e. the Linux kernel). This lowers
268 * the core priority level enough so that Linux IRQ handlers may
269 * never delay interrupts handled by high priority domains; we defer
270 * those handlers until this point instead. This is a substitute
271 * to using a threaded interrupt model for the Linux kernel.
272 *
273 * r0: address of user-defined routine
274 * context: caller must have preempted EVT15, hw interrupts must be off.
275 */
264ENTRY(___ipipe_call_irqtail) 276ENTRY(___ipipe_call_irqtail)
265 p0 = r0; 277 p0 = r0;
266 r0.l = 1f; 278 r0.l = 1f;
@@ -276,33 +288,19 @@ ENTRY(___ipipe_call_irqtail)
276 ( r7:4, p5:3 ) = [sp++]; 288 ( r7:4, p5:3 ) = [sp++];
277 rets = [sp++]; 289 rets = [sp++];
278 290
279 [--sp] = reti; 291#ifdef CONFIG_DEBUG_HWERR
280 reti = [sp++]; /* IRQs are off. */ 292 /* enable irq14 & hwerr interrupt, until we transition to _evt_evt14 */
281 r0.h = 3f; 293 r0 = (EVT_IVG14 | EVT_IVHW | \
282 r0.l = 3f; 294 EVT_IRPTEN | EVT_EVX | EVT_NMI | EVT_RST | EVT_EMU);
283 p0.l = lo(EVT14); 295#else
284 p0.h = hi(EVT14); 296 /* Only enable irq14 interrupt, until we transition to _evt_evt14 */
285 [p0] = r0; 297 r0 = (EVT_IVG14 | \
286 csync; 298 EVT_IRPTEN | EVT_EVX | EVT_NMI | EVT_RST | EVT_EMU);
287 r0 = 0x401f (z); 299#endif
288 sti r0; 300 sti r0;
289 raise 14; 301 raise 14; /* Branches to _evt_evt14 */
290 [--sp] = reti; /* IRQs on. */
2912: 3022:
292 jump 2b; /* Likely paranoid. */ 303 jump 2b; /* Likely paranoid. */
2933:
294 sp += 4; /* Discard saved RETI */
295 r0.h = _evt14_softirq;
296 r0.l = _evt14_softirq;
297 p0.l = lo(EVT14);
298 p0.h = hi(EVT14);
299 [p0] = r0;
300 csync;
301 p0.l = _bfin_irq_flags;
302 p0.h = _bfin_irq_flags;
303 r0 = [p0];
304 sti r0;
305 rts;
306ENDPROC(___ipipe_call_irqtail) 304ENDPROC(___ipipe_call_irqtail)
307 305
308#endif /* CONFIG_IPIPE */ 306#endif /* CONFIG_IPIPE */
diff --git a/arch/blackfin/mach-common/ints-priority.c b/arch/blackfin/mach-common/ints-priority.c
index b42150190d0e..6ffda78aaf9d 100644
--- a/arch/blackfin/mach-common/ints-priority.c
+++ b/arch/blackfin/mach-common/ints-priority.c
@@ -967,7 +967,7 @@ void __cpuinit init_exception_vectors(void)
967 bfin_write_EVT11(evt_evt11); 967 bfin_write_EVT11(evt_evt11);
968 bfin_write_EVT12(evt_evt12); 968 bfin_write_EVT12(evt_evt12);
969 bfin_write_EVT13(evt_evt13); 969 bfin_write_EVT13(evt_evt13);
970 bfin_write_EVT14(evt14_softirq); 970 bfin_write_EVT14(evt_evt14);
971 bfin_write_EVT15(evt_system_call); 971 bfin_write_EVT15(evt_system_call);
972 CSYNC(); 972 CSYNC();
973} 973}
@@ -1052,18 +1052,26 @@ int __init init_arch_irq(void)
1052 set_irq_chained_handler(irq, bfin_demux_error_irq); 1052 set_irq_chained_handler(irq, bfin_demux_error_irq);
1053 break; 1053 break;
1054#endif 1054#endif
1055
1055#ifdef CONFIG_SMP 1056#ifdef CONFIG_SMP
1057#ifdef CONFIG_TICKSOURCE_GPTMR0
1058 case IRQ_TIMER0:
1059#endif
1060#ifdef CONFIG_TICKSOURCE_CORETMR
1061 case IRQ_CORETMR:
1062#endif
1056 case IRQ_SUPPLE_0: 1063 case IRQ_SUPPLE_0:
1057 case IRQ_SUPPLE_1: 1064 case IRQ_SUPPLE_1:
1058 set_irq_handler(irq, handle_percpu_irq); 1065 set_irq_handler(irq, handle_percpu_irq);
1059 break; 1066 break;
1060#endif 1067#endif
1068
1061#ifdef CONFIG_IPIPE 1069#ifdef CONFIG_IPIPE
1062#ifndef CONFIG_TICKSOURCE_CORETMR 1070#ifndef CONFIG_TICKSOURCE_CORETMR
1063 case IRQ_TIMER0: 1071 case IRQ_TIMER0:
1064 set_irq_handler(irq, handle_simple_irq); 1072 set_irq_handler(irq, handle_simple_irq);
1065 break; 1073 break;
1066#endif /* !CONFIG_TICKSOURCE_CORETMR */ 1074#endif
1067 case IRQ_CORETMR: 1075 case IRQ_CORETMR:
1068 set_irq_handler(irq, handle_simple_irq); 1076 set_irq_handler(irq, handle_simple_irq);
1069 break; 1077 break;
@@ -1071,15 +1079,10 @@ int __init init_arch_irq(void)
1071 set_irq_handler(irq, handle_level_irq); 1079 set_irq_handler(irq, handle_level_irq);
1072 break; 1080 break;
1073#else /* !CONFIG_IPIPE */ 1081#else /* !CONFIG_IPIPE */
1074#ifdef CONFIG_TICKSOURCE_GPTMR0
1075 case IRQ_TIMER0:
1076 set_irq_handler(irq, handle_percpu_irq);
1077 break;
1078#endif /* CONFIG_TICKSOURCE_GPTMR0 */
1079 default: 1082 default:
1080 set_irq_handler(irq, handle_simple_irq); 1083 set_irq_handler(irq, handle_simple_irq);
1081 break; 1084 break;
1082#endif /* !CONFIG_IPIPE */ 1085#endif /* !CONFIG_IPIPE */
1083 } 1086 }
1084 } 1087 }
1085 1088
diff --git a/arch/blackfin/mach-common/lock.S b/arch/blackfin/mach-common/lock.S
deleted file mode 100644
index 6c5f5f0ea7fe..000000000000
--- a/arch/blackfin/mach-common/lock.S
+++ /dev/null
@@ -1,223 +0,0 @@
1/*
2 * File: arch/blackfin/mach-common/lock.S
3 * Based on:
4 * Author: LG Soft India
5 *
6 * Created: ?
7 * Description: kernel locks
8 *
9 * Modified:
10 * Copyright 2004-2006 Analog Devices Inc.
11 *
12 * Bugs: Enter bugs at http://blackfin.uclinux.org/
13 *
14 * This program is free software; you can redistribute it and/or modify
15 * it under the terms of the GNU General Public License as published by
16 * the Free Software Foundation; either version 2 of the License, or
17 * (at your option) any later version.
18 *
19 * This program is distributed in the hope that it will be useful,
20 * but WITHOUT ANY WARRANTY; without even the implied warranty of
21 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
22 * GNU General Public License for more details.
23 *
24 * You should have received a copy of the GNU General Public License
25 * along with this program; if not, see the file COPYING, or write
26 * to the Free Software Foundation, Inc.,
27 * 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
28 */
29
30#include <linux/linkage.h>
31#include <asm/blackfin.h>
32
33.text
34
35/* When you come here, it is assumed that
36 * R0 - Which way to be locked
37 */
38
39ENTRY(_cache_grab_lock)
40
41 [--SP]=( R7:0,P5:0 );
42
43 P1.H = HI(IMEM_CONTROL);
44 P1.L = LO(IMEM_CONTROL);
45 P5.H = HI(ICPLB_ADDR0);
46 P5.L = LO(ICPLB_ADDR0);
47 P4.H = HI(ICPLB_DATA0);
48 P4.L = LO(ICPLB_DATA0);
49 R7 = R0;
50
51 /* If the code of interest already resides in the cache
52 * invalidate the entire cache itself.
53 * invalidate_entire_icache;
54 */
55
56 SP += -12;
57 [--SP] = RETS;
58 CALL _invalidate_entire_icache;
59 RETS = [SP++];
60 SP += 12;
61
62 /* Disable the Interrupts*/
63
64 CLI R3;
65
66.LLOCK_WAY:
67
68 /* Way0 - 0xFFA133E0
69 * Way1 - 0xFFA137E0
70 * Way2 - 0xFFA13BE0 Total Way Size = 4K
71 * Way3 - 0xFFA13FE0
72 */
73
74 /* Procedure Ex. -Set the locks for other ways by setting ILOC[3:1]
75 * Only Way0 of the instruction cache can now be
76 * replaced by a new code
77 */
78
79 R5 = R7;
80 CC = BITTST(R7,0);
81 IF CC JUMP .LCLEAR1;
82 R7 = 0;
83 BITSET(R7,0);
84 JUMP .LDONE1;
85
86.LCLEAR1:
87 R7 = 0;
88 BITCLR(R7,0);
89.LDONE1: R4 = R7 << 3;
90 R7 = [P1];
91 R7 = R7 | R4;
92 SSYNC; /* SSYNC required writing to IMEM_CONTROL. */
93 .align 8;
94 [P1] = R7;
95 SSYNC;
96
97 R7 = R5;
98 CC = BITTST(R7,1);
99 IF CC JUMP .LCLEAR2;
100 R7 = 0;
101 BITSET(R7,1);
102 JUMP .LDONE2;
103
104.LCLEAR2:
105 R7 = 0;
106 BITCLR(R7,1);
107.LDONE2: R4 = R7 << 3;
108 R7 = [P1];
109 R7 = R7 | R4;
110 SSYNC; /* SSYNC required writing to IMEM_CONTROL. */
111 .align 8;
112 [P1] = R7;
113 SSYNC;
114
115 R7 = R5;
116 CC = BITTST(R7,2);
117 IF CC JUMP .LCLEAR3;
118 R7 = 0;
119 BITSET(R7,2);
120 JUMP .LDONE3;
121.LCLEAR3:
122 R7 = 0;
123 BITCLR(R7,2);
124.LDONE3: R4 = R7 << 3;
125 R7 = [P1];
126 R7 = R7 | R4;
127 SSYNC; /* SSYNC required writing to IMEM_CONTROL. */
128 .align 8;
129 [P1] = R7;
130 SSYNC;
131
132
133 R7 = R5;
134 CC = BITTST(R7,3);
135 IF CC JUMP .LCLEAR4;
136 R7 = 0;
137 BITSET(R7,3);
138 JUMP .LDONE4;
139.LCLEAR4:
140 R7 = 0;
141 BITCLR(R7,3);
142.LDONE4: R4 = R7 << 3;
143 R7 = [P1];
144 R7 = R7 | R4;
145 SSYNC; /* SSYNC required writing to IMEM_CONTROL. */
146 .align 8;
147 [P1] = R7;
148 SSYNC;
149
150 STI R3;
151
152 ( R7:0,P5:0 ) = [SP++];
153
154 RTS;
155ENDPROC(_cache_grab_lock)
156
157/* After the execution of critical code, the code is now locked into
158 * the cache way. Now we need to set ILOC.
159 *
160 * R0 - Which way to be locked
161 */
162
163ENTRY(_bfin_cache_lock)
164
165 [--SP]=( R7:0,P5:0 );
166
167 P1.H = HI(IMEM_CONTROL);
168 P1.L = LO(IMEM_CONTROL);
169
170 /* Disable the Interrupts*/
171 CLI R3;
172
173 R7 = [P1];
174 R2 = ~(0x78) (X); /* mask out ILOC */
175 R7 = R7 & R2;
176 R0 = R0 << 3;
177 R7 = R0 | R7;
178 SSYNC; /* SSYNC required writing to IMEM_CONTROL. */
179 .align 8;
180 [P1] = R7;
181 SSYNC;
182 /* Renable the Interrupts */
183 STI R3;
184
185 ( R7:0,P5:0 ) = [SP++];
186 RTS;
187ENDPROC(_bfin_cache_lock)
188
189/* Invalidate the Entire Instruction cache by
190 * disabling IMC bit
191 */
192ENTRY(_invalidate_entire_icache)
193 [--SP] = ( R7:5);
194
195 P0.L = LO(IMEM_CONTROL);
196 P0.H = HI(IMEM_CONTROL);
197 R7 = [P0];
198
199 /* Clear the IMC bit , All valid bits in the instruction
200 * cache are set to the invalid state
201 */
202 BITCLR(R7,IMC_P);
203 CLI R6;
204 SSYNC; /* SSYNC required before invalidating cache. */
205 .align 8;
206 [P0] = R7;
207 SSYNC;
208 STI R6;
209
210 /* Configures the instruction cache agian */
211 R6 = (IMC | ENICPLB);
212 R7 = R7 | R6;
213
214 CLI R6;
215 SSYNC; /* SSYNC required before writing to IMEM_CONTROL. */
216 .align 8;
217 [P0] = R7;
218 SSYNC;
219 STI R6;
220
221 ( R7:5) = [SP++];
222 RTS;
223ENDPROC(_invalidate_entire_icache)
diff --git a/arch/blackfin/mach-common/pm.c b/arch/blackfin/mach-common/pm.c
index 9e7e27b7fc8d..0e3d4ff9d8b6 100644
--- a/arch/blackfin/mach-common/pm.c
+++ b/arch/blackfin/mach-common/pm.c
@@ -38,6 +38,7 @@
38#include <linux/io.h> 38#include <linux/io.h>
39#include <linux/irq.h> 39#include <linux/irq.h>
40 40
41#include <asm/cplb.h>
41#include <asm/gpio.h> 42#include <asm/gpio.h>
42#include <asm/dma.h> 43#include <asm/dma.h>
43#include <asm/dpmc.h> 44#include <asm/dpmc.h>
@@ -170,58 +171,6 @@ static void flushinv_all_dcache(void)
170} 171}
171#endif 172#endif
172 173
173static inline void dcache_disable(void)
174{
175#ifdef CONFIG_BFIN_DCACHE
176 unsigned long ctrl;
177
178#if defined(CONFIG_BFIN_EXTMEM_WRITEBACK) || defined(CONFIG_BFIN_L2_WRITEBACK)
179 flushinv_all_dcache();
180#endif
181 SSYNC();
182 ctrl = bfin_read_DMEM_CONTROL();
183 ctrl &= ~ENDCPLB;
184 bfin_write_DMEM_CONTROL(ctrl);
185 SSYNC();
186#endif
187}
188
189static inline void dcache_enable(void)
190{
191#ifdef CONFIG_BFIN_DCACHE
192 unsigned long ctrl;
193 SSYNC();
194 ctrl = bfin_read_DMEM_CONTROL();
195 ctrl |= ENDCPLB;
196 bfin_write_DMEM_CONTROL(ctrl);
197 SSYNC();
198#endif
199}
200
201static inline void icache_disable(void)
202{
203#ifdef CONFIG_BFIN_ICACHE
204 unsigned long ctrl;
205 SSYNC();
206 ctrl = bfin_read_IMEM_CONTROL();
207 ctrl &= ~ENICPLB;
208 bfin_write_IMEM_CONTROL(ctrl);
209 SSYNC();
210#endif
211}
212
213static inline void icache_enable(void)
214{
215#ifdef CONFIG_BFIN_ICACHE
216 unsigned long ctrl;
217 SSYNC();
218 ctrl = bfin_read_IMEM_CONTROL();
219 ctrl |= ENICPLB;
220 bfin_write_IMEM_CONTROL(ctrl);
221 SSYNC();
222#endif
223}
224
225int bfin_pm_suspend_mem_enter(void) 174int bfin_pm_suspend_mem_enter(void)
226{ 175{
227 unsigned long flags; 176 unsigned long flags;
@@ -258,16 +207,19 @@ int bfin_pm_suspend_mem_enter(void)
258 207
259 bfin_gpio_pm_hibernate_suspend(); 208 bfin_gpio_pm_hibernate_suspend();
260 209
261 dcache_disable(); 210#if defined(CONFIG_BFIN_EXTMEM_WRITEBACK) || defined(CONFIG_BFIN_L2_WRITEBACK)
262 icache_disable(); 211 flushinv_all_dcache();
212#endif
213 _disable_dcplb();
214 _disable_icplb();
263 bf53x_suspend_l1_mem(memptr); 215 bf53x_suspend_l1_mem(memptr);
264 216
265 do_hibernate(wakeup | vr_wakeup); /* Goodbye */ 217 do_hibernate(wakeup | vr_wakeup); /* Goodbye */
266 218
267 bf53x_resume_l1_mem(memptr); 219 bf53x_resume_l1_mem(memptr);
268 220
269 icache_enable(); 221 _enable_icplb();
270 dcache_enable(); 222 _enable_dcplb();
271 223
272 bfin_gpio_pm_hibernate_restore(); 224 bfin_gpio_pm_hibernate_restore();
273 blackfin_dma_resume(); 225 blackfin_dma_resume();
diff --git a/arch/blackfin/mm/init.c b/arch/blackfin/mm/init.c
index 68bd0bd680cd..b88ce7fda548 100644
--- a/arch/blackfin/mm/init.c
+++ b/arch/blackfin/mm/init.c
@@ -33,6 +33,7 @@
33#include <asm/bfin-global.h> 33#include <asm/bfin-global.h>
34#include <asm/pda.h> 34#include <asm/pda.h>
35#include <asm/cplbinit.h> 35#include <asm/cplbinit.h>
36#include <asm/early_printk.h>
36#include "blackfin_sram.h" 37#include "blackfin_sram.h"
37 38
38/* 39/*
@@ -113,6 +114,8 @@ asmlinkage void __init init_pda(void)
113{ 114{
114 unsigned int cpu = raw_smp_processor_id(); 115 unsigned int cpu = raw_smp_processor_id();
115 116
117 early_shadow_stamp();
118
116 /* Initialize the PDA fields holding references to other parts 119 /* Initialize the PDA fields holding references to other parts
117 of the memory. The content of such memory is still 120 of the memory. The content of such memory is still
118 undefined at the time of the call, we are only setting up 121 undefined at the time of the call, we are only setting up
diff --git a/arch/blackfin/mm/isram-driver.c b/arch/blackfin/mm/isram-driver.c
index c080e70f98b0..beb1a608824c 100644
--- a/arch/blackfin/mm/isram-driver.c
+++ b/arch/blackfin/mm/isram-driver.c
@@ -16,6 +16,8 @@
16 * 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA 16 * 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
17 */ 17 */
18 18
19#define pr_fmt(fmt) "isram: " fmt
20
19#include <linux/module.h> 21#include <linux/module.h>
20#include <linux/kernel.h> 22#include <linux/kernel.h>
21#include <linux/types.h> 23#include <linux/types.h>
@@ -23,6 +25,7 @@
23#include <linux/sched.h> 25#include <linux/sched.h>
24 26
25#include <asm/blackfin.h> 27#include <asm/blackfin.h>
28#include <asm/dma.h>
26 29
27/* 30/*
28 * IMPORTANT WARNING ABOUT THESE FUNCTIONS 31 * IMPORTANT WARNING ABOUT THESE FUNCTIONS
@@ -50,10 +53,12 @@ static DEFINE_SPINLOCK(dtest_lock);
50#define IADDR2DTEST(x) \ 53#define IADDR2DTEST(x) \
51 ({ unsigned long __addr = (unsigned long)(x); \ 54 ({ unsigned long __addr = (unsigned long)(x); \
52 (__addr & 0x47F8) | /* address bits 14 & 10:3 */ \ 55 (__addr & 0x47F8) | /* address bits 14 & 10:3 */ \
56 (__addr & 0x8000) << 23 | /* Bank A/B */ \
53 (__addr & 0x0800) << 15 | /* address bit 11 */ \ 57 (__addr & 0x0800) << 15 | /* address bit 11 */ \
54 (__addr & 0x3000) << 4 | /* address bits 13:12 */ \ 58 (__addr & 0x3000) << 4 | /* address bits 13:12 */ \
55 (__addr & 0x8000) << 8 | /* address bit 15 */ \ 59 (__addr & 0x8000) << 8 | /* address bit 15 */ \
56 (0x1000004); /* isram access */ \ 60 (0x1000000) | /* instruction access = 1 */ \
61 (0x4); /* data array = 1 */ \
57 }) 62 })
58 63
59/* Takes a pointer, and returns the offset (in bits) which things should be shifted */ 64/* Takes a pointer, and returns the offset (in bits) which things should be shifted */
@@ -70,7 +75,7 @@ static void isram_write(const void *addr, uint64_t data)
70 if (addr >= (void *)(L1_CODE_START + L1_CODE_LENGTH)) 75 if (addr >= (void *)(L1_CODE_START + L1_CODE_LENGTH))
71 return; 76 return;
72 77
73 cmd = IADDR2DTEST(addr) | 1; /* write */ 78 cmd = IADDR2DTEST(addr) | 2; /* write */
74 79
75 /* 80 /*
76 * Writes to DTEST_DATA[0:1] need to be atomic with write to DTEST_COMMAND 81 * Writes to DTEST_DATA[0:1] need to be atomic with write to DTEST_COMMAND
@@ -127,8 +132,7 @@ static bool isram_check_addr(const void *addr, size_t n)
127 (addr < (void *)(L1_CODE_START + L1_CODE_LENGTH))) { 132 (addr < (void *)(L1_CODE_START + L1_CODE_LENGTH))) {
128 if ((addr + n) > (void *)(L1_CODE_START + L1_CODE_LENGTH)) { 133 if ((addr + n) > (void *)(L1_CODE_START + L1_CODE_LENGTH)) {
129 show_stack(NULL, NULL); 134 show_stack(NULL, NULL);
130 printk(KERN_ERR "isram_memcpy: copy involving %p length " 135 pr_err("copy involving %p length (%zu) too long\n", addr, n);
131 "(%zu) too long\n", addr, n);
132 } 136 }
133 return true; 137 return true;
134 } 138 }
@@ -199,3 +203,209 @@ void *isram_memcpy(void *dest, const void *src, size_t n)
199} 203}
200EXPORT_SYMBOL(isram_memcpy); 204EXPORT_SYMBOL(isram_memcpy);
201 205
206#ifdef CONFIG_BFIN_ISRAM_SELF_TEST
207
208#define TEST_LEN 0x100
209
210static __init void hex_dump(unsigned char *buf, int len)
211{
212 while (len--)
213 pr_cont("%02x", *buf++);
214}
215
216static __init int isram_read_test(char *sdram, void *l1inst)
217{
218 int i, ret = 0;
219 uint64_t data1, data2;
220
221 pr_info("INFO: running isram_read tests\n");
222
223 /* setup some different data to play with */
224 for (i = 0; i < TEST_LEN; ++i)
225 sdram[i] = i;
226 dma_memcpy(l1inst, sdram, TEST_LEN);
227
228 /* make sure we can read the L1 inst */
229 for (i = 0; i < TEST_LEN; i += sizeof(uint64_t)) {
230 data1 = isram_read(l1inst + i);
231 memcpy(&data2, sdram + i, sizeof(data2));
232 if (memcmp(&data1, &data2, sizeof(uint64_t))) {
233 pr_err("FAIL: isram_read(%p) returned %#llx but wanted %#llx\n",
234 l1inst + i, data1, data2);
235 ++ret;
236 }
237 }
238
239 return ret;
240}
241
242static __init int isram_write_test(char *sdram, void *l1inst)
243{
244 int i, ret = 0;
245 uint64_t data1, data2;
246
247 pr_info("INFO: running isram_write tests\n");
248
249 /* setup some different data to play with */
250 memset(sdram, 0, TEST_LEN * 2);
251 dma_memcpy(l1inst, sdram, TEST_LEN);
252 for (i = 0; i < TEST_LEN; ++i)
253 sdram[i] = i;
254
255 /* make sure we can write the L1 inst */
256 for (i = 0; i < TEST_LEN; i += sizeof(uint64_t)) {
257 memcpy(&data1, sdram + i, sizeof(data1));
258 isram_write(l1inst + i, data1);
259 data2 = isram_read(l1inst + i);
260 if (memcmp(&data1, &data2, sizeof(uint64_t))) {
261 pr_err("FAIL: isram_write(%p, %#llx) != %#llx\n",
262 l1inst + i, data1, data2);
263 ++ret;
264 }
265 }
266
267 dma_memcpy(sdram + TEST_LEN, l1inst, TEST_LEN);
268 if (memcmp(sdram, sdram + TEST_LEN, TEST_LEN)) {
269 pr_err("FAIL: isram_write() did not work properly\n");
270 ++ret;
271 }
272
273 return ret;
274}
275
276static __init int
277_isram_memcpy_test(char pattern, void *sdram, void *l1inst, const char *smemcpy,
278 void *(*fmemcpy)(void *, const void *, size_t))
279{
280 memset(sdram, pattern, TEST_LEN);
281 fmemcpy(l1inst, sdram, TEST_LEN);
282 fmemcpy(sdram + TEST_LEN, l1inst, TEST_LEN);
283 if (memcmp(sdram, sdram + TEST_LEN, TEST_LEN)) {
284 pr_err("FAIL: %s(%p <=> %p, %#x) failed (data is %#x)\n",
285 smemcpy, l1inst, sdram, TEST_LEN, pattern);
286 return 1;
287 }
288 return 0;
289}
290#define _isram_memcpy_test(a, b, c, d) _isram_memcpy_test(a, b, c, #d, d)
291
292static __init int isram_memcpy_test(char *sdram, void *l1inst)
293{
294 int i, j, thisret, ret = 0;
295
296 /* check broad isram_memcpy() */
297 pr_info("INFO: running broad isram_memcpy tests\n");
298 for (i = 0xf; i >= 0; --i)
299 ret += _isram_memcpy_test(i, sdram, l1inst, isram_memcpy);
300
301 /* check read of small, unaligned, and hardware 64bit limits */
302 pr_info("INFO: running isram_memcpy (read) tests\n");
303
304 for (i = 0; i < TEST_LEN; ++i)
305 sdram[i] = i;
306 dma_memcpy(l1inst, sdram, TEST_LEN);
307
308 thisret = 0;
309 for (i = 0; i < TEST_LEN - 32; ++i) {
310 unsigned char cmp[32];
311 for (j = 1; j <= 32; ++j) {
312 memset(cmp, 0, sizeof(cmp));
313 isram_memcpy(cmp, l1inst + i, j);
314 if (memcmp(cmp, sdram + i, j)) {
315 pr_err("FAIL: %p:", l1inst + 1);
316 hex_dump(cmp, j);
317 pr_cont(" SDRAM:");
318 hex_dump(sdram + i, j);
319 pr_cont("\n");
320 if (++thisret > 20) {
321 pr_err("FAIL: skipping remaining series\n");
322 i = TEST_LEN;
323 break;
324 }
325 }
326 }
327 }
328 ret += thisret;
329
330 /* check write of small, unaligned, and hardware 64bit limits */
331 pr_info("INFO: running isram_memcpy (write) tests\n");
332
333 memset(sdram + TEST_LEN, 0, TEST_LEN);
334 dma_memcpy(l1inst, sdram + TEST_LEN, TEST_LEN);
335
336 thisret = 0;
337 for (i = 0; i < TEST_LEN - 32; ++i) {
338 unsigned char cmp[32];
339 for (j = 1; j <= 32; ++j) {
340 isram_memcpy(l1inst + i, sdram + i, j);
341 dma_memcpy(cmp, l1inst + i, j);
342 if (memcmp(cmp, sdram + i, j)) {
343 pr_err("FAIL: %p:", l1inst + i);
344 hex_dump(cmp, j);
345 pr_cont(" SDRAM:");
346 hex_dump(sdram + i, j);
347 pr_cont("\n");
348 if (++thisret > 20) {
349 pr_err("FAIL: skipping remaining series\n");
350 i = TEST_LEN;
351 break;
352 }
353 }
354 }
355 }
356 ret += thisret;
357
358 return ret;
359}
360
361static __init int isram_test_init(void)
362{
363 int ret;
364 char *sdram;
365 void *l1inst;
366
367 sdram = kmalloc(TEST_LEN * 2, GFP_KERNEL);
368 if (!sdram) {
369 pr_warning("SKIP: could not allocate sdram\n");
370 return 0;
371 }
372
373 l1inst = l1_inst_sram_alloc(TEST_LEN);
374 if (!l1inst) {
375 kfree(sdram);
376 pr_warning("SKIP: could not allocate L1 inst\n");
377 return 0;
378 }
379
380 /* sanity check initial L1 inst state */
381 ret = 1;
382 pr_info("INFO: running initial dma_memcpy checks\n");
383 if (_isram_memcpy_test(0xa, sdram, l1inst, dma_memcpy))
384 goto abort;
385 if (_isram_memcpy_test(0x5, sdram, l1inst, dma_memcpy))
386 goto abort;
387
388 ret = 0;
389 ret += isram_read_test(sdram, l1inst);
390 ret += isram_write_test(sdram, l1inst);
391 ret += isram_memcpy_test(sdram, l1inst);
392
393 abort:
394 sram_free(l1inst);
395 kfree(sdram);
396
397 if (ret)
398 return -EIO;
399
400 pr_info("PASS: all tests worked !\n");
401 return 0;
402}
403late_initcall(isram_test_init);
404
405static __exit void isram_test_exit(void)
406{
407 /* stub to allow unloading */
408}
409module_exit(isram_test_exit);
410
411#endif
diff --git a/arch/blackfin/mm/sram-alloc.c b/arch/blackfin/mm/sram-alloc.c
index 0bc3c4ef0aad..eb63ab353e5a 100644
--- a/arch/blackfin/mm/sram-alloc.c
+++ b/arch/blackfin/mm/sram-alloc.c
@@ -42,11 +42,6 @@
42#include <asm/mem_map.h> 42#include <asm/mem_map.h>
43#include "blackfin_sram.h" 43#include "blackfin_sram.h"
44 44
45static DEFINE_PER_CPU(spinlock_t, l1sram_lock) ____cacheline_aligned_in_smp;
46static DEFINE_PER_CPU(spinlock_t, l1_data_sram_lock) ____cacheline_aligned_in_smp;
47static DEFINE_PER_CPU(spinlock_t, l1_inst_sram_lock) ____cacheline_aligned_in_smp;
48static spinlock_t l2_sram_lock ____cacheline_aligned_in_smp;
49
50/* the data structure for L1 scratchpad and DATA SRAM */ 45/* the data structure for L1 scratchpad and DATA SRAM */
51struct sram_piece { 46struct sram_piece {
52 void *paddr; 47 void *paddr;
@@ -55,6 +50,7 @@ struct sram_piece {
55 struct sram_piece *next; 50 struct sram_piece *next;
56}; 51};
57 52
53static DEFINE_PER_CPU_SHARED_ALIGNED(spinlock_t, l1sram_lock);
58static DEFINE_PER_CPU(struct sram_piece, free_l1_ssram_head); 54static DEFINE_PER_CPU(struct sram_piece, free_l1_ssram_head);
59static DEFINE_PER_CPU(struct sram_piece, used_l1_ssram_head); 55static DEFINE_PER_CPU(struct sram_piece, used_l1_ssram_head);
60 56
@@ -68,12 +64,18 @@ static DEFINE_PER_CPU(struct sram_piece, free_l1_data_B_sram_head);
68static DEFINE_PER_CPU(struct sram_piece, used_l1_data_B_sram_head); 64static DEFINE_PER_CPU(struct sram_piece, used_l1_data_B_sram_head);
69#endif 65#endif
70 66
67#if L1_DATA_A_LENGTH || L1_DATA_B_LENGTH
68static DEFINE_PER_CPU_SHARED_ALIGNED(spinlock_t, l1_data_sram_lock);
69#endif
70
71#if L1_CODE_LENGTH != 0 71#if L1_CODE_LENGTH != 0
72static DEFINE_PER_CPU_SHARED_ALIGNED(spinlock_t, l1_inst_sram_lock);
72static DEFINE_PER_CPU(struct sram_piece, free_l1_inst_sram_head); 73static DEFINE_PER_CPU(struct sram_piece, free_l1_inst_sram_head);
73static DEFINE_PER_CPU(struct sram_piece, used_l1_inst_sram_head); 74static DEFINE_PER_CPU(struct sram_piece, used_l1_inst_sram_head);
74#endif 75#endif
75 76
76#if L2_LENGTH != 0 77#if L2_LENGTH != 0
78static spinlock_t l2_sram_lock ____cacheline_aligned_in_smp;
77static struct sram_piece free_l2_sram_head, used_l2_sram_head; 79static struct sram_piece free_l2_sram_head, used_l2_sram_head;
78#endif 80#endif
79 81
@@ -225,10 +227,10 @@ static void __init l2_sram_init(void)
225 printk(KERN_INFO "Blackfin L2 SRAM: %d KB (%d KB free)\n", 227 printk(KERN_INFO "Blackfin L2 SRAM: %d KB (%d KB free)\n",
226 L2_LENGTH >> 10, 228 L2_LENGTH >> 10,
227 free_l2_sram_head.next->size >> 10); 229 free_l2_sram_head.next->size >> 10);
228#endif
229 230
230 /* mutex initialize */ 231 /* mutex initialize */
231 spin_lock_init(&l2_sram_lock); 232 spin_lock_init(&l2_sram_lock);
233#endif
232} 234}
233 235
234static int __init bfin_sram_init(void) 236static int __init bfin_sram_init(void)
@@ -416,18 +418,17 @@ EXPORT_SYMBOL(sram_free);
416 418
417void *l1_data_A_sram_alloc(size_t size) 419void *l1_data_A_sram_alloc(size_t size)
418{ 420{
421#if L1_DATA_A_LENGTH != 0
419 unsigned long flags; 422 unsigned long flags;
420 void *addr = NULL; 423 void *addr;
421 unsigned int cpu; 424 unsigned int cpu;
422 425
423 cpu = get_cpu(); 426 cpu = get_cpu();
424 /* add mutex operation */ 427 /* add mutex operation */
425 spin_lock_irqsave(&per_cpu(l1_data_sram_lock, cpu), flags); 428 spin_lock_irqsave(&per_cpu(l1_data_sram_lock, cpu), flags);
426 429
427#if L1_DATA_A_LENGTH != 0
428 addr = _sram_alloc(size, &per_cpu(free_l1_data_A_sram_head, cpu), 430 addr = _sram_alloc(size, &per_cpu(free_l1_data_A_sram_head, cpu),
429 &per_cpu(used_l1_data_A_sram_head, cpu)); 431 &per_cpu(used_l1_data_A_sram_head, cpu));
430#endif
431 432
432 /* add mutex operation */ 433 /* add mutex operation */
433 spin_unlock_irqrestore(&per_cpu(l1_data_sram_lock, cpu), flags); 434 spin_unlock_irqrestore(&per_cpu(l1_data_sram_lock, cpu), flags);
@@ -437,11 +438,15 @@ void *l1_data_A_sram_alloc(size_t size)
437 (long unsigned int)addr, size); 438 (long unsigned int)addr, size);
438 439
439 return addr; 440 return addr;
441#else
442 return NULL;
443#endif
440} 444}
441EXPORT_SYMBOL(l1_data_A_sram_alloc); 445EXPORT_SYMBOL(l1_data_A_sram_alloc);
442 446
443int l1_data_A_sram_free(const void *addr) 447int l1_data_A_sram_free(const void *addr)
444{ 448{
449#if L1_DATA_A_LENGTH != 0
445 unsigned long flags; 450 unsigned long flags;
446 int ret; 451 int ret;
447 unsigned int cpu; 452 unsigned int cpu;
@@ -450,18 +455,17 @@ int l1_data_A_sram_free(const void *addr)
450 /* add mutex operation */ 455 /* add mutex operation */
451 spin_lock_irqsave(&per_cpu(l1_data_sram_lock, cpu), flags); 456 spin_lock_irqsave(&per_cpu(l1_data_sram_lock, cpu), flags);
452 457
453#if L1_DATA_A_LENGTH != 0
454 ret = _sram_free(addr, &per_cpu(free_l1_data_A_sram_head, cpu), 458 ret = _sram_free(addr, &per_cpu(free_l1_data_A_sram_head, cpu),
455 &per_cpu(used_l1_data_A_sram_head, cpu)); 459 &per_cpu(used_l1_data_A_sram_head, cpu));
456#else
457 ret = -1;
458#endif
459 460
460 /* add mutex operation */ 461 /* add mutex operation */
461 spin_unlock_irqrestore(&per_cpu(l1_data_sram_lock, cpu), flags); 462 spin_unlock_irqrestore(&per_cpu(l1_data_sram_lock, cpu), flags);
462 put_cpu(); 463 put_cpu();
463 464
464 return ret; 465 return ret;
466#else
467 return -1;
468#endif
465} 469}
466EXPORT_SYMBOL(l1_data_A_sram_free); 470EXPORT_SYMBOL(l1_data_A_sram_free);
467 471
diff --git a/arch/cris/include/asm/mmu_context.h b/arch/cris/include/asm/mmu_context.h
index 72ba08dcfd18..1d45fd6365b7 100644
--- a/arch/cris/include/asm/mmu_context.h
+++ b/arch/cris/include/asm/mmu_context.h
@@ -17,7 +17,8 @@ extern void switch_mm(struct mm_struct *prev, struct mm_struct *next,
17 * registers like cr3 on the i386 17 * registers like cr3 on the i386
18 */ 18 */
19 19
20extern volatile DEFINE_PER_CPU(pgd_t *,current_pgd); /* defined in arch/cris/mm/fault.c */ 20/* defined in arch/cris/mm/fault.c */
21DECLARE_PER_CPU(pgd_t *, current_pgd);
21 22
22static inline void enter_lazy_tlb(struct mm_struct *mm, struct task_struct *tsk) 23static inline void enter_lazy_tlb(struct mm_struct *mm, struct task_struct *tsk)
23{ 24{
diff --git a/arch/cris/kernel/vmlinux.lds.S b/arch/cris/kernel/vmlinux.lds.S
index 0d2adfc794d4..6c81836b9229 100644
--- a/arch/cris/kernel/vmlinux.lds.S
+++ b/arch/cris/kernel/vmlinux.lds.S
@@ -140,12 +140,7 @@ SECTIONS
140 _end = .; 140 _end = .;
141 __end = .; 141 __end = .;
142 142
143 /* Sections to be discarded */
144 /DISCARD/ : {
145 EXIT_TEXT
146 EXIT_DATA
147 *(.exitcall.exit)
148 }
149
150 dram_end = dram_start + (CONFIG_ETRAX_DRAM_SIZE - __CONFIG_ETRAX_VMEM_SIZE)*1024*1024; 143 dram_end = dram_start + (CONFIG_ETRAX_DRAM_SIZE - __CONFIG_ETRAX_VMEM_SIZE)*1024*1024;
144
145 DISCARDS
151} 146}
diff --git a/arch/cris/mm/fault.c b/arch/cris/mm/fault.c
index f925115e3250..4a7cdd9ea1ee 100644
--- a/arch/cris/mm/fault.c
+++ b/arch/cris/mm/fault.c
@@ -29,7 +29,7 @@ extern void die_if_kernel(const char *, struct pt_regs *, long);
29 29
30/* current active page directory */ 30/* current active page directory */
31 31
32volatile DEFINE_PER_CPU(pgd_t *,current_pgd); 32DEFINE_PER_CPU(pgd_t *, current_pgd);
33unsigned long cris_signal_return_page; 33unsigned long cris_signal_return_page;
34 34
35/* 35/*
diff --git a/arch/frv/kernel/vmlinux.lds.S b/arch/frv/kernel/vmlinux.lds.S
index 22d9787406ed..7dbf41f68b52 100644
--- a/arch/frv/kernel/vmlinux.lds.S
+++ b/arch/frv/kernel/vmlinux.lds.S
@@ -177,6 +177,8 @@ SECTIONS
177 .debug_ranges 0 : { *(.debug_ranges) } 177 .debug_ranges 0 : { *(.debug_ranges) }
178 178
179 .comment 0 : { *(.comment) } 179 .comment 0 : { *(.comment) }
180
181 DISCARDS
180} 182}
181 183
182__kernel_image_size_no_bss = __bss_start - __kernel_image_start; 184__kernel_image_size_no_bss = __bss_start - __kernel_image_start;
diff --git a/arch/frv/mb93090-mb00/pci-frv.c b/arch/frv/mb93090-mb00/pci-frv.c
index 43d67534c712..566bdeb499d1 100644
--- a/arch/frv/mb93090-mb00/pci-frv.c
+++ b/arch/frv/mb93090-mb00/pci-frv.c
@@ -86,7 +86,7 @@ static void __init pcibios_allocate_bus_resources(struct list_head *bus_list)
86 struct pci_bus *bus; 86 struct pci_bus *bus;
87 struct pci_dev *dev; 87 struct pci_dev *dev;
88 int idx; 88 int idx;
89 struct resource *r, *pr; 89 struct resource *r;
90 90
91 /* Depth-First Search on bus tree */ 91 /* Depth-First Search on bus tree */
92 for (ln=bus_list->next; ln != bus_list; ln=ln->next) { 92 for (ln=bus_list->next; ln != bus_list; ln=ln->next) {
@@ -96,8 +96,7 @@ static void __init pcibios_allocate_bus_resources(struct list_head *bus_list)
96 r = &dev->resource[idx]; 96 r = &dev->resource[idx];
97 if (!r->start) 97 if (!r->start)
98 continue; 98 continue;
99 pr = pci_find_parent_resource(dev, r); 99 if (pci_claim_resource(dev, idx) < 0)
100 if (!pr || request_resource(pr, r) < 0)
101 printk(KERN_ERR "PCI: Cannot allocate resource region %d of bridge %s\n", idx, pci_name(dev)); 100 printk(KERN_ERR "PCI: Cannot allocate resource region %d of bridge %s\n", idx, pci_name(dev));
102 } 101 }
103 } 102 }
@@ -110,7 +109,7 @@ static void __init pcibios_allocate_resources(int pass)
110 struct pci_dev *dev = NULL; 109 struct pci_dev *dev = NULL;
111 int idx, disabled; 110 int idx, disabled;
112 u16 command; 111 u16 command;
113 struct resource *r, *pr; 112 struct resource *r;
114 113
115 for_each_pci_dev(dev) { 114 for_each_pci_dev(dev) {
116 pci_read_config_word(dev, PCI_COMMAND, &command); 115 pci_read_config_word(dev, PCI_COMMAND, &command);
@@ -127,8 +126,7 @@ static void __init pcibios_allocate_resources(int pass)
127 if (pass == disabled) { 126 if (pass == disabled) {
128 DBG("PCI: Resource %08lx-%08lx (f=%lx, d=%d, p=%d)\n", 127 DBG("PCI: Resource %08lx-%08lx (f=%lx, d=%d, p=%d)\n",
129 r->start, r->end, r->flags, disabled, pass); 128 r->start, r->end, r->flags, disabled, pass);
130 pr = pci_find_parent_resource(dev, r); 129 if (pci_claim_resource(dev, idx) < 0) {
131 if (!pr || request_resource(pr, r) < 0) {
132 printk(KERN_ERR "PCI: Cannot allocate resource region %d of device %s\n", idx, pci_name(dev)); 130 printk(KERN_ERR "PCI: Cannot allocate resource region %d of device %s\n", idx, pci_name(dev));
133 /* We'll assign a new address later */ 131 /* We'll assign a new address later */
134 r->end -= r->start; 132 r->end -= r->start;
diff --git a/arch/h8300/include/asm/pci.h b/arch/h8300/include/asm/pci.h
index 97389b35aa35..cc9762091c0a 100644
--- a/arch/h8300/include/asm/pci.h
+++ b/arch/h8300/include/asm/pci.h
@@ -8,7 +8,6 @@
8 */ 8 */
9 9
10#define pcibios_assign_all_busses() 0 10#define pcibios_assign_all_busses() 0
11#define pcibios_scan_all_fns(a, b) 0
12 11
13static inline void pcibios_set_master(struct pci_dev *dev) 12static inline void pcibios_set_master(struct pci_dev *dev)
14{ 13{
diff --git a/arch/h8300/kernel/vmlinux.lds.S b/arch/h8300/kernel/vmlinux.lds.S
index 43a87b9085b6..662b02ecb86e 100644
--- a/arch/h8300/kernel/vmlinux.lds.S
+++ b/arch/h8300/kernel/vmlinux.lds.S
@@ -152,9 +152,6 @@ SECTIONS
152 __end = . ; 152 __end = . ;
153 __ramstart = .; 153 __ramstart = .;
154 } 154 }
155 /DISCARD/ : {
156 *(.exitcall.exit)
157 }
158 .romfs : 155 .romfs :
159 { 156 {
160 *(.romfs*) 157 *(.romfs*)
@@ -165,4 +162,6 @@ SECTIONS
165 COMMAND_START = . - 0x200 ; 162 COMMAND_START = . - 0x200 ;
166 __ramend = . ; 163 __ramend = . ;
167 } 164 }
165
166 DISCARDS
168} 167}
diff --git a/arch/ia64/Kconfig b/arch/ia64/Kconfig
index 170042b420d4..011a1cdf0eb5 100644
--- a/arch/ia64/Kconfig
+++ b/arch/ia64/Kconfig
@@ -89,6 +89,9 @@ config GENERIC_TIME_VSYSCALL
89 bool 89 bool
90 default y 90 default y
91 91
92config HAVE_LEGACY_PER_CPU_AREA
93 def_bool y
94
92config HAVE_SETUP_PER_CPU_AREA 95config HAVE_SETUP_PER_CPU_AREA
93 def_bool y 96 def_bool y
94 97
@@ -112,6 +115,10 @@ config IA64_UNCACHED_ALLOCATOR
112 bool 115 bool
113 select GENERIC_ALLOCATOR 116 select GENERIC_ALLOCATOR
114 117
118config ARCH_USES_PG_UNCACHED
119 def_bool y
120 depends on IA64_UNCACHED_ALLOCATOR
121
115config AUDIT_ARCH 122config AUDIT_ARCH
116 bool 123 bool
117 default y 124 default y
diff --git a/arch/ia64/include/asm/agp.h b/arch/ia64/include/asm/agp.h
index c11fdd8ab4d7..01d09c401c5c 100644
--- a/arch/ia64/include/asm/agp.h
+++ b/arch/ia64/include/asm/agp.h
@@ -17,10 +17,6 @@
17#define unmap_page_from_agp(page) /* nothing */ 17#define unmap_page_from_agp(page) /* nothing */
18#define flush_agp_cache() mb() 18#define flush_agp_cache() mb()
19 19
20/* Convert a physical address to an address suitable for the GART. */
21#define phys_to_gart(x) (x)
22#define gart_to_phys(x) (x)
23
24/* GATT allocation. Returns/accepts GATT kernel virtual address. */ 20/* GATT allocation. Returns/accepts GATT kernel virtual address. */
25#define alloc_gatt_pages(order) \ 21#define alloc_gatt_pages(order) \
26 ((char *)__get_free_pages(GFP_KERNEL, (order))) 22 ((char *)__get_free_pages(GFP_KERNEL, (order)))
diff --git a/arch/ia64/include/asm/pci.h b/arch/ia64/include/asm/pci.h
index fcfca56bb850..55281aabe5f2 100644
--- a/arch/ia64/include/asm/pci.h
+++ b/arch/ia64/include/asm/pci.h
@@ -17,7 +17,6 @@
17 * loader. 17 * loader.
18 */ 18 */
19#define pcibios_assign_all_busses() 0 19#define pcibios_assign_all_busses() 0
20#define pcibios_scan_all_fns(a, b) 0
21 20
22#define PCIBIOS_MIN_IO 0x1000 21#define PCIBIOS_MIN_IO 0x1000
23#define PCIBIOS_MIN_MEM 0x10000000 22#define PCIBIOS_MIN_MEM 0x10000000
@@ -135,7 +134,18 @@ extern void pcibios_resource_to_bus(struct pci_dev *dev,
135extern void pcibios_bus_to_resource(struct pci_dev *dev, 134extern void pcibios_bus_to_resource(struct pci_dev *dev,
136 struct resource *res, struct pci_bus_region *region); 135 struct resource *res, struct pci_bus_region *region);
137 136
138#define pcibios_scan_all_fns(a, b) 0 137static inline struct resource *
138pcibios_select_root(struct pci_dev *pdev, struct resource *res)
139{
140 struct resource *root = NULL;
141
142 if (res->flags & IORESOURCE_IO)
143 root = &ioport_resource;
144 if (res->flags & IORESOURCE_MEM)
145 root = &iomem_resource;
146
147 return root;
148}
139 149
140#define HAVE_ARCH_PCI_GET_LEGACY_IDE_IRQ 150#define HAVE_ARCH_PCI_GET_LEGACY_IDE_IRQ
141static inline int pci_get_legacy_ide_irq(struct pci_dev *dev, int channel) 151static inline int pci_get_legacy_ide_irq(struct pci_dev *dev, int channel)
diff --git a/arch/ia64/include/asm/topology.h b/arch/ia64/include/asm/topology.h
index 7b4c8c70b2d1..d0141fbf51d0 100644
--- a/arch/ia64/include/asm/topology.h
+++ b/arch/ia64/include/asm/topology.h
@@ -61,12 +61,13 @@ void build_cpu_to_node_map(void);
61 .cache_nice_tries = 2, \ 61 .cache_nice_tries = 2, \
62 .busy_idx = 2, \ 62 .busy_idx = 2, \
63 .idle_idx = 1, \ 63 .idle_idx = 1, \
64 .newidle_idx = 2, \ 64 .newidle_idx = 0, \
65 .wake_idx = 1, \ 65 .wake_idx = 0, \
66 .forkexec_idx = 1, \ 66 .forkexec_idx = 0, \
67 .flags = SD_LOAD_BALANCE \ 67 .flags = SD_LOAD_BALANCE \
68 | SD_BALANCE_NEWIDLE \ 68 | SD_BALANCE_NEWIDLE \
69 | SD_BALANCE_EXEC \ 69 | SD_BALANCE_EXEC \
70 | SD_BALANCE_FORK \
70 | SD_WAKE_AFFINE, \ 71 | SD_WAKE_AFFINE, \
71 .last_balance = jiffies, \ 72 .last_balance = jiffies, \
72 .balance_interval = 1, \ 73 .balance_interval = 1, \
@@ -85,14 +86,14 @@ void build_cpu_to_node_map(void);
85 .cache_nice_tries = 2, \ 86 .cache_nice_tries = 2, \
86 .busy_idx = 3, \ 87 .busy_idx = 3, \
87 .idle_idx = 2, \ 88 .idle_idx = 2, \
88 .newidle_idx = 2, \ 89 .newidle_idx = 0, \
89 .wake_idx = 1, \ 90 .wake_idx = 0, \
90 .forkexec_idx = 1, \ 91 .forkexec_idx = 0, \
91 .flags = SD_LOAD_BALANCE \ 92 .flags = SD_LOAD_BALANCE \
93 | SD_BALANCE_NEWIDLE \
92 | SD_BALANCE_EXEC \ 94 | SD_BALANCE_EXEC \
93 | SD_BALANCE_FORK \ 95 | SD_BALANCE_FORK \
94 | SD_SERIALIZE \ 96 | SD_SERIALIZE, \
95 | SD_WAKE_BALANCE, \
96 .last_balance = jiffies, \ 97 .last_balance = jiffies, \
97 .balance_interval = 64, \ 98 .balance_interval = 64, \
98 .nr_balance_failed = 0, \ 99 .nr_balance_failed = 0, \
diff --git a/arch/ia64/kernel/head.S b/arch/ia64/kernel/head.S
index e6c5c3d5e1f8..23f846de62d5 100644
--- a/arch/ia64/kernel/head.S
+++ b/arch/ia64/kernel/head.S
@@ -34,7 +34,6 @@
34#include <asm/mca_asm.h> 34#include <asm/mca_asm.h>
35#include <linux/init.h> 35#include <linux/init.h>
36#include <linux/linkage.h> 36#include <linux/linkage.h>
37#include "head.h"
38 37
39#ifdef CONFIG_HOTPLUG_CPU 38#ifdef CONFIG_HOTPLUG_CPU
40#define SAL_PSR_BITS_TO_SET \ 39#define SAL_PSR_BITS_TO_SET \
diff --git a/arch/ia64/kernel/head.h b/arch/ia64/kernel/head.h
deleted file mode 100644
index 2e2ac6824e65..000000000000
--- a/arch/ia64/kernel/head.h
+++ /dev/null
@@ -1 +0,0 @@
1extern void console_print(const char *s);
diff --git a/arch/ia64/kernel/setup.c b/arch/ia64/kernel/setup.c
index 1b23ec126b63..1de86c96801d 100644
--- a/arch/ia64/kernel/setup.c
+++ b/arch/ia64/kernel/setup.c
@@ -855,11 +855,17 @@ identify_cpu (struct cpuinfo_ia64 *c)
855 c->unimpl_pa_mask = ~((1L<<63) | ((1L << phys_addr_size) - 1)); 855 c->unimpl_pa_mask = ~((1L<<63) | ((1L << phys_addr_size) - 1));
856} 856}
857 857
858/*
859 * In UP configuration, setup_per_cpu_areas() is defined in
860 * include/linux/percpu.h
861 */
862#ifdef CONFIG_SMP
858void __init 863void __init
859setup_per_cpu_areas (void) 864setup_per_cpu_areas (void)
860{ 865{
861 /* start_kernel() requires this... */ 866 /* start_kernel() requires this... */
862} 867}
868#endif
863 869
864/* 870/*
865 * Do the following calculations: 871 * Do the following calculations:
diff --git a/arch/ia64/kernel/smp.c b/arch/ia64/kernel/smp.c
index f0c521b0ba4c..93ebfea43c6c 100644
--- a/arch/ia64/kernel/smp.c
+++ b/arch/ia64/kernel/smp.c
@@ -58,7 +58,8 @@ static struct local_tlb_flush_counts {
58 unsigned int count; 58 unsigned int count;
59} __attribute__((__aligned__(32))) local_tlb_flush_counts[NR_CPUS]; 59} __attribute__((__aligned__(32))) local_tlb_flush_counts[NR_CPUS];
60 60
61static DEFINE_PER_CPU(unsigned short, shadow_flush_counts[NR_CPUS]) ____cacheline_aligned; 61static DEFINE_PER_CPU_SHARED_ALIGNED(unsigned short [NR_CPUS],
62 shadow_flush_counts);
62 63
63#define IPI_CALL_FUNC 0 64#define IPI_CALL_FUNC 0
64#define IPI_CPU_STOP 1 65#define IPI_CPU_STOP 1
diff --git a/arch/ia64/kernel/vmlinux.lds.S b/arch/ia64/kernel/vmlinux.lds.S
index 4a95e86b9ac2..eb4214d1c5af 100644
--- a/arch/ia64/kernel/vmlinux.lds.S
+++ b/arch/ia64/kernel/vmlinux.lds.S
@@ -24,14 +24,14 @@ PHDRS {
24} 24}
25SECTIONS 25SECTIONS
26{ 26{
27 /* Sections to be discarded */ 27 /* unwind exit sections must be discarded before the rest of the
28 sections get included. */
28 /DISCARD/ : { 29 /DISCARD/ : {
29 EXIT_TEXT
30 EXIT_DATA
31 *(.exitcall.exit)
32 *(.IA_64.unwind.exit.text) 30 *(.IA_64.unwind.exit.text)
33 *(.IA_64.unwind_info.exit.text) 31 *(.IA_64.unwind_info.exit.text)
34 } 32 *(.comment)
33 *(.note)
34 }
35 35
36 v = PAGE_OFFSET; /* this symbol is here to make debugging easier... */ 36 v = PAGE_OFFSET; /* this symbol is here to make debugging easier... */
37 phys_start = _start - LOAD_OFFSET; 37 phys_start = _start - LOAD_OFFSET;
@@ -316,7 +316,7 @@ SECTIONS
316 .debug_funcnames 0 : { *(.debug_funcnames) } 316 .debug_funcnames 0 : { *(.debug_funcnames) }
317 .debug_typenames 0 : { *(.debug_typenames) } 317 .debug_typenames 0 : { *(.debug_typenames) }
318 .debug_varnames 0 : { *(.debug_varnames) } 318 .debug_varnames 0 : { *(.debug_varnames) }
319 /* These must appear regardless of . */ 319
320 /DISCARD/ : { *(.comment) } 320 /* Default discards */
321 /DISCARD/ : { *(.note) } 321 DISCARDS
322} 322}
diff --git a/arch/ia64/sn/kernel/setup.c b/arch/ia64/sn/kernel/setup.c
index e456f062f241..ece1bf994499 100644
--- a/arch/ia64/sn/kernel/setup.c
+++ b/arch/ia64/sn/kernel/setup.c
@@ -71,7 +71,7 @@ EXPORT_SYMBOL(sn_rtc_cycles_per_second);
71DEFINE_PER_CPU(struct sn_hub_info_s, __sn_hub_info); 71DEFINE_PER_CPU(struct sn_hub_info_s, __sn_hub_info);
72EXPORT_PER_CPU_SYMBOL(__sn_hub_info); 72EXPORT_PER_CPU_SYMBOL(__sn_hub_info);
73 73
74DEFINE_PER_CPU(short, __sn_cnodeid_to_nasid[MAX_COMPACT_NODES]); 74DEFINE_PER_CPU(short [MAX_COMPACT_NODES], __sn_cnodeid_to_nasid);
75EXPORT_PER_CPU_SYMBOL(__sn_cnodeid_to_nasid); 75EXPORT_PER_CPU_SYMBOL(__sn_cnodeid_to_nasid);
76 76
77DEFINE_PER_CPU(struct nodepda_s *, __sn_nodepda); 77DEFINE_PER_CPU(struct nodepda_s *, __sn_nodepda);
diff --git a/arch/m32r/kernel/vmlinux.lds.S b/arch/m32r/kernel/vmlinux.lds.S
index 4179adf6c624..de5e21cca6a5 100644
--- a/arch/m32r/kernel/vmlinux.lds.S
+++ b/arch/m32r/kernel/vmlinux.lds.S
@@ -120,13 +120,6 @@ SECTIONS
120 120
121 _end = . ; 121 _end = . ;
122 122
123 /* Sections to be discarded */
124 /DISCARD/ : {
125 EXIT_TEXT
126 EXIT_DATA
127 *(.exitcall.exit)
128 }
129
130 /* Stabs debugging sections. */ 123 /* Stabs debugging sections. */
131 .stab 0 : { *(.stab) } 124 .stab 0 : { *(.stab) }
132 .stabstr 0 : { *(.stabstr) } 125 .stabstr 0 : { *(.stabstr) }
@@ -135,4 +128,7 @@ SECTIONS
135 .stab.index 0 : { *(.stab.index) } 128 .stab.index 0 : { *(.stab.index) }
136 .stab.indexstr 0 : { *(.stab.indexstr) } 129 .stab.indexstr 0 : { *(.stab.indexstr) }
137 .comment 0 : { *(.comment) } 130 .comment 0 : { *(.comment) }
131
132 /* Sections to be discarded */
133 DISCARDS
138} 134}
diff --git a/arch/m68k/include/asm/checksum.h b/arch/m68k/include/asm/checksum.h
index 1cf544767453..ec514485c8b6 100644
--- a/arch/m68k/include/asm/checksum.h
+++ b/arch/m68k/include/asm/checksum.h
@@ -1,5 +1,170 @@
1#ifdef __uClinux__ 1#ifndef _M68K_CHECKSUM_H
2#include "checksum_no.h" 2#define _M68K_CHECKSUM_H
3
4#include <linux/in6.h>
5
6/*
7 * computes the checksum of a memory block at buff, length len,
8 * and adds in "sum" (32-bit)
9 *
10 * returns a 32-bit number suitable for feeding into itself
11 * or csum_tcpudp_magic
12 *
13 * this function must be called with even lengths, except
14 * for the last fragment, which may be odd
15 *
16 * it's best to have buff aligned on a 32-bit boundary
17 */
18__wsum csum_partial(const void *buff, int len, __wsum sum);
19
20/*
21 * the same as csum_partial, but copies from src while it
22 * checksums
23 *
24 * here even more important to align src and dst on a 32-bit (or even
25 * better 64-bit) boundary
26 */
27
28extern __wsum csum_partial_copy_from_user(const void __user *src,
29 void *dst,
30 int len, __wsum sum,
31 int *csum_err);
32
33extern __wsum csum_partial_copy_nocheck(const void *src,
34 void *dst, int len,
35 __wsum sum);
36
37
38#ifdef CONFIG_COLDFIRE
39
40/*
41 * The ColdFire cores don't support all the 68k instructions used
42 * in the optimized checksum code below. So it reverts back to using
43 * more standard C coded checksums. The fast checksum code is
44 * significantly larger than the optimized version, so it is not
45 * inlined here.
46 */
47__sum16 ip_fast_csum(const void *iph, unsigned int ihl);
48
49static inline __sum16 csum_fold(__wsum sum)
50{
51 unsigned int tmp = (__force u32)sum;
52
53 tmp = (tmp & 0xffff) + (tmp >> 16);
54 tmp = (tmp & 0xffff) + (tmp >> 16);
55
56 return (__force __sum16)~tmp;
57}
58
3#else 59#else
4#include "checksum_mm.h" 60
5#endif 61/*
62 * This is a version of ip_fast_csum() optimized for IP headers,
63 * which always checksum on 4 octet boundaries.
64 */
65static inline __sum16 ip_fast_csum(const void *iph, unsigned int ihl)
66{
67 unsigned int sum = 0;
68 unsigned long tmp;
69
70 __asm__ ("subqw #1,%2\n"
71 "1:\t"
72 "movel %1@+,%3\n\t"
73 "addxl %3,%0\n\t"
74 "dbra %2,1b\n\t"
75 "movel %0,%3\n\t"
76 "swap %3\n\t"
77 "addxw %3,%0\n\t"
78 "clrw %3\n\t"
79 "addxw %3,%0\n\t"
80 : "=d" (sum), "=&a" (iph), "=&d" (ihl), "=&d" (tmp)
81 : "0" (sum), "1" (iph), "2" (ihl)
82 : "memory");
83 return (__force __sum16)~sum;
84}
85
86static inline __sum16 csum_fold(__wsum sum)
87{
88 unsigned int tmp = (__force u32)sum;
89
90 __asm__("swap %1\n\t"
91 "addw %1, %0\n\t"
92 "clrw %1\n\t"
93 "addxw %1, %0"
94 : "=&d" (sum), "=&d" (tmp)
95 : "0" (sum), "1" (tmp));
96
97 return (__force __sum16)~sum;
98}
99
100#endif /* CONFIG_COLDFIRE */
101
102static inline __wsum
103csum_tcpudp_nofold(__be32 saddr, __be32 daddr, unsigned short len,
104 unsigned short proto, __wsum sum)
105{
106 __asm__ ("addl %2,%0\n\t"
107 "addxl %3,%0\n\t"
108 "addxl %4,%0\n\t"
109 "clrl %1\n\t"
110 "addxl %1,%0"
111 : "=&d" (sum), "=d" (saddr)
112 : "g" (daddr), "1" (saddr), "d" (len + proto),
113 "0" (sum));
114 return sum;
115}
116
117
118/*
119 * computes the checksum of the TCP/UDP pseudo-header
120 * returns a 16-bit checksum, already complemented
121 */
122static inline __sum16
123csum_tcpudp_magic(__be32 saddr, __be32 daddr, unsigned short len,
124 unsigned short proto, __wsum sum)
125{
126 return csum_fold(csum_tcpudp_nofold(saddr,daddr,len,proto,sum));
127}
128
129/*
130 * this routine is used for miscellaneous IP-like checksums, mainly
131 * in icmp.c
132 */
133
134static inline __sum16 ip_compute_csum(const void *buff, int len)
135{
136 return csum_fold (csum_partial(buff, len, 0));
137}
138
139#define _HAVE_ARCH_IPV6_CSUM
140static __inline__ __sum16
141csum_ipv6_magic(const struct in6_addr *saddr, const struct in6_addr *daddr,
142 __u32 len, unsigned short proto, __wsum sum)
143{
144 register unsigned long tmp;
145 __asm__("addl %2@,%0\n\t"
146 "movel %2@(4),%1\n\t"
147 "addxl %1,%0\n\t"
148 "movel %2@(8),%1\n\t"
149 "addxl %1,%0\n\t"
150 "movel %2@(12),%1\n\t"
151 "addxl %1,%0\n\t"
152 "movel %3@,%1\n\t"
153 "addxl %1,%0\n\t"
154 "movel %3@(4),%1\n\t"
155 "addxl %1,%0\n\t"
156 "movel %3@(8),%1\n\t"
157 "addxl %1,%0\n\t"
158 "movel %3@(12),%1\n\t"
159 "addxl %1,%0\n\t"
160 "addxl %4,%0\n\t"
161 "clrl %1\n\t"
162 "addxl %1,%0"
163 : "=&d" (sum), "=&d" (tmp)
164 : "a" (saddr), "a" (daddr), "d" (len + proto),
165 "0" (sum));
166
167 return csum_fold(sum);
168}
169
170#endif /* _M68K_CHECKSUM_H */
diff --git a/arch/m68k/include/asm/checksum_mm.h b/arch/m68k/include/asm/checksum_mm.h
deleted file mode 100644
index 494f9aec37ea..000000000000
--- a/arch/m68k/include/asm/checksum_mm.h
+++ /dev/null
@@ -1,148 +0,0 @@
1#ifndef _M68K_CHECKSUM_H
2#define _M68K_CHECKSUM_H
3
4#include <linux/in6.h>
5
6/*
7 * computes the checksum of a memory block at buff, length len,
8 * and adds in "sum" (32-bit)
9 *
10 * returns a 32-bit number suitable for feeding into itself
11 * or csum_tcpudp_magic
12 *
13 * this function must be called with even lengths, except
14 * for the last fragment, which may be odd
15 *
16 * it's best to have buff aligned on a 32-bit boundary
17 */
18__wsum csum_partial(const void *buff, int len, __wsum sum);
19
20/*
21 * the same as csum_partial, but copies from src while it
22 * checksums
23 *
24 * here even more important to align src and dst on a 32-bit (or even
25 * better 64-bit) boundary
26 */
27
28extern __wsum csum_partial_copy_from_user(const void __user *src,
29 void *dst,
30 int len, __wsum sum,
31 int *csum_err);
32
33extern __wsum csum_partial_copy_nocheck(const void *src,
34 void *dst, int len,
35 __wsum sum);
36
37/*
38 * This is a version of ip_compute_csum() optimized for IP headers,
39 * which always checksum on 4 octet boundaries.
40 *
41 */
42static inline __sum16 ip_fast_csum(const void *iph, unsigned int ihl)
43{
44 unsigned int sum = 0;
45 unsigned long tmp;
46
47 __asm__ ("subqw #1,%2\n"
48 "1:\t"
49 "movel %1@+,%3\n\t"
50 "addxl %3,%0\n\t"
51 "dbra %2,1b\n\t"
52 "movel %0,%3\n\t"
53 "swap %3\n\t"
54 "addxw %3,%0\n\t"
55 "clrw %3\n\t"
56 "addxw %3,%0\n\t"
57 : "=d" (sum), "=&a" (iph), "=&d" (ihl), "=&d" (tmp)
58 : "0" (sum), "1" (iph), "2" (ihl)
59 : "memory");
60 return (__force __sum16)~sum;
61}
62
63/*
64 * Fold a partial checksum
65 */
66
67static inline __sum16 csum_fold(__wsum sum)
68{
69 unsigned int tmp = (__force u32)sum;
70 __asm__("swap %1\n\t"
71 "addw %1, %0\n\t"
72 "clrw %1\n\t"
73 "addxw %1, %0"
74 : "=&d" (sum), "=&d" (tmp)
75 : "0" (sum), "1" (tmp));
76 return (__force __sum16)~sum;
77}
78
79
80static inline __wsum
81csum_tcpudp_nofold(__be32 saddr, __be32 daddr, unsigned short len,
82 unsigned short proto, __wsum sum)
83{
84 __asm__ ("addl %2,%0\n\t"
85 "addxl %3,%0\n\t"
86 "addxl %4,%0\n\t"
87 "clrl %1\n\t"
88 "addxl %1,%0"
89 : "=&d" (sum), "=d" (saddr)
90 : "g" (daddr), "1" (saddr), "d" (len + proto),
91 "0" (sum));
92 return sum;
93}
94
95
96/*
97 * computes the checksum of the TCP/UDP pseudo-header
98 * returns a 16-bit checksum, already complemented
99 */
100static inline __sum16
101csum_tcpudp_magic(__be32 saddr, __be32 daddr, unsigned short len,
102 unsigned short proto, __wsum sum)
103{
104 return csum_fold(csum_tcpudp_nofold(saddr,daddr,len,proto,sum));
105}
106
107/*
108 * this routine is used for miscellaneous IP-like checksums, mainly
109 * in icmp.c
110 */
111
112static inline __sum16 ip_compute_csum(const void *buff, int len)
113{
114 return csum_fold (csum_partial(buff, len, 0));
115}
116
117#define _HAVE_ARCH_IPV6_CSUM
118static __inline__ __sum16
119csum_ipv6_magic(const struct in6_addr *saddr, const struct in6_addr *daddr,
120 __u32 len, unsigned short proto, __wsum sum)
121{
122 register unsigned long tmp;
123 __asm__("addl %2@,%0\n\t"
124 "movel %2@(4),%1\n\t"
125 "addxl %1,%0\n\t"
126 "movel %2@(8),%1\n\t"
127 "addxl %1,%0\n\t"
128 "movel %2@(12),%1\n\t"
129 "addxl %1,%0\n\t"
130 "movel %3@,%1\n\t"
131 "addxl %1,%0\n\t"
132 "movel %3@(4),%1\n\t"
133 "addxl %1,%0\n\t"
134 "movel %3@(8),%1\n\t"
135 "addxl %1,%0\n\t"
136 "movel %3@(12),%1\n\t"
137 "addxl %1,%0\n\t"
138 "addxl %4,%0\n\t"
139 "clrl %1\n\t"
140 "addxl %1,%0"
141 : "=&d" (sum), "=&d" (tmp)
142 : "a" (saddr), "a" (daddr), "d" (len + proto),
143 "0" (sum));
144
145 return csum_fold(sum);
146}
147
148#endif /* _M68K_CHECKSUM_H */
diff --git a/arch/m68k/include/asm/checksum_no.h b/arch/m68k/include/asm/checksum_no.h
deleted file mode 100644
index 81883482ffb1..000000000000
--- a/arch/m68k/include/asm/checksum_no.h
+++ /dev/null
@@ -1,132 +0,0 @@
1#ifndef _M68K_CHECKSUM_H
2#define _M68K_CHECKSUM_H
3
4#include <linux/in6.h>
5
6/*
7 * computes the checksum of a memory block at buff, length len,
8 * and adds in "sum" (32-bit)
9 *
10 * returns a 32-bit number suitable for feeding into itself
11 * or csum_tcpudp_magic
12 *
13 * this function must be called with even lengths, except
14 * for the last fragment, which may be odd
15 *
16 * it's best to have buff aligned on a 32-bit boundary
17 */
18__wsum csum_partial(const void *buff, int len, __wsum sum);
19
20/*
21 * the same as csum_partial, but copies from src while it
22 * checksums
23 *
24 * here even more important to align src and dst on a 32-bit (or even
25 * better 64-bit) boundary
26 */
27
28__wsum csum_partial_copy_nocheck(const void *src, void *dst,
29 int len, __wsum sum);
30
31
32/*
33 * the same as csum_partial_copy, but copies from user space.
34 *
35 * here even more important to align src and dst on a 32-bit (or even
36 * better 64-bit) boundary
37 */
38
39extern __wsum csum_partial_copy_from_user(const void __user *src,
40 void *dst, int len, __wsum sum, int *csum_err);
41
42__sum16 ip_fast_csum(const void *iph, unsigned int ihl);
43
44/*
45 * Fold a partial checksum
46 */
47
48static inline __sum16 csum_fold(__wsum sum)
49{
50 unsigned int tmp = (__force u32)sum;
51#ifdef CONFIG_COLDFIRE
52 tmp = (tmp & 0xffff) + (tmp >> 16);
53 tmp = (tmp & 0xffff) + (tmp >> 16);
54 return (__force __sum16)~tmp;
55#else
56 __asm__("swap %1\n\t"
57 "addw %1, %0\n\t"
58 "clrw %1\n\t"
59 "addxw %1, %0"
60 : "=&d" (sum), "=&d" (tmp)
61 : "0" (sum), "1" (sum));
62 return (__force __sum16)~sum;
63#endif
64}
65
66
67/*
68 * computes the checksum of the TCP/UDP pseudo-header
69 * returns a 16-bit checksum, already complemented
70 */
71
72static inline __wsum
73csum_tcpudp_nofold(__be32 saddr, __be32 daddr, unsigned short len,
74 unsigned short proto, __wsum sum)
75{
76 __asm__ ("addl %1,%0\n\t"
77 "addxl %4,%0\n\t"
78 "addxl %5,%0\n\t"
79 "clrl %1\n\t"
80 "addxl %1,%0"
81 : "=&d" (sum), "=&d" (saddr)
82 : "0" (daddr), "1" (saddr), "d" (len + proto),
83 "d"(sum));
84 return 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 */
98
99extern __sum16 ip_compute_csum(const void *buff, int len);
100
101#define _HAVE_ARCH_IPV6_CSUM
102static __inline__ __sum16
103csum_ipv6_magic(const struct in6_addr *saddr, const struct in6_addr *daddr,
104 __u32 len, unsigned short proto, __wsum sum)
105{
106 register unsigned long tmp;
107 __asm__("addl %2@,%0\n\t"
108 "movel %2@(4),%1\n\t"
109 "addxl %1,%0\n\t"
110 "movel %2@(8),%1\n\t"
111 "addxl %1,%0\n\t"
112 "movel %2@(12),%1\n\t"
113 "addxl %1,%0\n\t"
114 "movel %3@,%1\n\t"
115 "addxl %1,%0\n\t"
116 "movel %3@(4),%1\n\t"
117 "addxl %1,%0\n\t"
118 "movel %3@(8),%1\n\t"
119 "addxl %1,%0\n\t"
120 "movel %3@(12),%1\n\t"
121 "addxl %1,%0\n\t"
122 "addxl %4,%0\n\t"
123 "clrl %1\n\t"
124 "addxl %1,%0"
125 : "=&d" (sum), "=&d" (tmp)
126 : "a" (saddr), "a" (daddr), "d" (len + proto),
127 "0" (sum));
128
129 return csum_fold(sum);
130}
131
132#endif /* _M68K_CHECKSUM_H */
diff --git a/arch/m68k/include/asm/dma.h b/arch/m68k/include/asm/dma.h
index b82e660cf1c2..6fbdfe895104 100644
--- a/arch/m68k/include/asm/dma.h
+++ b/arch/m68k/include/asm/dma.h
@@ -1,5 +1,491 @@
1#ifdef __uClinux__ 1#ifndef _M68K_DMA_H
2#include "dma_no.h" 2#define _M68K_DMA_H 1
3
4#ifdef CONFIG_COLDFIRE
5/*
6 * ColdFire DMA Model:
7 * ColdFire DMA supports two forms of DMA: Single and Dual address. Single
8 * address mode emits a source address, and expects that the device will either
9 * pick up the data (DMA READ) or source data (DMA WRITE). This implies that
10 * the device will place data on the correct byte(s) of the data bus, as the
11 * memory transactions are always 32 bits. This implies that only 32 bit
12 * devices will find single mode transfers useful. Dual address DMA mode
13 * performs two cycles: source read and destination write. ColdFire will
14 * align the data so that the device will always get the correct bytes, thus
15 * is useful for 8 and 16 bit devices. This is the mode that is supported
16 * below.
17 *
18 * AUG/22/2000 : added support for 32-bit Dual-Address-Mode (K) 2000
19 * Oliver Kamphenkel (O.Kamphenkel@tu-bs.de)
20 *
21 * AUG/25/2000 : addad support for 8, 16 and 32-bit Single-Address-Mode (K)2000
22 * Oliver Kamphenkel (O.Kamphenkel@tu-bs.de)
23 *
24 * APR/18/2002 : added proper support for MCF5272 DMA controller.
25 * Arthur Shipkowski (art@videon-central.com)
26 */
27
28#include <asm/coldfire.h>
29#include <asm/mcfsim.h>
30#include <asm/mcfdma.h>
31
32/*
33 * Set number of channels of DMA on ColdFire for different implementations.
34 */
35#if defined(CONFIG_M5249) || defined(CONFIG_M5307) || defined(CONFIG_M5407) || \
36 defined(CONFIG_M523x) || defined(CONFIG_M527x) || defined(CONFIG_M528x)
37#define MAX_M68K_DMA_CHANNELS 4
38#elif defined(CONFIG_M5272)
39#define MAX_M68K_DMA_CHANNELS 1
40#elif defined(CONFIG_M532x)
41#define MAX_M68K_DMA_CHANNELS 0
3#else 42#else
4#include "dma_mm.h" 43#define MAX_M68K_DMA_CHANNELS 2
5#endif 44#endif
45
46extern unsigned int dma_base_addr[MAX_M68K_DMA_CHANNELS];
47extern unsigned int dma_device_address[MAX_M68K_DMA_CHANNELS];
48
49#if !defined(CONFIG_M5272)
50#define DMA_MODE_WRITE_BIT 0x01 /* Memory/IO to IO/Memory select */
51#define DMA_MODE_WORD_BIT 0x02 /* 8 or 16 bit transfers */
52#define DMA_MODE_LONG_BIT 0x04 /* or 32 bit transfers */
53#define DMA_MODE_SINGLE_BIT 0x08 /* single-address-mode */
54
55/* I/O to memory, 8 bits, mode */
56#define DMA_MODE_READ 0
57/* memory to I/O, 8 bits, mode */
58#define DMA_MODE_WRITE 1
59/* I/O to memory, 16 bits, mode */
60#define DMA_MODE_READ_WORD 2
61/* memory to I/O, 16 bits, mode */
62#define DMA_MODE_WRITE_WORD 3
63/* I/O to memory, 32 bits, mode */
64#define DMA_MODE_READ_LONG 4
65/* memory to I/O, 32 bits, mode */
66#define DMA_MODE_WRITE_LONG 5
67/* I/O to memory, 8 bits, single-address-mode */
68#define DMA_MODE_READ_SINGLE 8
69/* memory to I/O, 8 bits, single-address-mode */
70#define DMA_MODE_WRITE_SINGLE 9
71/* I/O to memory, 16 bits, single-address-mode */
72#define DMA_MODE_READ_WORD_SINGLE 10
73/* memory to I/O, 16 bits, single-address-mode */
74#define DMA_MODE_WRITE_WORD_SINGLE 11
75/* I/O to memory, 32 bits, single-address-mode */
76#define DMA_MODE_READ_LONG_SINGLE 12
77/* memory to I/O, 32 bits, single-address-mode */
78#define DMA_MODE_WRITE_LONG_SINGLE 13
79
80#else /* CONFIG_M5272 is defined */
81
82/* Source static-address mode */
83#define DMA_MODE_SRC_SA_BIT 0x01
84/* Two bits to select between all four modes */
85#define DMA_MODE_SSIZE_MASK 0x06
86/* Offset to shift bits in */
87#define DMA_MODE_SSIZE_OFF 0x01
88/* Destination static-address mode */
89#define DMA_MODE_DES_SA_BIT 0x10
90/* Two bits to select between all four modes */
91#define DMA_MODE_DSIZE_MASK 0x60
92/* Offset to shift bits in */
93#define DMA_MODE_DSIZE_OFF 0x05
94/* Size modifiers */
95#define DMA_MODE_SIZE_LONG 0x00
96#define DMA_MODE_SIZE_BYTE 0x01
97#define DMA_MODE_SIZE_WORD 0x02
98#define DMA_MODE_SIZE_LINE 0x03
99
100/*
101 * Aliases to help speed quick ports; these may be suboptimal, however. They
102 * do not include the SINGLE mode modifiers since the MCF5272 does not have a
103 * mode where the device is in control of its addressing.
104 */
105
106/* I/O to memory, 8 bits, mode */
107#define DMA_MODE_READ ((DMA_MODE_SIZE_BYTE << DMA_MODE_DSIZE_OFF) | (DMA_MODE_SIZE_BYTE << DMA_MODE_SSIZE_OFF) | DMA_SRC_SA_BIT)
108/* memory to I/O, 8 bits, mode */
109#define DMA_MODE_WRITE ((DMA_MODE_SIZE_BYTE << DMA_MODE_DSIZE_OFF) | (DMA_MODE_SIZE_BYTE << DMA_MODE_SSIZE_OFF) | DMA_DES_SA_BIT)
110/* I/O to memory, 16 bits, mode */
111#define DMA_MODE_READ_WORD ((DMA_MODE_SIZE_WORD << DMA_MODE_DSIZE_OFF) | (DMA_MODE_SIZE_WORD << DMA_MODE_SSIZE_OFF) | DMA_SRC_SA_BIT)
112/* memory to I/O, 16 bits, mode */
113#define DMA_MODE_WRITE_WORD ((DMA_MODE_SIZE_WORD << DMA_MODE_DSIZE_OFF) | (DMA_MODE_SIZE_WORD << DMA_MODE_SSIZE_OFF) | DMA_DES_SA_BIT)
114/* I/O to memory, 32 bits, mode */
115#define DMA_MODE_READ_LONG ((DMA_MODE_SIZE_LONG << DMA_MODE_DSIZE_OFF) | (DMA_MODE_SIZE_LONG << DMA_MODE_SSIZE_OFF) | DMA_SRC_SA_BIT)
116/* memory to I/O, 32 bits, mode */
117#define DMA_MODE_WRITE_LONG ((DMA_MODE_SIZE_LONG << DMA_MODE_DSIZE_OFF) | (DMA_MODE_SIZE_LONG << DMA_MODE_SSIZE_OFF) | DMA_DES_SA_BIT)
118
119#endif /* !defined(CONFIG_M5272) */
120
121#if !defined(CONFIG_M5272)
122/* enable/disable a specific DMA channel */
123static __inline__ void enable_dma(unsigned int dmanr)
124{
125 volatile unsigned short *dmawp;
126
127#ifdef DMA_DEBUG
128 printk("enable_dma(dmanr=%d)\n", dmanr);
129#endif
130
131 dmawp = (unsigned short *) dma_base_addr[dmanr];
132 dmawp[MCFDMA_DCR] |= MCFDMA_DCR_EEXT;
133}
134
135static __inline__ void disable_dma(unsigned int dmanr)
136{
137 volatile unsigned short *dmawp;
138 volatile unsigned char *dmapb;
139
140#ifdef DMA_DEBUG
141 printk("disable_dma(dmanr=%d)\n", dmanr);
142#endif
143
144 dmawp = (unsigned short *) dma_base_addr[dmanr];
145 dmapb = (unsigned char *) dma_base_addr[dmanr];
146
147 /* Turn off external requests, and stop any DMA in progress */
148 dmawp[MCFDMA_DCR] &= ~MCFDMA_DCR_EEXT;
149 dmapb[MCFDMA_DSR] = MCFDMA_DSR_DONE;
150}
151
152/*
153 * Clear the 'DMA Pointer Flip Flop'.
154 * Write 0 for LSB/MSB, 1 for MSB/LSB access.
155 * Use this once to initialize the FF to a known state.
156 * After that, keep track of it. :-)
157 * --- In order to do that, the DMA routines below should ---
158 * --- only be used while interrupts are disabled! ---
159 *
160 * This is a NOP for ColdFire. Provide a stub for compatibility.
161 */
162static __inline__ void clear_dma_ff(unsigned int dmanr)
163{
164}
165
166/* set mode (above) for a specific DMA channel */
167static __inline__ void set_dma_mode(unsigned int dmanr, char mode)
168{
169
170 volatile unsigned char *dmabp;
171 volatile unsigned short *dmawp;
172
173#ifdef DMA_DEBUG
174 printk("set_dma_mode(dmanr=%d,mode=%d)\n", dmanr, mode);
175#endif
176
177 dmabp = (unsigned char *) dma_base_addr[dmanr];
178 dmawp = (unsigned short *) dma_base_addr[dmanr];
179
180 /* Clear config errors */
181 dmabp[MCFDMA_DSR] = MCFDMA_DSR_DONE;
182
183 /* Set command register */
184 dmawp[MCFDMA_DCR] =
185 MCFDMA_DCR_INT | /* Enable completion irq */
186 MCFDMA_DCR_CS | /* Force one xfer per request */
187 MCFDMA_DCR_AA | /* Enable auto alignment */
188 /* single-address-mode */
189 ((mode & DMA_MODE_SINGLE_BIT) ? MCFDMA_DCR_SAA : 0) |
190 /* sets s_rw (-> r/w) high if Memory to I/0 */
191 ((mode & DMA_MODE_WRITE_BIT) ? MCFDMA_DCR_S_RW : 0) |
192 /* Memory to I/O or I/O to Memory */
193 ((mode & DMA_MODE_WRITE_BIT) ? MCFDMA_DCR_SINC : MCFDMA_DCR_DINC) |
194 /* 32 bit, 16 bit or 8 bit transfers */
195 ((mode & DMA_MODE_WORD_BIT) ? MCFDMA_DCR_SSIZE_WORD :
196 ((mode & DMA_MODE_LONG_BIT) ? MCFDMA_DCR_SSIZE_LONG :
197 MCFDMA_DCR_SSIZE_BYTE)) |
198 ((mode & DMA_MODE_WORD_BIT) ? MCFDMA_DCR_DSIZE_WORD :
199 ((mode & DMA_MODE_LONG_BIT) ? MCFDMA_DCR_DSIZE_LONG :
200 MCFDMA_DCR_DSIZE_BYTE));
201
202#ifdef DEBUG_DMA
203 printk("%s(%d): dmanr=%d DSR[%x]=%x DCR[%x]=%x\n", __FILE__, __LINE__,
204 dmanr, (int) &dmabp[MCFDMA_DSR], dmabp[MCFDMA_DSR],
205 (int) &dmawp[MCFDMA_DCR], dmawp[MCFDMA_DCR]);
206#endif
207}
208
209/* Set transfer address for specific DMA channel */
210static __inline__ void set_dma_addr(unsigned int dmanr, unsigned int a)
211{
212 volatile unsigned short *dmawp;
213 volatile unsigned int *dmalp;
214
215#ifdef DMA_DEBUG
216 printk("set_dma_addr(dmanr=%d,a=%x)\n", dmanr, a);
217#endif
218
219 dmawp = (unsigned short *) dma_base_addr[dmanr];
220 dmalp = (unsigned int *) dma_base_addr[dmanr];
221
222 /* Determine which address registers are used for memory/device accesses */
223 if (dmawp[MCFDMA_DCR] & MCFDMA_DCR_SINC) {
224 /* Source incrementing, must be memory */
225 dmalp[MCFDMA_SAR] = a;
226 /* Set dest address, must be device */
227 dmalp[MCFDMA_DAR] = dma_device_address[dmanr];
228 } else {
229 /* Destination incrementing, must be memory */
230 dmalp[MCFDMA_DAR] = a;
231 /* Set source address, must be device */
232 dmalp[MCFDMA_SAR] = dma_device_address[dmanr];
233 }
234
235#ifdef DEBUG_DMA
236 printk("%s(%d): dmanr=%d DCR[%x]=%x SAR[%x]=%08x DAR[%x]=%08x\n",
237 __FILE__, __LINE__, dmanr, (int) &dmawp[MCFDMA_DCR], dmawp[MCFDMA_DCR],
238 (int) &dmalp[MCFDMA_SAR], dmalp[MCFDMA_SAR],
239 (int) &dmalp[MCFDMA_DAR], dmalp[MCFDMA_DAR]);
240#endif
241}
242
243/*
244 * Specific for Coldfire - sets device address.
245 * Should be called after the mode set call, and before set DMA address.
246 */
247static __inline__ void set_dma_device_addr(unsigned int dmanr, unsigned int a)
248{
249#ifdef DMA_DEBUG
250 printk("set_dma_device_addr(dmanr=%d,a=%x)\n", dmanr, a);
251#endif
252
253 dma_device_address[dmanr] = a;
254}
255
256/*
257 * NOTE 2: "count" represents _bytes_.
258 */
259static __inline__ void set_dma_count(unsigned int dmanr, unsigned int count)
260{
261 volatile unsigned short *dmawp;
262
263#ifdef DMA_DEBUG
264 printk("set_dma_count(dmanr=%d,count=%d)\n", dmanr, count);
265#endif
266
267 dmawp = (unsigned short *) dma_base_addr[dmanr];
268 dmawp[MCFDMA_BCR] = (unsigned short)count;
269}
270
271/*
272 * Get DMA residue count. After a DMA transfer, this
273 * should return zero. Reading this while a DMA transfer is
274 * still in progress will return unpredictable results.
275 * Otherwise, it returns the number of _bytes_ left to transfer.
276 */
277static __inline__ int get_dma_residue(unsigned int dmanr)
278{
279 volatile unsigned short *dmawp;
280 unsigned short count;
281
282#ifdef DMA_DEBUG
283 printk("get_dma_residue(dmanr=%d)\n", dmanr);
284#endif
285
286 dmawp = (unsigned short *) dma_base_addr[dmanr];
287 count = dmawp[MCFDMA_BCR];
288 return((int) count);
289}
290#else /* CONFIG_M5272 is defined */
291
292/*
293 * The MCF5272 DMA controller is very different than the controller defined above
294 * in terms of register mapping. For instance, with the exception of the 16-bit
295 * interrupt register (IRQ#85, for reference), all of the registers are 32-bit.
296 *
297 * The big difference, however, is the lack of device-requested DMA. All modes
298 * are dual address transfer, and there is no 'device' setup or direction bit.
299 * You can DMA between a device and memory, between memory and memory, or even between
300 * two devices directly, with any combination of incrementing and non-incrementing
301 * addresses you choose. This puts a crimp in distinguishing between the 'device
302 * address' set up by set_dma_device_addr.
303 *
304 * Therefore, there are two options. One is to use set_dma_addr and set_dma_device_addr,
305 * which will act exactly as above in -- it will look to see if the source is set to
306 * autoincrement, and if so it will make the source use the set_dma_addr value and the
307 * destination the set_dma_device_addr value. Otherwise the source will be set to the
308 * set_dma_device_addr value and the destination will get the set_dma_addr value.
309 *
310 * The other is to use the provided set_dma_src_addr and set_dma_dest_addr functions
311 * and make it explicit. Depending on what you're doing, one of these two should work
312 * for you, but don't mix them in the same transfer setup.
313 */
314
315/* enable/disable a specific DMA channel */
316static __inline__ void enable_dma(unsigned int dmanr)
317{
318 volatile unsigned int *dmalp;
319
320#ifdef DMA_DEBUG
321 printk("enable_dma(dmanr=%d)\n", dmanr);
322#endif
323
324 dmalp = (unsigned int *) dma_base_addr[dmanr];
325 dmalp[MCFDMA_DMR] |= MCFDMA_DMR_EN;
326}
327
328static __inline__ void disable_dma(unsigned int dmanr)
329{
330 volatile unsigned int *dmalp;
331
332#ifdef DMA_DEBUG
333 printk("disable_dma(dmanr=%d)\n", dmanr);
334#endif
335
336 dmalp = (unsigned int *) dma_base_addr[dmanr];
337
338 /* Turn off external requests, and stop any DMA in progress */
339 dmalp[MCFDMA_DMR] &= ~MCFDMA_DMR_EN;
340 dmalp[MCFDMA_DMR] |= MCFDMA_DMR_RESET;
341}
342
343/*
344 * Clear the 'DMA Pointer Flip Flop'.
345 * Write 0 for LSB/MSB, 1 for MSB/LSB access.
346 * Use this once to initialize the FF to a known state.
347 * After that, keep track of it. :-)
348 * --- In order to do that, the DMA routines below should ---
349 * --- only be used while interrupts are disabled! ---
350 *
351 * This is a NOP for ColdFire. Provide a stub for compatibility.
352 */
353static __inline__ void clear_dma_ff(unsigned int dmanr)
354{
355}
356
357/* set mode (above) for a specific DMA channel */
358static __inline__ void set_dma_mode(unsigned int dmanr, char mode)
359{
360
361 volatile unsigned int *dmalp;
362 volatile unsigned short *dmawp;
363
364#ifdef DMA_DEBUG
365 printk("set_dma_mode(dmanr=%d,mode=%d)\n", dmanr, mode);
366#endif
367 dmalp = (unsigned int *) dma_base_addr[dmanr];
368 dmawp = (unsigned short *) dma_base_addr[dmanr];
369
370 /* Clear config errors */
371 dmalp[MCFDMA_DMR] |= MCFDMA_DMR_RESET;
372
373 /* Set command register */
374 dmalp[MCFDMA_DMR] =
375 MCFDMA_DMR_RQM_DUAL | /* Mandatory Request Mode setting */
376 MCFDMA_DMR_DSTT_SD | /* Set up addressing types; set to supervisor-data. */
377 MCFDMA_DMR_SRCT_SD | /* Set up addressing types; set to supervisor-data. */
378 /* source static-address-mode */
379 ((mode & DMA_MODE_SRC_SA_BIT) ? MCFDMA_DMR_SRCM_SA : MCFDMA_DMR_SRCM_IA) |
380 /* dest static-address-mode */
381 ((mode & DMA_MODE_DES_SA_BIT) ? MCFDMA_DMR_DSTM_SA : MCFDMA_DMR_DSTM_IA) |
382 /* burst, 32 bit, 16 bit or 8 bit transfers are separately configurable on the MCF5272 */
383 (((mode & DMA_MODE_SSIZE_MASK) >> DMA_MODE_SSIZE_OFF) << MCFDMA_DMR_DSTS_OFF) |
384 (((mode & DMA_MODE_SSIZE_MASK) >> DMA_MODE_SSIZE_OFF) << MCFDMA_DMR_SRCS_OFF);
385
386 dmawp[MCFDMA_DIR] |= MCFDMA_DIR_ASCEN; /* Enable completion interrupts */
387
388#ifdef DEBUG_DMA
389 printk("%s(%d): dmanr=%d DMR[%x]=%x DIR[%x]=%x\n", __FILE__, __LINE__,
390 dmanr, (int) &dmalp[MCFDMA_DMR], dmabp[MCFDMA_DMR],
391 (int) &dmawp[MCFDMA_DIR], dmawp[MCFDMA_DIR]);
392#endif
393}
394
395/* Set transfer address for specific DMA channel */
396static __inline__ void set_dma_addr(unsigned int dmanr, unsigned int a)
397{
398 volatile unsigned int *dmalp;
399
400#ifdef DMA_DEBUG
401 printk("set_dma_addr(dmanr=%d,a=%x)\n", dmanr, a);
402#endif
403
404 dmalp = (unsigned int *) dma_base_addr[dmanr];
405
406 /* Determine which address registers are used for memory/device accesses */
407 if (dmalp[MCFDMA_DMR] & MCFDMA_DMR_SRCM) {
408 /* Source incrementing, must be memory */
409 dmalp[MCFDMA_DSAR] = a;
410 /* Set dest address, must be device */
411 dmalp[MCFDMA_DDAR] = dma_device_address[dmanr];
412 } else {
413 /* Destination incrementing, must be memory */
414 dmalp[MCFDMA_DDAR] = a;
415 /* Set source address, must be device */
416 dmalp[MCFDMA_DSAR] = dma_device_address[dmanr];
417 }
418
419#ifdef DEBUG_DMA
420 printk("%s(%d): dmanr=%d DMR[%x]=%x SAR[%x]=%08x DAR[%x]=%08x\n",
421 __FILE__, __LINE__, dmanr, (int) &dmawp[MCFDMA_DMR], dmawp[MCFDMA_DMR],
422 (int) &dmalp[MCFDMA_DSAR], dmalp[MCFDMA_DSAR],
423 (int) &dmalp[MCFDMA_DDAR], dmalp[MCFDMA_DDAR]);
424#endif
425}
426
427/*
428 * Specific for Coldfire - sets device address.
429 * Should be called after the mode set call, and before set DMA address.
430 */
431static __inline__ void set_dma_device_addr(unsigned int dmanr, unsigned int a)
432{
433#ifdef DMA_DEBUG
434 printk("set_dma_device_addr(dmanr=%d,a=%x)\n", dmanr, a);
435#endif
436
437 dma_device_address[dmanr] = a;
438}
439
440/*
441 * NOTE 2: "count" represents _bytes_.
442 *
443 * NOTE 3: While a 32-bit register, "count" is only a maximum 24-bit value.
444 */
445static __inline__ void set_dma_count(unsigned int dmanr, unsigned int count)
446{
447 volatile unsigned int *dmalp;
448
449#ifdef DMA_DEBUG
450 printk("set_dma_count(dmanr=%d,count=%d)\n", dmanr, count);
451#endif
452
453 dmalp = (unsigned int *) dma_base_addr[dmanr];
454 dmalp[MCFDMA_DBCR] = count;
455}
456
457/*
458 * Get DMA residue count. After a DMA transfer, this
459 * should return zero. Reading this while a DMA transfer is
460 * still in progress will return unpredictable results.
461 * Otherwise, it returns the number of _bytes_ left to transfer.
462 */
463static __inline__ int get_dma_residue(unsigned int dmanr)
464{
465 volatile unsigned int *dmalp;
466 unsigned int count;
467
468#ifdef DMA_DEBUG
469 printk("get_dma_residue(dmanr=%d)\n", dmanr);
470#endif
471
472 dmalp = (unsigned int *) dma_base_addr[dmanr];
473 count = dmalp[MCFDMA_DBCR];
474 return(count);
475}
476
477#endif /* !defined(CONFIG_M5272) */
478#endif /* CONFIG_COLDFIRE */
479
480/* it's useless on the m68k, but unfortunately needed by the new
481 bootmem allocator (but this should do it for this) */
482#define MAX_DMA_ADDRESS PAGE_OFFSET
483
484#define MAX_DMA_CHANNELS 8
485
486extern int request_dma(unsigned int dmanr, const char * device_id); /* reserve a DMA channel */
487extern void free_dma(unsigned int dmanr); /* release it again */
488
489#define isa_dma_bridge_buggy (0)
490
491#endif /* _M68K_DMA_H */
diff --git a/arch/m68k/include/asm/dma_mm.h b/arch/m68k/include/asm/dma_mm.h
deleted file mode 100644
index 4240fbc946f8..000000000000
--- a/arch/m68k/include/asm/dma_mm.h
+++ /dev/null
@@ -1,16 +0,0 @@
1#ifndef _M68K_DMA_H
2#define _M68K_DMA_H 1
3
4
5/* it's useless on the m68k, but unfortunately needed by the new
6 bootmem allocator (but this should do it for this) */
7#define MAX_DMA_ADDRESS PAGE_OFFSET
8
9#define MAX_DMA_CHANNELS 8
10
11extern int request_dma(unsigned int dmanr, const char * device_id); /* reserve a DMA channel */
12extern void free_dma(unsigned int dmanr); /* release it again */
13
14#define isa_dma_bridge_buggy (0)
15
16#endif /* _M68K_DMA_H */
diff --git a/arch/m68k/include/asm/dma_no.h b/arch/m68k/include/asm/dma_no.h
deleted file mode 100644
index 939a02056217..000000000000
--- a/arch/m68k/include/asm/dma_no.h
+++ /dev/null
@@ -1,494 +0,0 @@
1#ifndef _M68K_DMA_H
2#define _M68K_DMA_H 1
3
4//#define DMA_DEBUG 1
5
6
7#ifdef CONFIG_COLDFIRE
8/*
9 * ColdFire DMA Model:
10 * ColdFire DMA supports two forms of DMA: Single and Dual address. Single
11 * address mode emits a source address, and expects that the device will either
12 * pick up the data (DMA READ) or source data (DMA WRITE). This implies that
13 * the device will place data on the correct byte(s) of the data bus, as the
14 * memory transactions are always 32 bits. This implies that only 32 bit
15 * devices will find single mode transfers useful. Dual address DMA mode
16 * performs two cycles: source read and destination write. ColdFire will
17 * align the data so that the device will always get the correct bytes, thus
18 * is useful for 8 and 16 bit devices. This is the mode that is supported
19 * below.
20 *
21 * AUG/22/2000 : added support for 32-bit Dual-Address-Mode (K) 2000
22 * Oliver Kamphenkel (O.Kamphenkel@tu-bs.de)
23 *
24 * AUG/25/2000 : addad support for 8, 16 and 32-bit Single-Address-Mode (K)2000
25 * Oliver Kamphenkel (O.Kamphenkel@tu-bs.de)
26 *
27 * APR/18/2002 : added proper support for MCF5272 DMA controller.
28 * Arthur Shipkowski (art@videon-central.com)
29 */
30
31#include <asm/coldfire.h>
32#include <asm/mcfsim.h>
33#include <asm/mcfdma.h>
34
35/*
36 * Set number of channels of DMA on ColdFire for different implementations.
37 */
38#if defined(CONFIG_M5249) || defined(CONFIG_M5307) || defined(CONFIG_M5407) || \
39 defined(CONFIG_M523x) || defined(CONFIG_M527x) || defined(CONFIG_M528x)
40#define MAX_M68K_DMA_CHANNELS 4
41#elif defined(CONFIG_M5272)
42#define MAX_M68K_DMA_CHANNELS 1
43#elif defined(CONFIG_M532x)
44#define MAX_M68K_DMA_CHANNELS 0
45#else
46#define MAX_M68K_DMA_CHANNELS 2
47#endif
48
49extern unsigned int dma_base_addr[MAX_M68K_DMA_CHANNELS];
50extern unsigned int dma_device_address[MAX_M68K_DMA_CHANNELS];
51
52#if !defined(CONFIG_M5272)
53#define DMA_MODE_WRITE_BIT 0x01 /* Memory/IO to IO/Memory select */
54#define DMA_MODE_WORD_BIT 0x02 /* 8 or 16 bit transfers */
55#define DMA_MODE_LONG_BIT 0x04 /* or 32 bit transfers */
56#define DMA_MODE_SINGLE_BIT 0x08 /* single-address-mode */
57
58/* I/O to memory, 8 bits, mode */
59#define DMA_MODE_READ 0
60/* memory to I/O, 8 bits, mode */
61#define DMA_MODE_WRITE 1
62/* I/O to memory, 16 bits, mode */
63#define DMA_MODE_READ_WORD 2
64/* memory to I/O, 16 bits, mode */
65#define DMA_MODE_WRITE_WORD 3
66/* I/O to memory, 32 bits, mode */
67#define DMA_MODE_READ_LONG 4
68/* memory to I/O, 32 bits, mode */
69#define DMA_MODE_WRITE_LONG 5
70/* I/O to memory, 8 bits, single-address-mode */
71#define DMA_MODE_READ_SINGLE 8
72/* memory to I/O, 8 bits, single-address-mode */
73#define DMA_MODE_WRITE_SINGLE 9
74/* I/O to memory, 16 bits, single-address-mode */
75#define DMA_MODE_READ_WORD_SINGLE 10
76/* memory to I/O, 16 bits, single-address-mode */
77#define DMA_MODE_WRITE_WORD_SINGLE 11
78/* I/O to memory, 32 bits, single-address-mode */
79#define DMA_MODE_READ_LONG_SINGLE 12
80/* memory to I/O, 32 bits, single-address-mode */
81#define DMA_MODE_WRITE_LONG_SINGLE 13
82
83#else /* CONFIG_M5272 is defined */
84
85/* Source static-address mode */
86#define DMA_MODE_SRC_SA_BIT 0x01
87/* Two bits to select between all four modes */
88#define DMA_MODE_SSIZE_MASK 0x06
89/* Offset to shift bits in */
90#define DMA_MODE_SSIZE_OFF 0x01
91/* Destination static-address mode */
92#define DMA_MODE_DES_SA_BIT 0x10
93/* Two bits to select between all four modes */
94#define DMA_MODE_DSIZE_MASK 0x60
95/* Offset to shift bits in */
96#define DMA_MODE_DSIZE_OFF 0x05
97/* Size modifiers */
98#define DMA_MODE_SIZE_LONG 0x00
99#define DMA_MODE_SIZE_BYTE 0x01
100#define DMA_MODE_SIZE_WORD 0x02
101#define DMA_MODE_SIZE_LINE 0x03
102
103/*
104 * Aliases to help speed quick ports; these may be suboptimal, however. They
105 * do not include the SINGLE mode modifiers since the MCF5272 does not have a
106 * mode where the device is in control of its addressing.
107 */
108
109/* I/O to memory, 8 bits, mode */
110#define DMA_MODE_READ ((DMA_MODE_SIZE_BYTE << DMA_MODE_DSIZE_OFF) | (DMA_MODE_SIZE_BYTE << DMA_MODE_SSIZE_OFF) | DMA_SRC_SA_BIT)
111/* memory to I/O, 8 bits, mode */
112#define DMA_MODE_WRITE ((DMA_MODE_SIZE_BYTE << DMA_MODE_DSIZE_OFF) | (DMA_MODE_SIZE_BYTE << DMA_MODE_SSIZE_OFF) | DMA_DES_SA_BIT)
113/* I/O to memory, 16 bits, mode */
114#define DMA_MODE_READ_WORD ((DMA_MODE_SIZE_WORD << DMA_MODE_DSIZE_OFF) | (DMA_MODE_SIZE_WORD << DMA_MODE_SSIZE_OFF) | DMA_SRC_SA_BIT)
115/* memory to I/O, 16 bits, mode */
116#define DMA_MODE_WRITE_WORD ((DMA_MODE_SIZE_WORD << DMA_MODE_DSIZE_OFF) | (DMA_MODE_SIZE_WORD << DMA_MODE_SSIZE_OFF) | DMA_DES_SA_BIT)
117/* I/O to memory, 32 bits, mode */
118#define DMA_MODE_READ_LONG ((DMA_MODE_SIZE_LONG << DMA_MODE_DSIZE_OFF) | (DMA_MODE_SIZE_LONG << DMA_MODE_SSIZE_OFF) | DMA_SRC_SA_BIT)
119/* memory to I/O, 32 bits, mode */
120#define DMA_MODE_WRITE_LONG ((DMA_MODE_SIZE_LONG << DMA_MODE_DSIZE_OFF) | (DMA_MODE_SIZE_LONG << DMA_MODE_SSIZE_OFF) | DMA_DES_SA_BIT)
121
122#endif /* !defined(CONFIG_M5272) */
123
124#if !defined(CONFIG_M5272)
125/* enable/disable a specific DMA channel */
126static __inline__ void enable_dma(unsigned int dmanr)
127{
128 volatile unsigned short *dmawp;
129
130#ifdef DMA_DEBUG
131 printk("enable_dma(dmanr=%d)\n", dmanr);
132#endif
133
134 dmawp = (unsigned short *) dma_base_addr[dmanr];
135 dmawp[MCFDMA_DCR] |= MCFDMA_DCR_EEXT;
136}
137
138static __inline__ void disable_dma(unsigned int dmanr)
139{
140 volatile unsigned short *dmawp;
141 volatile unsigned char *dmapb;
142
143#ifdef DMA_DEBUG
144 printk("disable_dma(dmanr=%d)\n", dmanr);
145#endif
146
147 dmawp = (unsigned short *) dma_base_addr[dmanr];
148 dmapb = (unsigned char *) dma_base_addr[dmanr];
149
150 /* Turn off external requests, and stop any DMA in progress */
151 dmawp[MCFDMA_DCR] &= ~MCFDMA_DCR_EEXT;
152 dmapb[MCFDMA_DSR] = MCFDMA_DSR_DONE;
153}
154
155/*
156 * Clear the 'DMA Pointer Flip Flop'.
157 * Write 0 for LSB/MSB, 1 for MSB/LSB access.
158 * Use this once to initialize the FF to a known state.
159 * After that, keep track of it. :-)
160 * --- In order to do that, the DMA routines below should ---
161 * --- only be used while interrupts are disabled! ---
162 *
163 * This is a NOP for ColdFire. Provide a stub for compatibility.
164 */
165static __inline__ void clear_dma_ff(unsigned int dmanr)
166{
167}
168
169/* set mode (above) for a specific DMA channel */
170static __inline__ void set_dma_mode(unsigned int dmanr, char mode)
171{
172
173 volatile unsigned char *dmabp;
174 volatile unsigned short *dmawp;
175
176#ifdef DMA_DEBUG
177 printk("set_dma_mode(dmanr=%d,mode=%d)\n", dmanr, mode);
178#endif
179
180 dmabp = (unsigned char *) dma_base_addr[dmanr];
181 dmawp = (unsigned short *) dma_base_addr[dmanr];
182
183 // Clear config errors
184 dmabp[MCFDMA_DSR] = MCFDMA_DSR_DONE;
185
186 // Set command register
187 dmawp[MCFDMA_DCR] =
188 MCFDMA_DCR_INT | // Enable completion irq
189 MCFDMA_DCR_CS | // Force one xfer per request
190 MCFDMA_DCR_AA | // Enable auto alignment
191 // single-address-mode
192 ((mode & DMA_MODE_SINGLE_BIT) ? MCFDMA_DCR_SAA : 0) |
193 // sets s_rw (-> r/w) high if Memory to I/0
194 ((mode & DMA_MODE_WRITE_BIT) ? MCFDMA_DCR_S_RW : 0) |
195 // Memory to I/O or I/O to Memory
196 ((mode & DMA_MODE_WRITE_BIT) ? MCFDMA_DCR_SINC : MCFDMA_DCR_DINC) |
197 // 32 bit, 16 bit or 8 bit transfers
198 ((mode & DMA_MODE_WORD_BIT) ? MCFDMA_DCR_SSIZE_WORD :
199 ((mode & DMA_MODE_LONG_BIT) ? MCFDMA_DCR_SSIZE_LONG :
200 MCFDMA_DCR_SSIZE_BYTE)) |
201 ((mode & DMA_MODE_WORD_BIT) ? MCFDMA_DCR_DSIZE_WORD :
202 ((mode & DMA_MODE_LONG_BIT) ? MCFDMA_DCR_DSIZE_LONG :
203 MCFDMA_DCR_DSIZE_BYTE));
204
205#ifdef DEBUG_DMA
206 printk("%s(%d): dmanr=%d DSR[%x]=%x DCR[%x]=%x\n", __FILE__, __LINE__,
207 dmanr, (int) &dmabp[MCFDMA_DSR], dmabp[MCFDMA_DSR],
208 (int) &dmawp[MCFDMA_DCR], dmawp[MCFDMA_DCR]);
209#endif
210}
211
212/* Set transfer address for specific DMA channel */
213static __inline__ void set_dma_addr(unsigned int dmanr, unsigned int a)
214{
215 volatile unsigned short *dmawp;
216 volatile unsigned int *dmalp;
217
218#ifdef DMA_DEBUG
219 printk("set_dma_addr(dmanr=%d,a=%x)\n", dmanr, a);
220#endif
221
222 dmawp = (unsigned short *) dma_base_addr[dmanr];
223 dmalp = (unsigned int *) dma_base_addr[dmanr];
224
225 // Determine which address registers are used for memory/device accesses
226 if (dmawp[MCFDMA_DCR] & MCFDMA_DCR_SINC) {
227 // Source incrementing, must be memory
228 dmalp[MCFDMA_SAR] = a;
229 // Set dest address, must be device
230 dmalp[MCFDMA_DAR] = dma_device_address[dmanr];
231 } else {
232 // Destination incrementing, must be memory
233 dmalp[MCFDMA_DAR] = a;
234 // Set source address, must be device
235 dmalp[MCFDMA_SAR] = dma_device_address[dmanr];
236 }
237
238#ifdef DEBUG_DMA
239 printk("%s(%d): dmanr=%d DCR[%x]=%x SAR[%x]=%08x DAR[%x]=%08x\n",
240 __FILE__, __LINE__, dmanr, (int) &dmawp[MCFDMA_DCR], dmawp[MCFDMA_DCR],
241 (int) &dmalp[MCFDMA_SAR], dmalp[MCFDMA_SAR],
242 (int) &dmalp[MCFDMA_DAR], dmalp[MCFDMA_DAR]);
243#endif
244}
245
246/*
247 * Specific for Coldfire - sets device address.
248 * Should be called after the mode set call, and before set DMA address.
249 */
250static __inline__ void set_dma_device_addr(unsigned int dmanr, unsigned int a)
251{
252#ifdef DMA_DEBUG
253 printk("set_dma_device_addr(dmanr=%d,a=%x)\n", dmanr, a);
254#endif
255
256 dma_device_address[dmanr] = a;
257}
258
259/*
260 * NOTE 2: "count" represents _bytes_.
261 */
262static __inline__ void set_dma_count(unsigned int dmanr, unsigned int count)
263{
264 volatile unsigned short *dmawp;
265
266#ifdef DMA_DEBUG
267 printk("set_dma_count(dmanr=%d,count=%d)\n", dmanr, count);
268#endif
269
270 dmawp = (unsigned short *) dma_base_addr[dmanr];
271 dmawp[MCFDMA_BCR] = (unsigned short)count;
272}
273
274/*
275 * Get DMA residue count. After a DMA transfer, this
276 * should return zero. Reading this while a DMA transfer is
277 * still in progress will return unpredictable results.
278 * Otherwise, it returns the number of _bytes_ left to transfer.
279 */
280static __inline__ int get_dma_residue(unsigned int dmanr)
281{
282 volatile unsigned short *dmawp;
283 unsigned short count;
284
285#ifdef DMA_DEBUG
286 printk("get_dma_residue(dmanr=%d)\n", dmanr);
287#endif
288
289 dmawp = (unsigned short *) dma_base_addr[dmanr];
290 count = dmawp[MCFDMA_BCR];
291 return((int) count);
292}
293#else /* CONFIG_M5272 is defined */
294
295/*
296 * The MCF5272 DMA controller is very different than the controller defined above
297 * in terms of register mapping. For instance, with the exception of the 16-bit
298 * interrupt register (IRQ#85, for reference), all of the registers are 32-bit.
299 *
300 * The big difference, however, is the lack of device-requested DMA. All modes
301 * are dual address transfer, and there is no 'device' setup or direction bit.
302 * You can DMA between a device and memory, between memory and memory, or even between
303 * two devices directly, with any combination of incrementing and non-incrementing
304 * addresses you choose. This puts a crimp in distinguishing between the 'device
305 * address' set up by set_dma_device_addr.
306 *
307 * Therefore, there are two options. One is to use set_dma_addr and set_dma_device_addr,
308 * which will act exactly as above in -- it will look to see if the source is set to
309 * autoincrement, and if so it will make the source use the set_dma_addr value and the
310 * destination the set_dma_device_addr value. Otherwise the source will be set to the
311 * set_dma_device_addr value and the destination will get the set_dma_addr value.
312 *
313 * The other is to use the provided set_dma_src_addr and set_dma_dest_addr functions
314 * and make it explicit. Depending on what you're doing, one of these two should work
315 * for you, but don't mix them in the same transfer setup.
316 */
317
318/* enable/disable a specific DMA channel */
319static __inline__ void enable_dma(unsigned int dmanr)
320{
321 volatile unsigned int *dmalp;
322
323#ifdef DMA_DEBUG
324 printk("enable_dma(dmanr=%d)\n", dmanr);
325#endif
326
327 dmalp = (unsigned int *) dma_base_addr[dmanr];
328 dmalp[MCFDMA_DMR] |= MCFDMA_DMR_EN;
329}
330
331static __inline__ void disable_dma(unsigned int dmanr)
332{
333 volatile unsigned int *dmalp;
334
335#ifdef DMA_DEBUG
336 printk("disable_dma(dmanr=%d)\n", dmanr);
337#endif
338
339 dmalp = (unsigned int *) dma_base_addr[dmanr];
340
341 /* Turn off external requests, and stop any DMA in progress */
342 dmalp[MCFDMA_DMR] &= ~MCFDMA_DMR_EN;
343 dmalp[MCFDMA_DMR] |= MCFDMA_DMR_RESET;
344}
345
346/*
347 * Clear the 'DMA Pointer Flip Flop'.
348 * Write 0 for LSB/MSB, 1 for MSB/LSB access.
349 * Use this once to initialize the FF to a known state.
350 * After that, keep track of it. :-)
351 * --- In order to do that, the DMA routines below should ---
352 * --- only be used while interrupts are disabled! ---
353 *
354 * This is a NOP for ColdFire. Provide a stub for compatibility.
355 */
356static __inline__ void clear_dma_ff(unsigned int dmanr)
357{
358}
359
360/* set mode (above) for a specific DMA channel */
361static __inline__ void set_dma_mode(unsigned int dmanr, char mode)
362{
363
364 volatile unsigned int *dmalp;
365 volatile unsigned short *dmawp;
366
367#ifdef DMA_DEBUG
368 printk("set_dma_mode(dmanr=%d,mode=%d)\n", dmanr, mode);
369#endif
370 dmalp = (unsigned int *) dma_base_addr[dmanr];
371 dmawp = (unsigned short *) dma_base_addr[dmanr];
372
373 // Clear config errors
374 dmalp[MCFDMA_DMR] |= MCFDMA_DMR_RESET;
375
376 // Set command register
377 dmalp[MCFDMA_DMR] =
378 MCFDMA_DMR_RQM_DUAL | // Mandatory Request Mode setting
379 MCFDMA_DMR_DSTT_SD | // Set up addressing types; set to supervisor-data.
380 MCFDMA_DMR_SRCT_SD | // Set up addressing types; set to supervisor-data.
381 // source static-address-mode
382 ((mode & DMA_MODE_SRC_SA_BIT) ? MCFDMA_DMR_SRCM_SA : MCFDMA_DMR_SRCM_IA) |
383 // dest static-address-mode
384 ((mode & DMA_MODE_DES_SA_BIT) ? MCFDMA_DMR_DSTM_SA : MCFDMA_DMR_DSTM_IA) |
385 // burst, 32 bit, 16 bit or 8 bit transfers are separately configurable on the MCF5272
386 (((mode & DMA_MODE_SSIZE_MASK) >> DMA_MODE_SSIZE_OFF) << MCFDMA_DMR_DSTS_OFF) |
387 (((mode & DMA_MODE_SSIZE_MASK) >> DMA_MODE_SSIZE_OFF) << MCFDMA_DMR_SRCS_OFF);
388
389 dmawp[MCFDMA_DIR] |= MCFDMA_DIR_ASCEN; /* Enable completion interrupts */
390
391#ifdef DEBUG_DMA
392 printk("%s(%d): dmanr=%d DMR[%x]=%x DIR[%x]=%x\n", __FILE__, __LINE__,
393 dmanr, (int) &dmalp[MCFDMA_DMR], dmabp[MCFDMA_DMR],
394 (int) &dmawp[MCFDMA_DIR], dmawp[MCFDMA_DIR]);
395#endif
396}
397
398/* Set transfer address for specific DMA channel */
399static __inline__ void set_dma_addr(unsigned int dmanr, unsigned int a)
400{
401 volatile unsigned int *dmalp;
402
403#ifdef DMA_DEBUG
404 printk("set_dma_addr(dmanr=%d,a=%x)\n", dmanr, a);
405#endif
406
407 dmalp = (unsigned int *) dma_base_addr[dmanr];
408
409 // Determine which address registers are used for memory/device accesses
410 if (dmalp[MCFDMA_DMR] & MCFDMA_DMR_SRCM) {
411 // Source incrementing, must be memory
412 dmalp[MCFDMA_DSAR] = a;
413 // Set dest address, must be device
414 dmalp[MCFDMA_DDAR] = dma_device_address[dmanr];
415 } else {
416 // Destination incrementing, must be memory
417 dmalp[MCFDMA_DDAR] = a;
418 // Set source address, must be device
419 dmalp[MCFDMA_DSAR] = dma_device_address[dmanr];
420 }
421
422#ifdef DEBUG_DMA
423 printk("%s(%d): dmanr=%d DMR[%x]=%x SAR[%x]=%08x DAR[%x]=%08x\n",
424 __FILE__, __LINE__, dmanr, (int) &dmawp[MCFDMA_DMR], dmawp[MCFDMA_DMR],
425 (int) &dmalp[MCFDMA_DSAR], dmalp[MCFDMA_DSAR],
426 (int) &dmalp[MCFDMA_DDAR], dmalp[MCFDMA_DDAR]);
427#endif
428}
429
430/*
431 * Specific for Coldfire - sets device address.
432 * Should be called after the mode set call, and before set DMA address.
433 */
434static __inline__ void set_dma_device_addr(unsigned int dmanr, unsigned int a)
435{
436#ifdef DMA_DEBUG
437 printk("set_dma_device_addr(dmanr=%d,a=%x)\n", dmanr, a);
438#endif
439
440 dma_device_address[dmanr] = a;
441}
442
443/*
444 * NOTE 2: "count" represents _bytes_.
445 *
446 * NOTE 3: While a 32-bit register, "count" is only a maximum 24-bit value.
447 */
448static __inline__ void set_dma_count(unsigned int dmanr, unsigned int count)
449{
450 volatile unsigned int *dmalp;
451
452#ifdef DMA_DEBUG
453 printk("set_dma_count(dmanr=%d,count=%d)\n", dmanr, count);
454#endif
455
456 dmalp = (unsigned int *) dma_base_addr[dmanr];
457 dmalp[MCFDMA_DBCR] = count;
458}
459
460/*
461 * Get DMA residue count. After a DMA transfer, this
462 * should return zero. Reading this while a DMA transfer is
463 * still in progress will return unpredictable results.
464 * Otherwise, it returns the number of _bytes_ left to transfer.
465 */
466static __inline__ int get_dma_residue(unsigned int dmanr)
467{
468 volatile unsigned int *dmalp;
469 unsigned int count;
470
471#ifdef DMA_DEBUG
472 printk("get_dma_residue(dmanr=%d)\n", dmanr);
473#endif
474
475 dmalp = (unsigned int *) dma_base_addr[dmanr];
476 count = dmalp[MCFDMA_DBCR];
477 return(count);
478}
479
480#endif /* !defined(CONFIG_M5272) */
481#endif /* CONFIG_COLDFIRE */
482
483#define MAX_DMA_CHANNELS 8
484
485/* Don't define MAX_DMA_ADDRESS; it's useless on the m68k/coldfire and any
486 occurrence should be flagged as an error. */
487/* under 2.4 it is actually needed by the new bootmem allocator */
488#define MAX_DMA_ADDRESS PAGE_OFFSET
489
490/* These are in kernel/dma.c: */
491extern int request_dma(unsigned int dmanr, const char *device_id); /* reserve a DMA channel */
492extern void free_dma(unsigned int dmanr); /* release it again */
493
494#endif /* _M68K_DMA_H */
diff --git a/arch/m68k/include/asm/elia.h b/arch/m68k/include/asm/elia.h
deleted file mode 100644
index e037d4e2de33..000000000000
--- a/arch/m68k/include/asm/elia.h
+++ /dev/null
@@ -1,41 +0,0 @@
1/****************************************************************************/
2
3/*
4 * elia.h -- Lineo (formerly Moreton Bay) eLIA platform support.
5 *
6 * (C) Copyright 1999-2000, Moreton Bay (www.moreton.com.au)
7 * (C) Copyright 1999-2000, Lineo (www.lineo.com)
8 */
9
10/****************************************************************************/
11#ifndef elia_h
12#define elia_h
13/****************************************************************************/
14
15#include <asm/coldfire.h>
16
17#ifdef CONFIG_eLIA
18
19/*
20 * The serial port DTR and DCD lines are also on the Parallel I/O
21 * as well, so define those too.
22 */
23
24#define eLIA_DCD1 0x0001
25#define eLIA_DCD0 0x0002
26#define eLIA_DTR1 0x0004
27#define eLIA_DTR0 0x0008
28
29#define eLIA_PCIRESET 0x0020
30
31/*
32 * Kernel macros to set and unset the LEDs.
33 */
34#ifndef __ASSEMBLY__
35extern unsigned short ppdata;
36#endif /* __ASSEMBLY__ */
37
38#endif /* CONFIG_eLIA */
39
40/****************************************************************************/
41#endif /* elia_h */
diff --git a/arch/m68k/include/asm/gpio.h b/arch/m68k/include/asm/gpio.h
new file mode 100644
index 000000000000..283214dc65a7
--- /dev/null
+++ b/arch/m68k/include/asm/gpio.h
@@ -0,0 +1,238 @@
1/*
2 * Coldfire generic GPIO support
3 *
4 * (C) Copyright 2009, Steven King <sfking@fdwdc.com>
5 *
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
8 * the Free Software Foundation; version 2 of the License.
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
16#ifndef coldfire_gpio_h
17#define coldfire_gpio_h
18
19#include <linux/io.h>
20#include <asm-generic/gpio.h>
21#include <asm/coldfire.h>
22#include <asm/mcfsim.h>
23
24/*
25 * The Freescale Coldfire family is quite varied in how they implement GPIO.
26 * Some parts have 8 bit ports, some have 16bit and some have 32bit; some have
27 * only one port, others have multiple ports; some have a single data latch
28 * for both input and output, others have a separate pin data register to read
29 * input; some require a read-modify-write access to change an output, others
30 * have set and clear registers for some of the outputs; Some have all the
31 * GPIOs in a single control area, others have some GPIOs implemented in
32 * different modules.
33 *
34 * This implementation attempts accomodate the differences while presenting
35 * a generic interface that will optimize to as few instructions as possible.
36 */
37#if defined(CONFIG_M5206) || defined(CONFIG_M5206e) || \
38 defined(CONFIG_M520x) || defined(CONFIG_M523x) || \
39 defined(CONFIG_M527x) || defined(CONFIG_M528x) || defined(CONFIG_M532x)
40
41/* These parts have GPIO organized by 8 bit ports */
42
43#define MCFGPIO_PORTTYPE u8
44#define MCFGPIO_PORTSIZE 8
45#define mcfgpio_read(port) __raw_readb(port)
46#define mcfgpio_write(data, port) __raw_writeb(data, port)
47
48#elif defined(CONFIG_M5307) || defined(CONFIG_M5407) || defined(CONFIG_M5272)
49
50/* These parts have GPIO organized by 16 bit ports */
51
52#define MCFGPIO_PORTTYPE u16
53#define MCFGPIO_PORTSIZE 16
54#define mcfgpio_read(port) __raw_readw(port)
55#define mcfgpio_write(data, port) __raw_writew(data, port)
56
57#elif defined(CONFIG_M5249)
58
59/* These parts have GPIO organized by 32 bit ports */
60
61#define MCFGPIO_PORTTYPE u32
62#define MCFGPIO_PORTSIZE 32
63#define mcfgpio_read(port) __raw_readl(port)
64#define mcfgpio_write(data, port) __raw_writel(data, port)
65
66#endif
67
68#define mcfgpio_bit(gpio) (1 << ((gpio) % MCFGPIO_PORTSIZE))
69#define mcfgpio_port(gpio) ((gpio) / MCFGPIO_PORTSIZE)
70
71#if defined(CONFIG_M520x) || defined(CONFIG_M523x) || \
72 defined(CONFIG_M527x) || defined(CONFIG_M528x) || defined(CONFIG_M532x)
73/*
74 * These parts have an 'Edge' Port module (external interrupt/GPIO) which uses
75 * read-modify-write to change an output and a GPIO module which has separate
76 * set/clr registers to directly change outputs with a single write access.
77 */
78#if defined(CONFIG_M528x)
79/*
80 * The 528x also has GPIOs in other modules (GPT, QADC) which use
81 * read-modify-write as well as those controlled by the EPORT and GPIO modules.
82 */
83#define MCFGPIO_SCR_START 40
84#else
85#define MCFGPIO_SCR_START 8
86#endif
87
88#define MCFGPIO_SETR_PORT(gpio) (MCFGPIO_SETR + \
89 mcfgpio_port(gpio - MCFGPIO_SCR_START))
90
91#define MCFGPIO_CLRR_PORT(gpio) (MCFGPIO_CLRR + \
92 mcfgpio_port(gpio - MCFGPIO_SCR_START))
93#else
94
95#define MCFGPIO_SCR_START MCFGPIO_PIN_MAX
96/* with MCFGPIO_SCR == MCFGPIO_PIN_MAX, these will be optimized away */
97#define MCFGPIO_SETR_PORT(gpio) 0
98#define MCFGPIO_CLRR_PORT(gpio) 0
99
100#endif
101/*
102 * Coldfire specific helper functions
103 */
104
105/* return the port pin data register for a gpio */
106static inline u32 __mcf_gpio_ppdr(unsigned gpio)
107{
108#if defined(CONFIG_M5206) || defined(CONFIG_M5206e) || \
109 defined(CONFIG_M5307) || defined(CONFIG_M5407)
110 return MCFSIM_PADAT;
111#elif defined(CONFIG_M5272)
112 if (gpio < 16)
113 return MCFSIM_PADAT;
114 else if (gpio < 32)
115 return MCFSIM_PBDAT;
116 else
117 return MCFSIM_PCDAT;
118#elif defined(CONFIG_M5249)
119 if (gpio < 32)
120 return MCFSIM2_GPIOREAD;
121 else
122 return MCFSIM2_GPIO1READ;
123#elif defined(CONFIG_M520x) || defined(CONFIG_M523x) || \
124 defined(CONFIG_M527x) || defined(CONFIG_M528x) || defined(CONFIG_M532x)
125 if (gpio < 8)
126 return MCFEPORT_EPPDR;
127#if defined(CONFIG_M528x)
128 else if (gpio < 16)
129 return MCFGPTA_GPTPORT;
130 else if (gpio < 24)
131 return MCFGPTB_GPTPORT;
132 else if (gpio < 32)
133 return MCFQADC_PORTQA;
134 else if (gpio < 40)
135 return MCFQADC_PORTQB;
136#endif
137 else
138 return MCFGPIO_PPDR + mcfgpio_port(gpio - MCFGPIO_SCR_START);
139#endif
140}
141
142/* return the port output data register for a gpio */
143static inline u32 __mcf_gpio_podr(unsigned gpio)
144{
145#if defined(CONFIG_M5206) || defined(CONFIG_M5206e) || \
146 defined(CONFIG_M5307) || defined(CONFIG_M5407)
147 return MCFSIM_PADAT;
148#elif defined(CONFIG_M5272)
149 if (gpio < 16)
150 return MCFSIM_PADAT;
151 else if (gpio < 32)
152 return MCFSIM_PBDAT;
153 else
154 return MCFSIM_PCDAT;
155#elif defined(CONFIG_M5249)
156 if (gpio < 32)
157 return MCFSIM2_GPIOWRITE;
158 else
159 return MCFSIM2_GPIO1WRITE;
160#elif defined(CONFIG_M520x) || defined(CONFIG_M523x) || \
161 defined(CONFIG_M527x) || defined(CONFIG_M528x) || defined(CONFIG_M532x)
162 if (gpio < 8)
163 return MCFEPORT_EPDR;
164#if defined(CONFIG_M528x)
165 else if (gpio < 16)
166 return MCFGPTA_GPTPORT;
167 else if (gpio < 24)
168 return MCFGPTB_GPTPORT;
169 else if (gpio < 32)
170 return MCFQADC_PORTQA;
171 else if (gpio < 40)
172 return MCFQADC_PORTQB;
173#endif
174 else
175 return MCFGPIO_PODR + mcfgpio_port(gpio - MCFGPIO_SCR_START);
176#endif
177}
178
179/*
180 * The Generic GPIO functions
181 *
182 * If the gpio is a compile time constant and is one of the Coldfire gpios,
183 * use the inline version, otherwise dispatch thru gpiolib.
184 */
185
186static inline int gpio_get_value(unsigned gpio)
187{
188 if (__builtin_constant_p(gpio) && gpio < MCFGPIO_PIN_MAX)
189 return mcfgpio_read(__mcf_gpio_ppdr(gpio)) & mcfgpio_bit(gpio);
190 else
191 return __gpio_get_value(gpio);
192}
193
194static inline void gpio_set_value(unsigned gpio, int value)
195{
196 if (__builtin_constant_p(gpio) && gpio < MCFGPIO_PIN_MAX) {
197 if (gpio < MCFGPIO_SCR_START) {
198 unsigned long flags;
199 MCFGPIO_PORTTYPE data;
200
201 local_irq_save(flags);
202 data = mcfgpio_read(__mcf_gpio_podr(gpio));
203 if (value)
204 data |= mcfgpio_bit(gpio);
205 else
206 data &= ~mcfgpio_bit(gpio);
207 mcfgpio_write(data, __mcf_gpio_podr(gpio));
208 local_irq_restore(flags);
209 } else {
210 if (value)
211 mcfgpio_write(mcfgpio_bit(gpio),
212 MCFGPIO_SETR_PORT(gpio));
213 else
214 mcfgpio_write(~mcfgpio_bit(gpio),
215 MCFGPIO_CLRR_PORT(gpio));
216 }
217 } else
218 __gpio_set_value(gpio, value);
219}
220
221static inline int gpio_to_irq(unsigned gpio)
222{
223 return (gpio < MCFGPIO_IRQ_MAX) ? gpio + MCFGPIO_IRQ_VECBASE : -EINVAL;
224}
225
226static inline int irq_to_gpio(unsigned irq)
227{
228 return (irq >= MCFGPIO_IRQ_VECBASE &&
229 irq < (MCFGPIO_IRQ_VECBASE + MCFGPIO_IRQ_MAX)) ?
230 irq - MCFGPIO_IRQ_VECBASE : -ENXIO;
231}
232
233static inline int gpio_cansleep(unsigned gpio)
234{
235 return gpio < MCFGPIO_PIN_MAX ? 0 : __gpio_cansleep(gpio);
236}
237
238#endif
diff --git a/arch/m68k/include/asm/hardirq_no.h b/arch/m68k/include/asm/hardirq_no.h
index bfad28149a49..b44b14be87d9 100644
--- a/arch/m68k/include/asm/hardirq_no.h
+++ b/arch/m68k/include/asm/hardirq_no.h
@@ -1,16 +1,8 @@
1#ifndef __M68K_HARDIRQ_H 1#ifndef __M68K_HARDIRQ_H
2#define __M68K_HARDIRQ_H 2#define __M68K_HARDIRQ_H
3 3
4#include <linux/cache.h>
5#include <linux/threads.h>
6#include <asm/irq.h> 4#include <asm/irq.h>
7 5
8typedef struct {
9 unsigned int __softirq_pending;
10} ____cacheline_aligned irq_cpustat_t;
11
12#include <linux/irq_cpustat.h> /* Standard mappings for irq_cpustat_t above */
13
14#define HARDIRQ_BITS 8 6#define HARDIRQ_BITS 8
15 7
16/* 8/*
@@ -22,6 +14,6 @@ typedef struct {
22# error HARDIRQ_BITS is too low! 14# error HARDIRQ_BITS is too low!
23#endif 15#endif
24 16
25void ack_bad_irq(unsigned int irq); 17#include <asm-generic/hardirq.h>
26 18
27#endif /* __M68K_HARDIRQ_H */ 19#endif /* __M68K_HARDIRQ_H */
diff --git a/arch/m68k/include/asm/io_no.h b/arch/m68k/include/asm/io_no.h
index 6adef1ee2082..7f57436ec18f 100644
--- a/arch/m68k/include/asm/io_no.h
+++ b/arch/m68k/include/asm/io_no.h
@@ -134,7 +134,7 @@ static inline void io_insl(unsigned int addr, void *buf, int len)
134#define insw(a,b,l) io_insw(a,b,l) 134#define insw(a,b,l) io_insw(a,b,l)
135#define insl(a,b,l) io_insl(a,b,l) 135#define insl(a,b,l) io_insl(a,b,l)
136 136
137#define IO_SPACE_LIMIT 0xffff 137#define IO_SPACE_LIMIT 0xffffffff
138 138
139 139
140/* Values for nocacheflag and cmode */ 140/* Values for nocacheflag and cmode */
diff --git a/arch/m68k/include/asm/irq.h b/arch/m68k/include/asm/irq.h
index d031416595b2..907eff1edd2f 100644
--- a/arch/m68k/include/asm/irq.h
+++ b/arch/m68k/include/asm/irq.h
@@ -1,5 +1,134 @@
1#ifdef __uClinux__ 1#ifndef _M68K_IRQ_H_
2#include "irq_no.h" 2#define _M68K_IRQ_H_
3
4/*
5 * This should be the same as the max(NUM_X_SOURCES) for all the
6 * different m68k hosts compiled into the kernel.
7 * Currently the Atari has 72 and the Amiga 24, but if both are
8 * supported in the kernel it is better to make room for 72.
9 */
10#if defined(CONFIG_COLDFIRE)
11#define NR_IRQS 256
12#elif defined(CONFIG_VME) || defined(CONFIG_SUN3) || defined(CONFIG_SUN3X)
13#define NR_IRQS 200
14#elif defined(CONFIG_ATARI) || defined(CONFIG_MAC)
15#define NR_IRQS 72
16#elif defined(CONFIG_Q40)
17#define NR_IRQS 43
18#elif defined(CONFIG_AMIGA) || !defined(CONFIG_MMU)
19#define NR_IRQS 32
20#elif defined(CONFIG_APOLLO)
21#define NR_IRQS 24
22#elif defined(CONFIG_HP300)
23#define NR_IRQS 8
3#else 24#else
4#include "irq_mm.h" 25#define NR_IRQS 0
5#endif 26#endif
27
28#ifdef CONFIG_MMU
29
30#include <linux/linkage.h>
31#include <linux/hardirq.h>
32#include <linux/irqreturn.h>
33#include <linux/spinlock_types.h>
34
35/*
36 * The hardirq mask has to be large enough to have
37 * space for potentially all IRQ sources in the system
38 * nesting on a single CPU:
39 */
40#if (1 << HARDIRQ_BITS) < NR_IRQS
41# error HARDIRQ_BITS is too low!
42#endif
43
44/*
45 * Interrupt source definitions
46 * General interrupt sources are the level 1-7.
47 * Adding an interrupt service routine for one of these sources
48 * results in the addition of that routine to a chain of routines.
49 * Each one is called in succession. Each individual interrupt
50 * service routine should determine if the device associated with
51 * that routine requires service.
52 */
53
54#define IRQ_SPURIOUS 0
55
56#define IRQ_AUTO_1 1 /* level 1 interrupt */
57#define IRQ_AUTO_2 2 /* level 2 interrupt */
58#define IRQ_AUTO_3 3 /* level 3 interrupt */
59#define IRQ_AUTO_4 4 /* level 4 interrupt */
60#define IRQ_AUTO_5 5 /* level 5 interrupt */
61#define IRQ_AUTO_6 6 /* level 6 interrupt */
62#define IRQ_AUTO_7 7 /* level 7 interrupt (non-maskable) */
63
64#define IRQ_USER 8
65
66extern unsigned int irq_canonicalize(unsigned int irq);
67
68struct pt_regs;
69
70/*
71 * various flags for request_irq() - the Amiga now uses the standard
72 * mechanism like all other architectures - IRQF_DISABLED and
73 * IRQF_SHARED are your friends.
74 */
75#ifndef MACH_AMIGA_ONLY
76#define IRQ_FLG_LOCK (0x0001) /* handler is not replaceable */
77#define IRQ_FLG_REPLACE (0x0002) /* replace existing handler */
78#define IRQ_FLG_FAST (0x0004)
79#define IRQ_FLG_SLOW (0x0008)
80#define IRQ_FLG_STD (0x8000) /* internally used */
81#endif
82
83/*
84 * This structure is used to chain together the ISRs for a particular
85 * interrupt source (if it supports chaining).
86 */
87typedef struct irq_node {
88 irqreturn_t (*handler)(int, void *);
89 void *dev_id;
90 struct irq_node *next;
91 unsigned long flags;
92 const char *devname;
93} irq_node_t;
94
95/*
96 * This structure has only 4 elements for speed reasons
97 */
98struct irq_handler {
99 int (*handler)(int, void *);
100 unsigned long flags;
101 void *dev_id;
102 const char *devname;
103};
104
105struct irq_controller {
106 const char *name;
107 spinlock_t lock;
108 int (*startup)(unsigned int irq);
109 void (*shutdown)(unsigned int irq);
110 void (*enable)(unsigned int irq);
111 void (*disable)(unsigned int irq);
112};
113
114extern int m68k_irq_startup(unsigned int);
115extern void m68k_irq_shutdown(unsigned int);
116
117/*
118 * This function returns a new irq_node_t
119 */
120extern irq_node_t *new_irq_node(void);
121
122extern void m68k_setup_auto_interrupt(void (*handler)(unsigned int, struct pt_regs *));
123extern void m68k_setup_user_interrupt(unsigned int vec, unsigned int cnt,
124 void (*handler)(unsigned int, struct pt_regs *));
125extern void m68k_setup_irq_controller(struct irq_controller *, unsigned int, unsigned int);
126
127asmlinkage void m68k_handle_int(unsigned int);
128asmlinkage void __m68k_handle_int(unsigned int, struct pt_regs *);
129
130#else
131#define irq_canonicalize(irq) (irq)
132#endif /* CONFIG_MMU */
133
134#endif /* _M68K_IRQ_H_ */
diff --git a/arch/m68k/include/asm/irq_mm.h b/arch/m68k/include/asm/irq_mm.h
deleted file mode 100644
index 0cab42cad79e..000000000000
--- a/arch/m68k/include/asm/irq_mm.h
+++ /dev/null
@@ -1,126 +0,0 @@
1#ifndef _M68K_IRQ_H_
2#define _M68K_IRQ_H_
3
4#include <linux/linkage.h>
5#include <linux/hardirq.h>
6#include <linux/irqreturn.h>
7#include <linux/spinlock_types.h>
8
9/*
10 * This should be the same as the max(NUM_X_SOURCES) for all the
11 * different m68k hosts compiled into the kernel.
12 * Currently the Atari has 72 and the Amiga 24, but if both are
13 * supported in the kernel it is better to make room for 72.
14 */
15#if defined(CONFIG_VME) || defined(CONFIG_SUN3) || defined(CONFIG_SUN3X)
16#define NR_IRQS 200
17#elif defined(CONFIG_ATARI) || defined(CONFIG_MAC)
18#define NR_IRQS 72
19#elif defined(CONFIG_Q40)
20#define NR_IRQS 43
21#elif defined(CONFIG_AMIGA)
22#define NR_IRQS 32
23#elif defined(CONFIG_APOLLO)
24#define NR_IRQS 24
25#elif defined(CONFIG_HP300)
26#define NR_IRQS 8
27#else
28#define NR_IRQS 0
29#endif
30
31/*
32 * The hardirq mask has to be large enough to have
33 * space for potentially all IRQ sources in the system
34 * nesting on a single CPU:
35 */
36#if (1 << HARDIRQ_BITS) < NR_IRQS
37# error HARDIRQ_BITS is too low!
38#endif
39
40/*
41 * Interrupt source definitions
42 * General interrupt sources are the level 1-7.
43 * Adding an interrupt service routine for one of these sources
44 * results in the addition of that routine to a chain of routines.
45 * Each one is called in succession. Each individual interrupt
46 * service routine should determine if the device associated with
47 * that routine requires service.
48 */
49
50#define IRQ_SPURIOUS 0
51
52#define IRQ_AUTO_1 1 /* level 1 interrupt */
53#define IRQ_AUTO_2 2 /* level 2 interrupt */
54#define IRQ_AUTO_3 3 /* level 3 interrupt */
55#define IRQ_AUTO_4 4 /* level 4 interrupt */
56#define IRQ_AUTO_5 5 /* level 5 interrupt */
57#define IRQ_AUTO_6 6 /* level 6 interrupt */
58#define IRQ_AUTO_7 7 /* level 7 interrupt (non-maskable) */
59
60#define IRQ_USER 8
61
62extern unsigned int irq_canonicalize(unsigned int irq);
63
64struct pt_regs;
65
66/*
67 * various flags for request_irq() - the Amiga now uses the standard
68 * mechanism like all other architectures - IRQF_DISABLED and
69 * IRQF_SHARED are your friends.
70 */
71#ifndef MACH_AMIGA_ONLY
72#define IRQ_FLG_LOCK (0x0001) /* handler is not replaceable */
73#define IRQ_FLG_REPLACE (0x0002) /* replace existing handler */
74#define IRQ_FLG_FAST (0x0004)
75#define IRQ_FLG_SLOW (0x0008)
76#define IRQ_FLG_STD (0x8000) /* internally used */
77#endif
78
79/*
80 * This structure is used to chain together the ISRs for a particular
81 * interrupt source (if it supports chaining).
82 */
83typedef struct irq_node {
84 irqreturn_t (*handler)(int, void *);
85 void *dev_id;
86 struct irq_node *next;
87 unsigned long flags;
88 const char *devname;
89} irq_node_t;
90
91/*
92 * This structure has only 4 elements for speed reasons
93 */
94struct irq_handler {
95 int (*handler)(int, void *);
96 unsigned long flags;
97 void *dev_id;
98 const char *devname;
99};
100
101struct irq_controller {
102 const char *name;
103 spinlock_t lock;
104 int (*startup)(unsigned int irq);
105 void (*shutdown)(unsigned int irq);
106 void (*enable)(unsigned int irq);
107 void (*disable)(unsigned int irq);
108};
109
110extern int m68k_irq_startup(unsigned int);
111extern void m68k_irq_shutdown(unsigned int);
112
113/*
114 * This function returns a new irq_node_t
115 */
116extern irq_node_t *new_irq_node(void);
117
118extern void m68k_setup_auto_interrupt(void (*handler)(unsigned int, struct pt_regs *));
119extern void m68k_setup_user_interrupt(unsigned int vec, unsigned int cnt,
120 void (*handler)(unsigned int, struct pt_regs *));
121extern void m68k_setup_irq_controller(struct irq_controller *, unsigned int, unsigned int);
122
123asmlinkage void m68k_handle_int(unsigned int);
124asmlinkage void __m68k_handle_int(unsigned int, struct pt_regs *);
125
126#endif /* _M68K_IRQ_H_ */
diff --git a/arch/m68k/include/asm/irq_no.h b/arch/m68k/include/asm/irq_no.h
deleted file mode 100644
index 9373c31ac87d..000000000000
--- a/arch/m68k/include/asm/irq_no.h
+++ /dev/null
@@ -1,26 +0,0 @@
1#ifndef _M68KNOMMU_IRQ_H_
2#define _M68KNOMMU_IRQ_H_
3
4#ifdef CONFIG_COLDFIRE
5/*
6 * On the ColdFire we keep track of all vectors. That way drivers
7 * can register whatever vector number they wish, and we can deal
8 * with it.
9 */
10#define SYS_IRQS 256
11#define NR_IRQS SYS_IRQS
12
13#else
14
15/*
16 * # of m68k interrupts
17 */
18#define SYS_IRQS 8
19#define NR_IRQS (24 + SYS_IRQS)
20
21#endif /* CONFIG_COLDFIRE */
22
23
24#define irq_canonicalize(irq) (irq)
25
26#endif /* _M68KNOMMU_IRQ_H_ */
diff --git a/arch/m68k/include/asm/m5206sim.h b/arch/m68k/include/asm/m5206sim.h
index 7e3594dea88b..9c384e294af9 100644
--- a/arch/m68k/include/asm/m5206sim.h
+++ b/arch/m68k/include/asm/m5206sim.h
@@ -85,8 +85,21 @@
85#define MCFSIM_PAR 0xcb /* Pin Assignment reg (r/w) */ 85#define MCFSIM_PAR 0xcb /* Pin Assignment reg (r/w) */
86#endif 86#endif
87 87
88#define MCFSIM_PADDR 0x1c5 /* Parallel Direction (r/w) */ 88#define MCFSIM_PADDR (MCF_MBAR + 0x1c5) /* Parallel Direction (r/w) */
89#define MCFSIM_PADAT 0x1c9 /* Parallel Port Value (r/w) */ 89#define MCFSIM_PADAT (MCF_MBAR + 0x1c9) /* Parallel Port Value (r/w) */
90
91/*
92 * Define system peripheral IRQ usage.
93 */
94#define MCF_IRQ_TIMER 30 /* Timer0, Level 6 */
95#define MCF_IRQ_PROFILER 31 /* Timer1, Level 7 */
96
97/*
98 * Generic GPIO
99 */
100#define MCFGPIO_PIN_MAX 8
101#define MCFGPIO_IRQ_VECBASE -1
102#define MCFGPIO_IRQ_MAX -1
90 103
91/* 104/*
92 * Some symbol defines for the Parallel Port Pin Assignment Register 105 * Some symbol defines for the Parallel Port Pin Assignment Register
@@ -111,21 +124,5 @@
111#define MCFSIM_DMA2ICR MCFSIM_ICR15 /* DMA 2 ICR */ 124#define MCFSIM_DMA2ICR MCFSIM_ICR15 /* DMA 2 ICR */
112#endif 125#endif
113 126
114#if defined(CONFIG_M5206e)
115#define MCFSIM_IMR_MASKALL 0xfffe /* All SIM intr sources */
116#endif
117
118/*
119 * Macro to get and set IMR register. It is 16 bits on the 5206.
120 */
121#define mcf_getimr() \
122 *((volatile unsigned short *) (MCF_MBAR + MCFSIM_IMR))
123
124#define mcf_setimr(imr) \
125 *((volatile unsigned short *) (MCF_MBAR + MCFSIM_IMR)) = (imr)
126
127#define mcf_getipr() \
128 *((volatile unsigned short *) (MCF_MBAR + MCFSIM_IPR))
129
130/****************************************************************************/ 127/****************************************************************************/
131#endif /* m5206sim_h */ 128#endif /* m5206sim_h */
diff --git a/arch/m68k/include/asm/m520xsim.h b/arch/m68k/include/asm/m520xsim.h
index 83bbcfd6e8f2..ed2b69b96805 100644
--- a/arch/m68k/include/asm/m520xsim.h
+++ b/arch/m68k/include/asm/m520xsim.h
@@ -11,9 +11,8 @@
11#define m520xsim_h 11#define m520xsim_h
12/****************************************************************************/ 12/****************************************************************************/
13 13
14
15/* 14/*
16 * Define the 5282 SIM register set addresses. 15 * Define the 520x SIM register set addresses.
17 */ 16 */
18#define MCFICM_INTC0 0x48000 /* Base for Interrupt Ctrl 0 */ 17#define MCFICM_INTC0 0x48000 /* Base for Interrupt Ctrl 0 */
19#define MCFINTC_IPRH 0x00 /* Interrupt pending 32-63 */ 18#define MCFINTC_IPRH 0x00 /* Interrupt pending 32-63 */
@@ -22,8 +21,22 @@
22#define MCFINTC_IMRL 0x0c /* Interrupt mask 1-31 */ 21#define MCFINTC_IMRL 0x0c /* Interrupt mask 1-31 */
23#define MCFINTC_INTFRCH 0x10 /* Interrupt force 32-63 */ 22#define MCFINTC_INTFRCH 0x10 /* Interrupt force 32-63 */
24#define MCFINTC_INTFRCL 0x14 /* Interrupt force 1-31 */ 23#define MCFINTC_INTFRCL 0x14 /* Interrupt force 1-31 */
24#define MCFINTC_SIMR 0x1c /* Set interrupt mask 0-63 */
25#define MCFINTC_CIMR 0x1d /* Clear interrupt mask 0-63 */
25#define MCFINTC_ICR0 0x40 /* Base ICR register */ 26#define MCFINTC_ICR0 0x40 /* Base ICR register */
26 27
28/*
29 * The common interrupt controller code just wants to know the absolute
30 * address to the SIMR and CIMR registers (not offsets into IPSBAR).
31 * The 520x family only has a single INTC unit.
32 */
33#define MCFINTC0_SIMR (MCF_IPSBAR + MCFICM_INTC0 + MCFINTC_SIMR)
34#define MCFINTC0_CIMR (MCF_IPSBAR + MCFICM_INTC0 + MCFINTC_CIMR)
35#define MCFINTC0_ICR0 (MCF_IPSBAR + MCFICM_INTC0 + MCFINTC_ICR0)
36#define MCFINTC1_SIMR (0)
37#define MCFINTC1_CIMR (0)
38#define MCFINTC1_ICR0 (0)
39
27#define MCFINT_VECBASE 64 40#define MCFINT_VECBASE 64
28#define MCFINT_UART0 26 /* Interrupt number for UART0 */ 41#define MCFINT_UART0 26 /* Interrupt number for UART0 */
29#define MCFINT_UART1 27 /* Interrupt number for UART1 */ 42#define MCFINT_UART1 27 /* Interrupt number for UART1 */
@@ -41,6 +54,62 @@
41#define MCFSIM_SDCS0 0x000a8110 /* SDRAM Chip Select 0 Configuration */ 54#define MCFSIM_SDCS0 0x000a8110 /* SDRAM Chip Select 0 Configuration */
42#define MCFSIM_SDCS1 0x000a8114 /* SDRAM Chip Select 1 Configuration */ 55#define MCFSIM_SDCS1 0x000a8114 /* SDRAM Chip Select 1 Configuration */
43 56
57#define MCFEPORT_EPDDR 0xFC088002
58#define MCFEPORT_EPDR 0xFC088004
59#define MCFEPORT_EPPDR 0xFC088005
60
61#define MCFGPIO_PODR_BUSCTL 0xFC0A4000
62#define MCFGPIO_PODR_BE 0xFC0A4001
63#define MCFGPIO_PODR_CS 0xFC0A4002
64#define MCFGPIO_PODR_FECI2C 0xFC0A4003
65#define MCFGPIO_PODR_QSPI 0xFC0A4004
66#define MCFGPIO_PODR_TIMER 0xFC0A4005
67#define MCFGPIO_PODR_UART 0xFC0A4006
68#define MCFGPIO_PODR_FECH 0xFC0A4007
69#define MCFGPIO_PODR_FECL 0xFC0A4008
70
71#define MCFGPIO_PDDR_BUSCTL 0xFC0A400C
72#define MCFGPIO_PDDR_BE 0xFC0A400D
73#define MCFGPIO_PDDR_CS 0xFC0A400E
74#define MCFGPIO_PDDR_FECI2C 0xFC0A400F
75#define MCFGPIO_PDDR_QSPI 0xFC0A4010
76#define MCFGPIO_PDDR_TIMER 0xFC0A4011
77#define MCFGPIO_PDDR_UART 0xFC0A4012
78#define MCFGPIO_PDDR_FECH 0xFC0A4013
79#define MCFGPIO_PDDR_FECL 0xFC0A4014
80
81#define MCFGPIO_PPDSDR_BUSCTL 0xFC0A401A
82#define MCFGPIO_PPDSDR_BE 0xFC0A401B
83#define MCFGPIO_PPDSDR_CS 0xFC0A401C
84#define MCFGPIO_PPDSDR_FECI2C 0xFC0A401D
85#define MCFGPIO_PPDSDR_QSPI 0xFC0A401E
86#define MCFGPIO_PPDSDR_TIMER 0xFC0A401F
87#define MCFGPIO_PPDSDR_UART 0xFC0A4021
88#define MCFGPIO_PPDSDR_FECH 0xFC0A4021
89#define MCFGPIO_PPDSDR_FECL 0xFC0A4022
90
91#define MCFGPIO_PCLRR_BUSCTL 0xFC0A4024
92#define MCFGPIO_PCLRR_BE 0xFC0A4025
93#define MCFGPIO_PCLRR_CS 0xFC0A4026
94#define MCFGPIO_PCLRR_FECI2C 0xFC0A4027
95#define MCFGPIO_PCLRR_QSPI 0xFC0A4028
96#define MCFGPIO_PCLRR_TIMER 0xFC0A4029
97#define MCFGPIO_PCLRR_UART 0xFC0A402A
98#define MCFGPIO_PCLRR_FECH 0xFC0A402B
99#define MCFGPIO_PCLRR_FECL 0xFC0A402C
100/*
101 * Generic GPIO support
102 */
103#define MCFGPIO_PODR MCFGPIO_PODR_BUSCTL
104#define MCFGPIO_PDDR MCFGPIO_PDDR_BUSCTL
105#define MCFGPIO_PPDR MCFGPIO_PPDSDR_BUSCTL
106#define MCFGPIO_SETR MCFGPIO_PPDSDR_BUSCTL
107#define MCFGPIO_CLRR MCFGPIO_PCLRR_BUSCTL
108
109#define MCFGPIO_PIN_MAX 80
110#define MCFGPIO_IRQ_MAX 8
111#define MCFGPIO_IRQ_VECBASE MCFINT_VECBASE
112/****************************************************************************/
44 113
45#define MCF_GPIO_PAR_UART (0xA4036) 114#define MCF_GPIO_PAR_UART (0xA4036)
46#define MCF_GPIO_PAR_FECI2C (0xA4033) 115#define MCF_GPIO_PAR_FECI2C (0xA4033)
@@ -55,10 +124,6 @@
55#define MCF_GPIO_PAR_FECI2C_PAR_SDA_URXD2 (0x02) 124#define MCF_GPIO_PAR_FECI2C_PAR_SDA_URXD2 (0x02)
56#define MCF_GPIO_PAR_FECI2C_PAR_SCL_UTXD2 (0x04) 125#define MCF_GPIO_PAR_FECI2C_PAR_SCL_UTXD2 (0x04)
57 126
58#define ICR_INTRCONF 0x05
59#define MCFPIT_IMR MCFINTC_IMRL
60#define MCFPIT_IMR_IBIT (1 << MCFINT_PIT1)
61
62/* 127/*
63 * Reset Controll Unit. 128 * Reset Controll Unit.
64 */ 129 */
diff --git a/arch/m68k/include/asm/m523xsim.h b/arch/m68k/include/asm/m523xsim.h
index 55183b5df1b8..a34894cf8e6f 100644
--- a/arch/m68k/include/asm/m523xsim.h
+++ b/arch/m68k/include/asm/m523xsim.h
@@ -50,5 +50,82 @@
50#define MCF_RCR_SWRESET 0x80 /* Software reset bit */ 50#define MCF_RCR_SWRESET 0x80 /* Software reset bit */
51#define MCF_RCR_FRCSTOUT 0x40 /* Force external reset */ 51#define MCF_RCR_FRCSTOUT 0x40 /* Force external reset */
52 52
53#define MCFGPIO_PODR_ADDR (MCF_IPSBAR + 0x100000)
54#define MCFGPIO_PODR_DATAH (MCF_IPSBAR + 0x100001)
55#define MCFGPIO_PODR_DATAL (MCF_IPSBAR + 0x100002)
56#define MCFGPIO_PODR_BUSCTL (MCF_IPSBAR + 0x100003)
57#define MCFGPIO_PODR_BS (MCF_IPSBAR + 0x100004)
58#define MCFGPIO_PODR_CS (MCF_IPSBAR + 0x100005)
59#define MCFGPIO_PODR_SDRAM (MCF_IPSBAR + 0x100006)
60#define MCFGPIO_PODR_FECI2C (MCF_IPSBAR + 0x100007)
61#define MCFGPIO_PODR_UARTH (MCF_IPSBAR + 0x100008)
62#define MCFGPIO_PODR_UARTL (MCF_IPSBAR + 0x100009)
63#define MCFGPIO_PODR_QSPI (MCF_IPSBAR + 0x10000A)
64#define MCFGPIO_PODR_TIMER (MCF_IPSBAR + 0x10000B)
65#define MCFGPIO_PODR_ETPU (MCF_IPSBAR + 0x10000C)
66
67#define MCFGPIO_PDDR_ADDR (MCF_IPSBAR + 0x100010)
68#define MCFGPIO_PDDR_DATAH (MCF_IPSBAR + 0x100011)
69#define MCFGPIO_PDDR_DATAL (MCF_IPSBAR + 0x100012)
70#define MCFGPIO_PDDR_BUSCTL (MCF_IPSBAR + 0x100013)
71#define MCFGPIO_PDDR_BS (MCF_IPSBAR + 0x100014)
72#define MCFGPIO_PDDR_CS (MCF_IPSBAR + 0x100015)
73#define MCFGPIO_PDDR_SDRAM (MCF_IPSBAR + 0x100016)
74#define MCFGPIO_PDDR_FECI2C (MCF_IPSBAR + 0x100017)
75#define MCFGPIO_PDDR_UARTH (MCF_IPSBAR + 0x100018)
76#define MCFGPIO_PDDR_UARTL (MCF_IPSBAR + 0x100019)
77#define MCFGPIO_PDDR_QSPI (MCF_IPSBAR + 0x10001A)
78#define MCFGPIO_PDDR_TIMER (MCF_IPSBAR + 0x10001B)
79#define MCFGPIO_PDDR_ETPU (MCF_IPSBAR + 0x10001C)
80
81#define MCFGPIO_PPDSDR_ADDR (MCF_IPSBAR + 0x100020)
82#define MCFGPIO_PPDSDR_DATAH (MCF_IPSBAR + 0x100021)
83#define MCFGPIO_PPDSDR_DATAL (MCF_IPSBAR + 0x100022)
84#define MCFGPIO_PPDSDR_BUSCTL (MCF_IPSBAR + 0x100023)
85#define MCFGPIO_PPDSDR_BS (MCF_IPSBAR + 0x100024)
86#define MCFGPIO_PPDSDR_CS (MCF_IPSBAR + 0x100025)
87#define MCFGPIO_PPDSDR_SDRAM (MCF_IPSBAR + 0x100026)
88#define MCFGPIO_PPDSDR_FECI2C (MCF_IPSBAR + 0x100027)
89#define MCFGPIO_PPDSDR_UARTH (MCF_IPSBAR + 0x100028)
90#define MCFGPIO_PPDSDR_UARTL (MCF_IPSBAR + 0x100029)
91#define MCFGPIO_PPDSDR_QSPI (MCF_IPSBAR + 0x10002A)
92#define MCFGPIO_PPDSDR_TIMER (MCF_IPSBAR + 0x10002B)
93#define MCFGPIO_PPDSDR_ETPU (MCF_IPSBAR + 0x10002C)
94
95#define MCFGPIO_PCLRR_ADDR (MCF_IPSBAR + 0x100030)
96#define MCFGPIO_PCLRR_DATAH (MCF_IPSBAR + 0x100031)
97#define MCFGPIO_PCLRR_DATAL (MCF_IPSBAR + 0x100032)
98#define MCFGPIO_PCLRR_BUSCTL (MCF_IPSBAR + 0x100033)
99#define MCFGPIO_PCLRR_BS (MCF_IPSBAR + 0x100034)
100#define MCFGPIO_PCLRR_CS (MCF_IPSBAR + 0x100035)
101#define MCFGPIO_PCLRR_SDRAM (MCF_IPSBAR + 0x100036)
102#define MCFGPIO_PCLRR_FECI2C (MCF_IPSBAR + 0x100037)
103#define MCFGPIO_PCLRR_UARTH (MCF_IPSBAR + 0x100038)
104#define MCFGPIO_PCLRR_UARTL (MCF_IPSBAR + 0x100039)
105#define MCFGPIO_PCLRR_QSPI (MCF_IPSBAR + 0x10003A)
106#define MCFGPIO_PCLRR_TIMER (MCF_IPSBAR + 0x10003B)
107#define MCFGPIO_PCLRR_ETPU (MCF_IPSBAR + 0x10003C)
108
109/*
110 * EPort
111 */
112
113#define MCFEPORT_EPDDR (MCF_IPSBAR + 0x130002)
114#define MCFEPORT_EPDR (MCF_IPSBAR + 0x130004)
115#define MCFEPORT_EPPDR (MCF_IPSBAR + 0x130005)
116
117/*
118 * Generic GPIO support
119 */
120#define MCFGPIO_PODR MCFGPIO_PODR_ADDR
121#define MCFGPIO_PDDR MCFGPIO_PDDR_ADDR
122#define MCFGPIO_PPDR MCFGPIO_PPDSDR_ADDR
123#define MCFGPIO_SETR MCFGPIO_PPDSDR_ADDR
124#define MCFGPIO_CLRR MCFGPIO_PCLRR_ADDR
125
126#define MCFGPIO_PIN_MAX 107
127#define MCFGPIO_IRQ_MAX 8
128#define MCFGPIO_IRQ_VECBASE MCFINT_VECBASE
129
53/****************************************************************************/ 130/****************************************************************************/
54#endif /* m523xsim_h */ 131#endif /* m523xsim_h */
diff --git a/arch/m68k/include/asm/m5249sim.h b/arch/m68k/include/asm/m5249sim.h
index 366eb8602d2f..14bce877ed88 100644
--- a/arch/m68k/include/asm/m5249sim.h
+++ b/arch/m68k/include/asm/m5249sim.h
@@ -71,16 +71,22 @@
71#define MCFSIM_DMA3ICR MCFSIM_ICR9 /* DMA 3 ICR */ 71#define MCFSIM_DMA3ICR MCFSIM_ICR9 /* DMA 3 ICR */
72 72
73/* 73/*
74 * Define system peripheral IRQ usage.
75 */
76#define MCF_IRQ_TIMER 30 /* Timer0, Level 6 */
77#define MCF_IRQ_PROFILER 31 /* Timer1, Level 7 */
78
79/*
74 * General purpose IO registers (in MBAR2). 80 * General purpose IO registers (in MBAR2).
75 */ 81 */
76#define MCFSIM2_GPIOREAD 0x0 /* GPIO read values */ 82#define MCFSIM2_GPIOREAD (MCF_MBAR2 + 0x000) /* GPIO read values */
77#define MCFSIM2_GPIOWRITE 0x4 /* GPIO write values */ 83#define MCFSIM2_GPIOWRITE (MCF_MBAR2 + 0x004) /* GPIO write values */
78#define MCFSIM2_GPIOENABLE 0x8 /* GPIO enabled */ 84#define MCFSIM2_GPIOENABLE (MCF_MBAR2 + 0x008) /* GPIO enabled */
79#define MCFSIM2_GPIOFUNC 0xc /* GPIO function */ 85#define MCFSIM2_GPIOFUNC (MCF_MBAR2 + 0x00C) /* GPIO function */
80#define MCFSIM2_GPIO1READ 0xb0 /* GPIO1 read values */ 86#define MCFSIM2_GPIO1READ (MCF_MBAR2 + 0x0B0) /* GPIO1 read values */
81#define MCFSIM2_GPIO1WRITE 0xb4 /* GPIO1 write values */ 87#define MCFSIM2_GPIO1WRITE (MCF_MBAR2 + 0x0B4) /* GPIO1 write values */
82#define MCFSIM2_GPIO1ENABLE 0xb8 /* GPIO1 enabled */ 88#define MCFSIM2_GPIO1ENABLE (MCF_MBAR2 + 0x0B8) /* GPIO1 enabled */
83#define MCFSIM2_GPIO1FUNC 0xbc /* GPIO1 function */ 89#define MCFSIM2_GPIO1FUNC (MCF_MBAR2 + 0x0BC) /* GPIO1 function */
84 90
85#define MCFSIM2_GPIOINTSTAT 0xc0 /* GPIO interrupt status */ 91#define MCFSIM2_GPIOINTSTAT 0xc0 /* GPIO interrupt status */
86#define MCFSIM2_GPIOINTCLEAR 0xc0 /* GPIO interrupt clear */ 92#define MCFSIM2_GPIOINTCLEAR 0xc0 /* GPIO interrupt clear */
@@ -100,20 +106,28 @@
100#define MCFSIM2_IDECONFIG1 0x18c /* IDEconfig1 */ 106#define MCFSIM2_IDECONFIG1 0x18c /* IDEconfig1 */
101#define MCFSIM2_IDECONFIG2 0x190 /* IDEconfig2 */ 107#define MCFSIM2_IDECONFIG2 0x190 /* IDEconfig2 */
102 108
103
104/* 109/*
105 * Macro to set IMR register. It is 32 bits on the 5249. 110 * Define the base interrupt for the second interrupt controller.
111 * We set it to 128, out of the way of the base interrupts, and plenty
112 * of room for its 64 interrupts.
106 */ 113 */
107#define MCFSIM_IMR_MASKALL 0x7fffe /* All SIM intr sources */ 114#define MCFINTC2_VECBASE 128
108 115
109#define mcf_getimr() \ 116#define MCFINTC2_GPIOIRQ0 (MCFINTC2_VECBASE + 32)
110 *((volatile unsigned long *) (MCF_MBAR + MCFSIM_IMR)) 117#define MCFINTC2_GPIOIRQ1 (MCFINTC2_VECBASE + 33)
118#define MCFINTC2_GPIOIRQ2 (MCFINTC2_VECBASE + 34)
119#define MCFINTC2_GPIOIRQ3 (MCFINTC2_VECBASE + 35)
120#define MCFINTC2_GPIOIRQ4 (MCFINTC2_VECBASE + 36)
121#define MCFINTC2_GPIOIRQ5 (MCFINTC2_VECBASE + 37)
122#define MCFINTC2_GPIOIRQ6 (MCFINTC2_VECBASE + 38)
123#define MCFINTC2_GPIOIRQ7 (MCFINTC2_VECBASE + 39)
111 124
112#define mcf_setimr(imr) \ 125/*
113 *((volatile unsigned long *) (MCF_MBAR + MCFSIM_IMR)) = (imr); 126 * Generic GPIO support
114 127 */
115#define mcf_getipr() \ 128#define MCFGPIO_PIN_MAX 64
116 *((volatile unsigned long *) (MCF_MBAR + MCFSIM_IPR)) 129#define MCFGPIO_IRQ_MAX -1
130#define MCFGPIO_IRQ_VECBASE -1
117 131
118/****************************************************************************/ 132/****************************************************************************/
119 133
@@ -137,9 +151,9 @@
137 subql #1,%a1 /* get MBAR2 address in a1 */ 151 subql #1,%a1 /* get MBAR2 address in a1 */
138 152
139 /* 153 /*
140 * Move secondary interrupts to base at 128. 154 * Move secondary interrupts to their base (128).
141 */ 155 */
142 moveb #0x80,%d0 156 moveb #MCFINTC2_VECBASE,%d0
143 moveb %d0,0x16b(%a1) /* interrupt base register */ 157 moveb %d0,0x16b(%a1) /* interrupt base register */
144 158
145 /* 159 /*
diff --git a/arch/m68k/include/asm/m5272sim.h b/arch/m68k/include/asm/m5272sim.h
index 6217edc21139..df3332c2317d 100644
--- a/arch/m68k/include/asm/m5272sim.h
+++ b/arch/m68k/include/asm/m5272sim.h
@@ -12,7 +12,6 @@
12#define m5272sim_h 12#define m5272sim_h
13/****************************************************************************/ 13/****************************************************************************/
14 14
15
16/* 15/*
17 * Define the 5272 SIM register set addresses. 16 * Define the 5272 SIM register set addresses.
18 */ 17 */
@@ -63,16 +62,59 @@
63#define MCFSIM_DCMR1 0x5c /* DRAM 1 Mask reg (r/w) */ 62#define MCFSIM_DCMR1 0x5c /* DRAM 1 Mask reg (r/w) */
64#define MCFSIM_DCCR1 0x63 /* DRAM 1 Control reg (r/w) */ 63#define MCFSIM_DCCR1 0x63 /* DRAM 1 Control reg (r/w) */
65 64
66#define MCFSIM_PACNT 0x80 /* Port A Control (r/w) */ 65#define MCFSIM_PACNT (MCF_MBAR + 0x80) /* Port A Control (r/w) */
67#define MCFSIM_PADDR 0x84 /* Port A Direction (r/w) */ 66#define MCFSIM_PADDR (MCF_MBAR + 0x84) /* Port A Direction (r/w) */
68#define MCFSIM_PADAT 0x86 /* Port A Data (r/w) */ 67#define MCFSIM_PADAT (MCF_MBAR + 0x86) /* Port A Data (r/w) */
69#define MCFSIM_PBCNT 0x88 /* Port B Control (r/w) */ 68#define MCFSIM_PBCNT (MCF_MBAR + 0x88) /* Port B Control (r/w) */
70#define MCFSIM_PBDDR 0x8c /* Port B Direction (r/w) */ 69#define MCFSIM_PBDDR (MCF_MBAR + 0x8c) /* Port B Direction (r/w) */
71#define MCFSIM_PBDAT 0x8e /* Port B Data (r/w) */ 70#define MCFSIM_PBDAT (MCF_MBAR + 0x8e) /* Port B Data (r/w) */
72#define MCFSIM_PCDDR 0x94 /* Port C Direction (r/w) */ 71#define MCFSIM_PCDDR (MCF_MBAR + 0x94) /* Port C Direction (r/w) */
73#define MCFSIM_PCDAT 0x96 /* Port C Data (r/w) */ 72#define MCFSIM_PCDAT (MCF_MBAR + 0x96) /* Port C Data (r/w) */
74#define MCFSIM_PDCNT 0x98 /* Port D Control (r/w) */ 73#define MCFSIM_PDCNT (MCF_MBAR + 0x98) /* Port D Control (r/w) */
74
75/*
76 * Define system peripheral IRQ usage.
77 */
78#define MCFINT_VECBASE 64 /* Base of interrupts */
79#define MCF_IRQ_SPURIOUS 64 /* User Spurious */
80#define MCF_IRQ_EINT1 65 /* External Interrupt 1 */
81#define MCF_IRQ_EINT2 66 /* External Interrupt 2 */
82#define MCF_IRQ_EINT3 67 /* External Interrupt 3 */
83#define MCF_IRQ_EINT4 68 /* External Interrupt 4 */
84#define MCF_IRQ_TIMER1 69 /* Timer 1 */
85#define MCF_IRQ_TIMER2 70 /* Timer 2 */
86#define MCF_IRQ_TIMER3 71 /* Timer 3 */
87#define MCF_IRQ_TIMER4 72 /* Timer 4 */
88#define MCF_IRQ_UART1 73 /* UART 1 */
89#define MCF_IRQ_UART2 74 /* UART 2 */
90#define MCF_IRQ_PLIP 75 /* PLIC 2Khz Periodic */
91#define MCF_IRQ_PLIA 76 /* PLIC Asynchronous */
92#define MCF_IRQ_USB0 77 /* USB Endpoint 0 */
93#define MCF_IRQ_USB1 78 /* USB Endpoint 1 */
94#define MCF_IRQ_USB2 79 /* USB Endpoint 2 */
95#define MCF_IRQ_USB3 80 /* USB Endpoint 3 */
96#define MCF_IRQ_USB4 81 /* USB Endpoint 4 */
97#define MCF_IRQ_USB5 82 /* USB Endpoint 5 */
98#define MCF_IRQ_USB6 83 /* USB Endpoint 6 */
99#define MCF_IRQ_USB7 84 /* USB Endpoint 7 */
100#define MCF_IRQ_DMA 85 /* DMA Controller */
101#define MCF_IRQ_ERX 86 /* Ethernet Receiver */
102#define MCF_IRQ_ETX 87 /* Ethernet Transmitter */
103#define MCF_IRQ_ENTC 88 /* Ethernet Non-Time Critical */
104#define MCF_IRQ_QSPI 89 /* Queued Serial Interface */
105#define MCF_IRQ_EINT5 90 /* External Interrupt 5 */
106#define MCF_IRQ_EINT6 91 /* External Interrupt 6 */
107#define MCF_IRQ_SWTO 92 /* Software Watchdog */
108#define MCFINT_VECMAX 95 /* Maxmum interrupt */
75 109
110#define MCF_IRQ_TIMER MCF_IRQ_TIMER1
111#define MCF_IRQ_PROFILER MCF_IRQ_TIMER2
76 112
113/*
114 * Generic GPIO support
115 */
116#define MCFGPIO_PIN_MAX 48
117#define MCFGPIO_IRQ_MAX -1
118#define MCFGPIO_IRQ_VECBASE -1
77/****************************************************************************/ 119/****************************************************************************/
78#endif /* m5272sim_h */ 120#endif /* m5272sim_h */
diff --git a/arch/m68k/include/asm/m527xsim.h b/arch/m68k/include/asm/m527xsim.h
index 95f4f8ee8f7c..453356d72d80 100644
--- a/arch/m68k/include/asm/m527xsim.h
+++ b/arch/m68k/include/asm/m527xsim.h
@@ -54,6 +54,175 @@
54#define MCFSIM_DMR1 0x5c /* SDRAM address mask 1 */ 54#define MCFSIM_DMR1 0x5c /* SDRAM address mask 1 */
55#endif 55#endif
56 56
57
58#ifdef CONFIG_M5271
59#define MCFGPIO_PODR_ADDR (MCF_IPSBAR + 0x100000)
60#define MCFGPIO_PODR_DATAH (MCF_IPSBAR + 0x100001)
61#define MCFGPIO_PODR_DATAL (MCF_IPSBAR + 0x100002)
62#define MCFGPIO_PODR_BUSCTL (MCF_IPSBAR + 0x100003)
63#define MCFGPIO_PODR_BS (MCF_IPSBAR + 0x100004)
64#define MCFGPIO_PODR_CS (MCF_IPSBAR + 0x100005)
65#define MCFGPIO_PODR_SDRAM (MCF_IPSBAR + 0x100006)
66#define MCFGPIO_PODR_FECI2C (MCF_IPSBAR + 0x100007)
67#define MCFGPIO_PODR_UARTH (MCF_IPSBAR + 0x100008)
68#define MCFGPIO_PODR_UARTL (MCF_IPSBAR + 0x100009)
69#define MCFGPIO_PODR_QSPI (MCF_IPSBAR + 0x10000A)
70#define MCFGPIO_PODR_TIMER (MCF_IPSBAR + 0x10000B)
71
72#define MCFGPIO_PDDR_ADDR (MCF_IPSBAR + 0x100010)
73#define MCFGPIO_PDDR_DATAH (MCF_IPSBAR + 0x100011)
74#define MCFGPIO_PDDR_DATAL (MCF_IPSBAR + 0x100012)
75#define MCFGPIO_PDDR_BUSCTL (MCF_IPSBAR + 0x100013)
76#define MCFGPIO_PDDR_BS (MCF_IPSBAR + 0x100014)
77#define MCFGPIO_PDDR_CS (MCF_IPSBAR + 0x100015)
78#define MCFGPIO_PDDR_SDRAM (MCF_IPSBAR + 0x100016)
79#define MCFGPIO_PDDR_FECI2C (MCF_IPSBAR + 0x100017)
80#define MCFGPIO_PDDR_UARTH (MCF_IPSBAR + 0x100018)
81#define MCFGPIO_PDDR_UARTL (MCF_IPSBAR + 0x100019)
82#define MCFGPIO_PDDR_QSPI (MCF_IPSBAR + 0x10001A)
83#define MCFGPIO_PDDR_TIMER (MCF_IPSBAR + 0x10001B)
84
85#define MCFGPIO_PPDSDR_ADDR (MCF_IPSBAR + 0x100020)
86#define MCFGPIO_PPDSDR_DATAH (MCF_IPSBAR + 0x100021)
87#define MCFGPIO_PPDSDR_DATAL (MCF_IPSBAR + 0x100022)
88#define MCFGPIO_PPDSDR_BUSCTL (MCF_IPSBAR + 0x100023)
89#define MCFGPIO_PPDSDR_BS (MCF_IPSBAR + 0x100024)
90#define MCFGPIO_PPDSDR_CS (MCF_IPSBAR + 0x100025)
91#define MCFGPIO_PPDSDR_SDRAM (MCF_IPSBAR + 0x100026)
92#define MCFGPIO_PPDSDR_FECI2C (MCF_IPSBAR + 0x100027)
93#define MCFGPIO_PPDSDR_UARTH (MCF_IPSBAR + 0x100028)
94#define MCFGPIO_PPDSDR_UARTL (MCF_IPSBAR + 0x100029)
95#define MCFGPIO_PPDSDR_QSPI (MCF_IPSBAR + 0x10002A)
96#define MCFGPIO_PPDSDR_TIMER (MCF_IPSBAR + 0x10002B)
97
98#define MCFGPIO_PCLRR_ADDR (MCF_IPSBAR + 0x100030)
99#define MCFGPIO_PCLRR_DATAH (MCF_IPSBAR + 0x100031)
100#define MCFGPIO_PCLRR_DATAL (MCF_IPSBAR + 0x100032)
101#define MCFGPIO_PCLRR_BUSCTL (MCF_IPSBAR + 0x100033)
102#define MCFGPIO_PCLRR_BS (MCF_IPSBAR + 0x100034)
103#define MCFGPIO_PCLRR_CS (MCF_IPSBAR + 0x100035)
104#define MCFGPIO_PCLRR_SDRAM (MCF_IPSBAR + 0x100036)
105#define MCFGPIO_PCLRR_FECI2C (MCF_IPSBAR + 0x100037)
106#define MCFGPIO_PCLRR_UARTH (MCF_IPSBAR + 0x100038)
107#define MCFGPIO_PCLRR_UARTL (MCF_IPSBAR + 0x100039)
108#define MCFGPIO_PCLRR_QSPI (MCF_IPSBAR + 0x10003A)
109#define MCFGPIO_PCLRR_TIMER (MCF_IPSBAR + 0x10003B)
110
111/*
112 * Generic GPIO support
113 */
114#define MCFGPIO_PODR MCFGPIO_PODR_ADDR
115#define MCFGPIO_PDDR MCFGPIO_PDDR_ADDR
116#define MCFGPIO_PPDR MCFGPIO_PPDSDR_ADDR
117#define MCFGPIO_SETR MCFGPIO_PPDSDR_ADDR
118#define MCFGPIO_CLRR MCFGPIO_PCLRR_ADDR
119
120#define MCFGPIO_PIN_MAX 100
121#define MCFGPIO_IRQ_MAX 8
122#define MCFGPIO_IRQ_VECBASE MCFINT_VECBASE
123#endif
124
125#ifdef CONFIG_M5275
126#define MCFGPIO_PODR_BUSCTL (MCF_IPSBAR + 0x100004)
127#define MCFGPIO_PODR_ADDR (MCF_IPSBAR + 0x100005)
128#define MCFGPIO_PODR_CS (MCF_IPSBAR + 0x100008)
129#define MCFGPIO_PODR_FEC0H (MCF_IPSBAR + 0x10000A)
130#define MCFGPIO_PODR_FEC0L (MCF_IPSBAR + 0x10000B)
131#define MCFGPIO_PODR_FECI2C (MCF_IPSBAR + 0x10000C)
132#define MCFGPIO_PODR_QSPI (MCF_IPSBAR + 0x10000D)
133#define MCFGPIO_PODR_SDRAM (MCF_IPSBAR + 0x10000E)
134#define MCFGPIO_PODR_TIMERH (MCF_IPSBAR + 0x10000F)
135#define MCFGPIO_PODR_TIMERL (MCF_IPSBAR + 0x100010)
136#define MCFGPIO_PODR_UARTL (MCF_IPSBAR + 0x100011)
137#define MCFGPIO_PODR_FEC1H (MCF_IPSBAR + 0x100012)
138#define MCFGPIO_PODR_FEC1L (MCF_IPSBAR + 0x100013)
139#define MCFGPIO_PODR_BS (MCF_IPSBAR + 0x100014)
140#define MCFGPIO_PODR_IRQ (MCF_IPSBAR + 0x100015)
141#define MCFGPIO_PODR_USBH (MCF_IPSBAR + 0x100016)
142#define MCFGPIO_PODR_USBL (MCF_IPSBAR + 0x100017)
143#define MCFGPIO_PODR_UARTH (MCF_IPSBAR + 0x100018)
144
145#define MCFGPIO_PDDR_BUSCTL (MCF_IPSBAR + 0x100020)
146#define MCFGPIO_PDDR_ADDR (MCF_IPSBAR + 0x100021)
147#define MCFGPIO_PDDR_CS (MCF_IPSBAR + 0x100024)
148#define MCFGPIO_PDDR_FEC0H (MCF_IPSBAR + 0x100026)
149#define MCFGPIO_PDDR_FEC0L (MCF_IPSBAR + 0x100027)
150#define MCFGPIO_PDDR_FECI2C (MCF_IPSBAR + 0x100028)
151#define MCFGPIO_PDDR_QSPI (MCF_IPSBAR + 0x100029)
152#define MCFGPIO_PDDR_SDRAM (MCF_IPSBAR + 0x10002A)
153#define MCFGPIO_PDDR_TIMERH (MCF_IPSBAR + 0x10002B)
154#define MCFGPIO_PDDR_TIMERL (MCF_IPSBAR + 0x10002C)
155#define MCFGPIO_PDDR_UARTL (MCF_IPSBAR + 0x10002D)
156#define MCFGPIO_PDDR_FEC1H (MCF_IPSBAR + 0x10002E)
157#define MCFGPIO_PDDR_FEC1L (MCF_IPSBAR + 0x10002F)
158#define MCFGPIO_PDDR_BS (MCF_IPSBAR + 0x100030)
159#define MCFGPIO_PDDR_IRQ (MCF_IPSBAR + 0x100031)
160#define MCFGPIO_PDDR_USBH (MCF_IPSBAR + 0x100032)
161#define MCFGPIO_PDDR_USBL (MCF_IPSBAR + 0x100033)
162#define MCFGPIO_PDDR_UARTH (MCF_IPSBAR + 0x100034)
163
164#define MCFGPIO_PPDSDR_BUSCTL (MCF_IPSBAR + 0x10003C)
165#define MCFGPIO_PPDSDR_ADDR (MCF_IPSBAR + 0x10003D)
166#define MCFGPIO_PPDSDR_CS (MCF_IPSBAR + 0x100040)
167#define MCFGPIO_PPDSDR_FEC0H (MCF_IPSBAR + 0x100042)
168#define MCFGPIO_PPDSDR_FEC0L (MCF_IPSBAR + 0x100043)
169#define MCFGPIO_PPDSDR_FECI2C (MCF_IPSBAR + 0x100044)
170#define MCFGPIO_PPDSDR_QSPI (MCF_IPSBAR + 0x100045)
171#define MCFGPIO_PPDSDR_SDRAM (MCF_IPSBAR + 0x100046)
172#define MCFGPIO_PPDSDR_TIMERH (MCF_IPSBAR + 0x100047)
173#define MCFGPIO_PPDSDR_TIMERL (MCF_IPSBAR + 0x100048)
174#define MCFGPIO_PPDSDR_UARTL (MCF_IPSBAR + 0x100049)
175#define MCFGPIO_PPDSDR_FEC1H (MCF_IPSBAR + 0x10004A)
176#define MCFGPIO_PPDSDR_FEC1L (MCF_IPSBAR + 0x10004B)
177#define MCFGPIO_PPDSDR_BS (MCF_IPSBAR + 0x10004C)
178#define MCFGPIO_PPDSDR_IRQ (MCF_IPSBAR + 0x10004D)
179#define MCFGPIO_PPDSDR_USBH (MCF_IPSBAR + 0x10004E)
180#define MCFGPIO_PPDSDR_USBL (MCF_IPSBAR + 0x10004F)
181#define MCFGPIO_PPDSDR_UARTH (MCF_IPSBAR + 0x100050)
182
183#define MCFGPIO_PCLRR_BUSCTL (MCF_IPSBAR + 0x100058)
184#define MCFGPIO_PCLRR_ADDR (MCF_IPSBAR + 0x100059)
185#define MCFGPIO_PCLRR_CS (MCF_IPSBAR + 0x10005C)
186#define MCFGPIO_PCLRR_FEC0H (MCF_IPSBAR + 0x10005E)
187#define MCFGPIO_PCLRR_FEC0L (MCF_IPSBAR + 0x10005F)
188#define MCFGPIO_PCLRR_FECI2C (MCF_IPSBAR + 0x100060)
189#define MCFGPIO_PCLRR_QSPI (MCF_IPSBAR + 0x100061)
190#define MCFGPIO_PCLRR_SDRAM (MCF_IPSBAR + 0x100062)
191#define MCFGPIO_PCLRR_TIMERH (MCF_IPSBAR + 0x100063)
192#define MCFGPIO_PCLRR_TIMERL (MCF_IPSBAR + 0x100064)
193#define MCFGPIO_PCLRR_UARTL (MCF_IPSBAR + 0x100065)
194#define MCFGPIO_PCLRR_FEC1H (MCF_IPSBAR + 0x100066)
195#define MCFGPIO_PCLRR_FEC1L (MCF_IPSBAR + 0x100067)
196#define MCFGPIO_PCLRR_BS (MCF_IPSBAR + 0x100068)
197#define MCFGPIO_PCLRR_IRQ (MCF_IPSBAR + 0x100069)
198#define MCFGPIO_PCLRR_USBH (MCF_IPSBAR + 0x10006A)
199#define MCFGPIO_PCLRR_USBL (MCF_IPSBAR + 0x10006B)
200#define MCFGPIO_PCLRR_UARTH (MCF_IPSBAR + 0x10006C)
201
202
203/*
204 * Generic GPIO support
205 */
206#define MCFGPIO_PODR MCFGPIO_PODR_BUSCTL
207#define MCFGPIO_PDDR MCFGPIO_PDDR_BUSCTL
208#define MCFGPIO_PPDR MCFGPIO_PPDSDR_BUSCTL
209#define MCFGPIO_SETR MCFGPIO_PPDSDR_BUSCTL
210#define MCFGPIO_CLRR MCFGPIO_PCLRR_BUSCTL
211
212#define MCFGPIO_PIN_MAX 148
213#define MCFGPIO_IRQ_MAX 8
214#define MCFGPIO_IRQ_VECBASE MCFINT_VECBASE
215#endif
216
217/*
218 * EPort
219 */
220
221#define MCFEPORT_EPDDR (MCF_IPSBAR + 0x130002)
222#define MCFEPORT_EPDR (MCF_IPSBAR + 0x130004)
223#define MCFEPORT_EPPDR (MCF_IPSBAR + 0x130005)
224
225
57/* 226/*
58 * GPIO pins setups to enable the UARTs. 227 * GPIO pins setups to enable the UARTs.
59 */ 228 */
diff --git a/arch/m68k/include/asm/m528xsim.h b/arch/m68k/include/asm/m528xsim.h
index d79c49f8134a..e2ad1f42b657 100644
--- a/arch/m68k/include/asm/m528xsim.h
+++ b/arch/m68k/include/asm/m528xsim.h
@@ -41,6 +41,157 @@
41#define MCFSIM_DMR1 0x54 /* SDRAM address mask 1 */ 41#define MCFSIM_DMR1 0x54 /* SDRAM address mask 1 */
42 42
43/* 43/*
44 * GPIO registers
45 */
46#define MCFGPIO_PORTA (MCF_IPSBAR + 0x00100000)
47#define MCFGPIO_PORTB (MCF_IPSBAR + 0x00100001)
48#define MCFGPIO_PORTC (MCF_IPSBAR + 0x00100002)
49#define MCFGPIO_PORTD (MCF_IPSBAR + 0x00100003)
50#define MCFGPIO_PORTE (MCF_IPSBAR + 0x00100004)
51#define MCFGPIO_PORTF (MCF_IPSBAR + 0x00100005)
52#define MCFGPIO_PORTG (MCF_IPSBAR + 0x00100006)
53#define MCFGPIO_PORTH (MCF_IPSBAR + 0x00100007)
54#define MCFGPIO_PORTJ (MCF_IPSBAR + 0x00100008)
55#define MCFGPIO_PORTDD (MCF_IPSBAR + 0x00100009)
56#define MCFGPIO_PORTEH (MCF_IPSBAR + 0x0010000A)
57#define MCFGPIO_PORTEL (MCF_IPSBAR + 0x0010000B)
58#define MCFGPIO_PORTAS (MCF_IPSBAR + 0x0010000C)
59#define MCFGPIO_PORTQS (MCF_IPSBAR + 0x0010000D)
60#define MCFGPIO_PORTSD (MCF_IPSBAR + 0x0010000E)
61#define MCFGPIO_PORTTC (MCF_IPSBAR + 0x0010000F)
62#define MCFGPIO_PORTTD (MCF_IPSBAR + 0x00100010)
63#define MCFGPIO_PORTUA (MCF_IPSBAR + 0x00100011)
64
65#define MCFGPIO_DDRA (MCF_IPSBAR + 0x00100014)
66#define MCFGPIO_DDRB (MCF_IPSBAR + 0x00100015)
67#define MCFGPIO_DDRC (MCF_IPSBAR + 0x00100016)
68#define MCFGPIO_DDRD (MCF_IPSBAR + 0x00100017)
69#define MCFGPIO_DDRE (MCF_IPSBAR + 0x00100018)
70#define MCFGPIO_DDRF (MCF_IPSBAR + 0x00100019)
71#define MCFGPIO_DDRG (MCF_IPSBAR + 0x0010001A)
72#define MCFGPIO_DDRH (MCF_IPSBAR + 0x0010001B)
73#define MCFGPIO_DDRJ (MCF_IPSBAR + 0x0010001C)
74#define MCFGPIO_DDRDD (MCF_IPSBAR + 0x0010001D)
75#define MCFGPIO_DDREH (MCF_IPSBAR + 0x0010001E)
76#define MCFGPIO_DDREL (MCF_IPSBAR + 0x0010001F)
77#define MCFGPIO_DDRAS (MCF_IPSBAR + 0x00100020)
78#define MCFGPIO_DDRQS (MCF_IPSBAR + 0x00100021)
79#define MCFGPIO_DDRSD (MCF_IPSBAR + 0x00100022)
80#define MCFGPIO_DDRTC (MCF_IPSBAR + 0x00100023)
81#define MCFGPIO_DDRTD (MCF_IPSBAR + 0x00100024)
82#define MCFGPIO_DDRUA (MCF_IPSBAR + 0x00100025)
83
84#define MCFGPIO_PORTAP (MCF_IPSBAR + 0x00100028)
85#define MCFGPIO_PORTBP (MCF_IPSBAR + 0x00100029)
86#define MCFGPIO_PORTCP (MCF_IPSBAR + 0x0010002A)
87#define MCFGPIO_PORTDP (MCF_IPSBAR + 0x0010002B)
88#define MCFGPIO_PORTEP (MCF_IPSBAR + 0x0010002C)
89#define MCFGPIO_PORTFP (MCF_IPSBAR + 0x0010002D)
90#define MCFGPIO_PORTGP (MCF_IPSBAR + 0x0010002E)
91#define MCFGPIO_PORTHP (MCF_IPSBAR + 0x0010002F)
92#define MCFGPIO_PORTJP (MCF_IPSBAR + 0x00100030)
93#define MCFGPIO_PORTDDP (MCF_IPSBAR + 0x00100031)
94#define MCFGPIO_PORTEHP (MCF_IPSBAR + 0x00100032)
95#define MCFGPIO_PORTELP (MCF_IPSBAR + 0x00100033)
96#define MCFGPIO_PORTASP (MCF_IPSBAR + 0x00100034)
97#define MCFGPIO_PORTQSP (MCF_IPSBAR + 0x00100035)
98#define MCFGPIO_PORTSDP (MCF_IPSBAR + 0x00100036)
99#define MCFGPIO_PORTTCP (MCF_IPSBAR + 0x00100037)
100#define MCFGPIO_PORTTDP (MCF_IPSBAR + 0x00100038)
101#define MCFGPIO_PORTUAP (MCF_IPSBAR + 0x00100039)
102
103#define MCFGPIO_SETA (MCF_IPSBAR + 0x00100028)
104#define MCFGPIO_SETB (MCF_IPSBAR + 0x00100029)
105#define MCFGPIO_SETC (MCF_IPSBAR + 0x0010002A)
106#define MCFGPIO_SETD (MCF_IPSBAR + 0x0010002B)
107#define MCFGPIO_SETE (MCF_IPSBAR + 0x0010002C)
108#define MCFGPIO_SETF (MCF_IPSBAR + 0x0010002D)
109#define MCFGPIO_SETG (MCF_IPSBAR + 0x0010002E)
110#define MCFGPIO_SETH (MCF_IPSBAR + 0x0010002F)
111#define MCFGPIO_SETJ (MCF_IPSBAR + 0x00100030)
112#define MCFGPIO_SETDD (MCF_IPSBAR + 0x00100031)
113#define MCFGPIO_SETEH (MCF_IPSBAR + 0x00100032)
114#define MCFGPIO_SETEL (MCF_IPSBAR + 0x00100033)
115#define MCFGPIO_SETAS (MCF_IPSBAR + 0x00100034)
116#define MCFGPIO_SETQS (MCF_IPSBAR + 0x00100035)
117#define MCFGPIO_SETSD (MCF_IPSBAR + 0x00100036)
118#define MCFGPIO_SETTC (MCF_IPSBAR + 0x00100037)
119#define MCFGPIO_SETTD (MCF_IPSBAR + 0x00100038)
120#define MCFGPIO_SETUA (MCF_IPSBAR + 0x00100039)
121
122#define MCFGPIO_CLRA (MCF_IPSBAR + 0x0010003C)
123#define MCFGPIO_CLRB (MCF_IPSBAR + 0x0010003D)
124#define MCFGPIO_CLRC (MCF_IPSBAR + 0x0010003E)
125#define MCFGPIO_CLRD (MCF_IPSBAR + 0x0010003F)
126#define MCFGPIO_CLRE (MCF_IPSBAR + 0x00100040)
127#define MCFGPIO_CLRF (MCF_IPSBAR + 0x00100041)
128#define MCFGPIO_CLRG (MCF_IPSBAR + 0x00100042)
129#define MCFGPIO_CLRH (MCF_IPSBAR + 0x00100043)
130#define MCFGPIO_CLRJ (MCF_IPSBAR + 0x00100044)
131#define MCFGPIO_CLRDD (MCF_IPSBAR + 0x00100045)
132#define MCFGPIO_CLREH (MCF_IPSBAR + 0x00100046)
133#define MCFGPIO_CLREL (MCF_IPSBAR + 0x00100047)
134#define MCFGPIO_CLRAS (MCF_IPSBAR + 0x00100048)
135#define MCFGPIO_CLRQS (MCF_IPSBAR + 0x00100049)
136#define MCFGPIO_CLRSD (MCF_IPSBAR + 0x0010004A)
137#define MCFGPIO_CLRTC (MCF_IPSBAR + 0x0010004B)
138#define MCFGPIO_CLRTD (MCF_IPSBAR + 0x0010004C)
139#define MCFGPIO_CLRUA (MCF_IPSBAR + 0x0010004D)
140
141#define MCFGPIO_PBCDPAR (MCF_IPSBAR + 0x00100050)
142#define MCFGPIO_PFPAR (MCF_IPSBAR + 0x00100051)
143#define MCFGPIO_PEPAR (MCF_IPSBAR + 0x00100052)
144#define MCFGPIO_PJPAR (MCF_IPSBAR + 0x00100054)
145#define MCFGPIO_PSDPAR (MCF_IPSBAR + 0x00100055)
146#define MCFGPIO_PASPAR (MCF_IPSBAR + 0x00100056)
147#define MCFGPIO_PEHLPAR (MCF_IPSBAR + 0x00100058)
148#define MCFGPIO_PQSPAR (MCF_IPSBAR + 0x00100059)
149#define MCFGPIO_PTCPAR (MCF_IPSBAR + 0x0010005A)
150#define MCFGPIO_PTDPAR (MCF_IPSBAR + 0x0010005B)
151#define MCFGPIO_PUAPAR (MCF_IPSBAR + 0x0010005C)
152
153/*
154 * Edge Port registers
155 */
156#define MCFEPORT_EPPAR (MCF_IPSBAR + 0x00130000)
157#define MCFEPORT_EPDDR (MCF_IPSBAR + 0x00130002)
158#define MCFEPORT_EPIER (MCF_IPSBAR + 0x00130003)
159#define MCFEPORT_EPDR (MCF_IPSBAR + 0x00130004)
160#define MCFEPORT_EPPDR (MCF_IPSBAR + 0x00130005)
161#define MCFEPORT_EPFR (MCF_IPSBAR + 0x00130006)
162
163/*
164 * Queued ADC registers
165 */
166#define MCFQADC_PORTQA (MCF_IPSBAR + 0x00190006)
167#define MCFQADC_PORTQB (MCF_IPSBAR + 0x00190007)
168#define MCFQADC_DDRQA (MCF_IPSBAR + 0x00190008)
169#define MCFQADC_DDRQB (MCF_IPSBAR + 0x00190009)
170
171/*
172 * General Purpose Timers registers
173 */
174#define MCFGPTA_GPTPORT (MCF_IPSBAR + 0x001A001D)
175#define MCFGPTA_GPTDDR (MCF_IPSBAR + 0x001A001E)
176#define MCFGPTB_GPTPORT (MCF_IPSBAR + 0x001B001D)
177#define MCFGPTB_GPTDDR (MCF_IPSBAR + 0x001B001E)
178/*
179 *
180 * definitions for generic gpio support
181 *
182 */
183#define MCFGPIO_PODR MCFGPIO_PORTA /* port output data */
184#define MCFGPIO_PDDR MCFGPIO_DDRA /* port data direction */
185#define MCFGPIO_PPDR MCFGPIO_PORTAP /* port pin data */
186#define MCFGPIO_SETR MCFGPIO_SETA /* set output */
187#define MCFGPIO_CLRR MCFGPIO_CLRA /* clr output */
188
189#define MCFGPIO_IRQ_MAX 8
190#define MCFGPIO_IRQ_VECBASE MCFINT_VECBASE
191#define MCFGPIO_PIN_MAX 180
192
193
194/*
44 * Derek Cheung - 6 Feb 2005 195 * Derek Cheung - 6 Feb 2005
45 * add I2C and QSPI register definition using Freescale's MCF5282 196 * add I2C and QSPI register definition using Freescale's MCF5282
46 */ 197 */
diff --git a/arch/m68k/include/asm/m5307sim.h b/arch/m68k/include/asm/m5307sim.h
index 5886728409c0..c6830e5b54ce 100644
--- a/arch/m68k/include/asm/m5307sim.h
+++ b/arch/m68k/include/asm/m5307sim.h
@@ -90,8 +90,15 @@
90#define MCFSIM_DACR1 0x110 /* DRAM 1 Addr and Ctrl (r/w) */ 90#define MCFSIM_DACR1 0x110 /* DRAM 1 Addr and Ctrl (r/w) */
91#define MCFSIM_DMR1 0x114 /* DRAM 1 Mask reg (r/w) */ 91#define MCFSIM_DMR1 0x114 /* DRAM 1 Mask reg (r/w) */
92 92
93#define MCFSIM_PADDR 0x244 /* Parallel Direction (r/w) */ 93#define MCFSIM_PADDR (MCF_MBAR + 0x244)
94#define MCFSIM_PADAT 0x248 /* Parallel Data (r/w) */ 94#define MCFSIM_PADAT (MCF_MBAR + 0x248)
95
96/*
97 * Generic GPIO support
98 */
99#define MCFGPIO_PIN_MAX 16
100#define MCFGPIO_IRQ_MAX -1
101#define MCFGPIO_IRQ_VECBASE -1
95 102
96 103
97/* Definition offset address for CS2-7 -- old mask 5307 */ 104/* Definition offset address for CS2-7 -- old mask 5307 */
@@ -117,22 +124,6 @@
117#define MCFSIM_DMA2ICR MCFSIM_ICR8 /* DMA 2 ICR */ 124#define MCFSIM_DMA2ICR MCFSIM_ICR8 /* DMA 2 ICR */
118#define MCFSIM_DMA3ICR MCFSIM_ICR9 /* DMA 3 ICR */ 125#define MCFSIM_DMA3ICR MCFSIM_ICR9 /* DMA 3 ICR */
119 126
120#if defined(CONFIG_M5307)
121#define MCFSIM_IMR_MASKALL 0x3fffe /* All SIM intr sources */
122#endif
123
124/*
125 * Macro to set IMR register. It is 32 bits on the 5307.
126 */
127#define mcf_getimr() \
128 *((volatile unsigned long *) (MCF_MBAR + MCFSIM_IMR))
129
130#define mcf_setimr(imr) \
131 *((volatile unsigned long *) (MCF_MBAR + MCFSIM_IMR)) = (imr);
132
133#define mcf_getipr() \
134 *((volatile unsigned long *) (MCF_MBAR + MCFSIM_IPR))
135
136 127
137/* 128/*
138 * Some symbol defines for the Parallel Port Pin Assignment Register 129 * Some symbol defines for the Parallel Port Pin Assignment Register
@@ -149,6 +140,11 @@
149#define IRQ3_LEVEL6 0x40 140#define IRQ3_LEVEL6 0x40
150#define IRQ1_LEVEL2 0x20 141#define IRQ1_LEVEL2 0x20
151 142
143/*
144 * Define system peripheral IRQ usage.
145 */
146#define MCF_IRQ_TIMER 30 /* Timer0, Level 6 */
147#define MCF_IRQ_PROFILER 31 /* Timer1, Level 7 */
152 148
153/* 149/*
154 * Define the Cache register flags. 150 * Define the Cache register flags.
diff --git a/arch/m68k/include/asm/m532xsim.h b/arch/m68k/include/asm/m532xsim.h
index eb7fd4448947..36bf15aec9ae 100644
--- a/arch/m68k/include/asm/m532xsim.h
+++ b/arch/m68k/include/asm/m532xsim.h
@@ -56,47 +56,21 @@
56#define MCFSIM_DMA3ICR MCFSIM_ICR9 /* DMA 3 ICR */ 56#define MCFSIM_DMA3ICR MCFSIM_ICR9 /* DMA 3 ICR */
57 57
58 58
59#define MCFSIM_IMR_MASKALL 0xFFFFFFFF /* All SIM intr sources */ 59#define MCFINTC0_SIMR 0xFC04801C
60 60#define MCFINTC0_CIMR 0xFC04801D
61#define MCFSIM_IMR_SIMR0 0xFC04801C 61#define MCFINTC0_ICR0 0xFC048040
62#define MCFSIM_IMR_SIMR1 0xFC04C01C 62#define MCFINTC1_SIMR 0xFC04C01C
63#define MCFSIM_IMR_CIMR0 0xFC04801D 63#define MCFINTC1_CIMR 0xFC04C01D
64#define MCFSIM_IMR_CIMR1 0xFC04C01D 64#define MCFINTC1_ICR0 0xFC04C040
65 65
66#define MCFSIM_ICR_TIMER1 (0xFC048040+32) 66#define MCFSIM_ICR_TIMER1 (0xFC048040+32)
67#define MCFSIM_ICR_TIMER2 (0xFC048040+33) 67#define MCFSIM_ICR_TIMER2 (0xFC048040+33)
68 68
69
70/* 69/*
71 * Macro to set IMR register. It is 32 bits on the 5307. 70 * Define system peripheral IRQ usage.
72 */ 71 */
73#define mcf_getimr() \ 72#define MCF_IRQ_TIMER (64 + 32) /* Timer0 */
74 *((volatile unsigned long *) (MCF_MBAR + MCFSIM_IMR)) 73#define MCF_IRQ_PROFILER (64 + 33) /* Timer1 */
75
76#define mcf_setimr(imr) \
77 *((volatile unsigned long *) (MCF_MBAR + MCFSIM_IMR)) = (imr);
78
79#define mcf_getipr() \
80 *((volatile unsigned long *) (MCF_MBAR + MCFSIM_IPR))
81
82#define mcf_getiprl() \
83 *((volatile unsigned long *) (MCF_MBAR + MCFSIM_IPRL))
84
85#define mcf_getiprh() \
86 *((volatile unsigned long *) (MCF_MBAR + MCFSIM_IPRH))
87
88
89#define mcf_enable_irq0(irq) \
90 *((volatile unsigned char*) (MCFSIM_IMR_CIMR0)) = (irq);
91
92#define mcf_enable_irq1(irq) \
93 *((volatile unsigned char*) (MCFSIM_IMR_CIMR1)) = (irq);
94
95#define mcf_disable_irq0(irq) \
96 *((volatile unsigned char*) (MCFSIM_IMR_SIMR0)) = (irq);
97
98#define mcf_disable_irq1(irq) \
99 *((volatile unsigned char*) (MCFSIM_IMR_SIMR1)) = (irq);
100 74
101/* 75/*
102 * Define the Cache register flags. 76 * Define the Cache register flags.
@@ -422,70 +396,70 @@
422 *********************************************************************/ 396 *********************************************************************/
423 397
424/* Register read/write macros */ 398/* Register read/write macros */
425#define MCF_GPIO_PODR_FECH MCF_REG08(0xFC0A4000) 399#define MCFGPIO_PODR_FECH (0xFC0A4000)
426#define MCF_GPIO_PODR_FECL MCF_REG08(0xFC0A4001) 400#define MCFGPIO_PODR_FECL (0xFC0A4001)
427#define MCF_GPIO_PODR_SSI MCF_REG08(0xFC0A4002) 401#define MCFGPIO_PODR_SSI (0xFC0A4002)
428#define MCF_GPIO_PODR_BUSCTL MCF_REG08(0xFC0A4003) 402#define MCFGPIO_PODR_BUSCTL (0xFC0A4003)
429#define MCF_GPIO_PODR_BE MCF_REG08(0xFC0A4004) 403#define MCFGPIO_PODR_BE (0xFC0A4004)
430#define MCF_GPIO_PODR_CS MCF_REG08(0xFC0A4005) 404#define MCFGPIO_PODR_CS (0xFC0A4005)
431#define MCF_GPIO_PODR_PWM MCF_REG08(0xFC0A4006) 405#define MCFGPIO_PODR_PWM (0xFC0A4006)
432#define MCF_GPIO_PODR_FECI2C MCF_REG08(0xFC0A4007) 406#define MCFGPIO_PODR_FECI2C (0xFC0A4007)
433#define MCF_GPIO_PODR_UART MCF_REG08(0xFC0A4009) 407#define MCFGPIO_PODR_UART (0xFC0A4009)
434#define MCF_GPIO_PODR_QSPI MCF_REG08(0xFC0A400A) 408#define MCFGPIO_PODR_QSPI (0xFC0A400A)
435#define MCF_GPIO_PODR_TIMER MCF_REG08(0xFC0A400B) 409#define MCFGPIO_PODR_TIMER (0xFC0A400B)
436#define MCF_GPIO_PODR_LCDDATAH MCF_REG08(0xFC0A400D) 410#define MCFGPIO_PODR_LCDDATAH (0xFC0A400D)
437#define MCF_GPIO_PODR_LCDDATAM MCF_REG08(0xFC0A400E) 411#define MCFGPIO_PODR_LCDDATAM (0xFC0A400E)
438#define MCF_GPIO_PODR_LCDDATAL MCF_REG08(0xFC0A400F) 412#define MCFGPIO_PODR_LCDDATAL (0xFC0A400F)
439#define MCF_GPIO_PODR_LCDCTLH MCF_REG08(0xFC0A4010) 413#define MCFGPIO_PODR_LCDCTLH (0xFC0A4010)
440#define MCF_GPIO_PODR_LCDCTLL MCF_REG08(0xFC0A4011) 414#define MCFGPIO_PODR_LCDCTLL (0xFC0A4011)
441#define MCF_GPIO_PDDR_FECH MCF_REG08(0xFC0A4014) 415#define MCFGPIO_PDDR_FECH (0xFC0A4014)
442#define MCF_GPIO_PDDR_FECL MCF_REG08(0xFC0A4015) 416#define MCFGPIO_PDDR_FECL (0xFC0A4015)
443#define MCF_GPIO_PDDR_SSI MCF_REG08(0xFC0A4016) 417#define MCFGPIO_PDDR_SSI (0xFC0A4016)
444#define MCF_GPIO_PDDR_BUSCTL MCF_REG08(0xFC0A4017) 418#define MCFGPIO_PDDR_BUSCTL (0xFC0A4017)
445#define MCF_GPIO_PDDR_BE MCF_REG08(0xFC0A4018) 419#define MCFGPIO_PDDR_BE (0xFC0A4018)
446#define MCF_GPIO_PDDR_CS MCF_REG08(0xFC0A4019) 420#define MCFGPIO_PDDR_CS (0xFC0A4019)
447#define MCF_GPIO_PDDR_PWM MCF_REG08(0xFC0A401A) 421#define MCFGPIO_PDDR_PWM (0xFC0A401A)
448#define MCF_GPIO_PDDR_FECI2C MCF_REG08(0xFC0A401B) 422#define MCFGPIO_PDDR_FECI2C (0xFC0A401B)
449#define MCF_GPIO_PDDR_UART MCF_REG08(0xFC0A401C) 423#define MCFGPIO_PDDR_UART (0xFC0A401C)
450#define MCF_GPIO_PDDR_QSPI MCF_REG08(0xFC0A401E) 424#define MCFGPIO_PDDR_QSPI (0xFC0A401E)
451#define MCF_GPIO_PDDR_TIMER MCF_REG08(0xFC0A401F) 425#define MCFGPIO_PDDR_TIMER (0xFC0A401F)
452#define MCF_GPIO_PDDR_LCDDATAH MCF_REG08(0xFC0A4021) 426#define MCFGPIO_PDDR_LCDDATAH (0xFC0A4021)
453#define MCF_GPIO_PDDR_LCDDATAM MCF_REG08(0xFC0A4022) 427#define MCFGPIO_PDDR_LCDDATAM (0xFC0A4022)
454#define MCF_GPIO_PDDR_LCDDATAL MCF_REG08(0xFC0A4023) 428#define MCFGPIO_PDDR_LCDDATAL (0xFC0A4023)
455#define MCF_GPIO_PDDR_LCDCTLH MCF_REG08(0xFC0A4024) 429#define MCFGPIO_PDDR_LCDCTLH (0xFC0A4024)
456#define MCF_GPIO_PDDR_LCDCTLL MCF_REG08(0xFC0A4025) 430#define MCFGPIO_PDDR_LCDCTLL (0xFC0A4025)
457#define MCF_GPIO_PPDSDR_FECH MCF_REG08(0xFC0A4028) 431#define MCFGPIO_PPDSDR_FECH (0xFC0A4028)
458#define MCF_GPIO_PPDSDR_FECL MCF_REG08(0xFC0A4029) 432#define MCFGPIO_PPDSDR_FECL (0xFC0A4029)
459#define MCF_GPIO_PPDSDR_SSI MCF_REG08(0xFC0A402A) 433#define MCFGPIO_PPDSDR_SSI (0xFC0A402A)
460#define MCF_GPIO_PPDSDR_BUSCTL MCF_REG08(0xFC0A402B) 434#define MCFGPIO_PPDSDR_BUSCTL (0xFC0A402B)
461#define MCF_GPIO_PPDSDR_BE MCF_REG08(0xFC0A402C) 435#define MCFGPIO_PPDSDR_BE (0xFC0A402C)
462#define MCF_GPIO_PPDSDR_CS MCF_REG08(0xFC0A402D) 436#define MCFGPIO_PPDSDR_CS (0xFC0A402D)
463#define MCF_GPIO_PPDSDR_PWM MCF_REG08(0xFC0A402E) 437#define MCFGPIO_PPDSDR_PWM (0xFC0A402E)
464#define MCF_GPIO_PPDSDR_FECI2C MCF_REG08(0xFC0A402F) 438#define MCFGPIO_PPDSDR_FECI2C (0xFC0A402F)
465#define MCF_GPIO_PPDSDR_UART MCF_REG08(0xFC0A4031) 439#define MCFGPIO_PPDSDR_UART (0xFC0A4031)
466#define MCF_GPIO_PPDSDR_QSPI MCF_REG08(0xFC0A4032) 440#define MCFGPIO_PPDSDR_QSPI (0xFC0A4032)
467#define MCF_GPIO_PPDSDR_TIMER MCF_REG08(0xFC0A4033) 441#define MCFGPIO_PPDSDR_TIMER (0xFC0A4033)
468#define MCF_GPIO_PPDSDR_LCDDATAH MCF_REG08(0xFC0A4035) 442#define MCFGPIO_PPDSDR_LCDDATAH (0xFC0A4035)
469#define MCF_GPIO_PPDSDR_LCDDATAM MCF_REG08(0xFC0A4036) 443#define MCFGPIO_PPDSDR_LCDDATAM (0xFC0A4036)
470#define MCF_GPIO_PPDSDR_LCDDATAL MCF_REG08(0xFC0A4037) 444#define MCFGPIO_PPDSDR_LCDDATAL (0xFC0A4037)
471#define MCF_GPIO_PPDSDR_LCDCTLH MCF_REG08(0xFC0A4038) 445#define MCFGPIO_PPDSDR_LCDCTLH (0xFC0A4038)
472#define MCF_GPIO_PPDSDR_LCDCTLL MCF_REG08(0xFC0A4039) 446#define MCFGPIO_PPDSDR_LCDCTLL (0xFC0A4039)
473#define MCF_GPIO_PCLRR_FECH MCF_REG08(0xFC0A403C) 447#define MCFGPIO_PCLRR_FECH (0xFC0A403C)
474#define MCF_GPIO_PCLRR_FECL MCF_REG08(0xFC0A403D) 448#define MCFGPIO_PCLRR_FECL (0xFC0A403D)
475#define MCF_GPIO_PCLRR_SSI MCF_REG08(0xFC0A403E) 449#define MCFGPIO_PCLRR_SSI (0xFC0A403E)
476#define MCF_GPIO_PCLRR_BUSCTL MCF_REG08(0xFC0A403F) 450#define MCFGPIO_PCLRR_BUSCTL (0xFC0A403F)
477#define MCF_GPIO_PCLRR_BE MCF_REG08(0xFC0A4040) 451#define MCFGPIO_PCLRR_BE (0xFC0A4040)
478#define MCF_GPIO_PCLRR_CS MCF_REG08(0xFC0A4041) 452#define MCFGPIO_PCLRR_CS (0xFC0A4041)
479#define MCF_GPIO_PCLRR_PWM MCF_REG08(0xFC0A4042) 453#define MCFGPIO_PCLRR_PWM (0xFC0A4042)
480#define MCF_GPIO_PCLRR_FECI2C MCF_REG08(0xFC0A4043) 454#define MCFGPIO_PCLRR_FECI2C (0xFC0A4043)
481#define MCF_GPIO_PCLRR_UART MCF_REG08(0xFC0A4045) 455#define MCFGPIO_PCLRR_UART (0xFC0A4045)
482#define MCF_GPIO_PCLRR_QSPI MCF_REG08(0xFC0A4046) 456#define MCFGPIO_PCLRR_QSPI (0xFC0A4046)
483#define MCF_GPIO_PCLRR_TIMER MCF_REG08(0xFC0A4047) 457#define MCFGPIO_PCLRR_TIMER (0xFC0A4047)
484#define MCF_GPIO_PCLRR_LCDDATAH MCF_REG08(0xFC0A4049) 458#define MCFGPIO_PCLRR_LCDDATAH (0xFC0A4049)
485#define MCF_GPIO_PCLRR_LCDDATAM MCF_REG08(0xFC0A404A) 459#define MCFGPIO_PCLRR_LCDDATAM (0xFC0A404A)
486#define MCF_GPIO_PCLRR_LCDDATAL MCF_REG08(0xFC0A404B) 460#define MCFGPIO_PCLRR_LCDDATAL (0xFC0A404B)
487#define MCF_GPIO_PCLRR_LCDCTLH MCF_REG08(0xFC0A404C) 461#define MCFGPIO_PCLRR_LCDCTLH (0xFC0A404C)
488#define MCF_GPIO_PCLRR_LCDCTLL MCF_REG08(0xFC0A404D) 462#define MCFGPIO_PCLRR_LCDCTLL (0xFC0A404D)
489#define MCF_GPIO_PAR_FEC MCF_REG08(0xFC0A4050) 463#define MCF_GPIO_PAR_FEC MCF_REG08(0xFC0A4050)
490#define MCF_GPIO_PAR_PWM MCF_REG08(0xFC0A4051) 464#define MCF_GPIO_PAR_PWM MCF_REG08(0xFC0A4051)
491#define MCF_GPIO_PAR_BUSCTL MCF_REG08(0xFC0A4052) 465#define MCF_GPIO_PAR_BUSCTL MCF_REG08(0xFC0A4052)
@@ -1187,6 +1161,20 @@
1187/* Bit definitions and macros for MCF_GPIO_DSCR_IRQ */ 1161/* Bit definitions and macros for MCF_GPIO_DSCR_IRQ */
1188#define MCF_GPIO_DSCR_IRQ_IRQ_DSE(x) (((x)&0x03)<<0) 1162#define MCF_GPIO_DSCR_IRQ_IRQ_DSE(x) (((x)&0x03)<<0)
1189 1163
1164/*
1165 * Generic GPIO support
1166 */
1167#define MCFGPIO_PODR MCFGPIO_PODR_FECH
1168#define MCFGPIO_PDDR MCFGPIO_PDDR_FECH
1169#define MCFGPIO_PPDR MCFGPIO_PPDSDR_FECH
1170#define MCFGPIO_SETR MCFGPIO_PPDSDR_FECH
1171#define MCFGPIO_CLRR MCFGPIO_PCLRR_FECH
1172
1173#define MCFGPIO_PIN_MAX 136
1174#define MCFGPIO_IRQ_MAX 8
1175#define MCFGPIO_IRQ_VECBASE MCFINT_VECBASE
1176
1177
1190/********************************************************************* 1178/*********************************************************************
1191 * 1179 *
1192 * Interrupt Controller (INTC) 1180 * Interrupt Controller (INTC)
@@ -2154,12 +2142,12 @@
2154 *********************************************************************/ 2142 *********************************************************************/
2155 2143
2156/* Register read/write macros */ 2144/* Register read/write macros */
2157#define MCF_EPORT_EPPAR MCF_REG16(0xFC094000) 2145#define MCFEPORT_EPPAR (0xFC094000)
2158#define MCF_EPORT_EPDDR MCF_REG08(0xFC094002) 2146#define MCFEPORT_EPDDR (0xFC094002)
2159#define MCF_EPORT_EPIER MCF_REG08(0xFC094003) 2147#define MCFEPORT_EPIER (0xFC094003)
2160#define MCF_EPORT_EPDR MCF_REG08(0xFC094004) 2148#define MCFEPORT_EPDR (0xFC094004)
2161#define MCF_EPORT_EPPDR MCF_REG08(0xFC094005) 2149#define MCFEPORT_EPPDR (0xFC094005)
2162#define MCF_EPORT_EPFR MCF_REG08(0xFC094006) 2150#define MCFEPORT_EPFR (0xFC094006)
2163 2151
2164/* Bit definitions and macros for MCF_EPORT_EPPAR */ 2152/* Bit definitions and macros for MCF_EPORT_EPPAR */
2165#define MCF_EPORT_EPPAR_EPPA1(x) (((x)&0x0003)<<2) 2153#define MCF_EPORT_EPPAR_EPPA1(x) (((x)&0x0003)<<2)
diff --git a/arch/m68k/include/asm/m5407sim.h b/arch/m68k/include/asm/m5407sim.h
index cc22c4a53005..c399abbf953c 100644
--- a/arch/m68k/include/asm/m5407sim.h
+++ b/arch/m68k/include/asm/m5407sim.h
@@ -73,9 +73,15 @@
73#define MCFSIM_DACR1 0x110 /* DRAM 1 Addr and Ctrl (r/w) */ 73#define MCFSIM_DACR1 0x110 /* DRAM 1 Addr and Ctrl (r/w) */
74#define MCFSIM_DMR1 0x114 /* DRAM 1 Mask reg (r/w) */ 74#define MCFSIM_DMR1 0x114 /* DRAM 1 Mask reg (r/w) */
75 75
76#define MCFSIM_PADDR 0x244 /* Parallel Direction (r/w) */ 76#define MCFSIM_PADDR (MCF_MBAR + 0x244)
77#define MCFSIM_PADAT 0x248 /* Parallel Data (r/w) */ 77#define MCFSIM_PADAT (MCF_MBAR + 0x248)
78 78
79/*
80 * Generic GPIO support
81 */
82#define MCFGPIO_PIN_MAX 16
83#define MCFGPIO_IRQ_MAX -1
84#define MCFGPIO_IRQ_VECBASE -1
79 85
80/* 86/*
81 * Some symbol defines for the above... 87 * Some symbol defines for the above...
@@ -91,19 +97,6 @@
91#define MCFSIM_DMA3ICR MCFSIM_ICR9 /* DMA 3 ICR */ 97#define MCFSIM_DMA3ICR MCFSIM_ICR9 /* DMA 3 ICR */
92 98
93/* 99/*
94 * Macro to set IMR register. It is 32 bits on the 5407.
95 */
96#define mcf_getimr() \
97 *((volatile unsigned long *) (MCF_MBAR + MCFSIM_IMR))
98
99#define mcf_setimr(imr) \
100 *((volatile unsigned long *) (MCF_MBAR + MCFSIM_IMR)) = (imr);
101
102#define mcf_getipr() \
103 *((volatile unsigned long *) (MCF_MBAR + MCFSIM_IPR))
104
105
106/*
107 * Some symbol defines for the Parallel Port Pin Assignment Register 100 * Some symbol defines for the Parallel Port Pin Assignment Register
108 */ 101 */
109#define MCFSIM_PAR_DREQ0 0x40 /* Set to select DREQ0 input */ 102#define MCFSIM_PAR_DREQ0 0x40 /* Set to select DREQ0 input */
@@ -118,6 +111,11 @@
118#define IRQ3_LEVEL6 0x40 111#define IRQ3_LEVEL6 0x40
119#define IRQ1_LEVEL2 0x20 112#define IRQ1_LEVEL2 0x20
120 113
114/*
115 * Define system peripheral IRQ usage.
116 */
117#define MCF_IRQ_TIMER 30 /* Timer0, Level 6 */
118#define MCF_IRQ_PROFILER 31 /* Timer1, Level 7 */
121 119
122/* 120/*
123 * Define the Cache register flags. 121 * Define the Cache register flags.
diff --git a/arch/m68k/include/asm/mcfgpio.h b/arch/m68k/include/asm/mcfgpio.h
new file mode 100644
index 000000000000..ee5e4ccce89e
--- /dev/null
+++ b/arch/m68k/include/asm/mcfgpio.h
@@ -0,0 +1,40 @@
1/*
2 * Coldfire generic GPIO support.
3 *
4 * (C) Copyright 2009, Steven King <sfking@fdwdc.com>
5 *
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
8 * the Free Software Foundation; version 2 of the License.
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
16#ifndef mcfgpio_h
17#define mcfgpio_h
18
19#include <linux/io.h>
20#include <asm-generic/gpio.h>
21
22struct mcf_gpio_chip {
23 struct gpio_chip gpio_chip;
24 void __iomem *pddr;
25 void __iomem *podr;
26 void __iomem *ppdr;
27 void __iomem *setr;
28 void __iomem *clrr;
29 const u8 *gpio_to_pinmux;
30};
31
32int mcf_gpio_direction_input(struct gpio_chip *, unsigned);
33int mcf_gpio_get_value(struct gpio_chip *, unsigned);
34int mcf_gpio_direction_output(struct gpio_chip *, unsigned, int);
35void mcf_gpio_set_value(struct gpio_chip *, unsigned, int);
36void mcf_gpio_set_value_fast(struct gpio_chip *, unsigned, int);
37int mcf_gpio_request(struct gpio_chip *, unsigned);
38void mcf_gpio_free(struct gpio_chip *, unsigned);
39
40#endif
diff --git a/arch/m68k/include/asm/mcfintc.h b/arch/m68k/include/asm/mcfintc.h
new file mode 100644
index 000000000000..4183320a3813
--- /dev/null
+++ b/arch/m68k/include/asm/mcfintc.h
@@ -0,0 +1,89 @@
1/****************************************************************************/
2
3/*
4 * mcfintc.h -- support definitions for the simple ColdFire
5 * Interrupt Controller
6 *
7 * (C) Copyright 2009, Greg Ungerer <gerg@uclinux.org>
8 */
9
10/****************************************************************************/
11#ifndef mcfintc_h
12#define mcfintc_h
13/****************************************************************************/
14
15/*
16 * Most of the older ColdFire parts use the same simple interrupt
17 * controller. This is currently used on the 5206, 5206e, 5249, 5307
18 * and 5407 parts.
19 *
20 * The builtin peripherals are masked through dedicated bits in the
21 * Interrupt Mask register (IMR) - and this is not indexed (or in any way
22 * related to) the actual interrupt number they use. So knowing the IRQ
23 * number doesn't explicitly map to a certain internal device for
24 * interrupt control purposes.
25 */
26
27/*
28 * Bit definitions for the ICR family of registers.
29 */
30#define MCFSIM_ICR_AUTOVEC 0x80 /* Auto-vectored intr */
31#define MCFSIM_ICR_LEVEL0 0x00 /* Level 0 intr */
32#define MCFSIM_ICR_LEVEL1 0x04 /* Level 1 intr */
33#define MCFSIM_ICR_LEVEL2 0x08 /* Level 2 intr */
34#define MCFSIM_ICR_LEVEL3 0x0c /* Level 3 intr */
35#define MCFSIM_ICR_LEVEL4 0x10 /* Level 4 intr */
36#define MCFSIM_ICR_LEVEL5 0x14 /* Level 5 intr */
37#define MCFSIM_ICR_LEVEL6 0x18 /* Level 6 intr */
38#define MCFSIM_ICR_LEVEL7 0x1c /* Level 7 intr */
39
40#define MCFSIM_ICR_PRI0 0x00 /* Priority 0 intr */
41#define MCFSIM_ICR_PRI1 0x01 /* Priority 1 intr */
42#define MCFSIM_ICR_PRI2 0x02 /* Priority 2 intr */
43#define MCFSIM_ICR_PRI3 0x03 /* Priority 3 intr */
44
45/*
46 * IMR bit position definitions. Not all ColdFire parts with this interrupt
47 * controller actually support all of these interrupt sources. But the bit
48 * numbers are the same in all cores.
49 */
50#define MCFINTC_EINT1 1 /* External int #1 */
51#define MCFINTC_EINT2 2 /* External int #2 */
52#define MCFINTC_EINT3 3 /* External int #3 */
53#define MCFINTC_EINT4 4 /* External int #4 */
54#define MCFINTC_EINT5 5 /* External int #5 */
55#define MCFINTC_EINT6 6 /* External int #6 */
56#define MCFINTC_EINT7 7 /* External int #7 */
57#define MCFINTC_SWT 8 /* Software Watchdog */
58#define MCFINTC_TIMER1 9
59#define MCFINTC_TIMER2 10
60#define MCFINTC_I2C 11 /* I2C / MBUS */
61#define MCFINTC_UART0 12
62#define MCFINTC_UART1 13
63#define MCFINTC_DMA0 14
64#define MCFINTC_DMA1 15
65#define MCFINTC_DMA2 16
66#define MCFINTC_DMA3 17
67#define MCFINTC_QSPI 18
68
69#ifndef __ASSEMBLER__
70
71/*
72 * There is no one-is-one correspondance between the interrupt number (irq)
73 * and the bit fields on the mask register. So we create a per-cpu type
74 * mapping of irq to mask bit. The CPU platform code needs to register
75 * its supported irq's at init time, using this function.
76 */
77extern unsigned char mcf_irq2imr[];
78static inline void mcf_mapirq2imr(int irq, int imr)
79{
80 mcf_irq2imr[irq] = imr;
81}
82
83void mcf_autovector(int irq);
84void mcf_setimr(int index);
85void mcf_clrimr(int index);
86#endif
87
88/****************************************************************************/
89#endif /* mcfintc_h */
diff --git a/arch/m68k/include/asm/mcfne.h b/arch/m68k/include/asm/mcfne.h
index 431f63aadd0e..bf638be0958c 100644
--- a/arch/m68k/include/asm/mcfne.h
+++ b/arch/m68k/include/asm/mcfne.h
@@ -239,87 +239,4 @@ void ne2000_outsw(unsigned int addr, const void *vbuf, unsigned long len)
239#endif /* NE2000_OFFOFFSET */ 239#endif /* NE2000_OFFOFFSET */
240 240
241/****************************************************************************/ 241/****************************************************************************/
242
243#ifdef COLDFIRE_NE2000_FUNCS
244
245/*
246 * Lastly the interrupt set up code...
247 * Minor differences between the different board types.
248 */
249
250#if defined(CONFIG_ARN5206)
251void ne2000_irqsetup(int irq)
252{
253 volatile unsigned char *icrp;
254
255 icrp = (volatile unsigned char *) (MCF_MBAR + MCFSIM_ICR4);
256 *icrp = MCFSIM_ICR_LEVEL4 | MCFSIM_ICR_PRI2;
257 mcf_setimr(mcf_getimr() & ~MCFSIM_IMR_EINT4);
258}
259#endif
260
261#if defined(CONFIG_M5206eC3)
262void ne2000_irqsetup(int irq)
263{
264 volatile unsigned char *icrp;
265
266 icrp = (volatile unsigned char *) (MCF_MBAR + MCFSIM_ICR4);
267 *icrp = MCFSIM_ICR_LEVEL4 | MCFSIM_ICR_PRI2 | MCFSIM_ICR_AUTOVEC;
268 mcf_setimr(mcf_getimr() & ~MCFSIM_IMR_EINT4);
269}
270#endif
271
272#if defined(CONFIG_M5206e) && defined(CONFIG_NETtel)
273void ne2000_irqsetup(int irq)
274{
275 mcf_autovector(irq);
276}
277#endif
278
279#if defined(CONFIG_M5272) && defined(CONFIG_NETtel)
280void ne2000_irqsetup(int irq)
281{
282 volatile unsigned long *icrp;
283 volatile unsigned long *pitr;
284
285 /* The NE2000 device uses external IRQ3 */
286 icrp = (volatile unsigned long *) (MCF_MBAR + MCFSIM_ICR1);
287 *icrp = (*icrp & 0x77077777) | 0x00d00000;
288
289 pitr = (volatile unsigned long *) (MCF_MBAR + MCFSIM_PITR);
290 *pitr = *pitr | 0x20000000;
291}
292
293void ne2000_irqack(int irq)
294{
295 volatile unsigned long *icrp;
296
297 /* The NE2000 device uses external IRQ3 */
298 icrp = (volatile unsigned long *) (MCF_MBAR + MCFSIM_ICR1);
299 *icrp = (*icrp & 0x77777777) | 0x00800000;
300}
301#endif
302
303#if defined(CONFIG_M5307) || defined(CONFIG_M5407)
304#if defined(CONFIG_NETtel) || defined(CONFIG_SECUREEDGEMP3)
305
306void ne2000_irqsetup(int irq)
307{
308 mcf_setimr(mcf_getimr() & ~MCFSIM_IMR_EINT3);
309 mcf_autovector(irq);
310}
311
312#else
313
314void ne2000_irqsetup(int irq)
315{
316 mcf_setimr(mcf_getimr() & ~MCFSIM_IMR_EINT3);
317}
318
319#endif /* ! CONFIG_NETtel || CONFIG_SECUREEDGEMP3 */
320#endif /* CONFIG_M5307 || CONFIG_M5407 */
321
322#endif /* COLDFIRE_NE2000_FUNCS */
323
324/****************************************************************************/
325#endif /* mcfne_h */ 242#endif /* mcfne_h */
diff --git a/arch/m68k/include/asm/mcfsim.h b/arch/m68k/include/asm/mcfsim.h
index da3f2ceff3a4..9c70a67bf85f 100644
--- a/arch/m68k/include/asm/mcfsim.h
+++ b/arch/m68k/include/asm/mcfsim.h
@@ -4,7 +4,7 @@
4 * mcfsim.h -- ColdFire System Integration Module support. 4 * mcfsim.h -- ColdFire System Integration Module support.
5 * 5 *
6 * (C) Copyright 1999-2003, Greg Ungerer (gerg@snapgear.com) 6 * (C) Copyright 1999-2003, Greg Ungerer (gerg@snapgear.com)
7 * (C) Copyright 2000, Lineo Inc. (www.lineo.com) 7 * (C) Copyright 2000, Lineo Inc. (www.lineo.com)
8 */ 8 */
9 9
10/****************************************************************************/ 10/****************************************************************************/
@@ -12,19 +12,21 @@
12#define mcfsim_h 12#define mcfsim_h
13/****************************************************************************/ 13/****************************************************************************/
14 14
15
16/* 15/*
17 * Include 5204, 5206/e, 5235, 5249, 5270/5271, 5272, 5280/5282, 16 * Include the appropriate ColdFire CPU specific System Integration Module
18 * 5307 or 5407 specific addresses. 17 * (SIM) definitions.
19 */ 18 */
20#if defined(CONFIG_M5206) || defined(CONFIG_M5206e) 19#if defined(CONFIG_M5206) || defined(CONFIG_M5206e)
21#include <asm/m5206sim.h> 20#include <asm/m5206sim.h>
21#include <asm/mcfintc.h>
22#elif defined(CONFIG_M520x) 22#elif defined(CONFIG_M520x)
23#include <asm/m520xsim.h> 23#include <asm/m520xsim.h>
24#elif defined(CONFIG_M523x) 24#elif defined(CONFIG_M523x)
25#include <asm/m523xsim.h> 25#include <asm/m523xsim.h>
26#include <asm/mcfintc.h>
26#elif defined(CONFIG_M5249) 27#elif defined(CONFIG_M5249)
27#include <asm/m5249sim.h> 28#include <asm/m5249sim.h>
29#include <asm/mcfintc.h>
28#elif defined(CONFIG_M527x) 30#elif defined(CONFIG_M527x)
29#include <asm/m527xsim.h> 31#include <asm/m527xsim.h>
30#elif defined(CONFIG_M5272) 32#elif defined(CONFIG_M5272)
@@ -33,94 +35,13 @@
33#include <asm/m528xsim.h> 35#include <asm/m528xsim.h>
34#elif defined(CONFIG_M5307) 36#elif defined(CONFIG_M5307)
35#include <asm/m5307sim.h> 37#include <asm/m5307sim.h>
38#include <asm/mcfintc.h>
36#elif defined(CONFIG_M532x) 39#elif defined(CONFIG_M532x)
37#include <asm/m532xsim.h> 40#include <asm/m532xsim.h>
38#elif defined(CONFIG_M5407) 41#elif defined(CONFIG_M5407)
39#include <asm/m5407sim.h> 42#include <asm/m5407sim.h>
43#include <asm/mcfintc.h>
40#endif 44#endif
41 45
42
43/*
44 * Define the base address of the SIM within the MBAR address space.
45 */
46#define MCFSIM_BASE 0x0 /* Base address of SIM */
47
48
49/*
50 * Bit definitions for the ICR family of registers.
51 */
52#define MCFSIM_ICR_AUTOVEC 0x80 /* Auto-vectored intr */
53#define MCFSIM_ICR_LEVEL0 0x00 /* Level 0 intr */
54#define MCFSIM_ICR_LEVEL1 0x04 /* Level 1 intr */
55#define MCFSIM_ICR_LEVEL2 0x08 /* Level 2 intr */
56#define MCFSIM_ICR_LEVEL3 0x0c /* Level 3 intr */
57#define MCFSIM_ICR_LEVEL4 0x10 /* Level 4 intr */
58#define MCFSIM_ICR_LEVEL5 0x14 /* Level 5 intr */
59#define MCFSIM_ICR_LEVEL6 0x18 /* Level 6 intr */
60#define MCFSIM_ICR_LEVEL7 0x1c /* Level 7 intr */
61
62#define MCFSIM_ICR_PRI0 0x00 /* Priority 0 intr */
63#define MCFSIM_ICR_PRI1 0x01 /* Priority 1 intr */
64#define MCFSIM_ICR_PRI2 0x02 /* Priority 2 intr */
65#define MCFSIM_ICR_PRI3 0x03 /* Priority 3 intr */
66
67/*
68 * Bit definitions for the Interrupt Mask register (IMR).
69 */
70#define MCFSIM_IMR_EINT1 0x0002 /* External intr # 1 */
71#define MCFSIM_IMR_EINT2 0x0004 /* External intr # 2 */
72#define MCFSIM_IMR_EINT3 0x0008 /* External intr # 3 */
73#define MCFSIM_IMR_EINT4 0x0010 /* External intr # 4 */
74#define MCFSIM_IMR_EINT5 0x0020 /* External intr # 5 */
75#define MCFSIM_IMR_EINT6 0x0040 /* External intr # 6 */
76#define MCFSIM_IMR_EINT7 0x0080 /* External intr # 7 */
77
78#define MCFSIM_IMR_SWD 0x0100 /* Software Watchdog intr */
79#define MCFSIM_IMR_TIMER1 0x0200 /* TIMER 1 intr */
80#define MCFSIM_IMR_TIMER2 0x0400 /* TIMER 2 intr */
81#define MCFSIM_IMR_MBUS 0x0800 /* MBUS intr */
82#define MCFSIM_IMR_UART1 0x1000 /* UART 1 intr */
83#define MCFSIM_IMR_UART2 0x2000 /* UART 2 intr */
84
85#if defined(CONFIG_M5206e)
86#define MCFSIM_IMR_DMA1 0x4000 /* DMA 1 intr */
87#define MCFSIM_IMR_DMA2 0x8000 /* DMA 2 intr */
88#elif defined(CONFIG_M5249) || defined(CONFIG_M5307)
89#define MCFSIM_IMR_DMA0 0x4000 /* DMA 0 intr */
90#define MCFSIM_IMR_DMA1 0x8000 /* DMA 1 intr */
91#define MCFSIM_IMR_DMA2 0x10000 /* DMA 2 intr */
92#define MCFSIM_IMR_DMA3 0x20000 /* DMA 3 intr */
93#endif
94
95/*
96 * Mask for all of the SIM devices. Some parts have more or less
97 * SIM devices. This is a catchall for the sandard set.
98 */
99#ifndef MCFSIM_IMR_MASKALL
100#define MCFSIM_IMR_MASKALL 0x3ffe /* All intr sources */
101#endif
102
103
104/*
105 * PIT interrupt settings, if not found in mXXXXsim.h file.
106 */
107#ifndef ICR_INTRCONF
108#define ICR_INTRCONF 0x2b /* PIT1 level 5, priority 3 */
109#endif
110#ifndef MCFPIT_IMR
111#define MCFPIT_IMR MCFINTC_IMRH
112#endif
113#ifndef MCFPIT_IMR_IBIT
114#define MCFPIT_IMR_IBIT (1 << (MCFINT_PIT1 - 32))
115#endif
116
117
118#ifndef __ASSEMBLY__
119/*
120 * Definition for the interrupt auto-vectoring support.
121 */
122extern void mcf_autovector(unsigned int vec);
123#endif /* __ASSEMBLY__ */
124
125/****************************************************************************/ 46/****************************************************************************/
126#endif /* mcfsim_h */ 47#endif /* mcfsim_h */
diff --git a/arch/m68k/include/asm/mcfsmc.h b/arch/m68k/include/asm/mcfsmc.h
index 2d7a4dbd9683..527bea5d6788 100644
--- a/arch/m68k/include/asm/mcfsmc.h
+++ b/arch/m68k/include/asm/mcfsmc.h
@@ -167,15 +167,15 @@ void smc_remap(unsigned int ioaddr)
167 static int once = 0; 167 static int once = 0;
168 extern unsigned short ppdata; 168 extern unsigned short ppdata;
169 if (once++ == 0) { 169 if (once++ == 0) {
170 *((volatile unsigned short *)(MCF_MBAR+MCFSIM_PADDR)) = 0x00ec; 170 *((volatile unsigned short *)MCFSIM_PADDR) = 0x00ec;
171 ppdata |= 0x0080; 171 ppdata |= 0x0080;
172 *((volatile unsigned short *)(MCF_MBAR+MCFSIM_PADAT)) = ppdata; 172 *((volatile unsigned short *)MCFSIM_PADAT) = ppdata;
173 outw(0x0001, ioaddr + BANK_SELECT); 173 outw(0x0001, ioaddr + BANK_SELECT);
174 outw(0x0001, ioaddr + BANK_SELECT); 174 outw(0x0001, ioaddr + BANK_SELECT);
175 outw(0x0067, ioaddr + BASE); 175 outw(0x0067, ioaddr + BASE);
176 176
177 ppdata &= ~0x0080; 177 ppdata &= ~0x0080;
178 *((volatile unsigned short *)(MCF_MBAR+MCFSIM_PADAT)) = ppdata; 178 *((volatile unsigned short *)MCFSIM_PADAT) = ppdata;
179 } 179 }
180 180
181 *((volatile unsigned short *)(MCF_MBAR+MCFSIM_CSCR3)) = 0x1180; 181 *((volatile unsigned short *)(MCF_MBAR+MCFSIM_CSCR3)) = 0x1180;
diff --git a/arch/m68k/include/asm/nettel.h b/arch/m68k/include/asm/nettel.h
index 0299f6a2deeb..4dec2d9fb994 100644
--- a/arch/m68k/include/asm/nettel.h
+++ b/arch/m68k/include/asm/nettel.h
@@ -48,14 +48,14 @@ extern volatile unsigned short ppdata;
48static __inline__ unsigned int mcf_getppdata(void) 48static __inline__ unsigned int mcf_getppdata(void)
49{ 49{
50 volatile unsigned short *pp; 50 volatile unsigned short *pp;
51 pp = (volatile unsigned short *) (MCF_MBAR + MCFSIM_PADAT); 51 pp = (volatile unsigned short *) MCFSIM_PADAT;
52 return((unsigned int) *pp); 52 return((unsigned int) *pp);
53} 53}
54 54
55static __inline__ void mcf_setppdata(unsigned int mask, unsigned int bits) 55static __inline__ void mcf_setppdata(unsigned int mask, unsigned int bits)
56{ 56{
57 volatile unsigned short *pp; 57 volatile unsigned short *pp;
58 pp = (volatile unsigned short *) (MCF_MBAR + MCFSIM_PADAT); 58 pp = (volatile unsigned short *) MCFSIM_PADAT;
59 ppdata = (ppdata & ~mask) | bits; 59 ppdata = (ppdata & ~mask) | bits;
60 *pp = ppdata; 60 *pp = ppdata;
61} 61}
diff --git a/arch/m68k/include/asm/page_no.h b/arch/m68k/include/asm/page_no.h
index 9aa3f90f4855..1f31b060cc8d 100644
--- a/arch/m68k/include/asm/page_no.h
+++ b/arch/m68k/include/asm/page_no.h
@@ -1,10 +1,12 @@
1#ifndef _M68KNOMMU_PAGE_H 1#ifndef _M68KNOMMU_PAGE_H
2#define _M68KNOMMU_PAGE_H 2#define _M68KNOMMU_PAGE_H
3 3
4#include <linux/const.h>
5
4/* PAGE_SHIFT determines the page size */ 6/* PAGE_SHIFT determines the page size */
5 7
6#define PAGE_SHIFT (12) 8#define PAGE_SHIFT (12)
7#define PAGE_SIZE (1UL << PAGE_SHIFT) 9#define PAGE_SIZE (_AC(1,UL) << PAGE_SHIFT)
8#define PAGE_MASK (~(PAGE_SIZE-1)) 10#define PAGE_MASK (~(PAGE_SIZE-1))
9 11
10#include <asm/setup.h> 12#include <asm/setup.h>
diff --git a/arch/m68k/include/asm/pinmux.h b/arch/m68k/include/asm/pinmux.h
new file mode 100644
index 000000000000..119ee686dbd1
--- /dev/null
+++ b/arch/m68k/include/asm/pinmux.h
@@ -0,0 +1,30 @@
1/*
2 * Coldfire generic GPIO pinmux support.
3 *
4 * (C) Copyright 2009, Steven King <sfking@fdwdc.com>
5 *
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
8 * the Free Software Foundation; version 2 of the License.
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
16#ifndef pinmux_h
17#define pinmux_h
18
19#define MCFPINMUX_NONE -1
20
21extern int mcf_pinmux_request(unsigned, unsigned);
22extern void mcf_pinmux_release(unsigned, unsigned);
23
24static inline int mcf_pinmux_is_valid(unsigned pinmux)
25{
26 return pinmux != MCFPINMUX_NONE;
27}
28
29#endif
30
diff --git a/arch/m68k/include/asm/processor.h b/arch/m68k/include/asm/processor.h
index fc3f2c22f2b8..74fd674b15ad 100644
--- a/arch/m68k/include/asm/processor.h
+++ b/arch/m68k/include/asm/processor.h
@@ -1,5 +1,170 @@
1#ifdef __uClinux__ 1/*
2#include "processor_no.h" 2 * include/asm-m68k/processor.h
3 *
4 * Copyright (C) 1995 Hamish Macdonald
5 */
6
7#ifndef __ASM_M68K_PROCESSOR_H
8#define __ASM_M68K_PROCESSOR_H
9
10/*
11 * Default implementation of macro that returns current
12 * instruction pointer ("program counter").
13 */
14#define current_text_addr() ({ __label__ _l; _l: &&_l;})
15
16#include <linux/thread_info.h>
17#include <asm/segment.h>
18#include <asm/fpu.h>
19#include <asm/ptrace.h>
20
21static inline unsigned long rdusp(void)
22{
23#ifdef CONFIG_COLDFIRE
24 extern unsigned int sw_usp;
25 return sw_usp;
3#else 26#else
4#include "processor_mm.h" 27 unsigned long usp;
28 __asm__ __volatile__("move %/usp,%0" : "=a" (usp));
29 return usp;
30#endif
31}
32
33static inline void wrusp(unsigned long usp)
34{
35#ifdef CONFIG_COLDFIRE
36 extern unsigned int sw_usp;
37 sw_usp = usp;
38#else
39 __asm__ __volatile__("move %0,%/usp" : : "a" (usp));
40#endif
41}
42
43/*
44 * User space process size: 3.75GB. This is hardcoded into a few places,
45 * so don't change it unless you know what you are doing.
46 */
47#ifndef CONFIG_SUN3
48#define TASK_SIZE (0xF0000000UL)
49#else
50#define TASK_SIZE (0x0E000000UL)
51#endif
52
53#ifdef __KERNEL__
54#define STACK_TOP TASK_SIZE
55#define STACK_TOP_MAX STACK_TOP
56#endif
57
58/* This decides where the kernel will search for a free chunk of vm
59 * space during mmap's.
60 */
61#ifdef CONFIG_MMU
62#ifndef CONFIG_SUN3
63#define TASK_UNMAPPED_BASE 0xC0000000UL
64#else
65#define TASK_UNMAPPED_BASE 0x0A000000UL
66#endif
67#define TASK_UNMAPPED_ALIGN(addr, off) PAGE_ALIGN(addr)
68#else
69#define TASK_UNMAPPED_BASE 0
70#endif
71
72struct thread_struct {
73 unsigned long ksp; /* kernel stack pointer */
74 unsigned long usp; /* user stack pointer */
75 unsigned short sr; /* saved status register */
76 unsigned short fs; /* saved fs (sfc, dfc) */
77 unsigned long crp[2]; /* cpu root pointer */
78 unsigned long esp0; /* points to SR of stack frame */
79 unsigned long faddr; /* info about last fault */
80 int signo, code;
81 unsigned long fp[8*3];
82 unsigned long fpcntl[3]; /* fp control regs */
83 unsigned char fpstate[FPSTATESIZE]; /* floating point state */
84 struct thread_info info;
85};
86
87#define INIT_THREAD { \
88 .ksp = sizeof(init_stack) + (unsigned long) init_stack, \
89 .sr = PS_S, \
90 .fs = __KERNEL_DS, \
91 .info = INIT_THREAD_INFO(init_task), \
92}
93
94#ifdef CONFIG_MMU
95/*
96 * Do necessary setup to start up a newly executed thread.
97 */
98static inline void start_thread(struct pt_regs * regs, unsigned long pc,
99 unsigned long usp)
100{
101 /* reads from user space */
102 set_fs(USER_DS);
103
104 regs->pc = pc;
105 regs->sr &= ~0x2000;
106 wrusp(usp);
107}
108
109#else
110
111/*
112 * Coldfire stacks need to be re-aligned on trap exit, conventional
113 * 68k can handle this case cleanly.
114 */
115#ifdef CONFIG_COLDFIRE
116#define reformat(_regs) do { (_regs)->format = 0x4; } while(0)
117#else
118#define reformat(_regs) do { } while (0)
119#endif
120
121#define start_thread(_regs, _pc, _usp) \
122do { \
123 set_fs(USER_DS); /* reads from user space */ \
124 (_regs)->pc = (_pc); \
125 ((struct switch_stack *)(_regs))[-1].a6 = 0; \
126 reformat(_regs); \
127 if (current->mm) \
128 (_regs)->d5 = current->mm->start_data; \
129 (_regs)->sr &= ~0x2000; \
130 wrusp(_usp); \
131} while(0)
132
133#endif
134
135/* Forward declaration, a strange C thing */
136struct task_struct;
137
138/* Free all resources held by a thread. */
139static inline void release_thread(struct task_struct *dead_task)
140{
141}
142
143/* Prepare to copy thread state - unlazy all lazy status */
144#define prepare_to_copy(tsk) do { } while (0)
145
146extern int kernel_thread(int (*fn)(void *), void * arg, unsigned long flags);
147
148/*
149 * Free current thread data structures etc..
150 */
151static inline void exit_thread(void)
152{
153}
154
155extern unsigned long thread_saved_pc(struct task_struct *tsk);
156
157unsigned long get_wchan(struct task_struct *p);
158
159#define KSTK_EIP(tsk) \
160 ({ \
161 unsigned long eip = 0; \
162 if ((tsk)->thread.esp0 > PAGE_SIZE && \
163 (virt_addr_valid((tsk)->thread.esp0))) \
164 eip = ((struct pt_regs *) (tsk)->thread.esp0)->pc; \
165 eip; })
166#define KSTK_ESP(tsk) ((tsk) == current ? rdusp() : (tsk)->thread.usp)
167
168#define cpu_relax() barrier()
169
5#endif 170#endif
diff --git a/arch/m68k/include/asm/processor_mm.h b/arch/m68k/include/asm/processor_mm.h
deleted file mode 100644
index 1f61ef53f0e0..000000000000
--- a/arch/m68k/include/asm/processor_mm.h
+++ /dev/null
@@ -1,130 +0,0 @@
1/*
2 * include/asm-m68k/processor.h
3 *
4 * Copyright (C) 1995 Hamish Macdonald
5 */
6
7#ifndef __ASM_M68K_PROCESSOR_H
8#define __ASM_M68K_PROCESSOR_H
9
10/*
11 * Default implementation of macro that returns current
12 * instruction pointer ("program counter").
13 */
14#define current_text_addr() ({ __label__ _l; _l: &&_l;})
15
16#include <linux/thread_info.h>
17#include <asm/segment.h>
18#include <asm/fpu.h>
19#include <asm/ptrace.h>
20
21static inline unsigned long rdusp(void)
22{
23 unsigned long usp;
24
25 __asm__ __volatile__("move %/usp,%0" : "=a" (usp));
26 return usp;
27}
28
29static inline void wrusp(unsigned long usp)
30{
31 __asm__ __volatile__("move %0,%/usp" : : "a" (usp));
32}
33
34/*
35 * User space process size: 3.75GB. This is hardcoded into a few places,
36 * so don't change it unless you know what you are doing.
37 */
38#ifndef CONFIG_SUN3
39#define TASK_SIZE (0xF0000000UL)
40#else
41#define TASK_SIZE (0x0E000000UL)
42#endif
43
44#ifdef __KERNEL__
45#define STACK_TOP TASK_SIZE
46#define STACK_TOP_MAX STACK_TOP
47#endif
48
49/* This decides where the kernel will search for a free chunk of vm
50 * space during mmap's.
51 */
52#ifndef CONFIG_SUN3
53#define TASK_UNMAPPED_BASE 0xC0000000UL
54#else
55#define TASK_UNMAPPED_BASE 0x0A000000UL
56#endif
57#define TASK_UNMAPPED_ALIGN(addr, off) PAGE_ALIGN(addr)
58
59struct thread_struct {
60 unsigned long ksp; /* kernel stack pointer */
61 unsigned long usp; /* user stack pointer */
62 unsigned short sr; /* saved status register */
63 unsigned short fs; /* saved fs (sfc, dfc) */
64 unsigned long crp[2]; /* cpu root pointer */
65 unsigned long esp0; /* points to SR of stack frame */
66 unsigned long faddr; /* info about last fault */
67 int signo, code;
68 unsigned long fp[8*3];
69 unsigned long fpcntl[3]; /* fp control regs */
70 unsigned char fpstate[FPSTATESIZE]; /* floating point state */
71 struct thread_info info;
72};
73
74#define INIT_THREAD { \
75 .ksp = sizeof(init_stack) + (unsigned long) init_stack, \
76 .sr = PS_S, \
77 .fs = __KERNEL_DS, \
78 .info = INIT_THREAD_INFO(init_task), \
79}
80
81/*
82 * Do necessary setup to start up a newly executed thread.
83 */
84static inline void start_thread(struct pt_regs * regs, unsigned long pc,
85 unsigned long usp)
86{
87 /* reads from user space */
88 set_fs(USER_DS);
89
90 regs->pc = pc;
91 regs->sr &= ~0x2000;
92 wrusp(usp);
93}
94
95/* Forward declaration, a strange C thing */
96struct task_struct;
97
98/* Free all resources held by a thread. */
99static inline void release_thread(struct task_struct *dead_task)
100{
101}
102
103/* Prepare to copy thread state - unlazy all lazy status */
104#define prepare_to_copy(tsk) do { } while (0)
105
106extern int kernel_thread(int (*fn)(void *), void * arg, unsigned long flags);
107
108/*
109 * Free current thread data structures etc..
110 */
111static inline void exit_thread(void)
112{
113}
114
115extern unsigned long thread_saved_pc(struct task_struct *tsk);
116
117unsigned long get_wchan(struct task_struct *p);
118
119#define KSTK_EIP(tsk) \
120 ({ \
121 unsigned long eip = 0; \
122 if ((tsk)->thread.esp0 > PAGE_SIZE && \
123 (virt_addr_valid((tsk)->thread.esp0))) \
124 eip = ((struct pt_regs *) (tsk)->thread.esp0)->pc; \
125 eip; })
126#define KSTK_ESP(tsk) ((tsk) == current ? rdusp() : (tsk)->thread.usp)
127
128#define cpu_relax() barrier()
129
130#endif
diff --git a/arch/m68k/include/asm/processor_no.h b/arch/m68k/include/asm/processor_no.h
deleted file mode 100644
index 7a1e0ba35f5a..000000000000
--- a/arch/m68k/include/asm/processor_no.h
+++ /dev/null
@@ -1,143 +0,0 @@
1/*
2 * include/asm-m68knommu/processor.h
3 *
4 * Copyright (C) 1995 Hamish Macdonald
5 */
6
7#ifndef __ASM_M68K_PROCESSOR_H
8#define __ASM_M68K_PROCESSOR_H
9
10/*
11 * Default implementation of macro that returns current
12 * instruction pointer ("program counter").
13 */
14#define current_text_addr() ({ __label__ _l; _l: &&_l;})
15
16#include <linux/compiler.h>
17#include <linux/threads.h>
18#include <asm/types.h>
19#include <asm/segment.h>
20#include <asm/fpu.h>
21#include <asm/ptrace.h>
22#include <asm/current.h>
23
24static inline unsigned long rdusp(void)
25{
26#ifdef CONFIG_COLDFIRE
27 extern unsigned int sw_usp;
28 return(sw_usp);
29#else
30 unsigned long usp;
31 __asm__ __volatile__("move %/usp,%0" : "=a" (usp));
32 return usp;
33#endif
34}
35
36static inline void wrusp(unsigned long usp)
37{
38#ifdef CONFIG_COLDFIRE
39 extern unsigned int sw_usp;
40 sw_usp = usp;
41#else
42 __asm__ __volatile__("move %0,%/usp" : : "a" (usp));
43#endif
44}
45
46/*
47 * User space process size: 3.75GB. This is hardcoded into a few places,
48 * so don't change it unless you know what you are doing.
49 */
50#define TASK_SIZE (0xF0000000UL)
51
52/*
53 * This decides where the kernel will search for a free chunk of vm
54 * space during mmap's. We won't be using it
55 */
56#define TASK_UNMAPPED_BASE 0
57
58/*
59 * if you change this structure, you must change the code and offsets
60 * in m68k/machasm.S
61 */
62
63struct thread_struct {
64 unsigned long ksp; /* kernel stack pointer */
65 unsigned long usp; /* user stack pointer */
66 unsigned short sr; /* saved status register */
67 unsigned short fs; /* saved fs (sfc, dfc) */
68 unsigned long crp[2]; /* cpu root pointer */
69 unsigned long esp0; /* points to SR of stack frame */
70 unsigned long fp[8*3];
71 unsigned long fpcntl[3]; /* fp control regs */
72 unsigned char fpstate[FPSTATESIZE]; /* floating point state */
73};
74
75#define INIT_THREAD { \
76 .ksp = sizeof(init_stack) + (unsigned long) init_stack, \
77 .sr = PS_S, \
78 .fs = __KERNEL_DS, \
79}
80
81/*
82 * Coldfire stacks need to be re-aligned on trap exit, conventional
83 * 68k can handle this case cleanly.
84 */
85#if defined(CONFIG_COLDFIRE)
86#define reformat(_regs) do { (_regs)->format = 0x4; } while(0)
87#else
88#define reformat(_regs) do { } while (0)
89#endif
90
91/*
92 * Do necessary setup to start up a newly executed thread.
93 *
94 * pass the data segment into user programs if it exists,
95 * it can't hurt anything as far as I can tell
96 */
97#define start_thread(_regs, _pc, _usp) \
98do { \
99 set_fs(USER_DS); /* reads from user space */ \
100 (_regs)->pc = (_pc); \
101 ((struct switch_stack *)(_regs))[-1].a6 = 0; \
102 reformat(_regs); \
103 if (current->mm) \
104 (_regs)->d5 = current->mm->start_data; \
105 (_regs)->sr &= ~0x2000; \
106 wrusp(_usp); \
107} while(0)
108
109/* Forward declaration, a strange C thing */
110struct task_struct;
111
112/* Free all resources held by a thread. */
113static inline void release_thread(struct task_struct *dead_task)
114{
115}
116
117/* Prepare to copy thread state - unlazy all lazy status */
118#define prepare_to_copy(tsk) do { } while (0)
119
120extern int kernel_thread(int (*fn)(void *), void * arg, unsigned long flags);
121
122/*
123 * Free current thread data structures etc..
124 */
125static inline void exit_thread(void)
126{
127}
128
129unsigned long thread_saved_pc(struct task_struct *tsk);
130unsigned long get_wchan(struct task_struct *p);
131
132#define KSTK_EIP(tsk) \
133 ({ \
134 unsigned long eip = 0; \
135 if ((tsk)->thread.esp0 > PAGE_SIZE && \
136 (virt_addr_valid((tsk)->thread.esp0))) \
137 eip = ((struct pt_regs *) (tsk)->thread.esp0)->pc; \
138 eip; })
139#define KSTK_ESP(tsk) ((tsk) == current ? rdusp() : (tsk)->thread.usp)
140
141#define cpu_relax() barrier()
142
143#endif
diff --git a/arch/m68k/include/asm/timex.h b/arch/m68k/include/asm/timex.h
index b87f2f278f67..6759dad954f6 100644
--- a/arch/m68k/include/asm/timex.h
+++ b/arch/m68k/include/asm/timex.h
@@ -3,10 +3,23 @@
3 * 3 *
4 * m68k architecture timex specifications 4 * m68k architecture timex specifications
5 */ 5 */
6#ifndef _ASMm68k_TIMEX_H 6#ifndef _ASMm68K_TIMEX_H
7#define _ASMm68k_TIMEX_H 7#define _ASMm68K_TIMEX_H
8 8
9#ifdef CONFIG_COLDFIRE
10/*
11 * CLOCK_TICK_RATE should give the underlying frequency of the tick timer
12 * to make ntp work best. For Coldfires, that's the main clock.
13 */
14#include <asm/coldfire.h>
15#define CLOCK_TICK_RATE MCF_CLK
16#else
17/*
18 * This default CLOCK_TICK_RATE is probably wrong for many 68k boards
19 * Users of those boards will need to check and modify accordingly
20 */
9#define CLOCK_TICK_RATE 1193180 /* Underlying HZ */ 21#define CLOCK_TICK_RATE 1193180 /* Underlying HZ */
22#endif
10 23
11typedef unsigned long cycles_t; 24typedef unsigned long cycles_t;
12 25
diff --git a/arch/m68k/kernel/vmlinux-std.lds b/arch/m68k/kernel/vmlinux-std.lds
index 01d212bb05a6..47eac19e8f61 100644
--- a/arch/m68k/kernel/vmlinux-std.lds
+++ b/arch/m68k/kernel/vmlinux-std.lds
@@ -82,13 +82,6 @@ SECTIONS
82 82
83 _end = . ; 83 _end = . ;
84 84
85 /* Sections to be discarded */
86 /DISCARD/ : {
87 EXIT_TEXT
88 EXIT_DATA
89 *(.exitcall.exit)
90 }
91
92 /* Stabs debugging sections. */ 85 /* Stabs debugging sections. */
93 .stab 0 : { *(.stab) } 86 .stab 0 : { *(.stab) }
94 .stabstr 0 : { *(.stabstr) } 87 .stabstr 0 : { *(.stabstr) }
@@ -97,4 +90,7 @@ SECTIONS
97 .stab.index 0 : { *(.stab.index) } 90 .stab.index 0 : { *(.stab.index) }
98 .stab.indexstr 0 : { *(.stab.indexstr) } 91 .stab.indexstr 0 : { *(.stab.indexstr) }
99 .comment 0 : { *(.comment) } 92 .comment 0 : { *(.comment) }
93
94 /* Sections to be discarded */
95 DISCARDS
100} 96}
diff --git a/arch/m68k/kernel/vmlinux-sun3.lds b/arch/m68k/kernel/vmlinux-sun3.lds
index c192f773db96..03efaf04d7d7 100644
--- a/arch/m68k/kernel/vmlinux-sun3.lds
+++ b/arch/m68k/kernel/vmlinux-sun3.lds
@@ -77,13 +77,6 @@ __init_begin = .;
77 77
78 _end = . ; 78 _end = . ;
79 79
80 /* Sections to be discarded */
81 /DISCARD/ : {
82 EXIT_TEXT
83 EXIT_DATA
84 *(.exitcall.exit)
85 }
86
87 .crap : { 80 .crap : {
88 /* Stabs debugging sections. */ 81 /* Stabs debugging sections. */
89 *(.stab) 82 *(.stab)
@@ -96,4 +89,6 @@ __init_begin = .;
96 *(.note) 89 *(.note)
97 } 90 }
98 91
92 /* Sections to be discarded */
93 DISCARDS
99} 94}
diff --git a/arch/m68knommu/Kconfig b/arch/m68knommu/Kconfig
index 534376299a99..e2201b90aa22 100644
--- a/arch/m68knommu/Kconfig
+++ b/arch/m68knommu/Kconfig
@@ -47,6 +47,10 @@ config GENERIC_FIND_NEXT_BIT
47 bool 47 bool
48 default y 48 default y
49 49
50config GENERIC_GPIO
51 bool
52 default n
53
50config GENERIC_HWEIGHT 54config GENERIC_HWEIGHT
51 bool 55 bool
52 default y 56 default y
@@ -182,6 +186,8 @@ config M527x
182config COLDFIRE 186config COLDFIRE
183 bool 187 bool
184 depends on (M5206 || M5206e || M520x || M523x || M5249 || M527x || M5272 || M528x || M5307 || M532x || M5407) 188 depends on (M5206 || M5206e || M520x || M523x || M5249 || M527x || M5272 || M528x || M5307 || M532x || M5407)
189 select GENERIC_GPIO
190 select ARCH_REQUIRE_GPIOLIB
185 default y 191 default y
186 192
187config CLOCK_SET 193config CLOCK_SET
diff --git a/arch/m68knommu/kernel/irq.c b/arch/m68knommu/kernel/irq.c
index 56e0f4c55a67..c9cac36d4422 100644
--- a/arch/m68knommu/kernel/irq.c
+++ b/arch/m68knommu/kernel/irq.c
@@ -29,32 +29,6 @@ asmlinkage void do_IRQ(int irq, struct pt_regs *regs)
29 set_irq_regs(oldregs); 29 set_irq_regs(oldregs);
30} 30}
31 31
32void ack_bad_irq(unsigned int irq)
33{
34 printk(KERN_ERR "IRQ: unexpected irq=%d\n", irq);
35}
36
37static struct irq_chip m_irq_chip = {
38 .name = "M68K-INTC",
39 .enable = enable_vector,
40 .disable = disable_vector,
41 .ack = ack_vector,
42};
43
44void __init init_IRQ(void)
45{
46 int irq;
47
48 init_vectors();
49
50 for (irq = 0; (irq < NR_IRQS); irq++) {
51 irq_desc[irq].status = IRQ_DISABLED;
52 irq_desc[irq].action = NULL;
53 irq_desc[irq].depth = 1;
54 irq_desc[irq].chip = &m_irq_chip;
55 }
56}
57
58int show_interrupts(struct seq_file *p, void *v) 32int show_interrupts(struct seq_file *p, void *v)
59{ 33{
60 struct irqaction *ap; 34 struct irqaction *ap;
diff --git a/arch/m68knommu/kernel/time.c b/arch/m68knommu/kernel/time.c
index d182b2f72211..c2aa717de08a 100644
--- a/arch/m68knommu/kernel/time.c
+++ b/arch/m68knommu/kernel/time.c
@@ -69,7 +69,7 @@ static unsigned long read_rtc_mmss(void)
69 if ((year += 1900) < 1970) 69 if ((year += 1900) < 1970)
70 year += 100; 70 year += 100;
71 71
72 return mktime(year, mon, day, hour, min, sec);; 72 return mktime(year, mon, day, hour, min, sec);
73} 73}
74 74
75unsigned long read_persistent_clock(void) 75unsigned long read_persistent_clock(void)
diff --git a/arch/m68knommu/kernel/vmlinux.lds.S b/arch/m68knommu/kernel/vmlinux.lds.S
index b7fe505e358d..2736a5e309c0 100644
--- a/arch/m68knommu/kernel/vmlinux.lds.S
+++ b/arch/m68knommu/kernel/vmlinux.lds.S
@@ -184,12 +184,6 @@ SECTIONS {
184 __init_end = .; 184 __init_end = .;
185 } > INIT 185 } > INIT
186 186
187 /DISCARD/ : {
188 EXIT_TEXT
189 EXIT_DATA
190 *(.exitcall.exit)
191 }
192
193 .bss : { 187 .bss : {
194 . = ALIGN(4); 188 . = ALIGN(4);
195 _sbss = . ; 189 _sbss = . ;
@@ -200,5 +194,6 @@ SECTIONS {
200 _end = . ; 194 _end = . ;
201 } > BSS 195 } > BSS
202 196
197 DISCARDS
203} 198}
204 199
diff --git a/arch/m68knommu/lib/checksum.c b/arch/m68knommu/lib/checksum.c
index 269d83bfbbe1..eccf25d3d73e 100644
--- a/arch/m68knommu/lib/checksum.c
+++ b/arch/m68knommu/lib/checksum.c
@@ -92,6 +92,7 @@ out:
92 return result; 92 return result;
93} 93}
94 94
95#ifdef CONFIG_COLDFIRE
95/* 96/*
96 * This is a version of ip_compute_csum() optimized for IP headers, 97 * This is a version of ip_compute_csum() optimized for IP headers,
97 * which always checksum on 4 octet boundaries. 98 * which always checksum on 4 octet boundaries.
@@ -100,6 +101,7 @@ __sum16 ip_fast_csum(const void *iph, unsigned int ihl)
100{ 101{
101 return (__force __sum16)~do_csum(iph,ihl*4); 102 return (__force __sum16)~do_csum(iph,ihl*4);
102} 103}
104#endif
103 105
104/* 106/*
105 * computes the checksum of a memory block at buff, length len, 107 * computes the checksum of a memory block at buff, length len,
@@ -127,15 +129,6 @@ __wsum csum_partial(const void *buff, int len, __wsum sum)
127EXPORT_SYMBOL(csum_partial); 129EXPORT_SYMBOL(csum_partial);
128 130
129/* 131/*
130 * this routine is used for miscellaneous IP-like checksums, mainly
131 * in icmp.c
132 */
133__sum16 ip_compute_csum(const void *buff, int len)
134{
135 return (__force __sum16)~do_csum(buff,len);
136}
137
138/*
139 * copy from fs while checksumming, otherwise like csum_partial 132 * copy from fs while checksumming, otherwise like csum_partial
140 */ 133 */
141 134
diff --git a/arch/m68knommu/platform/5206/Makefile b/arch/m68knommu/platform/5206/Makefile
index a439d9ab3f27..113c33390064 100644
--- a/arch/m68knommu/platform/5206/Makefile
+++ b/arch/m68knommu/platform/5206/Makefile
@@ -14,5 +14,5 @@
14 14
15asflags-$(CONFIG_FULLDEBUG) := -DDEBUGGER_COMPATIBLE_CACHE=1 15asflags-$(CONFIG_FULLDEBUG) := -DDEBUGGER_COMPATIBLE_CACHE=1
16 16
17obj-y := config.o 17obj-y := config.o gpio.o
18 18
diff --git a/arch/m68knommu/platform/5206/config.c b/arch/m68knommu/platform/5206/config.c
index f6f79874e9af..9c335465e66d 100644
--- a/arch/m68knommu/platform/5206/config.c
+++ b/arch/m68knommu/platform/5206/config.c
@@ -49,11 +49,11 @@ static void __init m5206_uart_init_line(int line, int irq)
49 if (line == 0) { 49 if (line == 0) {
50 writel(MCFSIM_ICR_LEVEL6 | MCFSIM_ICR_PRI1, MCF_MBAR + MCFSIM_UART1ICR); 50 writel(MCFSIM_ICR_LEVEL6 | MCFSIM_ICR_PRI1, MCF_MBAR + MCFSIM_UART1ICR);
51 writeb(irq, MCFUART_BASE1 + MCFUART_UIVR); 51 writeb(irq, MCFUART_BASE1 + MCFUART_UIVR);
52 mcf_setimr(mcf_getimr() & ~MCFSIM_IMR_UART1); 52 mcf_mapirq2imr(irq, MCFINTC_UART0);
53 } else if (line == 1) { 53 } else if (line == 1) {
54 writel(MCFSIM_ICR_LEVEL6 | MCFSIM_ICR_PRI2, MCF_MBAR + MCFSIM_UART2ICR); 54 writel(MCFSIM_ICR_LEVEL6 | MCFSIM_ICR_PRI2, MCF_MBAR + MCFSIM_UART2ICR);
55 writeb(irq, MCFUART_BASE2 + MCFUART_UIVR); 55 writeb(irq, MCFUART_BASE2 + MCFUART_UIVR);
56 mcf_setimr(mcf_getimr() & ~MCFSIM_IMR_UART2); 56 mcf_mapirq2imr(irq, MCFINTC_UART1);
57 } 57 }
58} 58}
59 59
@@ -68,38 +68,19 @@ static void __init m5206_uarts_init(void)
68 68
69/***************************************************************************/ 69/***************************************************************************/
70 70
71void mcf_autovector(unsigned int vec) 71static void __init m5206_timers_init(void)
72{ 72{
73 volatile unsigned char *mbar; 73 /* Timer1 is always used as system timer */
74 unsigned char icr; 74 writeb(MCFSIM_ICR_AUTOVEC | MCFSIM_ICR_LEVEL6 | MCFSIM_ICR_PRI3,
75 75 MCF_MBAR + MCFSIM_TIMER1ICR);
76 if ((vec >= 25) && (vec <= 31)) { 76 mcf_mapirq2imr(MCF_IRQ_TIMER, MCFINTC_TIMER1);
77 vec -= 25; 77
78 mbar = (volatile unsigned char *) MCF_MBAR; 78#ifdef CONFIG_HIGHPROFILE
79 icr = MCFSIM_ICR_AUTOVEC | (vec << 3); 79 /* Timer2 is to be used as a high speed profile timer */
80 *(mbar + MCFSIM_ICR1 + vec) = icr; 80 writeb(MCFSIM_ICR_AUTOVEC | MCFSIM_ICR_LEVEL7 | MCFSIM_ICR_PRI3,
81 vec = 0x1 << (vec + 1); 81 MCF_MBAR + MCFSIM_TIMER2ICR);
82 mcf_setimr(mcf_getimr() & ~vec); 82 mcf_mapirq2imr(MCF_IRQ_PROFILER, MCFINTC_TIMER2);
83 } 83#endif
84}
85
86/***************************************************************************/
87
88void mcf_settimericr(unsigned int timer, unsigned int level)
89{
90 volatile unsigned char *icrp;
91 unsigned int icr, imr;
92
93 if (timer <= 2) {
94 switch (timer) {
95 case 2: icr = MCFSIM_TIMER2ICR; imr = MCFSIM_IMR_TIMER2; break;
96 default: icr = MCFSIM_TIMER1ICR; imr = MCFSIM_IMR_TIMER1; break;
97 }
98
99 icrp = (volatile unsigned char *) (MCF_MBAR + icr);
100 *icrp = MCFSIM_ICR_AUTOVEC | (level << 2) | MCFSIM_ICR_PRI3;
101 mcf_setimr(mcf_getimr() & ~imr);
102 }
103} 84}
104 85
105/***************************************************************************/ 86/***************************************************************************/
@@ -117,15 +98,20 @@ void m5206_cpu_reset(void)
117 98
118void __init config_BSP(char *commandp, int size) 99void __init config_BSP(char *commandp, int size)
119{ 100{
120 mcf_setimr(MCFSIM_IMR_MASKALL);
121 mach_reset = m5206_cpu_reset; 101 mach_reset = m5206_cpu_reset;
102 m5206_timers_init();
103 m5206_uarts_init();
104
105 /* Only support the external interrupts on their primary level */
106 mcf_mapirq2imr(25, MCFINTC_EINT1);
107 mcf_mapirq2imr(28, MCFINTC_EINT4);
108 mcf_mapirq2imr(31, MCFINTC_EINT7);
122} 109}
123 110
124/***************************************************************************/ 111/***************************************************************************/
125 112
126static int __init init_BSP(void) 113static int __init init_BSP(void)
127{ 114{
128 m5206_uarts_init();
129 platform_add_devices(m5206_devices, ARRAY_SIZE(m5206_devices)); 115 platform_add_devices(m5206_devices, ARRAY_SIZE(m5206_devices));
130 return 0; 116 return 0;
131} 117}
diff --git a/arch/m68knommu/platform/5206/gpio.c b/arch/m68knommu/platform/5206/gpio.c
new file mode 100644
index 000000000000..60f779ce1651
--- /dev/null
+++ b/arch/m68knommu/platform/5206/gpio.c
@@ -0,0 +1,49 @@
1/*
2 * Coldfire generic GPIO support
3 *
4 * (C) Copyright 2009, Steven King <sfking@fdwdc.com>
5 *
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
8 * the Free Software Foundation; version 2 of the License.
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
16#include <linux/kernel.h>
17#include <linux/init.h>
18
19#include <asm/coldfire.h>
20#include <asm/mcfsim.h>
21#include <asm/mcfgpio.h>
22
23static struct mcf_gpio_chip mcf_gpio_chips[] = {
24 {
25 .gpio_chip = {
26 .label = "PP",
27 .request = mcf_gpio_request,
28 .free = mcf_gpio_free,
29 .direction_input = mcf_gpio_direction_input,
30 .direction_output = mcf_gpio_direction_output,
31 .get = mcf_gpio_get_value,
32 .set = mcf_gpio_set_value,
33 .ngpio = 8,
34 },
35 .pddr = MCFSIM_PADDR,
36 .podr = MCFSIM_PADAT,
37 .ppdr = MCFSIM_PADAT,
38 },
39};
40
41static int __init mcf_gpio_init(void)
42{
43 unsigned i = 0;
44 while (i < ARRAY_SIZE(mcf_gpio_chips))
45 (void)gpiochip_add((struct gpio_chip *)&mcf_gpio_chips[i++]);
46 return 0;
47}
48
49core_initcall(mcf_gpio_init);
diff --git a/arch/m68knommu/platform/5206e/Makefile b/arch/m68knommu/platform/5206e/Makefile
index a439d9ab3f27..113c33390064 100644
--- a/arch/m68knommu/platform/5206e/Makefile
+++ b/arch/m68knommu/platform/5206e/Makefile
@@ -14,5 +14,5 @@
14 14
15asflags-$(CONFIG_FULLDEBUG) := -DDEBUGGER_COMPATIBLE_CACHE=1 15asflags-$(CONFIG_FULLDEBUG) := -DDEBUGGER_COMPATIBLE_CACHE=1
16 16
17obj-y := config.o 17obj-y := config.o gpio.o
18 18
diff --git a/arch/m68knommu/platform/5206e/config.c b/arch/m68knommu/platform/5206e/config.c
index 65887799db81..0f41ba82a3b5 100644
--- a/arch/m68knommu/platform/5206e/config.c
+++ b/arch/m68knommu/platform/5206e/config.c
@@ -15,6 +15,7 @@
15#include <asm/machdep.h> 15#include <asm/machdep.h>
16#include <asm/coldfire.h> 16#include <asm/coldfire.h>
17#include <asm/mcfsim.h> 17#include <asm/mcfsim.h>
18#include <asm/mcfuart.h>
18#include <asm/mcfdma.h> 19#include <asm/mcfdma.h>
19#include <asm/mcfuart.h> 20#include <asm/mcfuart.h>
20 21
@@ -49,11 +50,11 @@ static void __init m5206e_uart_init_line(int line, int irq)
49 if (line == 0) { 50 if (line == 0) {
50 writel(MCFSIM_ICR_LEVEL6 | MCFSIM_ICR_PRI1, MCF_MBAR + MCFSIM_UART1ICR); 51 writel(MCFSIM_ICR_LEVEL6 | MCFSIM_ICR_PRI1, MCF_MBAR + MCFSIM_UART1ICR);
51 writeb(irq, MCFUART_BASE1 + MCFUART_UIVR); 52 writeb(irq, MCFUART_BASE1 + MCFUART_UIVR);
52 mcf_setimr(mcf_getimr() & ~MCFSIM_IMR_UART1); 53 mcf_mapirq2imr(irq, MCFINTC_UART0);
53 } else if (line == 1) { 54 } else if (line == 1) {
54 writel(MCFSIM_ICR_LEVEL6 | MCFSIM_ICR_PRI2, MCF_MBAR + MCFSIM_UART2ICR); 55 writel(MCFSIM_ICR_LEVEL6 | MCFSIM_ICR_PRI2, MCF_MBAR + MCFSIM_UART2ICR);
55 writeb(irq, MCFUART_BASE2 + MCFUART_UIVR); 56 writeb(irq, MCFUART_BASE2 + MCFUART_UIVR);
56 mcf_setimr(mcf_getimr() & ~MCFSIM_IMR_UART2); 57 mcf_mapirq2imr(irq, MCFINTC_UART1);
57 } 58 }
58} 59}
59 60
@@ -68,38 +69,19 @@ static void __init m5206e_uarts_init(void)
68 69
69/***************************************************************************/ 70/***************************************************************************/
70 71
71void mcf_autovector(unsigned int vec) 72static void __init m5206e_timers_init(void)
72{
73 volatile unsigned char *mbar;
74 unsigned char icr;
75
76 if ((vec >= 25) && (vec <= 31)) {
77 vec -= 25;
78 mbar = (volatile unsigned char *) MCF_MBAR;
79 icr = MCFSIM_ICR_AUTOVEC | (vec << 3);
80 *(mbar + MCFSIM_ICR1 + vec) = icr;
81 vec = 0x1 << (vec + 1);
82 mcf_setimr(mcf_getimr() & ~vec);
83 }
84}
85
86/***************************************************************************/
87
88void mcf_settimericr(unsigned int timer, unsigned int level)
89{ 73{
90 volatile unsigned char *icrp; 74 /* Timer1 is always used as system timer */
91 unsigned int icr, imr; 75 writeb(MCFSIM_ICR_AUTOVEC | MCFSIM_ICR_LEVEL6 | MCFSIM_ICR_PRI3,
92 76 MCF_MBAR + MCFSIM_TIMER1ICR);
93 if (timer <= 2) { 77 mcf_mapirq2imr(MCF_IRQ_TIMER, MCFINTC_TIMER1);
94 switch (timer) { 78
95 case 2: icr = MCFSIM_TIMER2ICR; imr = MCFSIM_IMR_TIMER2; break; 79#ifdef CONFIG_HIGHPROFILE
96 default: icr = MCFSIM_TIMER1ICR; imr = MCFSIM_IMR_TIMER1; break; 80 /* Timer2 is to be used as a high speed profile timer */
97 } 81 writeb(MCFSIM_ICR_AUTOVEC | MCFSIM_ICR_LEVEL7 | MCFSIM_ICR_PRI3,
98 82 MCF_MBAR + MCFSIM_TIMER2ICR);
99 icrp = (volatile unsigned char *) (MCF_MBAR + icr); 83 mcf_mapirq2imr(MCF_IRQ_PROFILER, MCFINTC_TIMER2);
100 *icrp = MCFSIM_ICR_AUTOVEC | (level << 2) | MCFSIM_ICR_PRI3; 84#endif
101 mcf_setimr(mcf_getimr() & ~imr);
102 }
103} 85}
104 86
105/***************************************************************************/ 87/***************************************************************************/
@@ -117,8 +99,6 @@ void m5206e_cpu_reset(void)
117 99
118void __init config_BSP(char *commandp, int size) 100void __init config_BSP(char *commandp, int size)
119{ 101{
120 mcf_setimr(MCFSIM_IMR_MASKALL);
121
122#if defined(CONFIG_NETtel) 102#if defined(CONFIG_NETtel)
123 /* Copy command line from FLASH to local buffer... */ 103 /* Copy command line from FLASH to local buffer... */
124 memcpy(commandp, (char *) 0xf0004000, size); 104 memcpy(commandp, (char *) 0xf0004000, size);
@@ -126,13 +106,19 @@ void __init config_BSP(char *commandp, int size)
126#endif /* CONFIG_NETtel */ 106#endif /* CONFIG_NETtel */
127 107
128 mach_reset = m5206e_cpu_reset; 108 mach_reset = m5206e_cpu_reset;
109 m5206e_timers_init();
110 m5206e_uarts_init();
111
112 /* Only support the external interrupts on their primary level */
113 mcf_mapirq2imr(25, MCFINTC_EINT1);
114 mcf_mapirq2imr(28, MCFINTC_EINT4);
115 mcf_mapirq2imr(31, MCFINTC_EINT7);
129} 116}
130 117
131/***************************************************************************/ 118/***************************************************************************/
132 119
133static int __init init_BSP(void) 120static int __init init_BSP(void)
134{ 121{
135 m5206e_uarts_init();
136 platform_add_devices(m5206e_devices, ARRAY_SIZE(m5206e_devices)); 122 platform_add_devices(m5206e_devices, ARRAY_SIZE(m5206e_devices));
137 return 0; 123 return 0;
138} 124}
diff --git a/arch/m68knommu/platform/5206e/gpio.c b/arch/m68knommu/platform/5206e/gpio.c
new file mode 100644
index 000000000000..60f779ce1651
--- /dev/null
+++ b/arch/m68knommu/platform/5206e/gpio.c
@@ -0,0 +1,49 @@
1/*
2 * Coldfire generic GPIO support
3 *
4 * (C) Copyright 2009, Steven King <sfking@fdwdc.com>
5 *
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
8 * the Free Software Foundation; version 2 of the License.
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
16#include <linux/kernel.h>
17#include <linux/init.h>
18
19#include <asm/coldfire.h>
20#include <asm/mcfsim.h>
21#include <asm/mcfgpio.h>
22
23static struct mcf_gpio_chip mcf_gpio_chips[] = {
24 {
25 .gpio_chip = {
26 .label = "PP",
27 .request = mcf_gpio_request,
28 .free = mcf_gpio_free,
29 .direction_input = mcf_gpio_direction_input,
30 .direction_output = mcf_gpio_direction_output,
31 .get = mcf_gpio_get_value,
32 .set = mcf_gpio_set_value,
33 .ngpio = 8,
34 },
35 .pddr = MCFSIM_PADDR,
36 .podr = MCFSIM_PADAT,
37 .ppdr = MCFSIM_PADAT,
38 },
39};
40
41static int __init mcf_gpio_init(void)
42{
43 unsigned i = 0;
44 while (i < ARRAY_SIZE(mcf_gpio_chips))
45 (void)gpiochip_add((struct gpio_chip *)&mcf_gpio_chips[i++]);
46 return 0;
47}
48
49core_initcall(mcf_gpio_init);
diff --git a/arch/m68knommu/platform/520x/Makefile b/arch/m68knommu/platform/520x/Makefile
index a50e76acc8fd..435ab3483dc1 100644
--- a/arch/m68knommu/platform/520x/Makefile
+++ b/arch/m68knommu/platform/520x/Makefile
@@ -14,4 +14,4 @@
14 14
15asflags-$(CONFIG_FULLDEBUG) := -DDEBUGGER_COMPATIBLE_CACHE=1 15asflags-$(CONFIG_FULLDEBUG) := -DDEBUGGER_COMPATIBLE_CACHE=1
16 16
17obj-y := config.o 17obj-y := config.o gpio.o
diff --git a/arch/m68knommu/platform/520x/config.c b/arch/m68knommu/platform/520x/config.c
index 1c43a8aec69b..92614de42cd3 100644
--- a/arch/m68knommu/platform/520x/config.c
+++ b/arch/m68knommu/platform/520x/config.c
@@ -81,20 +81,11 @@ static struct platform_device *m520x_devices[] __initdata = {
81 81
82/***************************************************************************/ 82/***************************************************************************/
83 83
84#define INTC0 (MCF_MBAR + MCFICM_INTC0)
85
86static void __init m520x_uart_init_line(int line, int irq) 84static void __init m520x_uart_init_line(int line, int irq)
87{ 85{
88 u32 imr;
89 u16 par; 86 u16 par;
90 u8 par2; 87 u8 par2;
91 88
92 writeb(0x03, INTC0 + MCFINTC_ICR0 + MCFINT_UART0 + line);
93
94 imr = readl(INTC0 + MCFINTC_IMRL);
95 imr &= ~((1 << (irq - MCFINT_VECBASE)) | 1);
96 writel(imr, INTC0 + MCFINTC_IMRL);
97
98 switch (line) { 89 switch (line) {
99 case 0: 90 case 0:
100 par = readw(MCF_IPSBAR + MCF_GPIO_PAR_UART); 91 par = readw(MCF_IPSBAR + MCF_GPIO_PAR_UART);
@@ -131,18 +122,8 @@ static void __init m520x_uarts_init(void)
131 122
132static void __init m520x_fec_init(void) 123static void __init m520x_fec_init(void)
133{ 124{
134 u32 imr;
135 u8 v; 125 u8 v;
136 126
137 /* Unmask FEC interrupts at ColdFire interrupt controller */
138 writeb(0x4, MCF_IPSBAR + MCFICM_INTC0 + MCFINTC_ICR0 + 36);
139 writeb(0x4, MCF_IPSBAR + MCFICM_INTC0 + MCFINTC_ICR0 + 40);
140 writeb(0x4, MCF_IPSBAR + MCFICM_INTC0 + MCFINTC_ICR0 + 42);
141
142 imr = readl(MCF_IPSBAR + MCFICM_INTC0 + MCFINTC_IMRH);
143 imr &= ~0x0001FFF0;
144 writel(imr, MCF_IPSBAR + MCFICM_INTC0 + MCFINTC_IMRH);
145
146 /* Set multi-function pins to ethernet mode */ 127 /* Set multi-function pins to ethernet mode */
147 v = readb(MCF_IPSBAR + MCF_GPIO_PAR_FEC); 128 v = readb(MCF_IPSBAR + MCF_GPIO_PAR_FEC);
148 writeb(v | 0xf0, MCF_IPSBAR + MCF_GPIO_PAR_FEC); 129 writeb(v | 0xf0, MCF_IPSBAR + MCF_GPIO_PAR_FEC);
@@ -153,17 +134,6 @@ static void __init m520x_fec_init(void)
153 134
154/***************************************************************************/ 135/***************************************************************************/
155 136
156/*
157 * Program the vector to be an auto-vectored.
158 */
159
160void mcf_autovector(unsigned int vec)
161{
162 /* Everything is auto-vectored on the 520x devices */
163}
164
165/***************************************************************************/
166
167static void m520x_cpu_reset(void) 137static void m520x_cpu_reset(void)
168{ 138{
169 local_irq_disable(); 139 local_irq_disable();
diff --git a/arch/m68knommu/platform/520x/gpio.c b/arch/m68knommu/platform/520x/gpio.c
new file mode 100644
index 000000000000..15b5bb62a698
--- /dev/null
+++ b/arch/m68knommu/platform/520x/gpio.c
@@ -0,0 +1,211 @@
1/*
2 * Coldfire generic GPIO support
3 *
4 * (C) Copyright 2009, Steven King <sfking@fdwdc.com>
5 *
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
8 * the Free Software Foundation; version 2 of the License.
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
16#include <linux/kernel.h>
17#include <linux/init.h>
18
19#include <asm/coldfire.h>
20#include <asm/mcfsim.h>
21#include <asm/mcfgpio.h>
22
23static struct mcf_gpio_chip mcf_gpio_chips[] = {
24 {
25 .gpio_chip = {
26 .label = "PIRQ",
27 .request = mcf_gpio_request,
28 .free = mcf_gpio_free,
29 .direction_input = mcf_gpio_direction_input,
30 .direction_output = mcf_gpio_direction_output,
31 .get = mcf_gpio_get_value,
32 .set = mcf_gpio_set_value,
33 .ngpio = 8,
34 },
35 .pddr = MCFEPORT_EPDDR,
36 .podr = MCFEPORT_EPDR,
37 .ppdr = MCFEPORT_EPPDR,
38 },
39 {
40 .gpio_chip = {
41 .label = "BUSCTL",
42 .request = mcf_gpio_request,
43 .free = mcf_gpio_free,
44 .direction_input = mcf_gpio_direction_input,
45 .direction_output = mcf_gpio_direction_output,
46 .get = mcf_gpio_get_value,
47 .set = mcf_gpio_set_value_fast,
48 .base = 8,
49 .ngpio = 4,
50 },
51 .pddr = MCFGPIO_PDDR_BUSCTL,
52 .podr = MCFGPIO_PODR_BUSCTL,
53 .ppdr = MCFGPIO_PPDSDR_BUSCTL,
54 .setr = MCFGPIO_PPDSDR_BUSCTL,
55 .clrr = MCFGPIO_PCLRR_BUSCTL,
56 },
57 {
58 .gpio_chip = {
59 .label = "BE",
60 .request = mcf_gpio_request,
61 .free = mcf_gpio_free,
62 .direction_input = mcf_gpio_direction_input,
63 .direction_output = mcf_gpio_direction_output,
64 .get = mcf_gpio_get_value,
65 .set = mcf_gpio_set_value_fast,
66 .base = 16,
67 .ngpio = 4,
68 },
69 .pddr = MCFGPIO_PDDR_BE,
70 .podr = MCFGPIO_PODR_BE,
71 .ppdr = MCFGPIO_PPDSDR_BE,
72 .setr = MCFGPIO_PPDSDR_BE,
73 .clrr = MCFGPIO_PCLRR_BE,
74 },
75 {
76 .gpio_chip = {
77 .label = "CS",
78 .request = mcf_gpio_request,
79 .free = mcf_gpio_free,
80 .direction_input = mcf_gpio_direction_input,
81 .direction_output = mcf_gpio_direction_output,
82 .get = mcf_gpio_get_value,
83 .set = mcf_gpio_set_value_fast,
84 .base = 25,
85 .ngpio = 3,
86 },
87 .pddr = MCFGPIO_PDDR_CS,
88 .podr = MCFGPIO_PODR_CS,
89 .ppdr = MCFGPIO_PPDSDR_CS,
90 .setr = MCFGPIO_PPDSDR_CS,
91 .clrr = MCFGPIO_PCLRR_CS,
92 },
93 {
94 .gpio_chip = {
95 .label = "FECI2C",
96 .request = mcf_gpio_request,
97 .free = mcf_gpio_free,
98 .direction_input = mcf_gpio_direction_input,
99 .direction_output = mcf_gpio_direction_output,
100 .get = mcf_gpio_get_value,
101 .set = mcf_gpio_set_value_fast,
102 .base = 32,
103 .ngpio = 4,
104 },
105 .pddr = MCFGPIO_PDDR_FECI2C,
106 .podr = MCFGPIO_PODR_FECI2C,
107 .ppdr = MCFGPIO_PPDSDR_FECI2C,
108 .setr = MCFGPIO_PPDSDR_FECI2C,
109 .clrr = MCFGPIO_PCLRR_FECI2C,
110 },
111 {
112 .gpio_chip = {
113 .label = "QSPI",
114 .request = mcf_gpio_request,
115 .free = mcf_gpio_free,
116 .direction_input = mcf_gpio_direction_input,
117 .direction_output = mcf_gpio_direction_output,
118 .get = mcf_gpio_get_value,
119 .set = mcf_gpio_set_value_fast,
120 .base = 40,
121 .ngpio = 4,
122 },
123 .pddr = MCFGPIO_PDDR_QSPI,
124 .podr = MCFGPIO_PODR_QSPI,
125 .ppdr = MCFGPIO_PPDSDR_QSPI,
126 .setr = MCFGPIO_PPDSDR_QSPI,
127 .clrr = MCFGPIO_PCLRR_QSPI,
128 },
129 {
130 .gpio_chip = {
131 .label = "TIMER",
132 .request = mcf_gpio_request,
133 .free = mcf_gpio_free,
134 .direction_input = mcf_gpio_direction_input,
135 .direction_output = mcf_gpio_direction_output,
136 .get = mcf_gpio_get_value,
137 .set = mcf_gpio_set_value_fast,
138 .base = 48,
139 .ngpio = 4,
140 },
141 .pddr = MCFGPIO_PDDR_TIMER,
142 .podr = MCFGPIO_PODR_TIMER,
143 .ppdr = MCFGPIO_PPDSDR_TIMER,
144 .setr = MCFGPIO_PPDSDR_TIMER,
145 .clrr = MCFGPIO_PCLRR_TIMER,
146 },
147 {
148 .gpio_chip = {
149 .label = "UART",
150 .request = mcf_gpio_request,
151 .free = mcf_gpio_free,
152 .direction_input = mcf_gpio_direction_input,
153 .direction_output = mcf_gpio_direction_output,
154 .get = mcf_gpio_get_value,
155 .set = mcf_gpio_set_value_fast,
156 .base = 56,
157 .ngpio = 8,
158 },
159 .pddr = MCFGPIO_PDDR_UART,
160 .podr = MCFGPIO_PODR_UART,
161 .ppdr = MCFGPIO_PPDSDR_UART,
162 .setr = MCFGPIO_PPDSDR_UART,
163 .clrr = MCFGPIO_PCLRR_UART,
164 },
165 {
166 .gpio_chip = {
167 .label = "FECH",
168 .request = mcf_gpio_request,
169 .free = mcf_gpio_free,
170 .direction_input = mcf_gpio_direction_input,
171 .direction_output = mcf_gpio_direction_output,
172 .get = mcf_gpio_get_value,
173 .set = mcf_gpio_set_value_fast,
174 .base = 64,
175 .ngpio = 8,
176 },
177 .pddr = MCFGPIO_PDDR_FECH,
178 .podr = MCFGPIO_PODR_FECH,
179 .ppdr = MCFGPIO_PPDSDR_FECH,
180 .setr = MCFGPIO_PPDSDR_FECH,
181 .clrr = MCFGPIO_PCLRR_FECH,
182 },
183 {
184 .gpio_chip = {
185 .label = "FECL",
186 .request = mcf_gpio_request,
187 .free = mcf_gpio_free,
188 .direction_input = mcf_gpio_direction_input,
189 .direction_output = mcf_gpio_direction_output,
190 .get = mcf_gpio_get_value,
191 .set = mcf_gpio_set_value_fast,
192 .base = 72,
193 .ngpio = 8,
194 },
195 .pddr = MCFGPIO_PDDR_FECL,
196 .podr = MCFGPIO_PODR_FECL,
197 .ppdr = MCFGPIO_PPDSDR_FECL,
198 .setr = MCFGPIO_PPDSDR_FECL,
199 .clrr = MCFGPIO_PCLRR_FECL,
200 },
201};
202
203static int __init mcf_gpio_init(void)
204{
205 unsigned i = 0;
206 while (i < ARRAY_SIZE(mcf_gpio_chips))
207 (void)gpiochip_add((struct gpio_chip *)&mcf_gpio_chips[i++]);
208 return 0;
209}
210
211core_initcall(mcf_gpio_init);
diff --git a/arch/m68knommu/platform/523x/Makefile b/arch/m68knommu/platform/523x/Makefile
index 5694d593f029..b8f9b45440c2 100644
--- a/arch/m68knommu/platform/523x/Makefile
+++ b/arch/m68knommu/platform/523x/Makefile
@@ -14,4 +14,4 @@
14 14
15asflags-$(CONFIG_FULLDEBUG) := -DDEBUGGER_COMPATIBLE_CACHE=1 15asflags-$(CONFIG_FULLDEBUG) := -DDEBUGGER_COMPATIBLE_CACHE=1
16 16
17obj-y := config.o 17obj-y := config.o gpio.o
diff --git a/arch/m68knommu/platform/523x/config.c b/arch/m68knommu/platform/523x/config.c
index 961fefebca14..6ba84f2aa397 100644
--- a/arch/m68knommu/platform/523x/config.c
+++ b/arch/m68knommu/platform/523x/config.c
@@ -82,66 +82,20 @@ static struct platform_device *m523x_devices[] __initdata = {
82 82
83/***************************************************************************/ 83/***************************************************************************/
84 84
85#define INTC0 (MCF_MBAR + MCFICM_INTC0)
86
87static void __init m523x_uart_init_line(int line, int irq)
88{
89 u32 imr;
90
91 if ((line < 0) || (line > 2))
92 return;
93
94 writeb(0x30+line, (INTC0 + MCFINTC_ICR0 + MCFINT_UART0 + line));
95
96 imr = readl(INTC0 + MCFINTC_IMRL);
97 imr &= ~((1 << (irq - MCFINT_VECBASE)) | 1);
98 writel(imr, INTC0 + MCFINTC_IMRL);
99}
100
101static void __init m523x_uarts_init(void)
102{
103 const int nrlines = ARRAY_SIZE(m523x_uart_platform);
104 int line;
105
106 for (line = 0; (line < nrlines); line++)
107 m523x_uart_init_line(line, m523x_uart_platform[line].irq);
108}
109
110/***************************************************************************/
111
112static void __init m523x_fec_init(void) 85static void __init m523x_fec_init(void)
113{ 86{
114 u32 imr; 87 u16 par;
115 88 u8 v;
116 /* Unmask FEC interrupts at ColdFire interrupt controller */ 89
117 writeb(0x28, MCF_IPSBAR + MCFICM_INTC0 + MCFINTC_ICR0 + 23); 90 /* Set multi-function pins to ethernet use */
118 writeb(0x27, MCF_IPSBAR + MCFICM_INTC0 + MCFINTC_ICR0 + 27); 91 par = readw(MCF_IPSBAR + 0x100082);
119 writeb(0x26, MCF_IPSBAR + MCFICM_INTC0 + MCFINTC_ICR0 + 29); 92 writew(par | 0xf00, MCF_IPSBAR + 0x100082);
120 93 v = readb(MCF_IPSBAR + 0x100078);
121 imr = readl(MCF_IPSBAR + MCFICM_INTC0 + MCFINTC_IMRH); 94 writeb(v | 0xc0, MCF_IPSBAR + 0x100078);
122 imr &= ~0xf;
123 writel(imr, MCF_IPSBAR + MCFICM_INTC0 + MCFINTC_IMRH);
124 imr = readl(MCF_IPSBAR + MCFICM_INTC0 + MCFINTC_IMRL);
125 imr &= ~0xff800001;
126 writel(imr, MCF_IPSBAR + MCFICM_INTC0 + MCFINTC_IMRL);
127}
128
129/***************************************************************************/
130
131void mcf_disableall(void)
132{
133 *((volatile unsigned long *) (MCF_IPSBAR + MCFICM_INTC0 + MCFINTC_IMRH)) = 0xffffffff;
134 *((volatile unsigned long *) (MCF_IPSBAR + MCFICM_INTC0 + MCFINTC_IMRL)) = 0xffffffff;
135} 95}
136 96
137/***************************************************************************/ 97/***************************************************************************/
138 98
139void mcf_autovector(unsigned int vec)
140{
141 /* Everything is auto-vectored on the 523x */
142}
143/***************************************************************************/
144
145static void m523x_cpu_reset(void) 99static void m523x_cpu_reset(void)
146{ 100{
147 local_irq_disable(); 101 local_irq_disable();
@@ -152,16 +106,14 @@ static void m523x_cpu_reset(void)
152 106
153void __init config_BSP(char *commandp, int size) 107void __init config_BSP(char *commandp, int size)
154{ 108{
155 mcf_disableall();
156 mach_reset = m523x_cpu_reset; 109 mach_reset = m523x_cpu_reset;
157 m523x_uarts_init();
158 m523x_fec_init();
159} 110}
160 111
161/***************************************************************************/ 112/***************************************************************************/
162 113
163static int __init init_BSP(void) 114static int __init init_BSP(void)
164{ 115{
116 m523x_fec_init();
165 platform_add_devices(m523x_devices, ARRAY_SIZE(m523x_devices)); 117 platform_add_devices(m523x_devices, ARRAY_SIZE(m523x_devices));
166 return 0; 118 return 0;
167} 119}
diff --git a/arch/m68knommu/platform/523x/gpio.c b/arch/m68knommu/platform/523x/gpio.c
new file mode 100644
index 000000000000..f02840d54d3c
--- /dev/null
+++ b/arch/m68knommu/platform/523x/gpio.c
@@ -0,0 +1,283 @@
1/*
2 * Coldfire generic GPIO support
3 *
4 * (C) Copyright 2009, Steven King <sfking@fdwdc.com>
5 *
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
8 * the Free Software Foundation; version 2 of the License.
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
16#include <linux/kernel.h>
17#include <linux/init.h>
18
19#include <asm/coldfire.h>
20#include <asm/mcfsim.h>
21#include <asm/mcfgpio.h>
22
23static struct mcf_gpio_chip mcf_gpio_chips[] = {
24 {
25 .gpio_chip = {
26 .label = "PIRQ",
27 .request = mcf_gpio_request,
28 .free = mcf_gpio_free,
29 .direction_input = mcf_gpio_direction_input,
30 .direction_output = mcf_gpio_direction_output,
31 .get = mcf_gpio_get_value,
32 .set = mcf_gpio_set_value,
33 .ngpio = 8,
34 },
35 .pddr = MCFEPORT_EPDDR,
36 .podr = MCFEPORT_EPDR,
37 .ppdr = MCFEPORT_EPPDR,
38 },
39 {
40 .gpio_chip = {
41 .label = "ADDR",
42 .request = mcf_gpio_request,
43 .free = mcf_gpio_free,
44 .direction_input = mcf_gpio_direction_input,
45 .direction_output = mcf_gpio_direction_output,
46 .get = mcf_gpio_get_value,
47 .set = mcf_gpio_set_value_fast,
48 .base = 13,
49 .ngpio = 3,
50 },
51 .pddr = MCFGPIO_PDDR_ADDR,
52 .podr = MCFGPIO_PODR_ADDR,
53 .ppdr = MCFGPIO_PPDSDR_ADDR,
54 .setr = MCFGPIO_PPDSDR_ADDR,
55 .clrr = MCFGPIO_PCLRR_ADDR,
56 },
57 {
58 .gpio_chip = {
59 .label = "DATAH",
60 .request = mcf_gpio_request,
61 .free = mcf_gpio_free,
62 .direction_input = mcf_gpio_direction_input,
63 .direction_output = mcf_gpio_direction_output,
64 .get = mcf_gpio_get_value,
65 .set = mcf_gpio_set_value_fast,
66 .base = 16,
67 .ngpio = 8,
68 },
69 .pddr = MCFGPIO_PDDR_DATAH,
70 .podr = MCFGPIO_PODR_DATAH,
71 .ppdr = MCFGPIO_PPDSDR_DATAH,
72 .setr = MCFGPIO_PPDSDR_DATAH,
73 .clrr = MCFGPIO_PCLRR_DATAH,
74 },
75 {
76 .gpio_chip = {
77 .label = "DATAL",
78 .request = mcf_gpio_request,
79 .free = mcf_gpio_free,
80 .direction_input = mcf_gpio_direction_input,
81 .direction_output = mcf_gpio_direction_output,
82 .get = mcf_gpio_get_value,
83 .set = mcf_gpio_set_value_fast,
84 .base = 24,
85 .ngpio = 8,
86 },
87 .pddr = MCFGPIO_PDDR_DATAL,
88 .podr = MCFGPIO_PODR_DATAL,
89 .ppdr = MCFGPIO_PPDSDR_DATAL,
90 .setr = MCFGPIO_PPDSDR_DATAL,
91 .clrr = MCFGPIO_PCLRR_DATAL,
92 },
93 {
94 .gpio_chip = {
95 .label = "BUSCTL",
96 .request = mcf_gpio_request,
97 .free = mcf_gpio_free,
98 .direction_input = mcf_gpio_direction_input,
99 .direction_output = mcf_gpio_direction_output,
100 .get = mcf_gpio_get_value,
101 .set = mcf_gpio_set_value_fast,
102 .base = 32,
103 .ngpio = 8,
104 },
105 .pddr = MCFGPIO_PDDR_BUSCTL,
106 .podr = MCFGPIO_PODR_BUSCTL,
107 .ppdr = MCFGPIO_PPDSDR_BUSCTL,
108 .setr = MCFGPIO_PPDSDR_BUSCTL,
109 .clrr = MCFGPIO_PCLRR_BUSCTL,
110 },
111 {
112 .gpio_chip = {
113 .label = "BS",
114 .request = mcf_gpio_request,
115 .free = mcf_gpio_free,
116 .direction_input = mcf_gpio_direction_input,
117 .direction_output = mcf_gpio_direction_output,
118 .get = mcf_gpio_get_value,
119 .set = mcf_gpio_set_value_fast,
120 .base = 40,
121 .ngpio = 4,
122 },
123 .pddr = MCFGPIO_PDDR_BS,
124 .podr = MCFGPIO_PODR_BS,
125 .ppdr = MCFGPIO_PPDSDR_BS,
126 .setr = MCFGPIO_PPDSDR_BS,
127 .clrr = MCFGPIO_PCLRR_BS,
128 },
129 {
130 .gpio_chip = {
131 .label = "CS",
132 .request = mcf_gpio_request,
133 .free = mcf_gpio_free,
134 .direction_input = mcf_gpio_direction_input,
135 .direction_output = mcf_gpio_direction_output,
136 .get = mcf_gpio_get_value,
137 .set = mcf_gpio_set_value_fast,
138 .base = 49,
139 .ngpio = 7,
140 },
141 .pddr = MCFGPIO_PDDR_CS,
142 .podr = MCFGPIO_PODR_CS,
143 .ppdr = MCFGPIO_PPDSDR_CS,
144 .setr = MCFGPIO_PPDSDR_CS,
145 .clrr = MCFGPIO_PCLRR_CS,
146 },
147 {
148 .gpio_chip = {
149 .label = "SDRAM",
150 .request = mcf_gpio_request,
151 .free = mcf_gpio_free,
152 .direction_input = mcf_gpio_direction_input,
153 .direction_output = mcf_gpio_direction_output,
154 .get = mcf_gpio_get_value,
155 .set = mcf_gpio_set_value_fast,
156 .base = 56,
157 .ngpio = 6,
158 },
159 .pddr = MCFGPIO_PDDR_SDRAM,
160 .podr = MCFGPIO_PODR_SDRAM,
161 .ppdr = MCFGPIO_PPDSDR_SDRAM,
162 .setr = MCFGPIO_PPDSDR_SDRAM,
163 .clrr = MCFGPIO_PCLRR_SDRAM,
164 },
165 {
166 .gpio_chip = {
167 .label = "FECI2C",
168 .request = mcf_gpio_request,
169 .free = mcf_gpio_free,
170 .direction_input = mcf_gpio_direction_input,
171 .direction_output = mcf_gpio_direction_output,
172 .get = mcf_gpio_get_value,
173 .set = mcf_gpio_set_value_fast,
174 .base = 64,
175 .ngpio = 4,
176 },
177 .pddr = MCFGPIO_PDDR_FECI2C,
178 .podr = MCFGPIO_PODR_FECI2C,
179 .ppdr = MCFGPIO_PPDSDR_FECI2C,
180 .setr = MCFGPIO_PPDSDR_FECI2C,
181 .clrr = MCFGPIO_PCLRR_FECI2C,
182 },
183 {
184 .gpio_chip = {
185 .label = "UARTH",
186 .request = mcf_gpio_request,
187 .free = mcf_gpio_free,
188 .direction_input = mcf_gpio_direction_input,
189 .direction_output = mcf_gpio_direction_output,
190 .get = mcf_gpio_get_value,
191 .set = mcf_gpio_set_value_fast,
192 .base = 72,
193 .ngpio = 2,
194 },
195 .pddr = MCFGPIO_PDDR_UARTH,
196 .podr = MCFGPIO_PODR_UARTH,
197 .ppdr = MCFGPIO_PPDSDR_UARTH,
198 .setr = MCFGPIO_PPDSDR_UARTH,
199 .clrr = MCFGPIO_PCLRR_UARTH,
200 },
201 {
202 .gpio_chip = {
203 .label = "UARTL",
204 .request = mcf_gpio_request,
205 .free = mcf_gpio_free,
206 .direction_input = mcf_gpio_direction_input,
207 .direction_output = mcf_gpio_direction_output,
208 .get = mcf_gpio_get_value,
209 .set = mcf_gpio_set_value_fast,
210 .base = 80,
211 .ngpio = 8,
212 },
213 .pddr = MCFGPIO_PDDR_UARTL,
214 .podr = MCFGPIO_PODR_UARTL,
215 .ppdr = MCFGPIO_PPDSDR_UARTL,
216 .setr = MCFGPIO_PPDSDR_UARTL,
217 .clrr = MCFGPIO_PCLRR_UARTL,
218 },
219 {
220 .gpio_chip = {
221 .label = "QSPI",
222 .request = mcf_gpio_request,
223 .free = mcf_gpio_free,
224 .direction_input = mcf_gpio_direction_input,
225 .direction_output = mcf_gpio_direction_output,
226 .get = mcf_gpio_get_value,
227 .set = mcf_gpio_set_value_fast,
228 .base = 88,
229 .ngpio = 5,
230 },
231 .pddr = MCFGPIO_PDDR_QSPI,
232 .podr = MCFGPIO_PODR_QSPI,
233 .ppdr = MCFGPIO_PPDSDR_QSPI,
234 .setr = MCFGPIO_PPDSDR_QSPI,
235 .clrr = MCFGPIO_PCLRR_QSPI,
236 },
237 {
238 .gpio_chip = {
239 .label = "TIMER",
240 .request = mcf_gpio_request,
241 .free = mcf_gpio_free,
242 .direction_input = mcf_gpio_direction_input,
243 .direction_output = mcf_gpio_direction_output,
244 .get = mcf_gpio_get_value,
245 .set = mcf_gpio_set_value_fast,
246 .base = 96,
247 .ngpio = 4,
248 },
249 .pddr = MCFGPIO_PDDR_TIMER,
250 .podr = MCFGPIO_PODR_TIMER,
251 .ppdr = MCFGPIO_PPDSDR_TIMER,
252 .setr = MCFGPIO_PPDSDR_TIMER,
253 .clrr = MCFGPIO_PCLRR_TIMER,
254 },
255 {
256 .gpio_chip = {
257 .label = "ETPU",
258 .request = mcf_gpio_request,
259 .free = mcf_gpio_free,
260 .direction_input = mcf_gpio_direction_input,
261 .direction_output = mcf_gpio_direction_output,
262 .get = mcf_gpio_get_value,
263 .set = mcf_gpio_set_value_fast,
264 .base = 104,
265 .ngpio = 3,
266 },
267 .pddr = MCFGPIO_PDDR_ETPU,
268 .podr = MCFGPIO_PODR_ETPU,
269 .ppdr = MCFGPIO_PPDSDR_ETPU,
270 .setr = MCFGPIO_PPDSDR_ETPU,
271 .clrr = MCFGPIO_PCLRR_ETPU,
272 },
273};
274
275static int __init mcf_gpio_init(void)
276{
277 unsigned i = 0;
278 while (i < ARRAY_SIZE(mcf_gpio_chips))
279 (void)gpiochip_add((struct gpio_chip *)&mcf_gpio_chips[i++]);
280 return 0;
281}
282
283core_initcall(mcf_gpio_init);
diff --git a/arch/m68knommu/platform/5249/Makefile b/arch/m68knommu/platform/5249/Makefile
index a439d9ab3f27..f56225d1582f 100644
--- a/arch/m68knommu/platform/5249/Makefile
+++ b/arch/m68knommu/platform/5249/Makefile
@@ -14,5 +14,5 @@
14 14
15asflags-$(CONFIG_FULLDEBUG) := -DDEBUGGER_COMPATIBLE_CACHE=1 15asflags-$(CONFIG_FULLDEBUG) := -DDEBUGGER_COMPATIBLE_CACHE=1
16 16
17obj-y := config.o 17obj-y := config.o gpio.o intc2.o
18 18
diff --git a/arch/m68knommu/platform/5249/config.c b/arch/m68knommu/platform/5249/config.c
index 93d998825925..646f5ba462fc 100644
--- a/arch/m68knommu/platform/5249/config.c
+++ b/arch/m68knommu/platform/5249/config.c
@@ -48,11 +48,11 @@ static void __init m5249_uart_init_line(int line, int irq)
48 if (line == 0) { 48 if (line == 0) {
49 writeb(MCFSIM_ICR_LEVEL6 | MCFSIM_ICR_PRI1, MCF_MBAR + MCFSIM_UART1ICR); 49 writeb(MCFSIM_ICR_LEVEL6 | MCFSIM_ICR_PRI1, MCF_MBAR + MCFSIM_UART1ICR);
50 writeb(irq, MCF_MBAR + MCFUART_BASE1 + MCFUART_UIVR); 50 writeb(irq, MCF_MBAR + MCFUART_BASE1 + MCFUART_UIVR);
51 mcf_setimr(mcf_getimr() & ~MCFSIM_IMR_UART1); 51 mcf_mapirq2imr(irq, MCFINTC_UART0);
52 } else if (line == 1) { 52 } else if (line == 1) {
53 writeb(MCFSIM_ICR_LEVEL6 | MCFSIM_ICR_PRI2, MCF_MBAR + MCFSIM_UART2ICR); 53 writeb(MCFSIM_ICR_LEVEL6 | MCFSIM_ICR_PRI2, MCF_MBAR + MCFSIM_UART2ICR);
54 writeb(irq, MCF_MBAR + MCFUART_BASE2 + MCFUART_UIVR); 54 writeb(irq, MCF_MBAR + MCFUART_BASE2 + MCFUART_UIVR);
55 mcf_setimr(mcf_getimr() & ~MCFSIM_IMR_UART2); 55 mcf_mapirq2imr(irq, MCFINTC_UART1);
56 } 56 }
57} 57}
58 58
@@ -65,38 +65,21 @@ static void __init m5249_uarts_init(void)
65 m5249_uart_init_line(line, m5249_uart_platform[line].irq); 65 m5249_uart_init_line(line, m5249_uart_platform[line].irq);
66} 66}
67 67
68
69/***************************************************************************/ 68/***************************************************************************/
70 69
71void mcf_autovector(unsigned int vec) 70static void __init m5249_timers_init(void)
72{ 71{
73 volatile unsigned char *mbar; 72 /* Timer1 is always used as system timer */
74 73 writeb(MCFSIM_ICR_AUTOVEC | MCFSIM_ICR_LEVEL6 | MCFSIM_ICR_PRI3,
75 if ((vec >= 25) && (vec <= 31)) { 74 MCF_MBAR + MCFSIM_TIMER1ICR);
76 mbar = (volatile unsigned char *) MCF_MBAR; 75 mcf_mapirq2imr(MCF_IRQ_TIMER, MCFINTC_TIMER1);
77 vec = 0x1 << (vec - 24); 76
78 *(mbar + MCFSIM_AVR) |= vec; 77#ifdef CONFIG_HIGHPROFILE
79 mcf_setimr(mcf_getimr() & ~vec); 78 /* Timer2 is to be used as a high speed profile timer */
80 } 79 writeb(MCFSIM_ICR_AUTOVEC | MCFSIM_ICR_LEVEL7 | MCFSIM_ICR_PRI3,
81} 80 MCF_MBAR + MCFSIM_TIMER2ICR);
82 81 mcf_mapirq2imr(MCF_IRQ_PROFILER, MCFINTC_TIMER2);
83/***************************************************************************/ 82#endif
84
85void mcf_settimericr(unsigned int timer, unsigned int level)
86{
87 volatile unsigned char *icrp;
88 unsigned int icr, imr;
89
90 if (timer <= 2) {
91 switch (timer) {
92 case 2: icr = MCFSIM_TIMER2ICR; imr = MCFSIM_IMR_TIMER2; break;
93 default: icr = MCFSIM_TIMER1ICR; imr = MCFSIM_IMR_TIMER1; break;
94 }
95
96 icrp = (volatile unsigned char *) (MCF_MBAR + icr);
97 *icrp = MCFSIM_ICR_AUTOVEC | (level << 2) | MCFSIM_ICR_PRI3;
98 mcf_setimr(mcf_getimr() & ~imr);
99 }
100} 83}
101 84
102/***************************************************************************/ 85/***************************************************************************/
@@ -114,15 +97,15 @@ void m5249_cpu_reset(void)
114 97
115void __init config_BSP(char *commandp, int size) 98void __init config_BSP(char *commandp, int size)
116{ 99{
117 mcf_setimr(MCFSIM_IMR_MASKALL);
118 mach_reset = m5249_cpu_reset; 100 mach_reset = m5249_cpu_reset;
101 m5249_timers_init();
102 m5249_uarts_init();
119} 103}
120 104
121/***************************************************************************/ 105/***************************************************************************/
122 106
123static int __init init_BSP(void) 107static int __init init_BSP(void)
124{ 108{
125 m5249_uarts_init();
126 platform_add_devices(m5249_devices, ARRAY_SIZE(m5249_devices)); 109 platform_add_devices(m5249_devices, ARRAY_SIZE(m5249_devices));
127 return 0; 110 return 0;
128} 111}
diff --git a/arch/m68knommu/platform/5249/gpio.c b/arch/m68knommu/platform/5249/gpio.c
new file mode 100644
index 000000000000..c611eab8b3b6
--- /dev/null
+++ b/arch/m68knommu/platform/5249/gpio.c
@@ -0,0 +1,65 @@
1/*
2 * Coldfire generic GPIO support
3 *
4 * (C) Copyright 2009, Steven King <sfking@fdwdc.com>
5 *
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
8 * the Free Software Foundation; version 2 of the License.
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
16#include <linux/kernel.h>
17#include <linux/init.h>
18
19#include <asm/coldfire.h>
20#include <asm/mcfsim.h>
21#include <asm/mcfgpio.h>
22
23static struct mcf_gpio_chip mcf_gpio_chips[] = {
24 {
25 .gpio_chip = {
26 .label = "GPIO0",
27 .request = mcf_gpio_request,
28 .free = mcf_gpio_free,
29 .direction_input = mcf_gpio_direction_input,
30 .direction_output = mcf_gpio_direction_output,
31 .get = mcf_gpio_get_value,
32 .set = mcf_gpio_set_value,
33 .ngpio = 32,
34 },
35 .pddr = MCFSIM2_GPIOENABLE,
36 .podr = MCFSIM2_GPIOWRITE,
37 .ppdr = MCFSIM2_GPIOREAD,
38 },
39 {
40 .gpio_chip = {
41 .label = "GPIO1",
42 .request = mcf_gpio_request,
43 .free = mcf_gpio_free,
44 .direction_input = mcf_gpio_direction_input,
45 .direction_output = mcf_gpio_direction_output,
46 .get = mcf_gpio_get_value,
47 .set = mcf_gpio_set_value,
48 .base = 32,
49 .ngpio = 32,
50 },
51 .pddr = MCFSIM2_GPIO1ENABLE,
52 .podr = MCFSIM2_GPIO1WRITE,
53 .ppdr = MCFSIM2_GPIO1READ,
54 },
55};
56
57static int __init mcf_gpio_init(void)
58{
59 unsigned i = 0;
60 while (i < ARRAY_SIZE(mcf_gpio_chips))
61 (void)gpiochip_add((struct gpio_chip *)&mcf_gpio_chips[i++]);
62 return 0;
63}
64
65core_initcall(mcf_gpio_init);
diff --git a/arch/m68knommu/platform/5249/intc2.c b/arch/m68knommu/platform/5249/intc2.c
new file mode 100644
index 000000000000..d09d9da04537
--- /dev/null
+++ b/arch/m68knommu/platform/5249/intc2.c
@@ -0,0 +1,59 @@
1/*
2 * intc2.c -- support for the 2nd INTC controller of the 5249
3 *
4 * (C) Copyright 2009, Greg Ungerer <gerg@snapgear.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#include <linux/types.h>
12#include <linux/init.h>
13#include <linux/kernel.h>
14#include <linux/interrupt.h>
15#include <linux/irq.h>
16#include <linux/io.h>
17#include <asm/coldfire.h>
18#include <asm/mcfsim.h>
19
20static void intc2_irq_gpio_mask(unsigned int irq)
21{
22 u32 imr;
23 imr = readl(MCF_MBAR2 + MCFSIM2_GPIOINTENABLE);
24 imr &= ~(0x1 << (irq - MCFINTC2_GPIOIRQ0));
25 writel(imr, MCF_MBAR2 + MCFSIM2_GPIOINTENABLE);
26}
27
28static void intc2_irq_gpio_unmask(unsigned int irq)
29{
30 u32 imr;
31 imr = readl(MCF_MBAR2 + MCFSIM2_GPIOINTENABLE);
32 imr |= (0x1 << (irq - MCFINTC2_GPIOIRQ0));
33 writel(imr, MCF_MBAR2 + MCFSIM2_GPIOINTENABLE);
34}
35
36static void intc2_irq_gpio_ack(unsigned int irq)
37{
38 writel(0x1 << (irq - MCFINTC2_GPIOIRQ0), MCF_MBAR2 + MCFSIM2_GPIOINTCLEAR);
39}
40
41static struct irq_chip intc2_irq_gpio_chip = {
42 .name = "CF-INTC2",
43 .mask = intc2_irq_gpio_mask,
44 .unmask = intc2_irq_gpio_unmask,
45 .ack = intc2_irq_gpio_ack,
46};
47
48static int __init mcf_intc2_init(void)
49{
50 int irq;
51
52 /* GPIO interrupt sources */
53 for (irq = MCFINTC2_GPIOIRQ0; (irq <= MCFINTC2_GPIOIRQ7); irq++)
54 irq_desc[irq].chip = &intc2_irq_gpio_chip;
55
56 return 0;
57}
58
59arch_initcall(mcf_intc2_init);
diff --git a/arch/m68knommu/platform/5272/Makefile b/arch/m68knommu/platform/5272/Makefile
index 26135d92b34d..93673ef8e2c1 100644
--- a/arch/m68knommu/platform/5272/Makefile
+++ b/arch/m68knommu/platform/5272/Makefile
@@ -14,5 +14,5 @@
14 14
15asflags-$(CONFIG_FULLDEBUG) := -DDEBUGGER_COMPATIBLE_CACHE=1 15asflags-$(CONFIG_FULLDEBUG) := -DDEBUGGER_COMPATIBLE_CACHE=1
16 16
17obj-y := config.o 17obj-y := config.o gpio.o intc.o
18 18
diff --git a/arch/m68knommu/platform/5272/config.c b/arch/m68knommu/platform/5272/config.c
index 5f95fcde05fd..59278c0887d0 100644
--- a/arch/m68knommu/platform/5272/config.c
+++ b/arch/m68knommu/platform/5272/config.c
@@ -20,12 +20,6 @@
20 20
21/***************************************************************************/ 21/***************************************************************************/
22 22
23extern unsigned int mcf_timervector;
24extern unsigned int mcf_profilevector;
25extern unsigned int mcf_timerlevel;
26
27/***************************************************************************/
28
29/* 23/*
30 * Some platforms need software versions of the GPIO data registers. 24 * Some platforms need software versions of the GPIO data registers.
31 */ 25 */
@@ -37,11 +31,11 @@ unsigned char ledbank = 0xff;
37static struct mcf_platform_uart m5272_uart_platform[] = { 31static struct mcf_platform_uart m5272_uart_platform[] = {
38 { 32 {
39 .mapbase = MCF_MBAR + MCFUART_BASE1, 33 .mapbase = MCF_MBAR + MCFUART_BASE1,
40 .irq = 73, 34 .irq = MCF_IRQ_UART1,
41 }, 35 },
42 { 36 {
43 .mapbase = MCF_MBAR + MCFUART_BASE2, 37 .mapbase = MCF_MBAR + MCFUART_BASE2,
44 .irq = 74, 38 .irq = MCF_IRQ_UART2,
45 }, 39 },
46 { }, 40 { },
47}; 41};
@@ -59,18 +53,18 @@ static struct resource m5272_fec_resources[] = {
59 .flags = IORESOURCE_MEM, 53 .flags = IORESOURCE_MEM,
60 }, 54 },
61 { 55 {
62 .start = 86, 56 .start = MCF_IRQ_ERX,
63 .end = 86, 57 .end = MCF_IRQ_ERX,
64 .flags = IORESOURCE_IRQ, 58 .flags = IORESOURCE_IRQ,
65 }, 59 },
66 { 60 {
67 .start = 87, 61 .start = MCF_IRQ_ETX,
68 .end = 87, 62 .end = MCF_IRQ_ETX,
69 .flags = IORESOURCE_IRQ, 63 .flags = IORESOURCE_IRQ,
70 }, 64 },
71 { 65 {
72 .start = 88, 66 .start = MCF_IRQ_ENTC,
73 .end = 88, 67 .end = MCF_IRQ_ENTC,
74 .flags = IORESOURCE_IRQ, 68 .flags = IORESOURCE_IRQ,
75 }, 69 },
76}; 70};
@@ -94,9 +88,6 @@ static void __init m5272_uart_init_line(int line, int irq)
94 u32 v; 88 u32 v;
95 89
96 if ((line >= 0) && (line < 2)) { 90 if ((line >= 0) && (line < 2)) {
97 v = (line) ? 0x0e000000 : 0xe0000000;
98 writel(v, MCF_MBAR + MCFSIM_ICR2);
99
100 /* Enable the output lines for the serial ports */ 91 /* Enable the output lines for the serial ports */
101 v = readl(MCF_MBAR + MCFSIM_PBCNT); 92 v = readl(MCF_MBAR + MCFSIM_PBCNT);
102 v = (v & ~0x000000ff) | 0x00000055; 93 v = (v & ~0x000000ff) | 0x00000055;
@@ -119,54 +110,6 @@ static void __init m5272_uarts_init(void)
119 110
120/***************************************************************************/ 111/***************************************************************************/
121 112
122static void __init m5272_fec_init(void)
123{
124 u32 imr;
125
126 /* Unmask FEC interrupts at ColdFire interrupt controller */
127 imr = readl(MCF_MBAR + MCFSIM_ICR3);
128 imr = (imr & ~0x00000fff) | 0x00000ddd;
129 writel(imr, MCF_MBAR + MCFSIM_ICR3);
130
131 imr = readl(MCF_MBAR + MCFSIM_ICR1);
132 imr = (imr & ~0x0f000000) | 0x0d000000;
133 writel(imr, MCF_MBAR + MCFSIM_ICR1);
134}
135
136/***************************************************************************/
137
138void mcf_disableall(void)
139{
140 volatile unsigned long *icrp;
141
142 icrp = (volatile unsigned long *) (MCF_MBAR + MCFSIM_ICR1);
143 icrp[0] = 0x88888888;
144 icrp[1] = 0x88888888;
145 icrp[2] = 0x88888888;
146 icrp[3] = 0x88888888;
147}
148
149/***************************************************************************/
150
151void mcf_autovector(unsigned int vec)
152{
153 /* Everything is auto-vectored on the 5272 */
154}
155
156/***************************************************************************/
157
158void mcf_settimericr(int timer, int level)
159{
160 volatile unsigned long *icrp;
161
162 if ((timer >= 1 ) && (timer <= 4)) {
163 icrp = (volatile unsigned long *) (MCF_MBAR + MCFSIM_ICR1);
164 *icrp = (0x8 | level) << ((4 - timer) * 4);
165 }
166}
167
168/***************************************************************************/
169
170static void m5272_cpu_reset(void) 113static void m5272_cpu_reset(void)
171{ 114{
172 local_irq_disable(); 115 local_irq_disable();
@@ -190,8 +133,6 @@ void __init config_BSP(char *commandp, int size)
190 *pivrp = 0x40; 133 *pivrp = 0x40;
191#endif 134#endif
192 135
193 mcf_disableall();
194
195#if defined(CONFIG_NETtel) || defined(CONFIG_SCALES) 136#if defined(CONFIG_NETtel) || defined(CONFIG_SCALES)
196 /* Copy command line from FLASH to local buffer... */ 137 /* Copy command line from FLASH to local buffer... */
197 memcpy(commandp, (char *) 0xf0004000, size); 138 memcpy(commandp, (char *) 0xf0004000, size);
@@ -202,8 +143,6 @@ void __init config_BSP(char *commandp, int size)
202 commandp[size-1] = 0; 143 commandp[size-1] = 0;
203#endif 144#endif
204 145
205 mcf_timervector = 69;
206 mcf_profilevector = 70;
207 mach_reset = m5272_cpu_reset; 146 mach_reset = m5272_cpu_reset;
208} 147}
209 148
@@ -212,7 +151,6 @@ void __init config_BSP(char *commandp, int size)
212static int __init init_BSP(void) 151static int __init init_BSP(void)
213{ 152{
214 m5272_uarts_init(); 153 m5272_uarts_init();
215 m5272_fec_init();
216 platform_add_devices(m5272_devices, ARRAY_SIZE(m5272_devices)); 154 platform_add_devices(m5272_devices, ARRAY_SIZE(m5272_devices));
217 return 0; 155 return 0;
218} 156}
diff --git a/arch/m68knommu/platform/5272/gpio.c b/arch/m68knommu/platform/5272/gpio.c
new file mode 100644
index 000000000000..459db89a89cc
--- /dev/null
+++ b/arch/m68knommu/platform/5272/gpio.c
@@ -0,0 +1,81 @@
1/*
2 * Coldfire generic GPIO support
3 *
4 * (C) Copyright 2009, Steven King <sfking@fdwdc.com>
5 *
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
8 * the Free Software Foundation; version 2 of the License.
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
16#include <linux/kernel.h>
17#include <linux/init.h>
18
19#include <asm/coldfire.h>
20#include <asm/mcfsim.h>
21#include <asm/mcfgpio.h>
22
23static struct mcf_gpio_chip mcf_gpio_chips[] = {
24 {
25 .gpio_chip = {
26 .label = "PA",
27 .request = mcf_gpio_request,
28 .free = mcf_gpio_free,
29 .direction_input = mcf_gpio_direction_input,
30 .direction_output = mcf_gpio_direction_output,
31 .get = mcf_gpio_get_value,
32 .set = mcf_gpio_set_value,
33 .ngpio = 16,
34 },
35 .pddr = MCFSIM_PADDR,
36 .podr = MCFSIM_PADAT,
37 .ppdr = MCFSIM_PADAT,
38 },
39 {
40 .gpio_chip = {
41 .label = "PB",
42 .request = mcf_gpio_request,
43 .free = mcf_gpio_free,
44 .direction_input = mcf_gpio_direction_input,
45 .direction_output = mcf_gpio_direction_output,
46 .get = mcf_gpio_get_value,
47 .set = mcf_gpio_set_value,
48 .base = 16,
49 .ngpio = 16,
50 },
51 .pddr = MCFSIM_PBDDR,
52 .podr = MCFSIM_PBDAT,
53 .ppdr = MCFSIM_PBDAT,
54 },
55 {
56 .gpio_chip = {
57 .label = "PC",
58 .request = mcf_gpio_request,
59 .free = mcf_gpio_free,
60 .direction_input = mcf_gpio_direction_input,
61 .direction_output = mcf_gpio_direction_output,
62 .get = mcf_gpio_get_value,
63 .set = mcf_gpio_set_value,
64 .base = 32,
65 .ngpio = 16,
66 },
67 .pddr = MCFSIM_PCDDR,
68 .podr = MCFSIM_PCDAT,
69 .ppdr = MCFSIM_PCDAT,
70 },
71};
72
73static int __init mcf_gpio_init(void)
74{
75 unsigned i = 0;
76 while (i < ARRAY_SIZE(mcf_gpio_chips))
77 (void)gpiochip_add((struct gpio_chip *)&mcf_gpio_chips[i++]);
78 return 0;
79}
80
81core_initcall(mcf_gpio_init);
diff --git a/arch/m68knommu/platform/5272/intc.c b/arch/m68knommu/platform/5272/intc.c
new file mode 100644
index 000000000000..7081e0a9720e
--- /dev/null
+++ b/arch/m68knommu/platform/5272/intc.c
@@ -0,0 +1,138 @@
1/*
2 * intc.c -- interrupt controller or ColdFire 5272 SoC
3 *
4 * (C) Copyright 2009, Greg Ungerer <gerg@snapgear.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#include <linux/types.h>
12#include <linux/init.h>
13#include <linux/kernel.h>
14#include <linux/interrupt.h>
15#include <linux/irq.h>
16#include <linux/io.h>
17#include <asm/coldfire.h>
18#include <asm/mcfsim.h>
19#include <asm/traps.h>
20
21/*
22 * The 5272 ColdFire interrupt controller is nothing like any other
23 * ColdFire interrupt controller - it truly is completely different.
24 * Given its age it is unlikely to be used on any other ColdFire CPU.
25 */
26
27/*
28 * The masking and priproty setting of interrupts on the 5272 is done
29 * via a set of 4 "Interrupt Controller Registers" (ICR). There is a
30 * loose mapping of vector number to register and internal bits, but
31 * a table is the easiest and quickest way to map them.
32 */
33struct irqmap {
34 unsigned char icr;
35 unsigned char index;
36 unsigned char ack;
37};
38
39static struct irqmap intc_irqmap[MCFINT_VECMAX - MCFINT_VECBASE] = {
40 /*MCF_IRQ_SPURIOUS*/ { .icr = 0, .index = 0, .ack = 0, },
41 /*MCF_IRQ_EINT1*/ { .icr = MCFSIM_ICR1, .index = 28, .ack = 1, },
42 /*MCF_IRQ_EINT2*/ { .icr = MCFSIM_ICR1, .index = 24, .ack = 1, },
43 /*MCF_IRQ_EINT3*/ { .icr = MCFSIM_ICR1, .index = 20, .ack = 1, },
44 /*MCF_IRQ_EINT4*/ { .icr = MCFSIM_ICR1, .index = 16, .ack = 1, },
45 /*MCF_IRQ_TIMER1*/ { .icr = MCFSIM_ICR1, .index = 12, .ack = 0, },
46 /*MCF_IRQ_TIMER2*/ { .icr = MCFSIM_ICR1, .index = 8, .ack = 0, },
47 /*MCF_IRQ_TIMER3*/ { .icr = MCFSIM_ICR1, .index = 4, .ack = 0, },
48 /*MCF_IRQ_TIMER4*/ { .icr = MCFSIM_ICR1, .index = 0, .ack = 0, },
49 /*MCF_IRQ_UART1*/ { .icr = MCFSIM_ICR2, .index = 28, .ack = 0, },
50 /*MCF_IRQ_UART2*/ { .icr = MCFSIM_ICR2, .index = 24, .ack = 0, },
51 /*MCF_IRQ_PLIP*/ { .icr = MCFSIM_ICR2, .index = 20, .ack = 0, },
52 /*MCF_IRQ_PLIA*/ { .icr = MCFSIM_ICR2, .index = 16, .ack = 0, },
53 /*MCF_IRQ_USB0*/ { .icr = MCFSIM_ICR2, .index = 12, .ack = 0, },
54 /*MCF_IRQ_USB1*/ { .icr = MCFSIM_ICR2, .index = 8, .ack = 0, },
55 /*MCF_IRQ_USB2*/ { .icr = MCFSIM_ICR2, .index = 4, .ack = 0, },
56 /*MCF_IRQ_USB3*/ { .icr = MCFSIM_ICR2, .index = 0, .ack = 0, },
57 /*MCF_IRQ_USB4*/ { .icr = MCFSIM_ICR3, .index = 28, .ack = 0, },
58 /*MCF_IRQ_USB5*/ { .icr = MCFSIM_ICR3, .index = 24, .ack = 0, },
59 /*MCF_IRQ_USB6*/ { .icr = MCFSIM_ICR3, .index = 20, .ack = 0, },
60 /*MCF_IRQ_USB7*/ { .icr = MCFSIM_ICR3, .index = 16, .ack = 0, },
61 /*MCF_IRQ_DMA*/ { .icr = MCFSIM_ICR3, .index = 12, .ack = 0, },
62 /*MCF_IRQ_ERX*/ { .icr = MCFSIM_ICR3, .index = 8, .ack = 0, },
63 /*MCF_IRQ_ETX*/ { .icr = MCFSIM_ICR3, .index = 4, .ack = 0, },
64 /*MCF_IRQ_ENTC*/ { .icr = MCFSIM_ICR3, .index = 0, .ack = 0, },
65 /*MCF_IRQ_QSPI*/ { .icr = MCFSIM_ICR4, .index = 28, .ack = 0, },
66 /*MCF_IRQ_EINT5*/ { .icr = MCFSIM_ICR4, .index = 24, .ack = 1, },
67 /*MCF_IRQ_EINT6*/ { .icr = MCFSIM_ICR4, .index = 20, .ack = 1, },
68 /*MCF_IRQ_SWTO*/ { .icr = MCFSIM_ICR4, .index = 16, .ack = 0, },
69};
70
71static void intc_irq_mask(unsigned int irq)
72{
73 if ((irq >= MCFINT_VECBASE) && (irq <= MCFINT_VECMAX)) {
74 u32 v;
75 irq -= MCFINT_VECBASE;
76 v = 0x8 << intc_irqmap[irq].index;
77 writel(v, MCF_MBAR + intc_irqmap[irq].icr);
78 }
79}
80
81static void intc_irq_unmask(unsigned int irq)
82{
83 if ((irq >= MCFINT_VECBASE) && (irq <= MCFINT_VECMAX)) {
84 u32 v;
85 irq -= MCFINT_VECBASE;
86 v = 0xd << intc_irqmap[irq].index;
87 writel(v, MCF_MBAR + intc_irqmap[irq].icr);
88 }
89}
90
91static void intc_irq_ack(unsigned int irq)
92{
93 /* Only external interrupts are acked */
94 if ((irq >= MCFINT_VECBASE) && (irq <= MCFINT_VECMAX)) {
95 irq -= MCFINT_VECBASE;
96 if (intc_irqmap[irq].ack) {
97 u32 v;
98 v = 0xd << intc_irqmap[irq].index;
99 writel(v, MCF_MBAR + intc_irqmap[irq].icr);
100 }
101 }
102}
103
104static int intc_irq_set_type(unsigned int irq, unsigned int type)
105{
106 /* We can set the edge type here for external interrupts */
107 return 0;
108}
109
110static struct irq_chip intc_irq_chip = {
111 .name = "CF-INTC",
112 .mask = intc_irq_mask,
113 .unmask = intc_irq_unmask,
114 .ack = intc_irq_ack,
115 .set_type = intc_irq_set_type,
116};
117
118void __init init_IRQ(void)
119{
120 int irq;
121
122 init_vectors();
123
124 /* Mask all interrupt sources */
125 writel(0x88888888, MCF_MBAR + MCFSIM_ICR1);
126 writel(0x88888888, MCF_MBAR + MCFSIM_ICR2);
127 writel(0x88888888, MCF_MBAR + MCFSIM_ICR3);
128 writel(0x88888888, MCF_MBAR + MCFSIM_ICR4);
129
130 for (irq = 0; (irq < NR_IRQS); irq++) {
131 irq_desc[irq].status = IRQ_DISABLED;
132 irq_desc[irq].action = NULL;
133 irq_desc[irq].depth = 1;
134 irq_desc[irq].chip = &intc_irq_chip;
135 intc_irq_set_type(irq, 0);
136 }
137}
138
diff --git a/arch/m68knommu/platform/527x/Makefile b/arch/m68knommu/platform/527x/Makefile
index 26135d92b34d..3d90e6d92459 100644
--- a/arch/m68knommu/platform/527x/Makefile
+++ b/arch/m68knommu/platform/527x/Makefile
@@ -14,5 +14,5 @@
14 14
15asflags-$(CONFIG_FULLDEBUG) := -DDEBUGGER_COMPATIBLE_CACHE=1 15asflags-$(CONFIG_FULLDEBUG) := -DDEBUGGER_COMPATIBLE_CACHE=1
16 16
17obj-y := config.o 17obj-y := config.o gpio.o
18 18
diff --git a/arch/m68knommu/platform/527x/config.c b/arch/m68knommu/platform/527x/config.c
index f746439cfd3e..fa51be172830 100644
--- a/arch/m68knommu/platform/527x/config.c
+++ b/arch/m68knommu/platform/527x/config.c
@@ -116,23 +116,13 @@ static struct platform_device *m527x_devices[] __initdata = {
116 116
117/***************************************************************************/ 117/***************************************************************************/
118 118
119#define INTC0 (MCF_MBAR + MCFICM_INTC0)
120
121static void __init m527x_uart_init_line(int line, int irq) 119static void __init m527x_uart_init_line(int line, int irq)
122{ 120{
123 u16 sepmask; 121 u16 sepmask;
124 u32 imr;
125 122
126 if ((line < 0) || (line > 2)) 123 if ((line < 0) || (line > 2))
127 return; 124 return;
128 125
129 /* level 6, line based priority */
130 writeb(0x30+line, INTC0 + MCFINTC_ICR0 + MCFINT_UART0 + line);
131
132 imr = readl(INTC0 + MCFINTC_IMRL);
133 imr &= ~((1 << (irq - MCFINT_VECBASE)) | 1);
134 writel(imr, INTC0 + MCFINTC_IMRL);
135
136 /* 126 /*
137 * External Pin Mask Setting & Enable External Pin for Interface 127 * External Pin Mask Setting & Enable External Pin for Interface
138 */ 128 */
@@ -157,32 +147,11 @@ static void __init m527x_uarts_init(void)
157 147
158/***************************************************************************/ 148/***************************************************************************/
159 149
160static void __init m527x_fec_irq_init(int nr)
161{
162 unsigned long base;
163 u32 imr;
164
165 base = MCF_IPSBAR + (nr ? MCFICM_INTC1 : MCFICM_INTC0);
166
167 writeb(0x28, base + MCFINTC_ICR0 + 23);
168 writeb(0x27, base + MCFINTC_ICR0 + 27);
169 writeb(0x26, base + MCFINTC_ICR0 + 29);
170
171 imr = readl(base + MCFINTC_IMRH);
172 imr &= ~0xf;
173 writel(imr, base + MCFINTC_IMRH);
174 imr = readl(base + MCFINTC_IMRL);
175 imr &= ~0xff800001;
176 writel(imr, base + MCFINTC_IMRL);
177}
178
179static void __init m527x_fec_init(void) 150static void __init m527x_fec_init(void)
180{ 151{
181 u16 par; 152 u16 par;
182 u8 v; 153 u8 v;
183 154
184 m527x_fec_irq_init(0);
185
186 /* Set multi-function pins to ethernet mode for fec0 */ 155 /* Set multi-function pins to ethernet mode for fec0 */
187#if defined(CONFIG_M5271) 156#if defined(CONFIG_M5271)
188 v = readb(MCF_IPSBAR + 0x100047); 157 v = readb(MCF_IPSBAR + 0x100047);
@@ -195,8 +164,6 @@ static void __init m527x_fec_init(void)
195#endif 164#endif
196 165
197#ifdef CONFIG_FEC2 166#ifdef CONFIG_FEC2
198 m527x_fec_irq_init(1);
199
200 /* Set multi-function pins to ethernet mode for fec1 */ 167 /* Set multi-function pins to ethernet mode for fec1 */
201 par = readw(MCF_IPSBAR + 0x100082); 168 par = readw(MCF_IPSBAR + 0x100082);
202 writew(par | 0xa0, MCF_IPSBAR + 0x100082); 169 writew(par | 0xa0, MCF_IPSBAR + 0x100082);
@@ -207,21 +174,6 @@ static void __init m527x_fec_init(void)
207 174
208/***************************************************************************/ 175/***************************************************************************/
209 176
210void mcf_disableall(void)
211{
212 *((volatile unsigned long *) (MCF_IPSBAR + MCFICM_INTC0 + MCFINTC_IMRH)) = 0xffffffff;
213 *((volatile unsigned long *) (MCF_IPSBAR + MCFICM_INTC0 + MCFINTC_IMRL)) = 0xffffffff;
214}
215
216/***************************************************************************/
217
218void mcf_autovector(unsigned int vec)
219{
220 /* Everything is auto-vectored on the 5272 */
221}
222
223/***************************************************************************/
224
225static void m527x_cpu_reset(void) 177static void m527x_cpu_reset(void)
226{ 178{
227 local_irq_disable(); 179 local_irq_disable();
@@ -232,7 +184,6 @@ static void m527x_cpu_reset(void)
232 184
233void __init config_BSP(char *commandp, int size) 185void __init config_BSP(char *commandp, int size)
234{ 186{
235 mcf_disableall();
236 mach_reset = m527x_cpu_reset; 187 mach_reset = m527x_cpu_reset;
237 m527x_uarts_init(); 188 m527x_uarts_init();
238 m527x_fec_init(); 189 m527x_fec_init();
diff --git a/arch/m68knommu/platform/527x/gpio.c b/arch/m68knommu/platform/527x/gpio.c
new file mode 100644
index 000000000000..1028142851ac
--- /dev/null
+++ b/arch/m68knommu/platform/527x/gpio.c
@@ -0,0 +1,607 @@
1/*
2 * Coldfire generic GPIO support
3 *
4 * (C) Copyright 2009, Steven King <sfking@fdwdc.com>
5 *
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
8 * the Free Software Foundation; version 2 of the License.
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
16#include <linux/kernel.h>
17#include <linux/init.h>
18
19#include <asm/coldfire.h>
20#include <asm/mcfsim.h>
21#include <asm/mcfgpio.h>
22
23static struct mcf_gpio_chip mcf_gpio_chips[] = {
24#if defined(CONFIG_M5271)
25 {
26 .gpio_chip = {
27 .label = "PIRQ",
28 .request = mcf_gpio_request,
29 .free = mcf_gpio_free,
30 .direction_input = mcf_gpio_direction_input,
31 .direction_output = mcf_gpio_direction_output,
32 .get = mcf_gpio_get_value,
33 .set = mcf_gpio_set_value,
34 .ngpio = 8,
35 },
36 .pddr = MCFEPORT_EPDDR,
37 .podr = MCFEPORT_EPDR,
38 .ppdr = MCFEPORT_EPPDR,
39 },
40 {
41 .gpio_chip = {
42 .label = "ADDR",
43 .request = mcf_gpio_request,
44 .free = mcf_gpio_free,
45 .direction_input = mcf_gpio_direction_input,
46 .direction_output = mcf_gpio_direction_output,
47 .get = mcf_gpio_get_value,
48 .set = mcf_gpio_set_value_fast,
49 .base = 13,
50 .ngpio = 3,
51 },
52 .pddr = MCFGPIO_PDDR_ADDR,
53 .podr = MCFGPIO_PODR_ADDR,
54 .ppdr = MCFGPIO_PPDSDR_ADDR,
55 .setr = MCFGPIO_PPDSDR_ADDR,
56 .clrr = MCFGPIO_PCLRR_ADDR,
57 },
58 {
59 .gpio_chip = {
60 .label = "DATAH",
61 .request = mcf_gpio_request,
62 .free = mcf_gpio_free,
63 .direction_input = mcf_gpio_direction_input,
64 .direction_output = mcf_gpio_direction_output,
65 .get = mcf_gpio_get_value,
66 .set = mcf_gpio_set_value_fast,
67 .base = 16,
68 .ngpio = 8,
69 },
70 .pddr = MCFGPIO_PDDR_DATAH,
71 .podr = MCFGPIO_PODR_DATAH,
72 .ppdr = MCFGPIO_PPDSDR_DATAH,
73 .setr = MCFGPIO_PPDSDR_DATAH,
74 .clrr = MCFGPIO_PCLRR_DATAH,
75 },
76 {
77 .gpio_chip = {
78 .label = "DATAL",
79 .request = mcf_gpio_request,
80 .free = mcf_gpio_free,
81 .direction_input = mcf_gpio_direction_input,
82 .direction_output = mcf_gpio_direction_output,
83 .get = mcf_gpio_get_value,
84 .set = mcf_gpio_set_value_fast,
85 .base = 24,
86 .ngpio = 8,
87 },
88 .pddr = MCFGPIO_PDDR_DATAL,
89 .podr = MCFGPIO_PODR_DATAL,
90 .ppdr = MCFGPIO_PPDSDR_DATAL,
91 .setr = MCFGPIO_PPDSDR_DATAL,
92 .clrr = MCFGPIO_PCLRR_DATAL,
93 },
94 {
95 .gpio_chip = {
96 .label = "BUSCTL",
97 .request = mcf_gpio_request,
98 .free = mcf_gpio_free,
99 .direction_input = mcf_gpio_direction_input,
100 .direction_output = mcf_gpio_direction_output,
101 .get = mcf_gpio_get_value,
102 .set = mcf_gpio_set_value_fast,
103 .base = 32,
104 .ngpio = 8,
105 },
106 .pddr = MCFGPIO_PDDR_BUSCTL,
107 .podr = MCFGPIO_PODR_BUSCTL,
108 .ppdr = MCFGPIO_PPDSDR_BUSCTL,
109 .setr = MCFGPIO_PPDSDR_BUSCTL,
110 .clrr = MCFGPIO_PCLRR_BUSCTL,
111 },
112 {
113 .gpio_chip = {
114 .label = "BS",
115 .request = mcf_gpio_request,
116 .free = mcf_gpio_free,
117 .direction_input = mcf_gpio_direction_input,
118 .direction_output = mcf_gpio_direction_output,
119 .get = mcf_gpio_get_value,
120 .set = mcf_gpio_set_value_fast,
121 .base = 40,
122 .ngpio = 4,
123 },
124 .pddr = MCFGPIO_PDDR_BS,
125 .podr = MCFGPIO_PODR_BS,
126 .ppdr = MCFGPIO_PPDSDR_BS,
127 .setr = MCFGPIO_PPDSDR_BS,
128 .clrr = MCFGPIO_PCLRR_BS,
129 },
130 {
131 .gpio_chip = {
132 .label = "CS",
133 .request = mcf_gpio_request,
134 .free = mcf_gpio_free,
135 .direction_input = mcf_gpio_direction_input,
136 .direction_output = mcf_gpio_direction_output,
137 .get = mcf_gpio_get_value,
138 .set = mcf_gpio_set_value_fast,
139 .base = 49,
140 .ngpio = 7,
141 },
142 .pddr = MCFGPIO_PDDR_CS,
143 .podr = MCFGPIO_PODR_CS,
144 .ppdr = MCFGPIO_PPDSDR_CS,
145 .setr = MCFGPIO_PPDSDR_CS,
146 .clrr = MCFGPIO_PCLRR_CS,
147 },
148 {
149 .gpio_chip = {
150 .label = "SDRAM",
151 .request = mcf_gpio_request,
152 .free = mcf_gpio_free,
153 .direction_input = mcf_gpio_direction_input,
154 .direction_output = mcf_gpio_direction_output,
155 .get = mcf_gpio_get_value,
156 .set = mcf_gpio_set_value_fast,
157 .base = 56,
158 .ngpio = 6,
159 },
160 .pddr = MCFGPIO_PDDR_SDRAM,
161 .podr = MCFGPIO_PODR_SDRAM,
162 .ppdr = MCFGPIO_PPDSDR_SDRAM,
163 .setr = MCFGPIO_PPDSDR_SDRAM,
164 .clrr = MCFGPIO_PCLRR_SDRAM,
165 },
166 {
167 .gpio_chip = {
168 .label = "FECI2C",
169 .request = mcf_gpio_request,
170 .free = mcf_gpio_free,
171 .direction_input = mcf_gpio_direction_input,
172 .direction_output = mcf_gpio_direction_output,
173 .get = mcf_gpio_get_value,
174 .set = mcf_gpio_set_value_fast,
175 .base = 64,
176 .ngpio = 4,
177 },
178 .pddr = MCFGPIO_PDDR_FECI2C,
179 .podr = MCFGPIO_PODR_FECI2C,
180 .ppdr = MCFGPIO_PPDSDR_FECI2C,
181 .setr = MCFGPIO_PPDSDR_FECI2C,
182 .clrr = MCFGPIO_PCLRR_FECI2C,
183 },
184 {
185 .gpio_chip = {
186 .label = "UARTH",
187 .request = mcf_gpio_request,
188 .free = mcf_gpio_free,
189 .direction_input = mcf_gpio_direction_input,
190 .direction_output = mcf_gpio_direction_output,
191 .get = mcf_gpio_get_value,
192 .set = mcf_gpio_set_value_fast,
193 .base = 72,
194 .ngpio = 2,
195 },
196 .pddr = MCFGPIO_PDDR_UARTH,
197 .podr = MCFGPIO_PODR_UARTH,
198 .ppdr = MCFGPIO_PPDSDR_UARTH,
199 .setr = MCFGPIO_PPDSDR_UARTH,
200 .clrr = MCFGPIO_PCLRR_UARTH,
201 },
202 {
203 .gpio_chip = {
204 .label = "UARTL",
205 .request = mcf_gpio_request,
206 .free = mcf_gpio_free,
207 .direction_input = mcf_gpio_direction_input,
208 .direction_output = mcf_gpio_direction_output,
209 .get = mcf_gpio_get_value,
210 .set = mcf_gpio_set_value_fast,
211 .base = 80,
212 .ngpio = 8,
213 },
214 .pddr = MCFGPIO_PDDR_UARTL,
215 .podr = MCFGPIO_PODR_UARTL,
216 .ppdr = MCFGPIO_PPDSDR_UARTL,
217 .setr = MCFGPIO_PPDSDR_UARTL,
218 .clrr = MCFGPIO_PCLRR_UARTL,
219 },
220 {
221 .gpio_chip = {
222 .label = "QSPI",
223 .request = mcf_gpio_request,
224 .free = mcf_gpio_free,
225 .direction_input = mcf_gpio_direction_input,
226 .direction_output = mcf_gpio_direction_output,
227 .get = mcf_gpio_get_value,
228 .set = mcf_gpio_set_value_fast,
229 .base = 88,
230 .ngpio = 5,
231 },
232 .pddr = MCFGPIO_PDDR_QSPI,
233 .podr = MCFGPIO_PODR_QSPI,
234 .ppdr = MCFGPIO_PPDSDR_QSPI,
235 .setr = MCFGPIO_PPDSDR_QSPI,
236 .clrr = MCFGPIO_PCLRR_QSPI,
237 },
238 {
239 .gpio_chip = {
240 .label = "TIMER",
241 .request = mcf_gpio_request,
242 .free = mcf_gpio_free,
243 .direction_input = mcf_gpio_direction_input,
244 .direction_output = mcf_gpio_direction_output,
245 .get = mcf_gpio_get_value,
246 .set = mcf_gpio_set_value_fast,
247 .base = 96,
248 .ngpio = 8,
249 },
250 .pddr = MCFGPIO_PDDR_TIMER,
251 .podr = MCFGPIO_PODR_TIMER,
252 .ppdr = MCFGPIO_PPDSDR_TIMER,
253 .setr = MCFGPIO_PPDSDR_TIMER,
254 .clrr = MCFGPIO_PCLRR_TIMER,
255 },
256#elif defined(CONFIG_M5275)
257 {
258 .gpio_chip = {
259 .label = "PIRQ",
260 .request = mcf_gpio_request,
261 .free = mcf_gpio_free,
262 .direction_input = mcf_gpio_direction_input,
263 .direction_output = mcf_gpio_direction_output,
264 .get = mcf_gpio_get_value,
265 .set = mcf_gpio_set_value,
266 .ngpio = 8,
267 },
268 .pddr = MCFEPORT_EPDDR,
269 .podr = MCFEPORT_EPDR,
270 .ppdr = MCFEPORT_EPPDR,
271 },
272 {
273 .gpio_chip = {
274 .label = "BUSCTL",
275 .request = mcf_gpio_request,
276 .free = mcf_gpio_free,
277 .direction_input = mcf_gpio_direction_input,
278 .direction_output = mcf_gpio_direction_output,
279 .get = mcf_gpio_get_value,
280 .set = mcf_gpio_set_value_fast,
281 .base = 8,
282 .ngpio = 8,
283 },
284 .pddr = MCFGPIO_PDDR_BUSCTL,
285 .podr = MCFGPIO_PODR_BUSCTL,
286 .ppdr = MCFGPIO_PPDSDR_BUSCTL,
287 .setr = MCFGPIO_PPDSDR_BUSCTL,
288 .clrr = MCFGPIO_PCLRR_BUSCTL,
289 },
290 {
291 .gpio_chip = {
292 .label = "ADDR",
293 .request = mcf_gpio_request,
294 .free = mcf_gpio_free,
295 .direction_input = mcf_gpio_direction_input,
296 .direction_output = mcf_gpio_direction_output,
297 .get = mcf_gpio_get_value,
298 .set = mcf_gpio_set_value_fast,
299 .base = 21,
300 .ngpio = 3,
301 },
302 .pddr = MCFGPIO_PDDR_ADDR,
303 .podr = MCFGPIO_PODR_ADDR,
304 .ppdr = MCFGPIO_PPDSDR_ADDR,
305 .setr = MCFGPIO_PPDSDR_ADDR,
306 .clrr = MCFGPIO_PCLRR_ADDR,
307 },
308 {
309 .gpio_chip = {
310 .label = "CS",
311 .request = mcf_gpio_request,
312 .free = mcf_gpio_free,
313 .direction_input = mcf_gpio_direction_input,
314 .direction_output = mcf_gpio_direction_output,
315 .get = mcf_gpio_get_value,
316 .set = mcf_gpio_set_value_fast,
317 .base = 25,
318 .ngpio = 7,
319 },
320 .pddr = MCFGPIO_PDDR_CS,
321 .podr = MCFGPIO_PODR_CS,
322 .ppdr = MCFGPIO_PPDSDR_CS,
323 .setr = MCFGPIO_PPDSDR_CS,
324 .clrr = MCFGPIO_PCLRR_CS,
325 },
326 {
327 .gpio_chip = {
328 .label = "FEC0H",
329 .request = mcf_gpio_request,
330 .free = mcf_gpio_free,
331 .direction_input = mcf_gpio_direction_input,
332 .direction_output = mcf_gpio_direction_output,
333 .get = mcf_gpio_get_value,
334 .set = mcf_gpio_set_value_fast,
335 .base = 32,
336 .ngpio = 8,
337 },
338 .pddr = MCFGPIO_PDDR_FEC0H,
339 .podr = MCFGPIO_PODR_FEC0H,
340 .ppdr = MCFGPIO_PPDSDR_FEC0H,
341 .setr = MCFGPIO_PPDSDR_FEC0H,
342 .clrr = MCFGPIO_PCLRR_FEC0H,
343 },
344 {
345 .gpio_chip = {
346 .label = "FEC0L",
347 .request = mcf_gpio_request,
348 .free = mcf_gpio_free,
349 .direction_input = mcf_gpio_direction_input,
350 .direction_output = mcf_gpio_direction_output,
351 .get = mcf_gpio_get_value,
352 .set = mcf_gpio_set_value_fast,
353 .base = 40,
354 .ngpio = 8,
355 },
356 .pddr = MCFGPIO_PDDR_FEC0L,
357 .podr = MCFGPIO_PODR_FEC0L,
358 .ppdr = MCFGPIO_PPDSDR_FEC0L,
359 .setr = MCFGPIO_PPDSDR_FEC0L,
360 .clrr = MCFGPIO_PCLRR_FEC0L,
361 },
362 {
363 .gpio_chip = {
364 .label = "FECI2C",
365 .request = mcf_gpio_request,
366 .free = mcf_gpio_free,
367 .direction_input = mcf_gpio_direction_input,
368 .direction_output = mcf_gpio_direction_output,
369 .get = mcf_gpio_get_value,
370 .set = mcf_gpio_set_value_fast,
371 .base = 48,
372 .ngpio = 6,
373 },
374 .pddr = MCFGPIO_PDDR_FECI2C,
375 .podr = MCFGPIO_PODR_FECI2C,
376 .ppdr = MCFGPIO_PPDSDR_FECI2C,
377 .setr = MCFGPIO_PPDSDR_FECI2C,
378 .clrr = MCFGPIO_PCLRR_FECI2C,
379 },
380 {
381 .gpio_chip = {
382 .label = "QSPI",
383 .request = mcf_gpio_request,
384 .free = mcf_gpio_free,
385 .direction_input = mcf_gpio_direction_input,
386 .direction_output = mcf_gpio_direction_output,
387 .get = mcf_gpio_get_value,
388 .set = mcf_gpio_set_value_fast,
389 .base = 56,
390 .ngpio = 7,
391 },
392 .pddr = MCFGPIO_PDDR_QSPI,
393 .podr = MCFGPIO_PODR_QSPI,
394 .ppdr = MCFGPIO_PPDSDR_QSPI,
395 .setr = MCFGPIO_PPDSDR_QSPI,
396 .clrr = MCFGPIO_PCLRR_QSPI,
397 },
398 {
399 .gpio_chip = {
400 .label = "SDRAM",
401 .request = mcf_gpio_request,
402 .free = mcf_gpio_free,
403 .direction_input = mcf_gpio_direction_input,
404 .direction_output = mcf_gpio_direction_output,
405 .get = mcf_gpio_get_value,
406 .set = mcf_gpio_set_value_fast,
407 .base = 64,
408 .ngpio = 8,
409 },
410 .pddr = MCFGPIO_PDDR_SDRAM,
411 .podr = MCFGPIO_PODR_SDRAM,
412 .ppdr = MCFGPIO_PPDSDR_SDRAM,
413 .setr = MCFGPIO_PPDSDR_SDRAM,
414 .clrr = MCFGPIO_PCLRR_SDRAM,
415 },
416 {
417 .gpio_chip = {
418 .label = "TIMERH",
419 .request = mcf_gpio_request,
420 .free = mcf_gpio_free,
421 .direction_input = mcf_gpio_direction_input,
422 .direction_output = mcf_gpio_direction_output,
423 .get = mcf_gpio_get_value,
424 .set = mcf_gpio_set_value_fast,
425 .base = 72,
426 .ngpio = 4,
427 },
428 .pddr = MCFGPIO_PDDR_TIMERH,
429 .podr = MCFGPIO_PODR_TIMERH,
430 .ppdr = MCFGPIO_PPDSDR_TIMERH,
431 .setr = MCFGPIO_PPDSDR_TIMERH,
432 .clrr = MCFGPIO_PCLRR_TIMERH,
433 },
434 {
435 .gpio_chip = {
436 .label = "TIMERL",
437 .request = mcf_gpio_request,
438 .free = mcf_gpio_free,
439 .direction_input = mcf_gpio_direction_input,
440 .direction_output = mcf_gpio_direction_output,
441 .get = mcf_gpio_get_value,
442 .set = mcf_gpio_set_value_fast,
443 .base = 80,
444 .ngpio = 4,
445 },
446 .pddr = MCFGPIO_PDDR_TIMERL,
447 .podr = MCFGPIO_PODR_TIMERL,
448 .ppdr = MCFGPIO_PPDSDR_TIMERL,
449 .setr = MCFGPIO_PPDSDR_TIMERL,
450 .clrr = MCFGPIO_PCLRR_TIMERL,
451 },
452 {
453 .gpio_chip = {
454 .label = "UARTL",
455 .request = mcf_gpio_request,
456 .free = mcf_gpio_free,
457 .direction_input = mcf_gpio_direction_input,
458 .direction_output = mcf_gpio_direction_output,
459 .get = mcf_gpio_get_value,
460 .set = mcf_gpio_set_value_fast,
461 .base = 88,
462 .ngpio = 8,
463 },
464 .pddr = MCFGPIO_PDDR_UARTL,
465 .podr = MCFGPIO_PODR_UARTL,
466 .ppdr = MCFGPIO_PPDSDR_UARTL,
467 .setr = MCFGPIO_PPDSDR_UARTL,
468 .clrr = MCFGPIO_PCLRR_UARTL,
469 },
470 {
471 .gpio_chip = {
472 .label = "FEC1H",
473 .request = mcf_gpio_request,
474 .free = mcf_gpio_free,
475 .direction_input = mcf_gpio_direction_input,
476 .direction_output = mcf_gpio_direction_output,
477 .get = mcf_gpio_get_value,
478 .set = mcf_gpio_set_value_fast,
479 .base = 96,
480 .ngpio = 8,
481 },
482 .pddr = MCFGPIO_PDDR_FEC1H,
483 .podr = MCFGPIO_PODR_FEC1H,
484 .ppdr = MCFGPIO_PPDSDR_FEC1H,
485 .setr = MCFGPIO_PPDSDR_FEC1H,
486 .clrr = MCFGPIO_PCLRR_FEC1H,
487 },
488 {
489 .gpio_chip = {
490 .label = "FEC1L",
491 .request = mcf_gpio_request,
492 .free = mcf_gpio_free,
493 .direction_input = mcf_gpio_direction_input,
494 .direction_output = mcf_gpio_direction_output,
495 .get = mcf_gpio_get_value,
496 .set = mcf_gpio_set_value_fast,
497 .base = 104,
498 .ngpio = 8,
499 },
500 .pddr = MCFGPIO_PDDR_FEC1L,
501 .podr = MCFGPIO_PODR_FEC1L,
502 .ppdr = MCFGPIO_PPDSDR_FEC1L,
503 .setr = MCFGPIO_PPDSDR_FEC1L,
504 .clrr = MCFGPIO_PCLRR_FEC1L,
505 },
506 {
507 .gpio_chip = {
508 .label = "BS",
509 .request = mcf_gpio_request,
510 .free = mcf_gpio_free,
511 .direction_input = mcf_gpio_direction_input,
512 .direction_output = mcf_gpio_direction_output,
513 .get = mcf_gpio_get_value,
514 .set = mcf_gpio_set_value_fast,
515 .base = 114,
516 .ngpio = 2,
517 },
518 .pddr = MCFGPIO_PDDR_BS,
519 .podr = MCFGPIO_PODR_BS,
520 .ppdr = MCFGPIO_PPDSDR_BS,
521 .setr = MCFGPIO_PPDSDR_BS,
522 .clrr = MCFGPIO_PCLRR_BS,
523 },
524 {
525 .gpio_chip = {
526 .label = "IRQ",
527 .request = mcf_gpio_request,
528 .free = mcf_gpio_free,
529 .direction_input = mcf_gpio_direction_input,
530 .direction_output = mcf_gpio_direction_output,
531 .get = mcf_gpio_get_value,
532 .set = mcf_gpio_set_value_fast,
533 .base = 121,
534 .ngpio = 7,
535 },
536 .pddr = MCFGPIO_PDDR_IRQ,
537 .podr = MCFGPIO_PODR_IRQ,
538 .ppdr = MCFGPIO_PPDSDR_IRQ,
539 .setr = MCFGPIO_PPDSDR_IRQ,
540 .clrr = MCFGPIO_PCLRR_IRQ,
541 },
542 {
543 .gpio_chip = {
544 .label = "USBH",
545 .request = mcf_gpio_request,
546 .free = mcf_gpio_free,
547 .direction_input = mcf_gpio_direction_input,
548 .direction_output = mcf_gpio_direction_output,
549 .get = mcf_gpio_get_value,
550 .set = mcf_gpio_set_value_fast,
551 .base = 128,
552 .ngpio = 1,
553 },
554 .pddr = MCFGPIO_PDDR_USBH,
555 .podr = MCFGPIO_PODR_USBH,
556 .ppdr = MCFGPIO_PPDSDR_USBH,
557 .setr = MCFGPIO_PPDSDR_USBH,
558 .clrr = MCFGPIO_PCLRR_USBH,
559 },
560 {
561 .gpio_chip = {
562 .label = "USBL",
563 .request = mcf_gpio_request,
564 .free = mcf_gpio_free,
565 .direction_input = mcf_gpio_direction_input,
566 .direction_output = mcf_gpio_direction_output,
567 .get = mcf_gpio_get_value,
568 .set = mcf_gpio_set_value_fast,
569 .base = 136,
570 .ngpio = 8,
571 },
572 .pddr = MCFGPIO_PDDR_USBL,
573 .podr = MCFGPIO_PODR_USBL,
574 .ppdr = MCFGPIO_PPDSDR_USBL,
575 .setr = MCFGPIO_PPDSDR_USBL,
576 .clrr = MCFGPIO_PCLRR_USBL,
577 },
578 {
579 .gpio_chip = {
580 .label = "UARTH",
581 .request = mcf_gpio_request,
582 .free = mcf_gpio_free,
583 .direction_input = mcf_gpio_direction_input,
584 .direction_output = mcf_gpio_direction_output,
585 .get = mcf_gpio_get_value,
586 .set = mcf_gpio_set_value_fast,
587 .base = 144,
588 .ngpio = 4,
589 },
590 .pddr = MCFGPIO_PDDR_UARTH,
591 .podr = MCFGPIO_PODR_UARTH,
592 .ppdr = MCFGPIO_PPDSDR_UARTH,
593 .setr = MCFGPIO_PPDSDR_UARTH,
594 .clrr = MCFGPIO_PCLRR_UARTH,
595 },
596#endif
597};
598
599static int __init mcf_gpio_init(void)
600{
601 unsigned i = 0;
602 while (i < ARRAY_SIZE(mcf_gpio_chips))
603 (void)gpiochip_add((struct gpio_chip *)&mcf_gpio_chips[i++]);
604 return 0;
605}
606
607core_initcall(mcf_gpio_init);
diff --git a/arch/m68knommu/platform/528x/Makefile b/arch/m68knommu/platform/528x/Makefile
index 26135d92b34d..3d90e6d92459 100644
--- a/arch/m68knommu/platform/528x/Makefile
+++ b/arch/m68knommu/platform/528x/Makefile
@@ -14,5 +14,5 @@
14 14
15asflags-$(CONFIG_FULLDEBUG) := -DDEBUGGER_COMPATIBLE_CACHE=1 15asflags-$(CONFIG_FULLDEBUG) := -DDEBUGGER_COMPATIBLE_CACHE=1
16 16
17obj-y := config.o 17obj-y := config.o gpio.o
18 18
diff --git a/arch/m68knommu/platform/528x/config.c b/arch/m68knommu/platform/528x/config.c
index a1d1a61c4fe6..6e608d1836f1 100644
--- a/arch/m68knommu/platform/528x/config.c
+++ b/arch/m68knommu/platform/528x/config.c
@@ -3,8 +3,8 @@
3/* 3/*
4 * linux/arch/m68knommu/platform/528x/config.c 4 * linux/arch/m68knommu/platform/528x/config.c
5 * 5 *
6 * Sub-architcture dependant initialization code for the Motorola 6 * Sub-architcture dependant initialization code for the Freescale
7 * 5280 and 5282 CPUs. 7 * 5280, 5281 and 5282 CPUs.
8 * 8 *
9 * Copyright (C) 1999-2003, Greg Ungerer (gerg@snapgear.com) 9 * Copyright (C) 1999-2003, Greg Ungerer (gerg@snapgear.com)
10 * Copyright (C) 2001-2003, SnapGear Inc. (www.snapgear.com) 10 * Copyright (C) 2001-2003, SnapGear Inc. (www.snapgear.com)
@@ -15,20 +15,13 @@
15#include <linux/kernel.h> 15#include <linux/kernel.h>
16#include <linux/param.h> 16#include <linux/param.h>
17#include <linux/init.h> 17#include <linux/init.h>
18#include <linux/interrupt.h>
19#include <linux/platform_device.h> 18#include <linux/platform_device.h>
20#include <linux/spi/spi.h>
21#include <linux/spi/flash.h>
22#include <linux/io.h> 19#include <linux/io.h>
23#include <asm/machdep.h> 20#include <asm/machdep.h>
24#include <asm/coldfire.h> 21#include <asm/coldfire.h>
25#include <asm/mcfsim.h> 22#include <asm/mcfsim.h>
26#include <asm/mcfuart.h> 23#include <asm/mcfuart.h>
27 24
28#ifdef CONFIG_MTD_PARTITIONS
29#include <linux/mtd/partitions.h>
30#endif
31
32/***************************************************************************/ 25/***************************************************************************/
33 26
34static struct mcf_platform_uart m528x_uart_platform[] = { 27static struct mcf_platform_uart m528x_uart_platform[] = {
@@ -91,23 +84,13 @@ static struct platform_device *m528x_devices[] __initdata = {
91 84
92/***************************************************************************/ 85/***************************************************************************/
93 86
94#define INTC0 (MCF_MBAR + MCFICM_INTC0)
95
96static void __init m528x_uart_init_line(int line, int irq) 87static void __init m528x_uart_init_line(int line, int irq)
97{ 88{
98 u8 port; 89 u8 port;
99 u32 imr;
100 90
101 if ((line < 0) || (line > 2)) 91 if ((line < 0) || (line > 2))
102 return; 92 return;
103 93
104 /* level 6, line based priority */
105 writeb(0x30+line, INTC0 + MCFINTC_ICR0 + MCFINT_UART0 + line);
106
107 imr = readl(INTC0 + MCFINTC_IMRL);
108 imr &= ~((1 << (irq - MCFINT_VECBASE)) | 1);
109 writel(imr, INTC0 + MCFINTC_IMRL);
110
111 /* make sure PUAPAR is set for UART0 and UART1 */ 94 /* make sure PUAPAR is set for UART0 and UART1 */
112 if (line < 2) { 95 if (line < 2) {
113 port = readb(MCF_MBAR + MCF5282_GPIO_PUAPAR); 96 port = readb(MCF_MBAR + MCF5282_GPIO_PUAPAR);
@@ -129,21 +112,8 @@ static void __init m528x_uarts_init(void)
129 112
130static void __init m528x_fec_init(void) 113static void __init m528x_fec_init(void)
131{ 114{
132 u32 imr;
133 u16 v16; 115 u16 v16;
134 116
135 /* Unmask FEC interrupts at ColdFire interrupt controller */
136 writeb(0x28, MCF_IPSBAR + MCFICM_INTC0 + MCFINTC_ICR0 + 23);
137 writeb(0x27, MCF_IPSBAR + MCFICM_INTC0 + MCFINTC_ICR0 + 27);
138 writeb(0x26, MCF_IPSBAR + MCFICM_INTC0 + MCFINTC_ICR0 + 29);
139
140 imr = readl(MCF_IPSBAR + MCFICM_INTC0 + MCFINTC_IMRH);
141 imr &= ~0xf;
142 writel(imr, MCF_IPSBAR + MCFICM_INTC0 + MCFINTC_IMRH);
143 imr = readl(MCF_IPSBAR + MCFICM_INTC0 + MCFINTC_IMRL);
144 imr &= ~0xff800001;
145 writel(imr, MCF_IPSBAR + MCFICM_INTC0 + MCFINTC_IMRL);
146
147 /* Set multi-function pins to ethernet mode for fec0 */ 117 /* Set multi-function pins to ethernet mode for fec0 */
148 v16 = readw(MCF_IPSBAR + 0x100056); 118 v16 = readw(MCF_IPSBAR + 0x100056);
149 writew(v16 | 0xf00, MCF_IPSBAR + 0x100056); 119 writew(v16 | 0xf00, MCF_IPSBAR + 0x100056);
@@ -152,21 +122,6 @@ static void __init m528x_fec_init(void)
152 122
153/***************************************************************************/ 123/***************************************************************************/
154 124
155void mcf_disableall(void)
156{
157 *((volatile unsigned long *) (MCF_IPSBAR + MCFICM_INTC0 + MCFINTC_IMRH)) = 0xffffffff;
158 *((volatile unsigned long *) (MCF_IPSBAR + MCFICM_INTC0 + MCFINTC_IMRL)) = 0xffffffff;
159}
160
161/***************************************************************************/
162
163void mcf_autovector(unsigned int vec)
164{
165 /* Everything is auto-vectored on the 5272 */
166}
167
168/***************************************************************************/
169
170static void m528x_cpu_reset(void) 125static void m528x_cpu_reset(void)
171{ 126{
172 local_irq_disable(); 127 local_irq_disable();
@@ -204,8 +159,6 @@ void wildfiremod_halt(void)
204 159
205void __init config_BSP(char *commandp, int size) 160void __init config_BSP(char *commandp, int size)
206{ 161{
207 mcf_disableall();
208
209#ifdef CONFIG_WILDFIRE 162#ifdef CONFIG_WILDFIRE
210 mach_halt = wildfire_halt; 163 mach_halt = wildfire_halt;
211#endif 164#endif
diff --git a/arch/m68knommu/platform/528x/gpio.c b/arch/m68knommu/platform/528x/gpio.c
new file mode 100644
index 000000000000..ec593950696a
--- /dev/null
+++ b/arch/m68knommu/platform/528x/gpio.c
@@ -0,0 +1,438 @@
1/*
2 * Coldfire generic GPIO support
3 *
4 * (C) Copyright 2009, Steven King <sfking@fdwdc.com>
5 *
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
8 * the Free Software Foundation; version 2 of the License.
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
16#include <linux/kernel.h>
17#include <linux/init.h>
18
19#include <asm/coldfire.h>
20#include <asm/mcfsim.h>
21#include <asm/mcfgpio.h>
22
23static struct mcf_gpio_chip mcf_gpio_chips[] = {
24 {
25 .gpio_chip = {
26 .label = "NQ",
27 .request = mcf_gpio_request,
28 .free = mcf_gpio_free,
29 .direction_input = mcf_gpio_direction_input,
30 .direction_output = mcf_gpio_direction_output,
31 .get = mcf_gpio_get_value,
32 .set = mcf_gpio_set_value,
33 .base = 1,
34 .ngpio = 8,
35 },
36 .pddr = MCFEPORT_EPDDR,
37 .podr = MCFEPORT_EPDR,
38 .ppdr = MCFEPORT_EPPDR,
39 },
40 {
41 .gpio_chip = {
42 .label = "TA",
43 .request = mcf_gpio_request,
44 .free = mcf_gpio_free,
45 .direction_input = mcf_gpio_direction_input,
46 .direction_output = mcf_gpio_direction_output,
47 .get = mcf_gpio_get_value,
48 .set = mcf_gpio_set_value_fast,
49 .base = 8,
50 .ngpio = 4,
51 },
52 .pddr = MCFGPTA_GPTDDR,
53 .podr = MCFGPTA_GPTPORT,
54 .ppdr = MCFGPTB_GPTPORT,
55 },
56 {
57 .gpio_chip = {
58 .label = "TB",
59 .request = mcf_gpio_request,
60 .free = mcf_gpio_free,
61 .direction_input = mcf_gpio_direction_input,
62 .direction_output = mcf_gpio_direction_output,
63 .get = mcf_gpio_get_value,
64 .set = mcf_gpio_set_value_fast,
65 .base = 16,
66 .ngpio = 4,
67 },
68 .pddr = MCFGPTB_GPTDDR,
69 .podr = MCFGPTB_GPTPORT,
70 .ppdr = MCFGPTB_GPTPORT,
71 },
72 {
73 .gpio_chip = {
74 .label = "QA",
75 .request = mcf_gpio_request,
76 .free = mcf_gpio_free,
77 .direction_input = mcf_gpio_direction_input,
78 .direction_output = mcf_gpio_direction_output,
79 .get = mcf_gpio_get_value,
80 .set = mcf_gpio_set_value_fast,
81 .base = 24,
82 .ngpio = 4,
83 },
84 .pddr = MCFQADC_DDRQA,
85 .podr = MCFQADC_PORTQA,
86 .ppdr = MCFQADC_PORTQA,
87 },
88 {
89 .gpio_chip = {
90 .label = "QB",
91 .request = mcf_gpio_request,
92 .free = mcf_gpio_free,
93 .direction_input = mcf_gpio_direction_input,
94 .direction_output = mcf_gpio_direction_output,
95 .get = mcf_gpio_get_value,
96 .set = mcf_gpio_set_value_fast,
97 .base = 32,
98 .ngpio = 4,
99 },
100 .pddr = MCFQADC_DDRQB,
101 .podr = MCFQADC_PORTQB,
102 .ppdr = MCFQADC_PORTQB,
103 },
104 {
105 .gpio_chip = {
106 .label = "A",
107 .request = mcf_gpio_request,
108 .free = mcf_gpio_free,
109 .direction_input = mcf_gpio_direction_input,
110 .direction_output = mcf_gpio_direction_output,
111 .get = mcf_gpio_get_value,
112 .set = mcf_gpio_set_value_fast,
113 .base = 40,
114 .ngpio = 8,
115 },
116 .pddr = MCFGPIO_DDRA,
117 .podr = MCFGPIO_PORTA,
118 .ppdr = MCFGPIO_PORTAP,
119 .setr = MCFGPIO_SETA,
120 .clrr = MCFGPIO_CLRA,
121 },
122 {
123 .gpio_chip = {
124 .label = "B",
125 .request = mcf_gpio_request,
126 .free = mcf_gpio_free,
127 .direction_input = mcf_gpio_direction_input,
128 .direction_output = mcf_gpio_direction_output,
129 .get = mcf_gpio_get_value,
130 .set = mcf_gpio_set_value_fast,
131 .base = 48,
132 .ngpio = 8,
133 },
134 .pddr = MCFGPIO_DDRB,
135 .podr = MCFGPIO_PORTB,
136 .ppdr = MCFGPIO_PORTBP,
137 .setr = MCFGPIO_SETB,
138 .clrr = MCFGPIO_CLRB,
139 },
140 {
141 .gpio_chip = {
142 .label = "C",
143 .request = mcf_gpio_request,
144 .free = mcf_gpio_free,
145 .direction_input = mcf_gpio_direction_input,
146 .direction_output = mcf_gpio_direction_output,
147 .get = mcf_gpio_get_value,
148 .set = mcf_gpio_set_value_fast,
149 .base = 56,
150 .ngpio = 8,
151 },
152 .pddr = MCFGPIO_DDRC,
153 .podr = MCFGPIO_PORTC,
154 .ppdr = MCFGPIO_PORTCP,
155 .setr = MCFGPIO_SETC,
156 .clrr = MCFGPIO_CLRC,
157 },
158 {
159 .gpio_chip = {
160 .label = "D",
161 .request = mcf_gpio_request,
162 .free = mcf_gpio_free,
163 .direction_input = mcf_gpio_direction_input,
164 .direction_output = mcf_gpio_direction_output,
165 .get = mcf_gpio_get_value,
166 .set = mcf_gpio_set_value_fast,
167 .base = 64,
168 .ngpio = 8,
169 },
170 .pddr = MCFGPIO_DDRD,
171 .podr = MCFGPIO_PORTD,
172 .ppdr = MCFGPIO_PORTDP,
173 .setr = MCFGPIO_SETD,
174 .clrr = MCFGPIO_CLRD,
175 },
176 {
177 .gpio_chip = {
178 .label = "E",
179 .request = mcf_gpio_request,
180 .free = mcf_gpio_free,
181 .direction_input = mcf_gpio_direction_input,
182 .direction_output = mcf_gpio_direction_output,
183 .get = mcf_gpio_get_value,
184 .set = mcf_gpio_set_value_fast,
185 .base = 72,
186 .ngpio = 8,
187 },
188 .pddr = MCFGPIO_DDRE,
189 .podr = MCFGPIO_PORTE,
190 .ppdr = MCFGPIO_PORTEP,
191 .setr = MCFGPIO_SETE,
192 .clrr = MCFGPIO_CLRE,
193 },
194 {
195 .gpio_chip = {
196 .label = "F",
197 .request = mcf_gpio_request,
198 .free = mcf_gpio_free,
199 .direction_input = mcf_gpio_direction_input,
200 .direction_output = mcf_gpio_direction_output,
201 .get = mcf_gpio_get_value,
202 .set = mcf_gpio_set_value_fast,
203 .base = 80,
204 .ngpio = 8,
205 },
206 .pddr = MCFGPIO_DDRF,
207 .podr = MCFGPIO_PORTF,
208 .ppdr = MCFGPIO_PORTFP,
209 .setr = MCFGPIO_SETF,
210 .clrr = MCFGPIO_CLRF,
211 },
212 {
213 .gpio_chip = {
214 .label = "G",
215 .request = mcf_gpio_request,
216 .free = mcf_gpio_free,
217 .direction_input = mcf_gpio_direction_input,
218 .direction_output = mcf_gpio_direction_output,
219 .get = mcf_gpio_get_value,
220 .set = mcf_gpio_set_value_fast,
221 .base = 88,
222 .ngpio = 8,
223 },
224 .pddr = MCFGPIO_DDRG,
225 .podr = MCFGPIO_PORTG,
226 .ppdr = MCFGPIO_PORTGP,
227 .setr = MCFGPIO_SETG,
228 .clrr = MCFGPIO_CLRG,
229 },
230 {
231 .gpio_chip = {
232 .label = "H",
233 .request = mcf_gpio_request,
234 .free = mcf_gpio_free,
235 .direction_input = mcf_gpio_direction_input,
236 .direction_output = mcf_gpio_direction_output,
237 .get = mcf_gpio_get_value,
238 .set = mcf_gpio_set_value_fast,
239 .base = 96,
240 .ngpio = 8,
241 },
242 .pddr = MCFGPIO_DDRH,
243 .podr = MCFGPIO_PORTH,
244 .ppdr = MCFGPIO_PORTHP,
245 .setr = MCFGPIO_SETH,
246 .clrr = MCFGPIO_CLRH,
247 },
248 {
249 .gpio_chip = {
250 .label = "J",
251 .request = mcf_gpio_request,
252 .free = mcf_gpio_free,
253 .direction_input = mcf_gpio_direction_input,
254 .direction_output = mcf_gpio_direction_output,
255 .get = mcf_gpio_get_value,
256 .set = mcf_gpio_set_value_fast,
257 .base = 104,
258 .ngpio = 8,
259 },
260 .pddr = MCFGPIO_DDRJ,
261 .podr = MCFGPIO_PORTJ,
262 .ppdr = MCFGPIO_PORTJP,
263 .setr = MCFGPIO_SETJ,
264 .clrr = MCFGPIO_CLRJ,
265 },
266 {
267 .gpio_chip = {
268 .label = "DD",
269 .request = mcf_gpio_request,
270 .free = mcf_gpio_free,
271 .direction_input = mcf_gpio_direction_input,
272 .direction_output = mcf_gpio_direction_output,
273 .get = mcf_gpio_get_value,
274 .set = mcf_gpio_set_value_fast,
275 .base = 112,
276 .ngpio = 8,
277 },
278 .pddr = MCFGPIO_DDRDD,
279 .podr = MCFGPIO_PORTDD,
280 .ppdr = MCFGPIO_PORTDDP,
281 .setr = MCFGPIO_SETDD,
282 .clrr = MCFGPIO_CLRDD,
283 },
284 {
285 .gpio_chip = {
286 .label = "EH",
287 .request = mcf_gpio_request,
288 .free = mcf_gpio_free,
289 .direction_input = mcf_gpio_direction_input,
290 .direction_output = mcf_gpio_direction_output,
291 .get = mcf_gpio_get_value,
292 .set = mcf_gpio_set_value_fast,
293 .base = 120,
294 .ngpio = 8,
295 },
296 .pddr = MCFGPIO_DDREH,
297 .podr = MCFGPIO_PORTEH,
298 .ppdr = MCFGPIO_PORTEHP,
299 .setr = MCFGPIO_SETEH,
300 .clrr = MCFGPIO_CLREH,
301 },
302 {
303 .gpio_chip = {
304 .label = "EL",
305 .request = mcf_gpio_request,
306 .free = mcf_gpio_free,
307 .direction_input = mcf_gpio_direction_input,
308 .direction_output = mcf_gpio_direction_output,
309 .get = mcf_gpio_get_value,
310 .set = mcf_gpio_set_value_fast,
311 .base = 128,
312 .ngpio = 8,
313 },
314 .pddr = MCFGPIO_DDREL,
315 .podr = MCFGPIO_PORTEL,
316 .ppdr = MCFGPIO_PORTELP,
317 .setr = MCFGPIO_SETEL,
318 .clrr = MCFGPIO_CLREL,
319 },
320 {
321 .gpio_chip = {
322 .label = "AS",
323 .request = mcf_gpio_request,
324 .free = mcf_gpio_free,
325 .direction_input = mcf_gpio_direction_input,
326 .direction_output = mcf_gpio_direction_output,
327 .get = mcf_gpio_get_value,
328 .set = mcf_gpio_set_value_fast,
329 .base = 136,
330 .ngpio = 6,
331 },
332 .pddr = MCFGPIO_DDRAS,
333 .podr = MCFGPIO_PORTAS,
334 .ppdr = MCFGPIO_PORTASP,
335 .setr = MCFGPIO_SETAS,
336 .clrr = MCFGPIO_CLRAS,
337 },
338 {
339 .gpio_chip = {
340 .label = "QS",
341 .request = mcf_gpio_request,
342 .free = mcf_gpio_free,
343 .direction_input = mcf_gpio_direction_input,
344 .direction_output = mcf_gpio_direction_output,
345 .get = mcf_gpio_get_value,
346 .set = mcf_gpio_set_value_fast,
347 .base = 144,
348 .ngpio = 7,
349 },
350 .pddr = MCFGPIO_DDRQS,
351 .podr = MCFGPIO_PORTQS,
352 .ppdr = MCFGPIO_PORTQSP,
353 .setr = MCFGPIO_SETQS,
354 .clrr = MCFGPIO_CLRQS,
355 },
356 {
357 .gpio_chip = {
358 .label = "SD",
359 .request = mcf_gpio_request,
360 .free = mcf_gpio_free,
361 .direction_input = mcf_gpio_direction_input,
362 .direction_output = mcf_gpio_direction_output,
363 .get = mcf_gpio_get_value,
364 .set = mcf_gpio_set_value_fast,
365 .base = 152,
366 .ngpio = 6,
367 },
368 .pddr = MCFGPIO_DDRSD,
369 .podr = MCFGPIO_PORTSD,
370 .ppdr = MCFGPIO_PORTSDP,
371 .setr = MCFGPIO_SETSD,
372 .clrr = MCFGPIO_CLRSD,
373 },
374 {
375 .gpio_chip = {
376 .label = "TC",
377 .request = mcf_gpio_request,
378 .free = mcf_gpio_free,
379 .direction_input = mcf_gpio_direction_input,
380 .direction_output = mcf_gpio_direction_output,
381 .get = mcf_gpio_get_value,
382 .set = mcf_gpio_set_value_fast,
383 .base = 160,
384 .ngpio = 4,
385 },
386 .pddr = MCFGPIO_DDRTC,
387 .podr = MCFGPIO_PORTTC,
388 .ppdr = MCFGPIO_PORTTCP,
389 .setr = MCFGPIO_SETTC,
390 .clrr = MCFGPIO_CLRTC,
391 },
392 {
393 .gpio_chip = {
394 .label = "TD",
395 .request = mcf_gpio_request,
396 .free = mcf_gpio_free,
397 .direction_input = mcf_gpio_direction_input,
398 .direction_output = mcf_gpio_direction_output,
399 .get = mcf_gpio_get_value,
400 .set = mcf_gpio_set_value_fast,
401 .base = 168,
402 .ngpio = 4,
403 },
404 .pddr = MCFGPIO_DDRTD,
405 .podr = MCFGPIO_PORTTD,
406 .ppdr = MCFGPIO_PORTTDP,
407 .setr = MCFGPIO_SETTD,
408 .clrr = MCFGPIO_CLRTD,
409 },
410 {
411 .gpio_chip = {
412 .label = "UA",
413 .request = mcf_gpio_request,
414 .free = mcf_gpio_free,
415 .direction_input = mcf_gpio_direction_input,
416 .direction_output = mcf_gpio_direction_output,
417 .get = mcf_gpio_get_value,
418 .set = mcf_gpio_set_value_fast,
419 .base = 176,
420 .ngpio = 4,
421 },
422 .pddr = MCFGPIO_DDRUA,
423 .podr = MCFGPIO_PORTUA,
424 .ppdr = MCFGPIO_PORTUAP,
425 .setr = MCFGPIO_SETUA,
426 .clrr = MCFGPIO_CLRUA,
427 },
428};
429
430static int __init mcf_gpio_init(void)
431{
432 unsigned i = 0;
433 while (i < ARRAY_SIZE(mcf_gpio_chips))
434 (void)gpiochip_add((struct gpio_chip *)&mcf_gpio_chips[i++]);
435 return 0;
436}
437
438core_initcall(mcf_gpio_init);
diff --git a/arch/m68knommu/platform/5307/Makefile b/arch/m68knommu/platform/5307/Makefile
index cfd586860fd8..667db6598451 100644
--- a/arch/m68knommu/platform/5307/Makefile
+++ b/arch/m68knommu/platform/5307/Makefile
@@ -14,5 +14,5 @@
14 14
15asflags-$(CONFIG_FULLDEBUG) := -DDEBUGGER_COMPATIBLE_CACHE=1 15asflags-$(CONFIG_FULLDEBUG) := -DDEBUGGER_COMPATIBLE_CACHE=1
16 16
17obj-y += config.o 17obj-y += config.o gpio.o
18 18
diff --git a/arch/m68knommu/platform/5307/config.c b/arch/m68knommu/platform/5307/config.c
index 39da9e9ff674..00900ac06a9c 100644
--- a/arch/m68knommu/platform/5307/config.c
+++ b/arch/m68knommu/platform/5307/config.c
@@ -21,12 +21,6 @@
21 21
22/***************************************************************************/ 22/***************************************************************************/
23 23
24extern unsigned int mcf_timervector;
25extern unsigned int mcf_profilevector;
26extern unsigned int mcf_timerlevel;
27
28/***************************************************************************/
29
30/* 24/*
31 * Some platforms need software versions of the GPIO data registers. 25 * Some platforms need software versions of the GPIO data registers.
32 */ 26 */
@@ -64,11 +58,11 @@ static void __init m5307_uart_init_line(int line, int irq)
64 if (line == 0) { 58 if (line == 0) {
65 writeb(MCFSIM_ICR_LEVEL6 | MCFSIM_ICR_PRI1, MCF_MBAR + MCFSIM_UART1ICR); 59 writeb(MCFSIM_ICR_LEVEL6 | MCFSIM_ICR_PRI1, MCF_MBAR + MCFSIM_UART1ICR);
66 writeb(irq, MCF_MBAR + MCFUART_BASE1 + MCFUART_UIVR); 60 writeb(irq, MCF_MBAR + MCFUART_BASE1 + MCFUART_UIVR);
67 mcf_setimr(mcf_getimr() & ~MCFSIM_IMR_UART1); 61 mcf_mapirq2imr(irq, MCFINTC_UART0);
68 } else if (line == 1) { 62 } else if (line == 1) {
69 writeb(MCFSIM_ICR_LEVEL6 | MCFSIM_ICR_PRI2, MCF_MBAR + MCFSIM_UART2ICR); 63 writeb(MCFSIM_ICR_LEVEL6 | MCFSIM_ICR_PRI2, MCF_MBAR + MCFSIM_UART2ICR);
70 writeb(irq, MCF_MBAR + MCFUART_BASE2 + MCFUART_UIVR); 64 writeb(irq, MCF_MBAR + MCFUART_BASE2 + MCFUART_UIVR);
71 mcf_setimr(mcf_getimr() & ~MCFSIM_IMR_UART2); 65 mcf_mapirq2imr(irq, MCFINTC_UART1);
72 } 66 }
73} 67}
74 68
@@ -83,35 +77,19 @@ static void __init m5307_uarts_init(void)
83 77
84/***************************************************************************/ 78/***************************************************************************/
85 79
86void mcf_autovector(unsigned int vec) 80static void __init m5307_timers_init(void)
87{
88 volatile unsigned char *mbar;
89
90 if ((vec >= 25) && (vec <= 31)) {
91 mbar = (volatile unsigned char *) MCF_MBAR;
92 vec = 0x1 << (vec - 24);
93 *(mbar + MCFSIM_AVR) |= vec;
94 mcf_setimr(mcf_getimr() & ~vec);
95 }
96}
97
98/***************************************************************************/
99
100void mcf_settimericr(unsigned int timer, unsigned int level)
101{ 81{
102 volatile unsigned char *icrp; 82 /* Timer1 is always used as system timer */
103 unsigned int icr, imr; 83 writeb(MCFSIM_ICR_AUTOVEC | MCFSIM_ICR_LEVEL6 | MCFSIM_ICR_PRI3,
104 84 MCF_MBAR + MCFSIM_TIMER1ICR);
105 if (timer <= 2) { 85 mcf_mapirq2imr(MCF_IRQ_TIMER, MCFINTC_TIMER1);
106 switch (timer) { 86
107 case 2: icr = MCFSIM_TIMER2ICR; imr = MCFSIM_IMR_TIMER2; break; 87#ifdef CONFIG_HIGHPROFILE
108 default: icr = MCFSIM_TIMER1ICR; imr = MCFSIM_IMR_TIMER1; break; 88 /* Timer2 is to be used as a high speed profile timer */
109 } 89 writeb(MCFSIM_ICR_AUTOVEC | MCFSIM_ICR_LEVEL7 | MCFSIM_ICR_PRI3,
110 90 MCF_MBAR + MCFSIM_TIMER2ICR);
111 icrp = (volatile unsigned char *) (MCF_MBAR + icr); 91 mcf_mapirq2imr(MCF_IRQ_PROFILER, MCFINTC_TIMER2);
112 *icrp = MCFSIM_ICR_AUTOVEC | (level << 2) | MCFSIM_ICR_PRI3; 92#endif
113 mcf_setimr(mcf_getimr() & ~imr);
114 }
115} 93}
116 94
117/***************************************************************************/ 95/***************************************************************************/
@@ -129,20 +107,22 @@ void m5307_cpu_reset(void)
129 107
130void __init config_BSP(char *commandp, int size) 108void __init config_BSP(char *commandp, int size)
131{ 109{
132 mcf_setimr(MCFSIM_IMR_MASKALL);
133
134#if defined(CONFIG_NETtel) || \ 110#if defined(CONFIG_NETtel) || \
135 defined(CONFIG_SECUREEDGEMP3) || defined(CONFIG_CLEOPATRA) 111 defined(CONFIG_SECUREEDGEMP3) || defined(CONFIG_CLEOPATRA)
136 /* Copy command line from FLASH to local buffer... */ 112 /* Copy command line from FLASH to local buffer... */
137 memcpy(commandp, (char *) 0xf0004000, size); 113 memcpy(commandp, (char *) 0xf0004000, size);
138 commandp[size-1] = 0; 114 commandp[size-1] = 0;
139 /* Different timer setup - to prevent device clash */
140 mcf_timervector = 30;
141 mcf_profilevector = 31;
142 mcf_timerlevel = 6;
143#endif 115#endif
144 116
145 mach_reset = m5307_cpu_reset; 117 mach_reset = m5307_cpu_reset;
118 m5307_timers_init();
119 m5307_uarts_init();
120
121 /* Only support the external interrupts on their primary level */
122 mcf_mapirq2imr(25, MCFINTC_EINT1);
123 mcf_mapirq2imr(27, MCFINTC_EINT3);
124 mcf_mapirq2imr(29, MCFINTC_EINT5);
125 mcf_mapirq2imr(31, MCFINTC_EINT7);
146 126
147#ifdef CONFIG_BDM_DISABLE 127#ifdef CONFIG_BDM_DISABLE
148 /* 128 /*
@@ -158,7 +138,6 @@ void __init config_BSP(char *commandp, int size)
158 138
159static int __init init_BSP(void) 139static int __init init_BSP(void)
160{ 140{
161 m5307_uarts_init();
162 platform_add_devices(m5307_devices, ARRAY_SIZE(m5307_devices)); 141 platform_add_devices(m5307_devices, ARRAY_SIZE(m5307_devices));
163 return 0; 142 return 0;
164} 143}
diff --git a/arch/m68knommu/platform/5307/gpio.c b/arch/m68knommu/platform/5307/gpio.c
new file mode 100644
index 000000000000..8da5880e4066
--- /dev/null
+++ b/arch/m68knommu/platform/5307/gpio.c
@@ -0,0 +1,49 @@
1/*
2 * Coldfire generic GPIO support
3 *
4 * (C) Copyright 2009, Steven King <sfking@fdwdc.com>
5 *
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
8 * the Free Software Foundation; version 2 of the License.
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
16#include <linux/kernel.h>
17#include <linux/init.h>
18
19#include <asm/coldfire.h>
20#include <asm/mcfsim.h>
21#include <asm/mcfgpio.h>
22
23static struct mcf_gpio_chip mcf_gpio_chips[] = {
24 {
25 .gpio_chip = {
26 .label = "PP",
27 .request = mcf_gpio_request,
28 .free = mcf_gpio_free,
29 .direction_input = mcf_gpio_direction_input,
30 .direction_output = mcf_gpio_direction_output,
31 .get = mcf_gpio_get_value,
32 .set = mcf_gpio_set_value,
33 .ngpio = 16,
34 },
35 .pddr = MCFSIM_PADDR,
36 .podr = MCFSIM_PADAT,
37 .ppdr = MCFSIM_PADAT,
38 },
39};
40
41static int __init mcf_gpio_init(void)
42{
43 unsigned i = 0;
44 while (i < ARRAY_SIZE(mcf_gpio_chips))
45 (void)gpiochip_add((struct gpio_chip *)&mcf_gpio_chips[i++]);
46 return 0;
47}
48
49core_initcall(mcf_gpio_init);
diff --git a/arch/m68knommu/platform/532x/Makefile b/arch/m68knommu/platform/532x/Makefile
index e431912f5628..4cc23245bcd1 100644
--- a/arch/m68knommu/platform/532x/Makefile
+++ b/arch/m68knommu/platform/532x/Makefile
@@ -15,4 +15,4 @@
15asflags-$(CONFIG_FULLDEBUG) := -DDEBUGGER_COMPATIBLE_CACHE=1 15asflags-$(CONFIG_FULLDEBUG) := -DDEBUGGER_COMPATIBLE_CACHE=1
16 16
17#obj-y := config.o usb-mcf532x.o spi-mcf532x.o 17#obj-y := config.o usb-mcf532x.o spi-mcf532x.o
18obj-y := config.o 18obj-y := config.o gpio.o
diff --git a/arch/m68knommu/platform/532x/config.c b/arch/m68knommu/platform/532x/config.c
index cdb761971f7a..d632948e64e5 100644
--- a/arch/m68knommu/platform/532x/config.c
+++ b/arch/m68knommu/platform/532x/config.c
@@ -20,7 +20,6 @@
20#include <linux/kernel.h> 20#include <linux/kernel.h>
21#include <linux/param.h> 21#include <linux/param.h>
22#include <linux/init.h> 22#include <linux/init.h>
23#include <linux/interrupt.h>
24#include <linux/io.h> 23#include <linux/io.h>
25#include <asm/machdep.h> 24#include <asm/machdep.h>
26#include <asm/coldfire.h> 25#include <asm/coldfire.h>
@@ -31,12 +30,6 @@
31 30
32/***************************************************************************/ 31/***************************************************************************/
33 32
34extern unsigned int mcf_timervector;
35extern unsigned int mcf_profilevector;
36extern unsigned int mcf_timerlevel;
37
38/***************************************************************************/
39
40static struct mcf_platform_uart m532x_uart_platform[] = { 33static struct mcf_platform_uart m532x_uart_platform[] = {
41 { 34 {
42 .mapbase = MCFUART_BASE1, 35 .mapbase = MCFUART_BASE1,
@@ -88,6 +81,7 @@ static struct platform_device m532x_fec = {
88 .num_resources = ARRAY_SIZE(m532x_fec_resources), 81 .num_resources = ARRAY_SIZE(m532x_fec_resources),
89 .resource = m532x_fec_resources, 82 .resource = m532x_fec_resources,
90}; 83};
84
91static struct platform_device *m532x_devices[] __initdata = { 85static struct platform_device *m532x_devices[] __initdata = {
92 &m532x_uart, 86 &m532x_uart,
93 &m532x_fec, 87 &m532x_fec,
@@ -98,18 +92,11 @@ static struct platform_device *m532x_devices[] __initdata = {
98static void __init m532x_uart_init_line(int line, int irq) 92static void __init m532x_uart_init_line(int line, int irq)
99{ 93{
100 if (line == 0) { 94 if (line == 0) {
101 MCF_INTC0_ICR26 = 0x3;
102 MCF_INTC0_CIMR = 26;
103 /* GPIO initialization */ 95 /* GPIO initialization */
104 MCF_GPIO_PAR_UART |= 0x000F; 96 MCF_GPIO_PAR_UART |= 0x000F;
105 } else if (line == 1) { 97 } else if (line == 1) {
106 MCF_INTC0_ICR27 = 0x3;
107 MCF_INTC0_CIMR = 27;
108 /* GPIO initialization */ 98 /* GPIO initialization */
109 MCF_GPIO_PAR_UART |= 0x0FF0; 99 MCF_GPIO_PAR_UART |= 0x0FF0;
110 } else if (line == 2) {
111 MCF_INTC0_ICR28 = 0x3;
112 MCF_INTC0_CIMR = 28;
113 } 100 }
114} 101}
115 102
@@ -125,14 +112,6 @@ static void __init m532x_uarts_init(void)
125 112
126static void __init m532x_fec_init(void) 113static void __init m532x_fec_init(void)
127{ 114{
128 /* Unmask FEC interrupts at ColdFire interrupt controller */
129 MCF_INTC0_ICR36 = 0x2;
130 MCF_INTC0_ICR40 = 0x2;
131 MCF_INTC0_ICR42 = 0x2;
132
133 MCF_INTC0_IMRH &= ~(MCF_INTC_IMRH_INT_MASK36 |
134 MCF_INTC_IMRH_INT_MASK40 | MCF_INTC_IMRH_INT_MASK42);
135
136 /* Set multi-function pins to ethernet mode for fec0 */ 115 /* Set multi-function pins to ethernet mode for fec0 */
137 MCF_GPIO_PAR_FECI2C |= (MCF_GPIO_PAR_FECI2C_PAR_MDC_EMDC | 116 MCF_GPIO_PAR_FECI2C |= (MCF_GPIO_PAR_FECI2C_PAR_MDC_EMDC |
138 MCF_GPIO_PAR_FECI2C_PAR_MDIO_EMDIO); 117 MCF_GPIO_PAR_FECI2C_PAR_MDIO_EMDIO);
@@ -142,26 +121,6 @@ static void __init m532x_fec_init(void)
142 121
143/***************************************************************************/ 122/***************************************************************************/
144 123
145void mcf_settimericr(unsigned int timer, unsigned int level)
146{
147 volatile unsigned char *icrp;
148 unsigned int icr;
149 unsigned char irq;
150
151 if (timer <= 2) {
152 switch (timer) {
153 case 2: irq = 33; icr = MCFSIM_ICR_TIMER2; break;
154 default: irq = 32; icr = MCFSIM_ICR_TIMER1; break;
155 }
156
157 icrp = (volatile unsigned char *) (icr);
158 *icrp = level;
159 mcf_enable_irq0(irq);
160 }
161}
162
163/***************************************************************************/
164
165static void m532x_cpu_reset(void) 124static void m532x_cpu_reset(void)
166{ 125{
167 local_irq_disable(); 126 local_irq_disable();
@@ -172,8 +131,6 @@ static void m532x_cpu_reset(void)
172 131
173void __init config_BSP(char *commandp, int size) 132void __init config_BSP(char *commandp, int size)
174{ 133{
175 mcf_setimr(MCFSIM_IMR_MASKALL);
176
177#if !defined(CONFIG_BOOTPARAM) 134#if !defined(CONFIG_BOOTPARAM)
178 /* Copy command line from FLASH to local buffer... */ 135 /* Copy command line from FLASH to local buffer... */
179 memcpy(commandp, (char *) 0x4000, 4); 136 memcpy(commandp, (char *) 0x4000, 4);
@@ -185,10 +142,6 @@ void __init config_BSP(char *commandp, int size)
185 } 142 }
186#endif 143#endif
187 144
188 mcf_timervector = 64+32;
189 mcf_profilevector = 64+33;
190 mach_reset = m532x_cpu_reset;
191
192#ifdef CONFIG_BDM_DISABLE 145#ifdef CONFIG_BDM_DISABLE
193 /* 146 /*
194 * Disable the BDM clocking. This also turns off most of the rest of 147 * Disable the BDM clocking. This also turns off most of the rest of
@@ -438,8 +391,8 @@ void gpio_init(void)
438 /* Initialize TIN3 as a GPIO output to enable the write 391 /* Initialize TIN3 as a GPIO output to enable the write
439 half of the latch */ 392 half of the latch */
440 MCF_GPIO_PAR_TIMER = 0x00; 393 MCF_GPIO_PAR_TIMER = 0x00;
441 MCF_GPIO_PDDR_TIMER = 0x08; 394 __raw_writeb(0x08, MCFGPIO_PDDR_TIMER);
442 MCF_GPIO_PCLRR_TIMER = 0x0; 395 __raw_writeb(0x00, MCFGPIO_PCLRR_TIMER);
443 396
444} 397}
445 398
diff --git a/arch/m68knommu/platform/532x/gpio.c b/arch/m68knommu/platform/532x/gpio.c
new file mode 100644
index 000000000000..184b77382c3d
--- /dev/null
+++ b/arch/m68knommu/platform/532x/gpio.c
@@ -0,0 +1,337 @@
1/*
2 * Coldfire generic GPIO support
3 *
4 * (C) Copyright 2009, Steven King <sfking@fdwdc.com>
5 *
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
8 * the Free Software Foundation; version 2 of the License.
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
16#include <linux/kernel.h>
17#include <linux/init.h>
18
19#include <asm/coldfire.h>
20#include <asm/mcfsim.h>
21#include <asm/mcfgpio.h>
22
23static struct mcf_gpio_chip mcf_gpio_chips[] = {
24 {
25 .gpio_chip = {
26 .label = "PIRQ",
27 .request = mcf_gpio_request,
28 .free = mcf_gpio_free,
29 .direction_input = mcf_gpio_direction_input,
30 .direction_output = mcf_gpio_direction_output,
31 .get = mcf_gpio_get_value,
32 .set = mcf_gpio_set_value,
33 .ngpio = 8,
34 },
35 .pddr = MCFEPORT_EPDDR,
36 .podr = MCFEPORT_EPDR,
37 .ppdr = MCFEPORT_EPPDR,
38 },
39 {
40 .gpio_chip = {
41 .label = "FECH",
42 .request = mcf_gpio_request,
43 .free = mcf_gpio_free,
44 .direction_input = mcf_gpio_direction_input,
45 .direction_output = mcf_gpio_direction_output,
46 .get = mcf_gpio_get_value,
47 .set = mcf_gpio_set_value_fast,
48 .base = 8,
49 .ngpio = 8,
50 },
51 .pddr = MCFGPIO_PDDR_FECH,
52 .podr = MCFGPIO_PODR_FECH,
53 .ppdr = MCFGPIO_PPDSDR_FECH,
54 .setr = MCFGPIO_PPDSDR_FECH,
55 .clrr = MCFGPIO_PCLRR_FECH,
56 },
57 {
58 .gpio_chip = {
59 .label = "FECL",
60 .request = mcf_gpio_request,
61 .free = mcf_gpio_free,
62 .direction_input = mcf_gpio_direction_input,
63 .direction_output = mcf_gpio_direction_output,
64 .get = mcf_gpio_get_value,
65 .set = mcf_gpio_set_value_fast,
66 .base = 16,
67 .ngpio = 8,
68 },
69 .pddr = MCFGPIO_PDDR_FECL,
70 .podr = MCFGPIO_PODR_FECL,
71 .ppdr = MCFGPIO_PPDSDR_FECL,
72 .setr = MCFGPIO_PPDSDR_FECL,
73 .clrr = MCFGPIO_PCLRR_FECL,
74 },
75 {
76 .gpio_chip = {
77 .label = "SSI",
78 .request = mcf_gpio_request,
79 .free = mcf_gpio_free,
80 .direction_input = mcf_gpio_direction_input,
81 .direction_output = mcf_gpio_direction_output,
82 .get = mcf_gpio_get_value,
83 .set = mcf_gpio_set_value_fast,
84 .base = 24,
85 .ngpio = 5,
86 },
87 .pddr = MCFGPIO_PDDR_SSI,
88 .podr = MCFGPIO_PODR_SSI,
89 .ppdr = MCFGPIO_PPDSDR_SSI,
90 .setr = MCFGPIO_PPDSDR_SSI,
91 .clrr = MCFGPIO_PCLRR_SSI,
92 },
93 {
94 .gpio_chip = {
95 .label = "BUSCTL",
96 .request = mcf_gpio_request,
97 .free = mcf_gpio_free,
98 .direction_input = mcf_gpio_direction_input,
99 .direction_output = mcf_gpio_direction_output,
100 .get = mcf_gpio_get_value,
101 .set = mcf_gpio_set_value_fast,
102 .base = 32,
103 .ngpio = 4,
104 },
105 .pddr = MCFGPIO_PDDR_BUSCTL,
106 .podr = MCFGPIO_PODR_BUSCTL,
107 .ppdr = MCFGPIO_PPDSDR_BUSCTL,
108 .setr = MCFGPIO_PPDSDR_BUSCTL,
109 .clrr = MCFGPIO_PCLRR_BUSCTL,
110 },
111 {
112 .gpio_chip = {
113 .label = "BE",
114 .request = mcf_gpio_request,
115 .free = mcf_gpio_free,
116 .direction_input = mcf_gpio_direction_input,
117 .direction_output = mcf_gpio_direction_output,
118 .get = mcf_gpio_get_value,
119 .set = mcf_gpio_set_value_fast,
120 .base = 40,
121 .ngpio = 4,
122 },
123 .pddr = MCFGPIO_PDDR_BE,
124 .podr = MCFGPIO_PODR_BE,
125 .ppdr = MCFGPIO_PPDSDR_BE,
126 .setr = MCFGPIO_PPDSDR_BE,
127 .clrr = MCFGPIO_PCLRR_BE,
128 },
129 {
130 .gpio_chip = {
131 .label = "CS",
132 .request = mcf_gpio_request,
133 .free = mcf_gpio_free,
134 .direction_input = mcf_gpio_direction_input,
135 .direction_output = mcf_gpio_direction_output,
136 .get = mcf_gpio_get_value,
137 .set = mcf_gpio_set_value_fast,
138 .base = 49,
139 .ngpio = 5,
140 },
141 .pddr = MCFGPIO_PDDR_CS,
142 .podr = MCFGPIO_PODR_CS,
143 .ppdr = MCFGPIO_PPDSDR_CS,
144 .setr = MCFGPIO_PPDSDR_CS,
145 .clrr = MCFGPIO_PCLRR_CS,
146 },
147 {
148 .gpio_chip = {
149 .label = "PWM",
150 .request = mcf_gpio_request,
151 .free = mcf_gpio_free,
152 .direction_input = mcf_gpio_direction_input,
153 .direction_output = mcf_gpio_direction_output,
154 .get = mcf_gpio_get_value,
155 .set = mcf_gpio_set_value_fast,
156 .base = 58,
157 .ngpio = 4,
158 },
159 .pddr = MCFGPIO_PDDR_PWM,
160 .podr = MCFGPIO_PODR_PWM,
161 .ppdr = MCFGPIO_PPDSDR_PWM,
162 .setr = MCFGPIO_PPDSDR_PWM,
163 .clrr = MCFGPIO_PCLRR_PWM,
164 },
165 {
166 .gpio_chip = {
167 .label = "FECI2C",
168 .request = mcf_gpio_request,
169 .free = mcf_gpio_free,
170 .direction_input = mcf_gpio_direction_input,
171 .direction_output = mcf_gpio_direction_output,
172 .get = mcf_gpio_get_value,
173 .set = mcf_gpio_set_value_fast,
174 .base = 64,
175 .ngpio = 4,
176 },
177 .pddr = MCFGPIO_PDDR_FECI2C,
178 .podr = MCFGPIO_PODR_FECI2C,
179 .ppdr = MCFGPIO_PPDSDR_FECI2C,
180 .setr = MCFGPIO_PPDSDR_FECI2C,
181 .clrr = MCFGPIO_PCLRR_FECI2C,
182 },
183 {
184 .gpio_chip = {
185 .label = "UART",
186 .request = mcf_gpio_request,
187 .free = mcf_gpio_free,
188 .direction_input = mcf_gpio_direction_input,
189 .direction_output = mcf_gpio_direction_output,
190 .get = mcf_gpio_get_value,
191 .set = mcf_gpio_set_value_fast,
192 .base = 72,
193 .ngpio = 8,
194 },
195 .pddr = MCFGPIO_PDDR_UART,
196 .podr = MCFGPIO_PODR_UART,
197 .ppdr = MCFGPIO_PPDSDR_UART,
198 .setr = MCFGPIO_PPDSDR_UART,
199 .clrr = MCFGPIO_PCLRR_UART,
200 },
201 {
202 .gpio_chip = {
203 .label = "QSPI",
204 .request = mcf_gpio_request,
205 .free = mcf_gpio_free,
206 .direction_input = mcf_gpio_direction_input,
207 .direction_output = mcf_gpio_direction_output,
208 .get = mcf_gpio_get_value,
209 .set = mcf_gpio_set_value_fast,
210 .base = 80,
211 .ngpio = 6,
212 },
213 .pddr = MCFGPIO_PDDR_QSPI,
214 .podr = MCFGPIO_PODR_QSPI,
215 .ppdr = MCFGPIO_PPDSDR_QSPI,
216 .setr = MCFGPIO_PPDSDR_QSPI,
217 .clrr = MCFGPIO_PCLRR_QSPI,
218 },
219 {
220 .gpio_chip = {
221 .label = "TIMER",
222 .request = mcf_gpio_request,
223 .free = mcf_gpio_free,
224 .direction_input = mcf_gpio_direction_input,
225 .direction_output = mcf_gpio_direction_output,
226 .get = mcf_gpio_get_value,
227 .set = mcf_gpio_set_value_fast,
228 .base = 88,
229 .ngpio = 4,
230 },
231 .pddr = MCFGPIO_PDDR_TIMER,
232 .podr = MCFGPIO_PODR_TIMER,
233 .ppdr = MCFGPIO_PPDSDR_TIMER,
234 .setr = MCFGPIO_PPDSDR_TIMER,
235 .clrr = MCFGPIO_PCLRR_TIMER,
236 },
237 {
238 .gpio_chip = {
239 .label = "LCDDATAH",
240 .request = mcf_gpio_request,
241 .free = mcf_gpio_free,
242 .direction_input = mcf_gpio_direction_input,
243 .direction_output = mcf_gpio_direction_output,
244 .get = mcf_gpio_get_value,
245 .set = mcf_gpio_set_value_fast,
246 .base = 96,
247 .ngpio = 2,
248 },
249 .pddr = MCFGPIO_PDDR_LCDDATAH,
250 .podr = MCFGPIO_PODR_LCDDATAH,
251 .ppdr = MCFGPIO_PPDSDR_LCDDATAH,
252 .setr = MCFGPIO_PPDSDR_LCDDATAH,
253 .clrr = MCFGPIO_PCLRR_LCDDATAH,
254 },
255 {
256 .gpio_chip = {
257 .label = "LCDDATAM",
258 .request = mcf_gpio_request,
259 .free = mcf_gpio_free,
260 .direction_input = mcf_gpio_direction_input,
261 .direction_output = mcf_gpio_direction_output,
262 .get = mcf_gpio_get_value,
263 .set = mcf_gpio_set_value_fast,
264 .base = 104,
265 .ngpio = 8,
266 },
267 .pddr = MCFGPIO_PDDR_LCDDATAM,
268 .podr = MCFGPIO_PODR_LCDDATAM,
269 .ppdr = MCFGPIO_PPDSDR_LCDDATAM,
270 .setr = MCFGPIO_PPDSDR_LCDDATAM,
271 .clrr = MCFGPIO_PCLRR_LCDDATAM,
272 },
273 {
274 .gpio_chip = {
275 .label = "LCDDATAL",
276 .request = mcf_gpio_request,
277 .free = mcf_gpio_free,
278 .direction_input = mcf_gpio_direction_input,
279 .direction_output = mcf_gpio_direction_output,
280 .get = mcf_gpio_get_value,
281 .set = mcf_gpio_set_value_fast,
282 .base = 112,
283 .ngpio = 8,
284 },
285 .pddr = MCFGPIO_PDDR_LCDDATAL,
286 .podr = MCFGPIO_PODR_LCDDATAL,
287 .ppdr = MCFGPIO_PPDSDR_LCDDATAL,
288 .setr = MCFGPIO_PPDSDR_LCDDATAL,
289 .clrr = MCFGPIO_PCLRR_LCDDATAL,
290 },
291 {
292 .gpio_chip = {
293 .label = "LCDCTLH",
294 .request = mcf_gpio_request,
295 .free = mcf_gpio_free,
296 .direction_input = mcf_gpio_direction_input,
297 .direction_output = mcf_gpio_direction_output,
298 .get = mcf_gpio_get_value,
299 .set = mcf_gpio_set_value_fast,
300 .base = 120,
301 .ngpio = 1,
302 },
303 .pddr = MCFGPIO_PDDR_LCDCTLH,
304 .podr = MCFGPIO_PODR_LCDCTLH,
305 .ppdr = MCFGPIO_PPDSDR_LCDCTLH,
306 .setr = MCFGPIO_PPDSDR_LCDCTLH,
307 .clrr = MCFGPIO_PCLRR_LCDCTLH,
308 },
309 {
310 .gpio_chip = {
311 .label = "LCDCTLL",
312 .request = mcf_gpio_request,
313 .free = mcf_gpio_free,
314 .direction_input = mcf_gpio_direction_input,
315 .direction_output = mcf_gpio_direction_output,
316 .get = mcf_gpio_get_value,
317 .set = mcf_gpio_set_value_fast,
318 .base = 128,
319 .ngpio = 8,
320 },
321 .pddr = MCFGPIO_PDDR_LCDCTLL,
322 .podr = MCFGPIO_PODR_LCDCTLL,
323 .ppdr = MCFGPIO_PPDSDR_LCDCTLL,
324 .setr = MCFGPIO_PPDSDR_LCDCTLL,
325 .clrr = MCFGPIO_PCLRR_LCDCTLL,
326 },
327};
328
329static int __init mcf_gpio_init(void)
330{
331 unsigned i = 0;
332 while (i < ARRAY_SIZE(mcf_gpio_chips))
333 (void)gpiochip_add((struct gpio_chip *)&mcf_gpio_chips[i++]);
334 return 0;
335}
336
337core_initcall(mcf_gpio_init);
diff --git a/arch/m68knommu/platform/5407/Makefile b/arch/m68knommu/platform/5407/Makefile
index e6035e7a2d3f..dee62c5dbaa6 100644
--- a/arch/m68knommu/platform/5407/Makefile
+++ b/arch/m68knommu/platform/5407/Makefile
@@ -14,5 +14,5 @@
14 14
15asflags-$(CONFIG_FULLDEBUG) := -DDEBUGGER_COMPATIBLE_CACHE=1 15asflags-$(CONFIG_FULLDEBUG) := -DDEBUGGER_COMPATIBLE_CACHE=1
16 16
17obj-y := config.o 17obj-y := config.o gpio.o
18 18
diff --git a/arch/m68knommu/platform/5407/config.c b/arch/m68knommu/platform/5407/config.c
index b41d942bf8d0..70ea789a400c 100644
--- a/arch/m68knommu/platform/5407/config.c
+++ b/arch/m68knommu/platform/5407/config.c
@@ -20,12 +20,6 @@
20 20
21/***************************************************************************/ 21/***************************************************************************/
22 22
23extern unsigned int mcf_timervector;
24extern unsigned int mcf_profilevector;
25extern unsigned int mcf_timerlevel;
26
27/***************************************************************************/
28
29static struct mcf_platform_uart m5407_uart_platform[] = { 23static struct mcf_platform_uart m5407_uart_platform[] = {
30 { 24 {
31 .mapbase = MCF_MBAR + MCFUART_BASE1, 25 .mapbase = MCF_MBAR + MCFUART_BASE1,
@@ -55,11 +49,11 @@ static void __init m5407_uart_init_line(int line, int irq)
55 if (line == 0) { 49 if (line == 0) {
56 writeb(MCFSIM_ICR_LEVEL6 | MCFSIM_ICR_PRI1, MCF_MBAR + MCFSIM_UART1ICR); 50 writeb(MCFSIM_ICR_LEVEL6 | MCFSIM_ICR_PRI1, MCF_MBAR + MCFSIM_UART1ICR);
57 writeb(irq, MCF_MBAR + MCFUART_BASE1 + MCFUART_UIVR); 51 writeb(irq, MCF_MBAR + MCFUART_BASE1 + MCFUART_UIVR);
58 mcf_setimr(mcf_getimr() & ~MCFSIM_IMR_UART1); 52 mcf_mapirq2imr(irq, MCFINTC_UART0);
59 } else if (line == 1) { 53 } else if (line == 1) {
60 writeb(MCFSIM_ICR_LEVEL6 | MCFSIM_ICR_PRI2, MCF_MBAR + MCFSIM_UART2ICR); 54 writeb(MCFSIM_ICR_LEVEL6 | MCFSIM_ICR_PRI2, MCF_MBAR + MCFSIM_UART2ICR);
61 writeb(irq, MCF_MBAR + MCFUART_BASE2 + MCFUART_UIVR); 55 writeb(irq, MCF_MBAR + MCFUART_BASE2 + MCFUART_UIVR);
62 mcf_setimr(mcf_getimr() & ~MCFSIM_IMR_UART2); 56 mcf_mapirq2imr(irq, MCFINTC_UART1);
63 } 57 }
64} 58}
65 59
@@ -74,35 +68,19 @@ static void __init m5407_uarts_init(void)
74 68
75/***************************************************************************/ 69/***************************************************************************/
76 70
77void mcf_autovector(unsigned int vec) 71static void __init m5407_timers_init(void)
78{
79 volatile unsigned char *mbar;
80
81 if ((vec >= 25) && (vec <= 31)) {
82 mbar = (volatile unsigned char *) MCF_MBAR;
83 vec = 0x1 << (vec - 24);
84 *(mbar + MCFSIM_AVR) |= vec;
85 mcf_setimr(mcf_getimr() & ~vec);
86 }
87}
88
89/***************************************************************************/
90
91void mcf_settimericr(unsigned int timer, unsigned int level)
92{ 72{
93 volatile unsigned char *icrp; 73 /* Timer1 is always used as system timer */
94 unsigned int icr, imr; 74 writeb(MCFSIM_ICR_AUTOVEC | MCFSIM_ICR_LEVEL6 | MCFSIM_ICR_PRI3,
95 75 MCF_MBAR + MCFSIM_TIMER1ICR);
96 if (timer <= 2) { 76 mcf_mapirq2imr(MCF_IRQ_TIMER, MCFINTC_TIMER1);
97 switch (timer) { 77
98 case 2: icr = MCFSIM_TIMER2ICR; imr = MCFSIM_IMR_TIMER2; break; 78#ifdef CONFIG_HIGHPROFILE
99 default: icr = MCFSIM_TIMER1ICR; imr = MCFSIM_IMR_TIMER1; break; 79 /* Timer2 is to be used as a high speed profile timer */
100 } 80 writeb(MCFSIM_ICR_AUTOVEC | MCFSIM_ICR_LEVEL7 | MCFSIM_ICR_PRI3,
101 81 MCF_MBAR + MCFSIM_TIMER2ICR);
102 icrp = (volatile unsigned char *) (MCF_MBAR + icr); 82 mcf_mapirq2imr(MCF_IRQ_PROFILER, MCFINTC_TIMER2);
103 *icrp = MCFSIM_ICR_AUTOVEC | (level << 2) | MCFSIM_ICR_PRI3; 83#endif
104 mcf_setimr(mcf_getimr() & ~imr);
105 }
106} 84}
107 85
108/***************************************************************************/ 86/***************************************************************************/
@@ -120,23 +98,21 @@ void m5407_cpu_reset(void)
120 98
121void __init config_BSP(char *commandp, int size) 99void __init config_BSP(char *commandp, int size)
122{ 100{
123 mcf_setimr(MCFSIM_IMR_MASKALL);
124
125#if defined(CONFIG_CLEOPATRA)
126 /* Different timer setup - to prevent device clash */
127 mcf_timervector = 30;
128 mcf_profilevector = 31;
129 mcf_timerlevel = 6;
130#endif
131
132 mach_reset = m5407_cpu_reset; 101 mach_reset = m5407_cpu_reset;
102 m5407_timers_init();
103 m5407_uarts_init();
104
105 /* Only support the external interrupts on their primary level */
106 mcf_mapirq2imr(25, MCFINTC_EINT1);
107 mcf_mapirq2imr(27, MCFINTC_EINT3);
108 mcf_mapirq2imr(29, MCFINTC_EINT5);
109 mcf_mapirq2imr(31, MCFINTC_EINT7);
133} 110}
134 111
135/***************************************************************************/ 112/***************************************************************************/
136 113
137static int __init init_BSP(void) 114static int __init init_BSP(void)
138{ 115{
139 m5407_uarts_init();
140 platform_add_devices(m5407_devices, ARRAY_SIZE(m5407_devices)); 116 platform_add_devices(m5407_devices, ARRAY_SIZE(m5407_devices));
141 return 0; 117 return 0;
142} 118}
diff --git a/arch/m68knommu/platform/5407/gpio.c b/arch/m68knommu/platform/5407/gpio.c
new file mode 100644
index 000000000000..8da5880e4066
--- /dev/null
+++ b/arch/m68knommu/platform/5407/gpio.c
@@ -0,0 +1,49 @@
1/*
2 * Coldfire generic GPIO support
3 *
4 * (C) Copyright 2009, Steven King <sfking@fdwdc.com>
5 *
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
8 * the Free Software Foundation; version 2 of the License.
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
16#include <linux/kernel.h>
17#include <linux/init.h>
18
19#include <asm/coldfire.h>
20#include <asm/mcfsim.h>
21#include <asm/mcfgpio.h>
22
23static struct mcf_gpio_chip mcf_gpio_chips[] = {
24 {
25 .gpio_chip = {
26 .label = "PP",
27 .request = mcf_gpio_request,
28 .free = mcf_gpio_free,
29 .direction_input = mcf_gpio_direction_input,
30 .direction_output = mcf_gpio_direction_output,
31 .get = mcf_gpio_get_value,
32 .set = mcf_gpio_set_value,
33 .ngpio = 16,
34 },
35 .pddr = MCFSIM_PADDR,
36 .podr = MCFSIM_PADAT,
37 .ppdr = MCFSIM_PADAT,
38 },
39};
40
41static int __init mcf_gpio_init(void)
42{
43 unsigned i = 0;
44 while (i < ARRAY_SIZE(mcf_gpio_chips))
45 (void)gpiochip_add((struct gpio_chip *)&mcf_gpio_chips[i++]);
46 return 0;
47}
48
49core_initcall(mcf_gpio_init);
diff --git a/arch/m68knommu/platform/68328/ints.c b/arch/m68knommu/platform/68328/ints.c
index 72e56d554f4f..b91ee85d4b5d 100644
--- a/arch/m68knommu/platform/68328/ints.c
+++ b/arch/m68knommu/platform/68328/ints.c
@@ -73,34 +73,6 @@ extern e_vector *_ramvec;
73/* The number of spurious interrupts */ 73/* The number of spurious interrupts */
74volatile unsigned int num_spurious; 74volatile unsigned int num_spurious;
75 75
76/*
77 * This function should be called during kernel startup to initialize
78 * the machine vector table.
79 */
80void __init init_vectors(void)
81{
82 int i;
83
84 /* set up the vectors */
85 for (i = 72; i < 256; ++i)
86 _ramvec[i] = (e_vector) bad_interrupt;
87
88 _ramvec[32] = system_call;
89
90 _ramvec[65] = (e_vector) inthandler1;
91 _ramvec[66] = (e_vector) inthandler2;
92 _ramvec[67] = (e_vector) inthandler3;
93 _ramvec[68] = (e_vector) inthandler4;
94 _ramvec[69] = (e_vector) inthandler5;
95 _ramvec[70] = (e_vector) inthandler6;
96 _ramvec[71] = (e_vector) inthandler7;
97
98 IVR = 0x40; /* Set DragonBall IVR (interrupt base) to 64 */
99
100 /* turn off all interrupts */
101 IMR = ~0;
102}
103
104/* The 68k family did not have a good way to determine the source 76/* The 68k family did not have a good way to determine the source
105 * of interrupts until later in the family. The EC000 core does 77 * of interrupts until later in the family. The EC000 core does
106 * not provide the vector number on the stack, we vector everything 78 * not provide the vector number on the stack, we vector everything
@@ -163,18 +135,54 @@ void process_int(int vec, struct pt_regs *fp)
163 } 135 }
164} 136}
165 137
166void enable_vector(unsigned int irq) 138static void intc_irq_unmask(unsigned int irq)
167{ 139{
168 IMR &= ~(1<<irq); 140 IMR &= ~(1<<irq);
169} 141}
170 142
171void disable_vector(unsigned int irq) 143static void intc_irq_mask(unsigned int irq)
172{ 144{
173 IMR |= (1<<irq); 145 IMR |= (1<<irq);
174} 146}
175 147
176void ack_vector(unsigned int irq) 148static struct irq_chip intc_irq_chip = {
149 .name = "M68K-INTC",
150 .mask = intc_irq_mask,
151 .unmask = intc_irq_unmask,
152};
153
154/*
155 * This function should be called during kernel startup to initialize
156 * the machine vector table.
157 */
158void __init init_IRQ(void)
177{ 159{
178 /* Nothing needed */ 160 int i;
161
162 /* set up the vectors */
163 for (i = 72; i < 256; ++i)
164 _ramvec[i] = (e_vector) bad_interrupt;
165
166 _ramvec[32] = system_call;
167
168 _ramvec[65] = (e_vector) inthandler1;
169 _ramvec[66] = (e_vector) inthandler2;
170 _ramvec[67] = (e_vector) inthandler3;
171 _ramvec[68] = (e_vector) inthandler4;
172 _ramvec[69] = (e_vector) inthandler5;
173 _ramvec[70] = (e_vector) inthandler6;
174 _ramvec[71] = (e_vector) inthandler7;
175
176 IVR = 0x40; /* Set DragonBall IVR (interrupt base) to 64 */
177
178 /* turn off all interrupts */
179 IMR = ~0;
180
181 for (i = 0; (i < NR_IRQS); i++) {
182 irq_desc[i].status = IRQ_DISABLED;
183 irq_desc[i].action = NULL;
184 irq_desc[i].depth = 1;
185 irq_desc[i].chip = &intc_irq_chip;
186 }
179} 187}
180 188
diff --git a/arch/m68knommu/platform/68360/ints.c b/arch/m68knommu/platform/68360/ints.c
index c36781157e09..1143f77caca4 100644
--- a/arch/m68knommu/platform/68360/ints.c
+++ b/arch/m68knommu/platform/68360/ints.c
@@ -37,11 +37,33 @@ extern void *_ramvec[];
37/* The number of spurious interrupts */ 37/* The number of spurious interrupts */
38volatile unsigned int num_spurious; 38volatile unsigned int num_spurious;
39 39
40static void intc_irq_unmask(unsigned int irq)
41{
42 pquicc->intr_cimr |= (1 << irq);
43}
44
45static void intc_irq_mask(unsigned int irq)
46{
47 pquicc->intr_cimr &= ~(1 << irq);
48}
49
50static void intc_irq_ack(unsigned int irq)
51{
52 pquicc->intr_cisr = (1 << irq);
53}
54
55static struct irq_chip intc_irq_chip = {
56 .name = "M68K-INTC",
57 .mask = intc_irq_mask,
58 .unmask = intc_irq_unmask,
59 .ack = intc_irq_ack,
60};
61
40/* 62/*
41 * This function should be called during kernel startup to initialize 63 * This function should be called during kernel startup to initialize
42 * the vector table. 64 * the vector table.
43 */ 65 */
44void init_vectors(void) 66void init_IRQ(void)
45{ 67{
46 int i; 68 int i;
47 int vba = (CPM_VECTOR_BASE<<4); 69 int vba = (CPM_VECTOR_BASE<<4);
@@ -109,20 +131,12 @@ void init_vectors(void)
109 131
110 /* turn off all CPM interrupts */ 132 /* turn off all CPM interrupts */
111 pquicc->intr_cimr = 0x00000000; 133 pquicc->intr_cimr = 0x00000000;
112}
113
114void enable_vector(unsigned int irq)
115{
116 pquicc->intr_cimr |= (1 << irq);
117}
118 134
119void disable_vector(unsigned int irq) 135 for (i = 0; (i < NR_IRQS); i++) {
120{ 136 irq_desc[i].status = IRQ_DISABLED;
121 pquicc->intr_cimr &= ~(1 << irq); 137 irq_desc[i].action = NULL;
122} 138 irq_desc[i].depth = 1;
123 139 irq_desc[i].chip = &intc_irq_chip;
124void ack_vector(unsigned int irq) 140 }
125{
126 pquicc->intr_cisr = (1 << irq);
127} 141}
128 142
diff --git a/arch/m68knommu/platform/coldfire/Makefile b/arch/m68knommu/platform/coldfire/Makefile
index 1bcb9372353f..f72a0e5d9996 100644
--- a/arch/m68knommu/platform/coldfire/Makefile
+++ b/arch/m68knommu/platform/coldfire/Makefile
@@ -15,16 +15,17 @@
15asflags-$(CONFIG_FULLDEBUG) := -DDEBUGGER_COMPATIBLE_CACHE=1 15asflags-$(CONFIG_FULLDEBUG) := -DDEBUGGER_COMPATIBLE_CACHE=1
16 16
17obj-$(CONFIG_COLDFIRE) += clk.o dma.o entry.o vectors.o 17obj-$(CONFIG_COLDFIRE) += clk.o dma.o entry.o vectors.o
18obj-$(CONFIG_M5206) += timers.o 18obj-$(CONFIG_M5206) += timers.o intc.o
19obj-$(CONFIG_M5206e) += timers.o 19obj-$(CONFIG_M5206e) += timers.o intc.o
20obj-$(CONFIG_M520x) += pit.o 20obj-$(CONFIG_M520x) += pit.o intc-simr.o
21obj-$(CONFIG_M523x) += pit.o dma_timer.o 21obj-$(CONFIG_M523x) += pit.o dma_timer.o intc-2.o
22obj-$(CONFIG_M5249) += timers.o 22obj-$(CONFIG_M5249) += timers.o intc.o
23obj-$(CONFIG_M527x) += pit.o 23obj-$(CONFIG_M527x) += pit.o intc-2.o
24obj-$(CONFIG_M5272) += timers.o 24obj-$(CONFIG_M5272) += timers.o
25obj-$(CONFIG_M528x) += pit.o 25obj-$(CONFIG_M528x) += pit.o intc-2.o
26obj-$(CONFIG_M5307) += timers.o 26obj-$(CONFIG_M5307) += timers.o intc.o
27obj-$(CONFIG_M532x) += timers.o 27obj-$(CONFIG_M532x) += timers.o intc-simr.o
28obj-$(CONFIG_M5407) += timers.o 28obj-$(CONFIG_M5407) += timers.o intc.o
29 29
30obj-y += pinmux.o gpio.o
30extra-y := head.o 31extra-y := head.o
diff --git a/arch/m68knommu/platform/coldfire/gpio.c b/arch/m68knommu/platform/coldfire/gpio.c
new file mode 100644
index 000000000000..ff0045793450
--- /dev/null
+++ b/arch/m68knommu/platform/coldfire/gpio.c
@@ -0,0 +1,127 @@
1/*
2 * Coldfire generic GPIO support.
3 *
4 * (C) Copyright 2009, Steven King <sfking@fdwdc.com>
5 *
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
8 * the Free Software Foundation; version 2 of the License.
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
16#include <linux/kernel.h>
17#include <linux/init.h>
18#include <linux/sysdev.h>
19
20#include <asm/gpio.h>
21#include <asm/pinmux.h>
22#include <asm/mcfgpio.h>
23
24#define MCF_CHIP(chip) container_of(chip, struct mcf_gpio_chip, gpio_chip)
25
26int mcf_gpio_direction_input(struct gpio_chip *chip, unsigned offset)
27{
28 unsigned long flags;
29 MCFGPIO_PORTTYPE dir;
30 struct mcf_gpio_chip *mcf_chip = MCF_CHIP(chip);
31
32 local_irq_save(flags);
33 dir = mcfgpio_read(mcf_chip->pddr);
34 dir &= ~mcfgpio_bit(chip->base + offset);
35 mcfgpio_write(dir, mcf_chip->pddr);
36 local_irq_restore(flags);
37
38 return 0;
39}
40
41int mcf_gpio_get_value(struct gpio_chip *chip, unsigned offset)
42{
43 struct mcf_gpio_chip *mcf_chip = MCF_CHIP(chip);
44
45 return mcfgpio_read(mcf_chip->ppdr) & mcfgpio_bit(chip->base + offset);
46}
47
48int mcf_gpio_direction_output(struct gpio_chip *chip, unsigned offset,
49 int value)
50{
51 unsigned long flags;
52 MCFGPIO_PORTTYPE data;
53 struct mcf_gpio_chip *mcf_chip = MCF_CHIP(chip);
54
55 local_irq_save(flags);
56 /* write the value to the output latch */
57 data = mcfgpio_read(mcf_chip->podr);
58 if (value)
59 data |= mcfgpio_bit(chip->base + offset);
60 else
61 data &= ~mcfgpio_bit(chip->base + offset);
62 mcfgpio_write(data, mcf_chip->podr);
63
64 /* now set the direction to output */
65 data = mcfgpio_read(mcf_chip->pddr);
66 data |= mcfgpio_bit(chip->base + offset);
67 mcfgpio_write(data, mcf_chip->pddr);
68 local_irq_restore(flags);
69
70 return 0;
71}
72
73void mcf_gpio_set_value(struct gpio_chip *chip, unsigned offset, int value)
74{
75 struct mcf_gpio_chip *mcf_chip = MCF_CHIP(chip);
76
77 unsigned long flags;
78 MCFGPIO_PORTTYPE data;
79
80 local_irq_save(flags);
81 data = mcfgpio_read(mcf_chip->podr);
82 if (value)
83 data |= mcfgpio_bit(chip->base + offset);
84 else
85 data &= ~mcfgpio_bit(chip->base + offset);
86 mcfgpio_write(data, mcf_chip->podr);
87 local_irq_restore(flags);
88}
89
90void mcf_gpio_set_value_fast(struct gpio_chip *chip, unsigned offset, int value)
91{
92 struct mcf_gpio_chip *mcf_chip = MCF_CHIP(chip);
93
94 if (value)
95 mcfgpio_write(mcfgpio_bit(chip->base + offset), mcf_chip->setr);
96 else
97 mcfgpio_write(~mcfgpio_bit(chip->base + offset), mcf_chip->clrr);
98}
99
100int mcf_gpio_request(struct gpio_chip *chip, unsigned offset)
101{
102 struct mcf_gpio_chip *mcf_chip = MCF_CHIP(chip);
103
104 return mcf_chip->gpio_to_pinmux ?
105 mcf_pinmux_request(mcf_chip->gpio_to_pinmux[offset], 0) : 0;
106}
107
108void mcf_gpio_free(struct gpio_chip *chip, unsigned offset)
109{
110 struct mcf_gpio_chip *mcf_chip = MCF_CHIP(chip);
111
112 mcf_gpio_direction_input(chip, offset);
113
114 if (mcf_chip->gpio_to_pinmux)
115 mcf_pinmux_release(mcf_chip->gpio_to_pinmux[offset], 0);
116}
117
118struct sysdev_class mcf_gpio_sysclass = {
119 .name = "gpio",
120};
121
122static int __init mcf_gpio_sysinit(void)
123{
124 return sysdev_class_register(&mcf_gpio_sysclass);
125}
126
127core_initcall(mcf_gpio_sysinit);
diff --git a/arch/m68knommu/platform/coldfire/intc-2.c b/arch/m68knommu/platform/coldfire/intc-2.c
new file mode 100644
index 000000000000..5598c8b8661f
--- /dev/null
+++ b/arch/m68knommu/platform/coldfire/intc-2.c
@@ -0,0 +1,93 @@
1/*
2 * intc-1.c
3 *
4 * (C) Copyright 2009, Greg Ungerer <gerg@snapgear.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#include <linux/types.h>
12#include <linux/init.h>
13#include <linux/kernel.h>
14#include <linux/interrupt.h>
15#include <linux/irq.h>
16#include <linux/io.h>
17#include <asm/coldfire.h>
18#include <asm/mcfsim.h>
19#include <asm/traps.h>
20
21/*
22 * Each vector needs a unique priority and level asscoiated with it.
23 * We don't really care so much what they are, we don't rely on the
24 * tranditional priority interrupt scheme of the m68k/ColdFire.
25 */
26static u8 intc_intpri = 0x36;
27
28static void intc_irq_mask(unsigned int irq)
29{
30 if ((irq >= MCFINT_VECBASE) && (irq <= MCFINT_VECBASE + 128)) {
31 unsigned long imraddr;
32 u32 val, imrbit;
33
34 irq -= MCFINT_VECBASE;
35 imraddr = MCF_IPSBAR;
36 imraddr += (irq & 0x40) ? MCFICM_INTC1 : MCFICM_INTC0;
37 imraddr += (irq & 0x20) ? MCFINTC_IMRH : MCFINTC_IMRL;
38 imrbit = 0x1 << (irq & 0x1f);
39
40 val = __raw_readl(imraddr);
41 __raw_writel(val | imrbit, imraddr);
42 }
43}
44
45static void intc_irq_unmask(unsigned int irq)
46{
47 if ((irq >= MCFINT_VECBASE) && (irq <= MCFINT_VECBASE + 128)) {
48 unsigned long intaddr, imraddr, icraddr;
49 u32 val, imrbit;
50
51 irq -= MCFINT_VECBASE;
52 intaddr = MCF_IPSBAR;
53 intaddr += (irq & 0x40) ? MCFICM_INTC1 : MCFICM_INTC0;
54 imraddr = intaddr + ((irq & 0x20) ? MCFINTC_IMRH : MCFINTC_IMRL);
55 icraddr = intaddr + MCFINTC_ICR0 + (irq & 0x3f);
56 imrbit = 0x1 << (irq & 0x1f);
57
58 /* Don't set the "maskall" bit! */
59 if ((irq & 0x20) == 0)
60 imrbit |= 0x1;
61
62 if (__raw_readb(icraddr) == 0)
63 __raw_writeb(intc_intpri--, icraddr);
64
65 val = __raw_readl(imraddr);
66 __raw_writel(val & ~imrbit, imraddr);
67 }
68}
69
70static struct irq_chip intc_irq_chip = {
71 .name = "CF-INTC",
72 .mask = intc_irq_mask,
73 .unmask = intc_irq_unmask,
74};
75
76void __init init_IRQ(void)
77{
78 int irq;
79
80 init_vectors();
81
82 /* Mask all interrupt sources */
83 __raw_writel(0x1, MCF_IPSBAR + MCFICM_INTC0 + MCFINTC_IMRL);
84 __raw_writel(0x1, MCF_IPSBAR + MCFICM_INTC1 + MCFINTC_IMRL);
85
86 for (irq = 0; (irq < NR_IRQS); irq++) {
87 irq_desc[irq].status = IRQ_DISABLED;
88 irq_desc[irq].action = NULL;
89 irq_desc[irq].depth = 1;
90 irq_desc[irq].chip = &intc_irq_chip;
91 }
92}
93
diff --git a/arch/m68knommu/platform/coldfire/intc-simr.c b/arch/m68knommu/platform/coldfire/intc-simr.c
new file mode 100644
index 000000000000..1b01e79c2f63
--- /dev/null
+++ b/arch/m68knommu/platform/coldfire/intc-simr.c
@@ -0,0 +1,78 @@
1/*
2 * intc-simr.c
3 *
4 * (C) Copyright 2009, Greg Ungerer <gerg@snapgear.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#include <linux/types.h>
12#include <linux/init.h>
13#include <linux/kernel.h>
14#include <linux/interrupt.h>
15#include <linux/irq.h>
16#include <linux/io.h>
17#include <asm/coldfire.h>
18#include <asm/mcfsim.h>
19#include <asm/traps.h>
20
21static void intc_irq_mask(unsigned int irq)
22{
23 if (irq >= MCFINT_VECBASE) {
24 if (irq < MCFINT_VECBASE + 64)
25 __raw_writeb(irq - MCFINT_VECBASE, MCFINTC0_SIMR);
26 else if ((irq < MCFINT_VECBASE + 128) && MCFINTC1_SIMR)
27 __raw_writeb(irq - MCFINT_VECBASE - 64, MCFINTC1_SIMR);
28 }
29}
30
31static void intc_irq_unmask(unsigned int irq)
32{
33 if (irq >= MCFINT_VECBASE) {
34 if (irq < MCFINT_VECBASE + 64)
35 __raw_writeb(irq - MCFINT_VECBASE, MCFINTC0_CIMR);
36 else if ((irq < MCFINT_VECBASE + 128) && MCFINTC1_CIMR)
37 __raw_writeb(irq - MCFINT_VECBASE - 64, MCFINTC1_CIMR);
38 }
39}
40
41static int intc_irq_set_type(unsigned int irq, unsigned int type)
42{
43 if (irq >= MCFINT_VECBASE) {
44 if (irq < MCFINT_VECBASE + 64)
45 __raw_writeb(5, MCFINTC0_ICR0 + irq - MCFINT_VECBASE);
46 else if ((irq < MCFINT_VECBASE) && MCFINTC1_ICR0)
47 __raw_writeb(5, MCFINTC1_ICR0 + irq - MCFINT_VECBASE - 64);
48 }
49 return 0;
50}
51
52static struct irq_chip intc_irq_chip = {
53 .name = "CF-INTC",
54 .mask = intc_irq_mask,
55 .unmask = intc_irq_unmask,
56 .set_type = intc_irq_set_type,
57};
58
59void __init init_IRQ(void)
60{
61 int irq;
62
63 init_vectors();
64
65 /* Mask all interrupt sources */
66 __raw_writeb(0xff, MCFINTC0_SIMR);
67 if (MCFINTC1_SIMR)
68 __raw_writeb(0xff, MCFINTC1_SIMR);
69
70 for (irq = 0; (irq < NR_IRQS); irq++) {
71 irq_desc[irq].status = IRQ_DISABLED;
72 irq_desc[irq].action = NULL;
73 irq_desc[irq].depth = 1;
74 irq_desc[irq].chip = &intc_irq_chip;
75 intc_irq_set_type(irq, 0);
76 }
77}
78
diff --git a/arch/m68knommu/platform/coldfire/intc.c b/arch/m68knommu/platform/coldfire/intc.c
new file mode 100644
index 000000000000..a4560c86db71
--- /dev/null
+++ b/arch/m68knommu/platform/coldfire/intc.c
@@ -0,0 +1,153 @@
1/*
2 * intc.c -- support for the old ColdFire interrupt controller
3 *
4 * (C) Copyright 2009, Greg Ungerer <gerg@snapgear.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#include <linux/types.h>
12#include <linux/init.h>
13#include <linux/kernel.h>
14#include <linux/interrupt.h>
15#include <linux/irq.h>
16#include <linux/io.h>
17#include <asm/traps.h>
18#include <asm/coldfire.h>
19#include <asm/mcfsim.h>
20
21/*
22 * The mapping of irq number to a mask register bit is not one-to-one.
23 * The irq numbers are either based on "level" of interrupt or fixed
24 * for an autovector-able interrupt. So we keep a local data structure
25 * that maps from irq to mask register. Not all interrupts will have
26 * an IMR bit.
27 */
28unsigned char mcf_irq2imr[NR_IRQS];
29
30/*
31 * Define the miniumun and maximum external interrupt numbers.
32 * This is also used as the "level" interrupt numbers.
33 */
34#define EIRQ1 25
35#define EIRQ7 31
36
37/*
38 * In the early version 2 core ColdFire parts the IMR register was 16 bits
39 * in size. Version 3 (and later version 2) core parts have a 32 bit
40 * sized IMR register. Provide some size independant methods to access the
41 * IMR register.
42 */
43#ifdef MCFSIM_IMR_IS_16BITS
44
45void mcf_setimr(int index)
46{
47 u16 imr;
48 imr = __raw_readw(MCF_MBAR + MCFSIM_IMR);
49 __raw_writew(imr | (0x1 << index), MCF_MBAR + MCFSIM_IMR);
50}
51
52void mcf_clrimr(int index)
53{
54 u16 imr;
55 imr = __raw_readw(MCF_MBAR + MCFSIM_IMR);
56 __raw_writew(imr & ~(0x1 << index), MCF_MBAR + MCFSIM_IMR);
57}
58
59void mcf_maskimr(unsigned int mask)
60{
61 u16 imr;
62 imr = __raw_readw(MCF_MBAR + MCFSIM_IMR);
63 imr |= mask;
64 __raw_writew(imr, MCF_MBAR + MCFSIM_IMR);
65}
66
67#else
68
69void mcf_setimr(int index)
70{
71 u32 imr;
72 imr = __raw_readl(MCF_MBAR + MCFSIM_IMR);
73 __raw_writel(imr | (0x1 << index), MCF_MBAR + MCFSIM_IMR);
74}
75
76void mcf_clrimr(int index)
77{
78 u32 imr;
79 imr = __raw_readl(MCF_MBAR + MCFSIM_IMR);
80 __raw_writel(imr & ~(0x1 << index), MCF_MBAR + MCFSIM_IMR);
81}
82
83void mcf_maskimr(unsigned int mask)
84{
85 u32 imr;
86 imr = __raw_readl(MCF_MBAR + MCFSIM_IMR);
87 imr |= mask;
88 __raw_writel(imr, MCF_MBAR + MCFSIM_IMR);
89}
90
91#endif
92
93/*
94 * Interrupts can be "vectored" on the ColdFire cores that support this old
95 * interrupt controller. That is, the device raising the interrupt can also
96 * supply the vector number to interrupt through. The AVR register of the
97 * interrupt controller enables or disables this for each external interrupt,
98 * so provide generic support for this. Setting this up is out-of-band for
99 * the interrupt system API's, and needs to be done by the driver that
100 * supports this device. Very few devices actually use this.
101 */
102void mcf_autovector(int irq)
103{
104#ifdef MCFSIM_AVR
105 if ((irq >= EIRQ1) && (irq <= EIRQ7)) {
106 u8 avec;
107 avec = __raw_readb(MCF_MBAR + MCFSIM_AVR);
108 avec |= (0x1 << (irq - EIRQ1 + 1));
109 __raw_writeb(avec, MCF_MBAR + MCFSIM_AVR);
110 }
111#endif
112}
113
114static void intc_irq_mask(unsigned int irq)
115{
116 if (mcf_irq2imr[irq])
117 mcf_setimr(mcf_irq2imr[irq]);
118}
119
120static void intc_irq_unmask(unsigned int irq)
121{
122 if (mcf_irq2imr[irq])
123 mcf_clrimr(mcf_irq2imr[irq]);
124}
125
126static int intc_irq_set_type(unsigned int irq, unsigned int type)
127{
128 return 0;
129}
130
131static struct irq_chip intc_irq_chip = {
132 .name = "CF-INTC",
133 .mask = intc_irq_mask,
134 .unmask = intc_irq_unmask,
135 .set_type = intc_irq_set_type,
136};
137
138void __init init_IRQ(void)
139{
140 int irq;
141
142 init_vectors();
143 mcf_maskimr(0xffffffff);
144
145 for (irq = 0; (irq < NR_IRQS); irq++) {
146 irq_desc[irq].status = IRQ_DISABLED;
147 irq_desc[irq].action = NULL;
148 irq_desc[irq].depth = 1;
149 irq_desc[irq].chip = &intc_irq_chip;
150 intc_irq_set_type(irq, 0);
151 }
152}
153
diff --git a/arch/m68knommu/platform/coldfire/pinmux.c b/arch/m68knommu/platform/coldfire/pinmux.c
new file mode 100644
index 000000000000..8c62b825939f
--- /dev/null
+++ b/arch/m68knommu/platform/coldfire/pinmux.c
@@ -0,0 +1,28 @@
1/*
2 * Coldfire generic GPIO pinmux support.
3 *
4 * (C) Copyright 2009, Steven King <sfking@fdwdc.com>
5 *
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
8 * the Free Software Foundation; version 2 of the License.
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 */
16
17#include <linux/kernel.h>
18
19#include <asm/pinmux.h>
20
21int mcf_pinmux_request(unsigned pinmux, unsigned func)
22{
23 return 0;
24}
25
26void mcf_pinmux_release(unsigned pinmux, unsigned func)
27{
28}
diff --git a/arch/m68knommu/platform/coldfire/pit.c b/arch/m68knommu/platform/coldfire/pit.c
index 61b96211f8ff..d8720ee34510 100644
--- a/arch/m68knommu/platform/coldfire/pit.c
+++ b/arch/m68knommu/platform/coldfire/pit.c
@@ -32,7 +32,6 @@
32 */ 32 */
33#define FREQ ((MCF_CLK / 2) / 64) 33#define FREQ ((MCF_CLK / 2) / 64)
34#define TA(a) (MCF_IPSBAR + MCFPIT_BASE1 + (a)) 34#define TA(a) (MCF_IPSBAR + MCFPIT_BASE1 + (a))
35#define INTC0 (MCF_IPSBAR + MCFICM_INTC0)
36#define PIT_CYCLES_PER_JIFFY (FREQ / HZ) 35#define PIT_CYCLES_PER_JIFFY (FREQ / HZ)
37 36
38static u32 pit_cnt; 37static u32 pit_cnt;
@@ -154,8 +153,6 @@ static struct clocksource pit_clk = {
154 153
155void hw_timer_init(void) 154void hw_timer_init(void)
156{ 155{
157 u32 imr;
158
159 cf_pit_clockevent.cpumask = cpumask_of(smp_processor_id()); 156 cf_pit_clockevent.cpumask = cpumask_of(smp_processor_id());
160 cf_pit_clockevent.mult = div_sc(FREQ, NSEC_PER_SEC, 32); 157 cf_pit_clockevent.mult = div_sc(FREQ, NSEC_PER_SEC, 32);
161 cf_pit_clockevent.max_delta_ns = 158 cf_pit_clockevent.max_delta_ns =
@@ -166,11 +163,6 @@ void hw_timer_init(void)
166 163
167 setup_irq(MCFINT_VECBASE + MCFINT_PIT1, &pit_irq); 164 setup_irq(MCFINT_VECBASE + MCFINT_PIT1, &pit_irq);
168 165
169 __raw_writeb(ICR_INTRCONF, INTC0 + MCFINTC_ICR0 + MCFINT_PIT1);
170 imr = __raw_readl(INTC0 + MCFPIT_IMR);
171 imr &= ~MCFPIT_IMR_IBIT;
172 __raw_writel(imr, INTC0 + MCFPIT_IMR);
173
174 pit_clk.mult = clocksource_hz2mult(FREQ, pit_clk.shift); 166 pit_clk.mult = clocksource_hz2mult(FREQ, pit_clk.shift);
175 clocksource_register(&pit_clk); 167 clocksource_register(&pit_clk);
176} 168}
diff --git a/arch/m68knommu/platform/coldfire/timers.c b/arch/m68knommu/platform/coldfire/timers.c
index 1ba8a3731653..2304d736c701 100644
--- a/arch/m68knommu/platform/coldfire/timers.c
+++ b/arch/m68knommu/platform/coldfire/timers.c
@@ -31,19 +31,9 @@
31#define TA(a) (MCF_MBAR + MCFTIMER_BASE1 + (a)) 31#define TA(a) (MCF_MBAR + MCFTIMER_BASE1 + (a))
32 32
33/* 33/*
34 * Default the timer and vector to use for ColdFire. Some ColdFire
35 * CPU's and some boards may want different. Their sub-architecture
36 * startup code (in config.c) can change these if they want.
37 */
38unsigned int mcf_timervector = 29;
39unsigned int mcf_profilevector = 31;
40unsigned int mcf_timerlevel = 5;
41
42/*
43 * These provide the underlying interrupt vector support. 34 * These provide the underlying interrupt vector support.
44 * Unfortunately it is a little different on each ColdFire. 35 * Unfortunately it is a little different on each ColdFire.
45 */ 36 */
46extern void mcf_settimericr(int timer, int level);
47void coldfire_profile_init(void); 37void coldfire_profile_init(void);
48 38
49#if defined(CONFIG_M532x) 39#if defined(CONFIG_M532x)
@@ -107,8 +97,6 @@ static struct clocksource mcftmr_clk = {
107 97
108void hw_timer_init(void) 98void hw_timer_init(void)
109{ 99{
110 setup_irq(mcf_timervector, &mcftmr_timer_irq);
111
112 __raw_writew(MCFTIMER_TMR_DISABLE, TA(MCFTIMER_TMR)); 100 __raw_writew(MCFTIMER_TMR_DISABLE, TA(MCFTIMER_TMR));
113 mcftmr_cycles_per_jiffy = FREQ / HZ; 101 mcftmr_cycles_per_jiffy = FREQ / HZ;
114 /* 102 /*
@@ -124,7 +112,7 @@ void hw_timer_init(void)
124 mcftmr_clk.mult = clocksource_hz2mult(FREQ, mcftmr_clk.shift); 112 mcftmr_clk.mult = clocksource_hz2mult(FREQ, mcftmr_clk.shift);
125 clocksource_register(&mcftmr_clk); 113 clocksource_register(&mcftmr_clk);
126 114
127 mcf_settimericr(1, mcf_timerlevel); 115 setup_irq(MCF_IRQ_TIMER, &mcftmr_timer_irq);
128 116
129#ifdef CONFIG_HIGHPROFILE 117#ifdef CONFIG_HIGHPROFILE
130 coldfire_profile_init(); 118 coldfire_profile_init();
@@ -171,8 +159,6 @@ void coldfire_profile_init(void)
171 printk(KERN_INFO "PROFILE: lodging TIMER2 @ %dHz as profile timer\n", 159 printk(KERN_INFO "PROFILE: lodging TIMER2 @ %dHz as profile timer\n",
172 PROFILEHZ); 160 PROFILEHZ);
173 161
174 setup_irq(mcf_profilevector, &coldfire_profile_irq);
175
176 /* Set up TIMER 2 as high speed profile clock */ 162 /* Set up TIMER 2 as high speed profile clock */
177 __raw_writew(MCFTIMER_TMR_DISABLE, PA(MCFTIMER_TMR)); 163 __raw_writew(MCFTIMER_TMR_DISABLE, PA(MCFTIMER_TMR));
178 164
@@ -180,7 +166,7 @@ void coldfire_profile_init(void)
180 __raw_writew(MCFTIMER_TMR_ENORI | MCFTIMER_TMR_CLK16 | 166 __raw_writew(MCFTIMER_TMR_ENORI | MCFTIMER_TMR_CLK16 |
181 MCFTIMER_TMR_RESTART | MCFTIMER_TMR_ENABLE, PA(MCFTIMER_TMR)); 167 MCFTIMER_TMR_RESTART | MCFTIMER_TMR_ENABLE, PA(MCFTIMER_TMR));
182 168
183 mcf_settimericr(2, 7); 169 setup_irq(MCF_IRQ_PROFILER, &coldfire_profile_irq);
184} 170}
185 171
186/***************************************************************************/ 172/***************************************************************************/
diff --git a/arch/m68knommu/platform/coldfire/vectors.c b/arch/m68knommu/platform/coldfire/vectors.c
index bdca0297fa9a..a21d3f870b7a 100644
--- a/arch/m68knommu/platform/coldfire/vectors.c
+++ b/arch/m68knommu/platform/coldfire/vectors.c
@@ -1,7 +1,7 @@
1/***************************************************************************/ 1/***************************************************************************/
2 2
3/* 3/*
4 * linux/arch/m68knommu/platform/5307/vectors.c 4 * linux/arch/m68knommu/platform/coldfire/vectors.c
5 * 5 *
6 * Copyright (C) 1999-2007, Greg Ungerer <gerg@snapgear.com> 6 * Copyright (C) 1999-2007, Greg Ungerer <gerg@snapgear.com>
7 */ 7 */
@@ -15,7 +15,6 @@
15#include <asm/machdep.h> 15#include <asm/machdep.h>
16#include <asm/coldfire.h> 16#include <asm/coldfire.h>
17#include <asm/mcfsim.h> 17#include <asm/mcfsim.h>
18#include <asm/mcfdma.h>
19#include <asm/mcfwdebug.h> 18#include <asm/mcfwdebug.h>
20 19
21/***************************************************************************/ 20/***************************************************************************/
@@ -79,20 +78,3 @@ void __init init_vectors(void)
79} 78}
80 79
81/***************************************************************************/ 80/***************************************************************************/
82
83void enable_vector(unsigned int irq)
84{
85 /* Currently no action on ColdFire */
86}
87
88void disable_vector(unsigned int irq)
89{
90 /* Currently no action on ColdFire */
91}
92
93void ack_vector(unsigned int irq)
94{
95 /* Currently no action on ColdFire */
96}
97
98/***************************************************************************/
diff --git a/arch/microblaze/kernel/vmlinux.lds.S b/arch/microblaze/kernel/vmlinux.lds.S
index d34d38dcd12c..ec5fa91a48d8 100644
--- a/arch/microblaze/kernel/vmlinux.lds.S
+++ b/arch/microblaze/kernel/vmlinux.lds.S
@@ -23,8 +23,8 @@ SECTIONS {
23 _stext = . ; 23 _stext = . ;
24 *(.text .text.*) 24 *(.text .text.*)
25 *(.fixup) 25 *(.fixup)
26 26 EXIT_TEXT
27 *(.exitcall.exit) 27 EXIT_CALL
28 SCHED_TEXT 28 SCHED_TEXT
29 LOCK_TEXT 29 LOCK_TEXT
30 KPROBES_TEXT 30 KPROBES_TEXT
@@ -162,4 +162,6 @@ SECTIONS {
162 } 162 }
163 . = ALIGN(4096); 163 . = ALIGN(4096);
164 _end = .; 164 _end = .;
165
166 DISCARDS
165} 167}
diff --git a/arch/mips/Kconfig b/arch/mips/Kconfig
index 3ca0fe1a9123..705a7a9170f3 100644
--- a/arch/mips/Kconfig
+++ b/arch/mips/Kconfig
@@ -6,7 +6,7 @@ config MIPS
6 select HAVE_ARCH_KGDB 6 select HAVE_ARCH_KGDB
7 # Horrible source of confusion. Die, die, die ... 7 # Horrible source of confusion. Die, die, die ...
8 select EMBEDDED 8 select EMBEDDED
9 select RTC_LIB 9 select RTC_LIB if !LEMOTE_FULOONG2E
10 10
11mainmenu "Linux/MIPS Kernel Configuration" 11mainmenu "Linux/MIPS Kernel Configuration"
12 12
@@ -80,6 +80,21 @@ config BCM47XX
80 help 80 help
81 Support for BCM47XX based boards 81 Support for BCM47XX based boards
82 82
83config BCM63XX
84 bool "Broadcom BCM63XX based boards"
85 select CEVT_R4K
86 select CSRC_R4K
87 select DMA_NONCOHERENT
88 select IRQ_CPU
89 select SYS_HAS_CPU_MIPS32_R1
90 select SYS_SUPPORTS_32BIT_KERNEL
91 select SYS_SUPPORTS_BIG_ENDIAN
92 select SYS_HAS_EARLY_PRINTK
93 select SWAP_IO_SPACE
94 select ARCH_REQUIRE_GPIOLIB
95 help
96 Support for BCM63XX based boards
97
83config MIPS_COBALT 98config MIPS_COBALT
84 bool "Cobalt Server" 99 bool "Cobalt Server"
85 select CEVT_R4K 100 select CEVT_R4K
@@ -174,30 +189,15 @@ config LASAT
174 select SYS_SUPPORTS_64BIT_KERNEL if BROKEN 189 select SYS_SUPPORTS_64BIT_KERNEL if BROKEN
175 select SYS_SUPPORTS_LITTLE_ENDIAN 190 select SYS_SUPPORTS_LITTLE_ENDIAN
176 191
177config LEMOTE_FULONG 192config MACH_LOONGSON
178 bool "Lemote Fulong mini-PC" 193 bool "Loongson family of machines"
179 select ARCH_SPARSEMEM_ENABLE
180 select CEVT_R4K
181 select CSRC_R4K
182 select SYS_HAS_CPU_LOONGSON2
183 select DMA_NONCOHERENT
184 select BOOT_ELF32
185 select BOARD_SCACHE
186 select HAVE_STD_PC_SERIAL_PORT
187 select HW_HAS_PCI
188 select I8259
189 select ISA
190 select IRQ_CPU
191 select SYS_SUPPORTS_32BIT_KERNEL
192 select SYS_SUPPORTS_64BIT_KERNEL
193 select SYS_SUPPORTS_LITTLE_ENDIAN
194 select SYS_SUPPORTS_HIGHMEM
195 select SYS_HAS_EARLY_PRINTK
196 select GENERIC_ISA_DMA_SUPPORT_BROKEN
197 select CPU_HAS_WB
198 help 194 help
199 Lemote Fulong mini-PC board based on the Chinese Loongson-2E CPU and 195 This enables the support of Loongson family of machines.
200 an FPGA northbridge 196
197 Loongson is a family of general-purpose MIPS-compatible CPUs.
198 developed at Institute of Computing Technology (ICT),
199 Chinese Academy of Sciences (CAS) in the People's Republic
200 of China. The chief architect is Professor Weiwu Hu.
201 201
202config MIPS_MALTA 202config MIPS_MALTA
203 bool "MIPS Malta board" 203 bool "MIPS Malta board"
@@ -660,6 +660,7 @@ endchoice
660 660
661source "arch/mips/alchemy/Kconfig" 661source "arch/mips/alchemy/Kconfig"
662source "arch/mips/basler/excite/Kconfig" 662source "arch/mips/basler/excite/Kconfig"
663source "arch/mips/bcm63xx/Kconfig"
663source "arch/mips/jazz/Kconfig" 664source "arch/mips/jazz/Kconfig"
664source "arch/mips/lasat/Kconfig" 665source "arch/mips/lasat/Kconfig"
665source "arch/mips/pmc-sierra/Kconfig" 666source "arch/mips/pmc-sierra/Kconfig"
@@ -668,6 +669,7 @@ source "arch/mips/sibyte/Kconfig"
668source "arch/mips/txx9/Kconfig" 669source "arch/mips/txx9/Kconfig"
669source "arch/mips/vr41xx/Kconfig" 670source "arch/mips/vr41xx/Kconfig"
670source "arch/mips/cavium-octeon/Kconfig" 671source "arch/mips/cavium-octeon/Kconfig"
672source "arch/mips/loongson/Kconfig"
671 673
672endmenu 674endmenu
673 675
@@ -1044,12 +1046,10 @@ choice
1044 prompt "CPU type" 1046 prompt "CPU type"
1045 default CPU_R4X00 1047 default CPU_R4X00
1046 1048
1047config CPU_LOONGSON2 1049config CPU_LOONGSON2E
1048 bool "Loongson 2" 1050 bool "Loongson 2E"
1049 depends on SYS_HAS_CPU_LOONGSON2 1051 depends on SYS_HAS_CPU_LOONGSON2E
1050 select CPU_SUPPORTS_32BIT_KERNEL 1052 select CPU_LOONGSON2
1051 select CPU_SUPPORTS_64BIT_KERNEL
1052 select CPU_SUPPORTS_HIGHMEM
1053 help 1053 help
1054 The Loongson 2E processor implements the MIPS III instruction set 1054 The Loongson 2E processor implements the MIPS III instruction set
1055 with many extensions. 1055 with many extensions.
@@ -1057,7 +1057,6 @@ config CPU_LOONGSON2
1057config CPU_MIPS32_R1 1057config CPU_MIPS32_R1
1058 bool "MIPS32 Release 1" 1058 bool "MIPS32 Release 1"
1059 depends on SYS_HAS_CPU_MIPS32_R1 1059 depends on SYS_HAS_CPU_MIPS32_R1
1060 select CPU_HAS_LLSC
1061 select CPU_HAS_PREFETCH 1060 select CPU_HAS_PREFETCH
1062 select CPU_SUPPORTS_32BIT_KERNEL 1061 select CPU_SUPPORTS_32BIT_KERNEL
1063 select CPU_SUPPORTS_HIGHMEM 1062 select CPU_SUPPORTS_HIGHMEM
@@ -1075,7 +1074,6 @@ config CPU_MIPS32_R1
1075config CPU_MIPS32_R2 1074config CPU_MIPS32_R2
1076 bool "MIPS32 Release 2" 1075 bool "MIPS32 Release 2"
1077 depends on SYS_HAS_CPU_MIPS32_R2 1076 depends on SYS_HAS_CPU_MIPS32_R2
1078 select CPU_HAS_LLSC
1079 select CPU_HAS_PREFETCH 1077 select CPU_HAS_PREFETCH
1080 select CPU_SUPPORTS_32BIT_KERNEL 1078 select CPU_SUPPORTS_32BIT_KERNEL
1081 select CPU_SUPPORTS_HIGHMEM 1079 select CPU_SUPPORTS_HIGHMEM
@@ -1089,7 +1087,6 @@ config CPU_MIPS32_R2
1089config CPU_MIPS64_R1 1087config CPU_MIPS64_R1
1090 bool "MIPS64 Release 1" 1088 bool "MIPS64 Release 1"
1091 depends on SYS_HAS_CPU_MIPS64_R1 1089 depends on SYS_HAS_CPU_MIPS64_R1
1092 select CPU_HAS_LLSC
1093 select CPU_HAS_PREFETCH 1090 select CPU_HAS_PREFETCH
1094 select CPU_SUPPORTS_32BIT_KERNEL 1091 select CPU_SUPPORTS_32BIT_KERNEL
1095 select CPU_SUPPORTS_64BIT_KERNEL 1092 select CPU_SUPPORTS_64BIT_KERNEL
@@ -1109,7 +1106,6 @@ config CPU_MIPS64_R1
1109config CPU_MIPS64_R2 1106config CPU_MIPS64_R2
1110 bool "MIPS64 Release 2" 1107 bool "MIPS64 Release 2"
1111 depends on SYS_HAS_CPU_MIPS64_R2 1108 depends on SYS_HAS_CPU_MIPS64_R2
1112 select CPU_HAS_LLSC
1113 select CPU_HAS_PREFETCH 1109 select CPU_HAS_PREFETCH
1114 select CPU_SUPPORTS_32BIT_KERNEL 1110 select CPU_SUPPORTS_32BIT_KERNEL
1115 select CPU_SUPPORTS_64BIT_KERNEL 1111 select CPU_SUPPORTS_64BIT_KERNEL
@@ -1155,7 +1151,6 @@ config CPU_VR41XX
1155config CPU_R4300 1151config CPU_R4300
1156 bool "R4300" 1152 bool "R4300"
1157 depends on SYS_HAS_CPU_R4300 1153 depends on SYS_HAS_CPU_R4300
1158 select CPU_HAS_LLSC
1159 select CPU_SUPPORTS_32BIT_KERNEL 1154 select CPU_SUPPORTS_32BIT_KERNEL
1160 select CPU_SUPPORTS_64BIT_KERNEL 1155 select CPU_SUPPORTS_64BIT_KERNEL
1161 help 1156 help
@@ -1164,7 +1159,6 @@ config CPU_R4300
1164config CPU_R4X00 1159config CPU_R4X00
1165 bool "R4x00" 1160 bool "R4x00"
1166 depends on SYS_HAS_CPU_R4X00 1161 depends on SYS_HAS_CPU_R4X00
1167 select CPU_HAS_LLSC
1168 select CPU_SUPPORTS_32BIT_KERNEL 1162 select CPU_SUPPORTS_32BIT_KERNEL
1169 select CPU_SUPPORTS_64BIT_KERNEL 1163 select CPU_SUPPORTS_64BIT_KERNEL
1170 help 1164 help
@@ -1174,7 +1168,6 @@ config CPU_R4X00
1174config CPU_TX49XX 1168config CPU_TX49XX
1175 bool "R49XX" 1169 bool "R49XX"
1176 depends on SYS_HAS_CPU_TX49XX 1170 depends on SYS_HAS_CPU_TX49XX
1177 select CPU_HAS_LLSC
1178 select CPU_HAS_PREFETCH 1171 select CPU_HAS_PREFETCH
1179 select CPU_SUPPORTS_32BIT_KERNEL 1172 select CPU_SUPPORTS_32BIT_KERNEL
1180 select CPU_SUPPORTS_64BIT_KERNEL 1173 select CPU_SUPPORTS_64BIT_KERNEL
@@ -1182,7 +1175,6 @@ config CPU_TX49XX
1182config CPU_R5000 1175config CPU_R5000
1183 bool "R5000" 1176 bool "R5000"
1184 depends on SYS_HAS_CPU_R5000 1177 depends on SYS_HAS_CPU_R5000
1185 select CPU_HAS_LLSC
1186 select CPU_SUPPORTS_32BIT_KERNEL 1178 select CPU_SUPPORTS_32BIT_KERNEL
1187 select CPU_SUPPORTS_64BIT_KERNEL 1179 select CPU_SUPPORTS_64BIT_KERNEL
1188 help 1180 help
@@ -1191,14 +1183,12 @@ config CPU_R5000
1191config CPU_R5432 1183config CPU_R5432
1192 bool "R5432" 1184 bool "R5432"
1193 depends on SYS_HAS_CPU_R5432 1185 depends on SYS_HAS_CPU_R5432
1194 select CPU_HAS_LLSC
1195 select CPU_SUPPORTS_32BIT_KERNEL 1186 select CPU_SUPPORTS_32BIT_KERNEL
1196 select CPU_SUPPORTS_64BIT_KERNEL 1187 select CPU_SUPPORTS_64BIT_KERNEL
1197 1188
1198config CPU_R5500 1189config CPU_R5500
1199 bool "R5500" 1190 bool "R5500"
1200 depends on SYS_HAS_CPU_R5500 1191 depends on SYS_HAS_CPU_R5500
1201 select CPU_HAS_LLSC
1202 select CPU_SUPPORTS_32BIT_KERNEL 1192 select CPU_SUPPORTS_32BIT_KERNEL
1203 select CPU_SUPPORTS_64BIT_KERNEL 1193 select CPU_SUPPORTS_64BIT_KERNEL
1204 select CPU_SUPPORTS_HUGEPAGES 1194 select CPU_SUPPORTS_HUGEPAGES
@@ -1209,7 +1199,6 @@ config CPU_R5500
1209config CPU_R6000 1199config CPU_R6000
1210 bool "R6000" 1200 bool "R6000"
1211 depends on EXPERIMENTAL 1201 depends on EXPERIMENTAL
1212 select CPU_HAS_LLSC
1213 depends on SYS_HAS_CPU_R6000 1202 depends on SYS_HAS_CPU_R6000
1214 select CPU_SUPPORTS_32BIT_KERNEL 1203 select CPU_SUPPORTS_32BIT_KERNEL
1215 help 1204 help
@@ -1219,7 +1208,6 @@ config CPU_R6000
1219config CPU_NEVADA 1208config CPU_NEVADA
1220 bool "RM52xx" 1209 bool "RM52xx"
1221 depends on SYS_HAS_CPU_NEVADA 1210 depends on SYS_HAS_CPU_NEVADA
1222 select CPU_HAS_LLSC
1223 select CPU_SUPPORTS_32BIT_KERNEL 1211 select CPU_SUPPORTS_32BIT_KERNEL
1224 select CPU_SUPPORTS_64BIT_KERNEL 1212 select CPU_SUPPORTS_64BIT_KERNEL
1225 help 1213 help
@@ -1229,7 +1217,6 @@ config CPU_R8000
1229 bool "R8000" 1217 bool "R8000"
1230 depends on EXPERIMENTAL 1218 depends on EXPERIMENTAL
1231 depends on SYS_HAS_CPU_R8000 1219 depends on SYS_HAS_CPU_R8000
1232 select CPU_HAS_LLSC
1233 select CPU_HAS_PREFETCH 1220 select CPU_HAS_PREFETCH
1234 select CPU_SUPPORTS_64BIT_KERNEL 1221 select CPU_SUPPORTS_64BIT_KERNEL
1235 help 1222 help
@@ -1239,7 +1226,6 @@ config CPU_R8000
1239config CPU_R10000 1226config CPU_R10000
1240 bool "R10000" 1227 bool "R10000"
1241 depends on SYS_HAS_CPU_R10000 1228 depends on SYS_HAS_CPU_R10000
1242 select CPU_HAS_LLSC
1243 select CPU_HAS_PREFETCH 1229 select CPU_HAS_PREFETCH
1244 select CPU_SUPPORTS_32BIT_KERNEL 1230 select CPU_SUPPORTS_32BIT_KERNEL
1245 select CPU_SUPPORTS_64BIT_KERNEL 1231 select CPU_SUPPORTS_64BIT_KERNEL
@@ -1250,7 +1236,6 @@ config CPU_R10000
1250config CPU_RM7000 1236config CPU_RM7000
1251 bool "RM7000" 1237 bool "RM7000"
1252 depends on SYS_HAS_CPU_RM7000 1238 depends on SYS_HAS_CPU_RM7000
1253 select CPU_HAS_LLSC
1254 select CPU_HAS_PREFETCH 1239 select CPU_HAS_PREFETCH
1255 select CPU_SUPPORTS_32BIT_KERNEL 1240 select CPU_SUPPORTS_32BIT_KERNEL
1256 select CPU_SUPPORTS_64BIT_KERNEL 1241 select CPU_SUPPORTS_64BIT_KERNEL
@@ -1259,7 +1244,6 @@ config CPU_RM7000
1259config CPU_RM9000 1244config CPU_RM9000
1260 bool "RM9000" 1245 bool "RM9000"
1261 depends on SYS_HAS_CPU_RM9000 1246 depends on SYS_HAS_CPU_RM9000
1262 select CPU_HAS_LLSC
1263 select CPU_HAS_PREFETCH 1247 select CPU_HAS_PREFETCH
1264 select CPU_SUPPORTS_32BIT_KERNEL 1248 select CPU_SUPPORTS_32BIT_KERNEL
1265 select CPU_SUPPORTS_64BIT_KERNEL 1249 select CPU_SUPPORTS_64BIT_KERNEL
@@ -1269,7 +1253,6 @@ config CPU_RM9000
1269config CPU_SB1 1253config CPU_SB1
1270 bool "SB1" 1254 bool "SB1"
1271 depends on SYS_HAS_CPU_SB1 1255 depends on SYS_HAS_CPU_SB1
1272 select CPU_HAS_LLSC
1273 select CPU_SUPPORTS_32BIT_KERNEL 1256 select CPU_SUPPORTS_32BIT_KERNEL
1274 select CPU_SUPPORTS_64BIT_KERNEL 1257 select CPU_SUPPORTS_64BIT_KERNEL
1275 select CPU_SUPPORTS_HIGHMEM 1258 select CPU_SUPPORTS_HIGHMEM
@@ -1296,7 +1279,13 @@ config CPU_CAVIUM_OCTEON
1296 1279
1297endchoice 1280endchoice
1298 1281
1299config SYS_HAS_CPU_LOONGSON2 1282config CPU_LOONGSON2
1283 bool
1284 select CPU_SUPPORTS_32BIT_KERNEL
1285 select CPU_SUPPORTS_64BIT_KERNEL
1286 select CPU_SUPPORTS_HIGHMEM
1287
1288config SYS_HAS_CPU_LOONGSON2E
1300 bool 1289 bool
1301 1290
1302config SYS_HAS_CPU_MIPS32_R1 1291config SYS_HAS_CPU_MIPS32_R1
@@ -1683,9 +1672,6 @@ config SB1_PASS_2_1_WORKAROUNDS
1683config 64BIT_PHYS_ADDR 1672config 64BIT_PHYS_ADDR
1684 bool 1673 bool
1685 1674
1686config CPU_HAS_LLSC
1687 bool
1688
1689config CPU_HAS_SMARTMIPS 1675config CPU_HAS_SMARTMIPS
1690 depends on SYS_SUPPORTS_SMARTMIPS 1676 depends on SYS_SUPPORTS_SMARTMIPS
1691 bool "Support for the SmartMIPS ASE" 1677 bool "Support for the SmartMIPS ASE"
diff --git a/arch/mips/Makefile b/arch/mips/Makefile
index 861da514a468..c825b14b4ed0 100644
--- a/arch/mips/Makefile
+++ b/arch/mips/Makefile
@@ -120,7 +120,11 @@ cflags-$(CONFIG_CPU_R4300) += -march=r4300 -Wa,--trap
120cflags-$(CONFIG_CPU_VR41XX) += -march=r4100 -Wa,--trap 120cflags-$(CONFIG_CPU_VR41XX) += -march=r4100 -Wa,--trap
121cflags-$(CONFIG_CPU_R4X00) += -march=r4600 -Wa,--trap 121cflags-$(CONFIG_CPU_R4X00) += -march=r4600 -Wa,--trap
122cflags-$(CONFIG_CPU_TX49XX) += -march=r4600 -Wa,--trap 122cflags-$(CONFIG_CPU_TX49XX) += -march=r4600 -Wa,--trap
123cflags-$(CONFIG_CPU_LOONGSON2) += -march=r4600 -Wa,--trap 123# only gcc >= 4.4 have the loongson-specific support
124cflags-$(CONFIG_CPU_LOONGSON2) += -Wa,--trap
125cflags-$(CONFIG_CPU_LOONGSON2E) += \
126 $(call cc-option,-march=loongson2e,-march=r4600)
127
124cflags-$(CONFIG_CPU_MIPS32_R1) += $(call cc-option,-march=mips32,-mips32 -U_MIPS_ISA -D_MIPS_ISA=_MIPS_ISA_MIPS32) \ 128cflags-$(CONFIG_CPU_MIPS32_R1) += $(call cc-option,-march=mips32,-mips32 -U_MIPS_ISA -D_MIPS_ISA=_MIPS_ISA_MIPS32) \
125 -Wa,-mips32 -Wa,--trap 129 -Wa,-mips32 -Wa,--trap
126cflags-$(CONFIG_CPU_MIPS32_R2) += $(call cc-option,-march=mips32r2,-mips32r2 -U_MIPS_ISA -D_MIPS_ISA=_MIPS_ISA_MIPS32) \ 130cflags-$(CONFIG_CPU_MIPS32_R2) += $(call cc-option,-march=mips32r2,-mips32r2 -U_MIPS_ISA -D_MIPS_ISA=_MIPS_ISA_MIPS32) \
@@ -314,11 +318,12 @@ cflags-$(CONFIG_WR_PPMC) += -I$(srctree)/arch/mips/include/asm/mach-wrppmc
314load-$(CONFIG_WR_PPMC) += 0xffffffff80100000 318load-$(CONFIG_WR_PPMC) += 0xffffffff80100000
315 319
316# 320#
317# lemote fulong mini-PC board 321# Loongson family
318# 322#
319core-$(CONFIG_LEMOTE_FULONG) +=arch/mips/lemote/lm2e/ 323core-$(CONFIG_MACH_LOONGSON) +=arch/mips/loongson/
320load-$(CONFIG_LEMOTE_FULONG) +=0xffffffff80100000 324cflags-$(CONFIG_MACH_LOONGSON) += -I$(srctree)/arch/mips/include/asm/mach-loongson \
321cflags-$(CONFIG_LEMOTE_FULONG) += -I$(srctree)/arch/mips/include/asm/mach-lemote 325 -mno-branch-likely
326load-$(CONFIG_LEMOTE_FULOONG2E) +=0xffffffff80100000
322 327
323# 328#
324# MIPS Malta board 329# MIPS Malta board
@@ -560,6 +565,13 @@ cflags-$(CONFIG_BCM47XX) += -I$(srctree)/arch/mips/include/asm/mach-bcm47xx
560load-$(CONFIG_BCM47XX) := 0xffffffff80001000 565load-$(CONFIG_BCM47XX) := 0xffffffff80001000
561 566
562# 567#
568# Broadcom BCM63XX boards
569#
570core-$(CONFIG_BCM63XX) += arch/mips/bcm63xx/
571cflags-$(CONFIG_BCM63XX) += -I$(srctree)/arch/mips/include/asm/mach-bcm63xx/
572load-$(CONFIG_BCM63XX) := 0xffffffff80010000
573
574#
563# SNI RM 575# SNI RM
564# 576#
565core-$(CONFIG_SNI_RM) += arch/mips/sni/ 577core-$(CONFIG_SNI_RM) += arch/mips/sni/
diff --git a/arch/mips/alchemy/common/setup.c b/arch/mips/alchemy/common/setup.c
index 3f036b3d400e..6184baa56786 100644
--- a/arch/mips/alchemy/common/setup.c
+++ b/arch/mips/alchemy/common/setup.c
@@ -27,6 +27,7 @@
27 27
28#include <linux/init.h> 28#include <linux/init.h>
29#include <linux/ioport.h> 29#include <linux/ioport.h>
30#include <linux/jiffies.h>
30#include <linux/module.h> 31#include <linux/module.h>
31#include <linux/pm.h> 32#include <linux/pm.h>
32 33
@@ -53,6 +54,9 @@ void __init plat_mem_setup(void)
53 printk(KERN_INFO "(PRId %08x) @ %lu.%02lu MHz\n", read_c0_prid(), 54 printk(KERN_INFO "(PRId %08x) @ %lu.%02lu MHz\n", read_c0_prid(),
54 est_freq / 1000000, ((est_freq % 1000000) * 100) / 1000000); 55 est_freq / 1000000, ((est_freq % 1000000) * 100) / 1000000);
55 56
57 /* this is faster than wasting cycles trying to approximate it */
58 preset_lpj = (est_freq >> 1) / HZ;
59
56 _machine_restart = au1000_restart; 60 _machine_restart = au1000_restart;
57 _machine_halt = au1000_halt; 61 _machine_halt = au1000_halt;
58 pm_power_off = au1000_power_off; 62 pm_power_off = au1000_power_off;
diff --git a/arch/mips/alchemy/common/time.c b/arch/mips/alchemy/common/time.c
index 33fbae79af5e..f34ff8601942 100644
--- a/arch/mips/alchemy/common/time.c
+++ b/arch/mips/alchemy/common/time.c
@@ -36,14 +36,13 @@
36#include <linux/interrupt.h> 36#include <linux/interrupt.h>
37#include <linux/spinlock.h> 37#include <linux/spinlock.h>
38 38
39#include <asm/processor.h>
39#include <asm/time.h> 40#include <asm/time.h>
40#include <asm/mach-au1x00/au1000.h> 41#include <asm/mach-au1x00/au1000.h>
41 42
42/* 32kHz clock enabled and detected */ 43/* 32kHz clock enabled and detected */
43#define CNTR_OK (SYS_CNTRL_E0 | SYS_CNTRL_32S) 44#define CNTR_OK (SYS_CNTRL_E0 | SYS_CNTRL_32S)
44 45
45extern int allow_au1k_wait; /* default off for CP0 Counter */
46
47static cycle_t au1x_counter1_read(struct clocksource *cs) 46static cycle_t au1x_counter1_read(struct clocksource *cs)
48{ 47{
49 return au_readl(SYS_RTCREAD); 48 return au_readl(SYS_RTCREAD);
@@ -153,13 +152,17 @@ void __init plat_time_init(void)
153 152
154 printk(KERN_INFO "Alchemy clocksource installed\n"); 153 printk(KERN_INFO "Alchemy clocksource installed\n");
155 154
156 /* can now use 'wait' */
157 allow_au1k_wait = 1;
158 return; 155 return;
159 156
160cntr_err: 157cntr_err:
161 /* counters unusable, use C0 counter */ 158 /*
159 * MIPS kernel assigns 'au1k_wait' to 'cpu_wait' before this
160 * function is called. Because the Alchemy counters are unusable
161 * the C0 timekeeping code is installed and use of the 'wait'
162 * instruction must be prohibited, which is done most easily by
163 * assigning NULL to cpu_wait.
164 */
165 cpu_wait = NULL;
162 r4k_clockevent_init(); 166 r4k_clockevent_init();
163 init_r4k_clocksource(); 167 init_r4k_clocksource();
164 allow_au1k_wait = 0;
165} 168}
diff --git a/arch/mips/ar7/platform.c b/arch/mips/ar7/platform.c
index cf50fa29b198..e2278c04459d 100644
--- a/arch/mips/ar7/platform.c
+++ b/arch/mips/ar7/platform.c
@@ -417,6 +417,20 @@ static struct platform_device ar7_udc = {
417 .num_resources = ARRAY_SIZE(usb_res), 417 .num_resources = ARRAY_SIZE(usb_res),
418}; 418};
419 419
420static struct resource ar7_wdt_res = {
421 .name = "regs",
422 .start = -1, /* Filled at runtime */
423 .end = -1, /* Filled at runtime */
424 .flags = IORESOURCE_MEM,
425};
426
427static struct platform_device ar7_wdt = {
428 .id = -1,
429 .name = "ar7_wdt",
430 .resource = &ar7_wdt_res,
431 .num_resources = 1,
432};
433
420static inline unsigned char char2hex(char h) 434static inline unsigned char char2hex(char h)
421{ 435{
422 switch (h) { 436 switch (h) {
@@ -487,6 +501,7 @@ static void __init detect_leds(void)
487 501
488static int __init ar7_register_devices(void) 502static int __init ar7_register_devices(void)
489{ 503{
504 u16 chip_id;
490 int res; 505 int res;
491#ifdef CONFIG_SERIAL_8250 506#ifdef CONFIG_SERIAL_8250
492 static struct uart_port uart_port[2]; 507 static struct uart_port uart_port[2];
@@ -565,6 +580,23 @@ static int __init ar7_register_devices(void)
565 580
566 res = platform_device_register(&ar7_udc); 581 res = platform_device_register(&ar7_udc);
567 582
583 chip_id = ar7_chip_id();
584 switch (chip_id) {
585 case AR7_CHIP_7100:
586 case AR7_CHIP_7200:
587 ar7_wdt_res.start = AR7_REGS_WDT;
588 break;
589 case AR7_CHIP_7300:
590 ar7_wdt_res.start = UR8_REGS_WDT;
591 break;
592 default:
593 break;
594 }
595
596 ar7_wdt_res.end = ar7_wdt_res.start + 0x20;
597
598 res = platform_device_register(&ar7_wdt);
599
568 return res; 600 return res;
569} 601}
570arch_initcall(ar7_register_devices); 602arch_initcall(ar7_register_devices);
diff --git a/arch/mips/bcm63xx/Kconfig b/arch/mips/bcm63xx/Kconfig
new file mode 100644
index 000000000000..fb177d6df066
--- /dev/null
+++ b/arch/mips/bcm63xx/Kconfig
@@ -0,0 +1,25 @@
1menu "CPU support"
2 depends on BCM63XX
3
4config BCM63XX_CPU_6338
5 bool "support 6338 CPU"
6 select HW_HAS_PCI
7 select USB_ARCH_HAS_OHCI
8 select USB_OHCI_BIG_ENDIAN_DESC
9 select USB_OHCI_BIG_ENDIAN_MMIO
10
11config BCM63XX_CPU_6345
12 bool "support 6345 CPU"
13 select USB_OHCI_BIG_ENDIAN_DESC
14 select USB_OHCI_BIG_ENDIAN_MMIO
15
16config BCM63XX_CPU_6348
17 bool "support 6348 CPU"
18 select HW_HAS_PCI
19
20config BCM63XX_CPU_6358
21 bool "support 6358 CPU"
22 select HW_HAS_PCI
23endmenu
24
25source "arch/mips/bcm63xx/boards/Kconfig"
diff --git a/arch/mips/bcm63xx/Makefile b/arch/mips/bcm63xx/Makefile
new file mode 100644
index 000000000000..aaa585cf26e3
--- /dev/null
+++ b/arch/mips/bcm63xx/Makefile
@@ -0,0 +1,7 @@
1obj-y += clk.o cpu.o cs.o gpio.o irq.o prom.o setup.o timer.o \
2 dev-dsp.o dev-enet.o
3obj-$(CONFIG_EARLY_PRINTK) += early_printk.o
4
5obj-y += boards/
6
7EXTRA_CFLAGS += -Werror
diff --git a/arch/mips/bcm63xx/boards/Kconfig b/arch/mips/bcm63xx/boards/Kconfig
new file mode 100644
index 000000000000..c6aed33d893e
--- /dev/null
+++ b/arch/mips/bcm63xx/boards/Kconfig
@@ -0,0 +1,11 @@
1choice
2 prompt "Board support"
3 depends on BCM63XX
4 default BOARD_BCM963XX
5
6config BOARD_BCM963XX
7 bool "Generic Broadcom 963xx boards"
8 select SSB
9 help
10
11endchoice
diff --git a/arch/mips/bcm63xx/boards/Makefile b/arch/mips/bcm63xx/boards/Makefile
new file mode 100644
index 000000000000..e5cc86dc1da8
--- /dev/null
+++ b/arch/mips/bcm63xx/boards/Makefile
@@ -0,0 +1,3 @@
1obj-$(CONFIG_BOARD_BCM963XX) += board_bcm963xx.o
2
3EXTRA_CFLAGS += -Werror
diff --git a/arch/mips/bcm63xx/boards/board_bcm963xx.c b/arch/mips/bcm63xx/boards/board_bcm963xx.c
new file mode 100644
index 000000000000..fd77f548207a
--- /dev/null
+++ b/arch/mips/bcm63xx/boards/board_bcm963xx.c
@@ -0,0 +1,837 @@
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) 2008 Maxime Bizon <mbizon@freebox.fr>
7 * Copyright (C) 2008 Florian Fainelli <florian@openwrt.org>
8 */
9
10#include <linux/init.h>
11#include <linux/kernel.h>
12#include <linux/string.h>
13#include <linux/platform_device.h>
14#include <linux/mtd/mtd.h>
15#include <linux/mtd/partitions.h>
16#include <linux/mtd/physmap.h>
17#include <linux/ssb/ssb.h>
18#include <asm/addrspace.h>
19#include <bcm63xx_board.h>
20#include <bcm63xx_cpu.h>
21#include <bcm63xx_regs.h>
22#include <bcm63xx_io.h>
23#include <bcm63xx_board.h>
24#include <bcm63xx_dev_pci.h>
25#include <bcm63xx_dev_enet.h>
26#include <bcm63xx_dev_dsp.h>
27#include <board_bcm963xx.h>
28
29#define PFX "board_bcm963xx: "
30
31static struct bcm963xx_nvram nvram;
32static unsigned int mac_addr_used;
33static struct board_info board;
34
35/*
36 * known 6338 boards
37 */
38#ifdef CONFIG_BCM63XX_CPU_6338
39static struct board_info __initdata board_96338gw = {
40 .name = "96338GW",
41 .expected_cpu_id = 0x6338,
42
43 .has_enet0 = 1,
44 .enet0 = {
45 .force_speed_100 = 1,
46 .force_duplex_full = 1,
47 },
48
49 .has_ohci0 = 1,
50
51 .leds = {
52 {
53 .name = "adsl",
54 .gpio = 3,
55 .active_low = 1,
56 },
57 {
58 .name = "ses",
59 .gpio = 5,
60 .active_low = 1,
61 },
62 {
63 .name = "ppp-fail",
64 .gpio = 4,
65 .active_low = 1,
66 },
67 {
68 .name = "power",
69 .gpio = 0,
70 .active_low = 1,
71 .default_trigger = "default-on",
72 },
73 {
74 .name = "stop",
75 .gpio = 1,
76 .active_low = 1,
77 }
78 },
79};
80
81static struct board_info __initdata board_96338w = {
82 .name = "96338W",
83 .expected_cpu_id = 0x6338,
84
85 .has_enet0 = 1,
86 .enet0 = {
87 .force_speed_100 = 1,
88 .force_duplex_full = 1,
89 },
90
91 .leds = {
92 {
93 .name = "adsl",
94 .gpio = 3,
95 .active_low = 1,
96 },
97 {
98 .name = "ses",
99 .gpio = 5,
100 .active_low = 1,
101 },
102 {
103 .name = "ppp-fail",
104 .gpio = 4,
105 .active_low = 1,
106 },
107 {
108 .name = "power",
109 .gpio = 0,
110 .active_low = 1,
111 .default_trigger = "default-on",
112 },
113 {
114 .name = "stop",
115 .gpio = 1,
116 .active_low = 1,
117 },
118 },
119};
120#endif
121
122/*
123 * known 6345 boards
124 */
125#ifdef CONFIG_BCM63XX_CPU_6345
126static struct board_info __initdata board_96345gw2 = {
127 .name = "96345GW2",
128 .expected_cpu_id = 0x6345,
129};
130#endif
131
132/*
133 * known 6348 boards
134 */
135#ifdef CONFIG_BCM63XX_CPU_6348
136static struct board_info __initdata board_96348r = {
137 .name = "96348R",
138 .expected_cpu_id = 0x6348,
139
140 .has_enet0 = 1,
141 .has_pci = 1,
142
143 .enet0 = {
144 .has_phy = 1,
145 .use_internal_phy = 1,
146 },
147
148 .leds = {
149 {
150 .name = "adsl-fail",
151 .gpio = 2,
152 .active_low = 1,
153 },
154 {
155 .name = "ppp",
156 .gpio = 3,
157 .active_low = 1,
158 },
159 {
160 .name = "ppp-fail",
161 .gpio = 4,
162 .active_low = 1,
163 },
164 {
165 .name = "power",
166 .gpio = 0,
167 .active_low = 1,
168 .default_trigger = "default-on",
169
170 },
171 {
172 .name = "stop",
173 .gpio = 1,
174 .active_low = 1,
175 },
176 },
177};
178
179static struct board_info __initdata board_96348gw_10 = {
180 .name = "96348GW-10",
181 .expected_cpu_id = 0x6348,
182
183 .has_enet0 = 1,
184 .has_enet1 = 1,
185 .has_pci = 1,
186
187 .enet0 = {
188 .has_phy = 1,
189 .use_internal_phy = 1,
190 },
191 .enet1 = {
192 .force_speed_100 = 1,
193 .force_duplex_full = 1,
194 },
195
196 .has_ohci0 = 1,
197 .has_pccard = 1,
198 .has_ehci0 = 1,
199
200 .has_dsp = 1,
201 .dsp = {
202 .gpio_rst = 6,
203 .gpio_int = 34,
204 .cs = 2,
205 .ext_irq = 2,
206 },
207
208 .leds = {
209 {
210 .name = "adsl-fail",
211 .gpio = 2,
212 .active_low = 1,
213 },
214 {
215 .name = "ppp",
216 .gpio = 3,
217 .active_low = 1,
218 },
219 {
220 .name = "ppp-fail",
221 .gpio = 4,
222 .active_low = 1,
223 },
224 {
225 .name = "power",
226 .gpio = 0,
227 .active_low = 1,
228 .default_trigger = "default-on",
229 },
230 {
231 .name = "stop",
232 .gpio = 1,
233 .active_low = 1,
234 },
235 },
236};
237
238static struct board_info __initdata board_96348gw_11 = {
239 .name = "96348GW-11",
240 .expected_cpu_id = 0x6348,
241
242 .has_enet0 = 1,
243 .has_enet1 = 1,
244 .has_pci = 1,
245
246 .enet0 = {
247 .has_phy = 1,
248 .use_internal_phy = 1,
249 },
250
251 .enet1 = {
252 .force_speed_100 = 1,
253 .force_duplex_full = 1,
254 },
255
256
257 .has_ohci0 = 1,
258 .has_pccard = 1,
259 .has_ehci0 = 1,
260
261 .leds = {
262 {
263 .name = "adsl-fail",
264 .gpio = 2,
265 .active_low = 1,
266 },
267 {
268 .name = "ppp",
269 .gpio = 3,
270 .active_low = 1,
271 },
272 {
273 .name = "ppp-fail",
274 .gpio = 4,
275 .active_low = 1,
276 },
277 {
278 .name = "power",
279 .gpio = 0,
280 .active_low = 1,
281 .default_trigger = "default-on",
282 },
283 {
284 .name = "stop",
285 .gpio = 1,
286 .active_low = 1,
287 },
288 },
289};
290
291static struct board_info __initdata board_96348gw = {
292 .name = "96348GW",
293 .expected_cpu_id = 0x6348,
294
295 .has_enet0 = 1,
296 .has_enet1 = 1,
297 .has_pci = 1,
298
299 .enet0 = {
300 .has_phy = 1,
301 .use_internal_phy = 1,
302 },
303 .enet1 = {
304 .force_speed_100 = 1,
305 .force_duplex_full = 1,
306 },
307
308 .has_ohci0 = 1,
309
310 .has_dsp = 1,
311 .dsp = {
312 .gpio_rst = 6,
313 .gpio_int = 34,
314 .ext_irq = 2,
315 .cs = 2,
316 },
317
318 .leds = {
319 {
320 .name = "adsl-fail",
321 .gpio = 2,
322 .active_low = 1,
323 },
324 {
325 .name = "ppp",
326 .gpio = 3,
327 .active_low = 1,
328 },
329 {
330 .name = "ppp-fail",
331 .gpio = 4,
332 .active_low = 1,
333 },
334 {
335 .name = "power",
336 .gpio = 0,
337 .active_low = 1,
338 .default_trigger = "default-on",
339 },
340 {
341 .name = "stop",
342 .gpio = 1,
343 .active_low = 1,
344 },
345 },
346};
347
348static struct board_info __initdata board_FAST2404 = {
349 .name = "F@ST2404",
350 .expected_cpu_id = 0x6348,
351
352 .has_enet0 = 1,
353 .has_enet1 = 1,
354 .has_pci = 1,
355
356 .enet0 = {
357 .has_phy = 1,
358 .use_internal_phy = 1,
359 },
360
361 .enet1 = {
362 .force_speed_100 = 1,
363 .force_duplex_full = 1,
364 },
365
366
367 .has_ohci0 = 1,
368 .has_pccard = 1,
369 .has_ehci0 = 1,
370};
371
372static struct board_info __initdata board_DV201AMR = {
373 .name = "DV201AMR",
374 .expected_cpu_id = 0x6348,
375
376 .has_pci = 1,
377 .has_ohci0 = 1,
378
379 .has_enet0 = 1,
380 .has_enet1 = 1,
381 .enet0 = {
382 .has_phy = 1,
383 .use_internal_phy = 1,
384 },
385 .enet1 = {
386 .force_speed_100 = 1,
387 .force_duplex_full = 1,
388 },
389};
390
391static struct board_info __initdata board_96348gw_a = {
392 .name = "96348GW-A",
393 .expected_cpu_id = 0x6348,
394
395 .has_enet0 = 1,
396 .has_enet1 = 1,
397 .has_pci = 1,
398
399 .enet0 = {
400 .has_phy = 1,
401 .use_internal_phy = 1,
402 },
403 .enet1 = {
404 .force_speed_100 = 1,
405 .force_duplex_full = 1,
406 },
407
408 .has_ohci0 = 1,
409};
410#endif
411
412/*
413 * known 6358 boards
414 */
415#ifdef CONFIG_BCM63XX_CPU_6358
416static struct board_info __initdata board_96358vw = {
417 .name = "96358VW",
418 .expected_cpu_id = 0x6358,
419
420 .has_enet0 = 1,
421 .has_enet1 = 1,
422 .has_pci = 1,
423
424 .enet0 = {
425 .has_phy = 1,
426 .use_internal_phy = 1,
427 },
428
429 .enet1 = {
430 .force_speed_100 = 1,
431 .force_duplex_full = 1,
432 },
433
434
435 .has_ohci0 = 1,
436 .has_pccard = 1,
437 .has_ehci0 = 1,
438
439 .leds = {
440 {
441 .name = "adsl-fail",
442 .gpio = 15,
443 .active_low = 1,
444 },
445 {
446 .name = "ppp",
447 .gpio = 22,
448 .active_low = 1,
449 },
450 {
451 .name = "ppp-fail",
452 .gpio = 23,
453 .active_low = 1,
454 },
455 {
456 .name = "power",
457 .gpio = 4,
458 .default_trigger = "default-on",
459 },
460 {
461 .name = "stop",
462 .gpio = 5,
463 },
464 },
465};
466
467static struct board_info __initdata board_96358vw2 = {
468 .name = "96358VW2",
469 .expected_cpu_id = 0x6358,
470
471 .has_enet0 = 1,
472 .has_enet1 = 1,
473 .has_pci = 1,
474
475 .enet0 = {
476 .has_phy = 1,
477 .use_internal_phy = 1,
478 },
479
480 .enet1 = {
481 .force_speed_100 = 1,
482 .force_duplex_full = 1,
483 },
484
485
486 .has_ohci0 = 1,
487 .has_pccard = 1,
488 .has_ehci0 = 1,
489
490 .leds = {
491 {
492 .name = "adsl",
493 .gpio = 22,
494 .active_low = 1,
495 },
496 {
497 .name = "ppp-fail",
498 .gpio = 23,
499 },
500 {
501 .name = "power",
502 .gpio = 5,
503 .active_low = 1,
504 .default_trigger = "default-on",
505 },
506 {
507 .name = "stop",
508 .gpio = 4,
509 .active_low = 1,
510 },
511 },
512};
513
514static struct board_info __initdata board_AGPFS0 = {
515 .name = "AGPF-S0",
516 .expected_cpu_id = 0x6358,
517
518 .has_enet0 = 1,
519 .has_enet1 = 1,
520 .has_pci = 1,
521
522 .enet0 = {
523 .has_phy = 1,
524 .use_internal_phy = 1,
525 },
526
527 .enet1 = {
528 .force_speed_100 = 1,
529 .force_duplex_full = 1,
530 },
531
532 .has_ohci0 = 1,
533 .has_ehci0 = 1,
534};
535#endif
536
537/*
538 * all boards
539 */
540static const struct board_info __initdata *bcm963xx_boards[] = {
541#ifdef CONFIG_BCM63XX_CPU_6338
542 &board_96338gw,
543 &board_96338w,
544#endif
545#ifdef CONFIG_BCM63XX_CPU_6345
546 &board_96345gw2,
547#endif
548#ifdef CONFIG_BCM63XX_CPU_6348
549 &board_96348r,
550 &board_96348gw,
551 &board_96348gw_10,
552 &board_96348gw_11,
553 &board_FAST2404,
554 &board_DV201AMR,
555 &board_96348gw_a,
556#endif
557
558#ifdef CONFIG_BCM63XX_CPU_6358
559 &board_96358vw,
560 &board_96358vw2,
561 &board_AGPFS0,
562#endif
563};
564
565/*
566 * early init callback, read nvram data from flash and checksum it
567 */
568void __init board_prom_init(void)
569{
570 unsigned int check_len, i;
571 u8 *boot_addr, *cfe, *p;
572 char cfe_version[32];
573 u32 val;
574
575 /* read base address of boot chip select (0)
576 * 6345 does not have MPI but boots from standard
577 * MIPS Flash address */
578 if (BCMCPU_IS_6345())
579 val = 0x1fc00000;
580 else {
581 val = bcm_mpi_readl(MPI_CSBASE_REG(0));
582 val &= MPI_CSBASE_BASE_MASK;
583 }
584 boot_addr = (u8 *)KSEG1ADDR(val);
585
586 /* dump cfe version */
587 cfe = boot_addr + BCM963XX_CFE_VERSION_OFFSET;
588 if (!memcmp(cfe, "cfe-v", 5))
589 snprintf(cfe_version, sizeof(cfe_version), "%u.%u.%u-%u.%u",
590 cfe[5], cfe[6], cfe[7], cfe[8], cfe[9]);
591 else
592 strcpy(cfe_version, "unknown");
593 printk(KERN_INFO PFX "CFE version: %s\n", cfe_version);
594
595 /* extract nvram data */
596 memcpy(&nvram, boot_addr + BCM963XX_NVRAM_OFFSET, sizeof(nvram));
597
598 /* check checksum before using data */
599 if (nvram.version <= 4)
600 check_len = offsetof(struct bcm963xx_nvram, checksum_old);
601 else
602 check_len = sizeof(nvram);
603 val = 0;
604 p = (u8 *)&nvram;
605 while (check_len--)
606 val += *p;
607 if (val) {
608 printk(KERN_ERR PFX "invalid nvram checksum\n");
609 return;
610 }
611
612 /* find board by name */
613 for (i = 0; i < ARRAY_SIZE(bcm963xx_boards); i++) {
614 if (strncmp(nvram.name, bcm963xx_boards[i]->name,
615 sizeof(nvram.name)))
616 continue;
617 /* copy, board desc array is marked initdata */
618 memcpy(&board, bcm963xx_boards[i], sizeof(board));
619 break;
620 }
621
622 /* bail out if board is not found, will complain later */
623 if (!board.name[0]) {
624 char name[17];
625 memcpy(name, nvram.name, 16);
626 name[16] = 0;
627 printk(KERN_ERR PFX "unknown bcm963xx board: %s\n",
628 name);
629 return;
630 }
631
632 /* setup pin multiplexing depending on board enabled device,
633 * this has to be done this early since PCI init is done
634 * inside arch_initcall */
635 val = 0;
636
637#ifdef CONFIG_PCI
638 if (board.has_pci) {
639 bcm63xx_pci_enabled = 1;
640 if (BCMCPU_IS_6348())
641 val |= GPIO_MODE_6348_G2_PCI;
642 }
643#endif
644
645 if (board.has_pccard) {
646 if (BCMCPU_IS_6348())
647 val |= GPIO_MODE_6348_G1_MII_PCCARD;
648 }
649
650 if (board.has_enet0 && !board.enet0.use_internal_phy) {
651 if (BCMCPU_IS_6348())
652 val |= GPIO_MODE_6348_G3_EXT_MII |
653 GPIO_MODE_6348_G0_EXT_MII;
654 }
655
656 if (board.has_enet1 && !board.enet1.use_internal_phy) {
657 if (BCMCPU_IS_6348())
658 val |= GPIO_MODE_6348_G3_EXT_MII |
659 GPIO_MODE_6348_G0_EXT_MII;
660 }
661
662 bcm_gpio_writel(val, GPIO_MODE_REG);
663}
664
665/*
666 * second stage init callback, good time to panic if we couldn't
667 * identify on which board we're running since early printk is working
668 */
669void __init board_setup(void)
670{
671 if (!board.name[0])
672 panic("unable to detect bcm963xx board");
673 printk(KERN_INFO PFX "board name: %s\n", board.name);
674
675 /* make sure we're running on expected cpu */
676 if (bcm63xx_get_cpu_id() != board.expected_cpu_id)
677 panic("unexpected CPU for bcm963xx board");
678}
679
680/*
681 * return board name for /proc/cpuinfo
682 */
683const char *board_get_name(void)
684{
685 return board.name;
686}
687
688/*
689 * register & return a new board mac address
690 */
691static int board_get_mac_address(u8 *mac)
692{
693 u8 *p;
694 int count;
695
696 if (mac_addr_used >= nvram.mac_addr_count) {
697 printk(KERN_ERR PFX "not enough mac address\n");
698 return -ENODEV;
699 }
700
701 memcpy(mac, nvram.mac_addr_base, ETH_ALEN);
702 p = mac + ETH_ALEN - 1;
703 count = mac_addr_used;
704
705 while (count--) {
706 do {
707 (*p)++;
708 if (*p != 0)
709 break;
710 p--;
711 } while (p != mac);
712 }
713
714 if (p == mac) {
715 printk(KERN_ERR PFX "unable to fetch mac address\n");
716 return -ENODEV;
717 }
718
719 mac_addr_used++;
720 return 0;
721}
722
723static struct mtd_partition mtd_partitions[] = {
724 {
725 .name = "cfe",
726 .offset = 0x0,
727 .size = 0x40000,
728 }
729};
730
731static struct physmap_flash_data flash_data = {
732 .width = 2,
733 .nr_parts = ARRAY_SIZE(mtd_partitions),
734 .parts = mtd_partitions,
735};
736
737static struct resource mtd_resources[] = {
738 {
739 .start = 0, /* filled at runtime */
740 .end = 0, /* filled at runtime */
741 .flags = IORESOURCE_MEM,
742 }
743};
744
745static struct platform_device mtd_dev = {
746 .name = "physmap-flash",
747 .resource = mtd_resources,
748 .num_resources = ARRAY_SIZE(mtd_resources),
749 .dev = {
750 .platform_data = &flash_data,
751 },
752};
753
754/*
755 * Register a sane SPROMv2 to make the on-board
756 * bcm4318 WLAN work
757 */
758#ifdef CONFIG_SSB_PCIHOST
759static struct ssb_sprom bcm63xx_sprom = {
760 .revision = 0x02,
761 .board_rev = 0x17,
762 .country_code = 0x0,
763 .ant_available_bg = 0x3,
764 .pa0b0 = 0x15ae,
765 .pa0b1 = 0xfa85,
766 .pa0b2 = 0xfe8d,
767 .pa1b0 = 0xffff,
768 .pa1b1 = 0xffff,
769 .pa1b2 = 0xffff,
770 .gpio0 = 0xff,
771 .gpio1 = 0xff,
772 .gpio2 = 0xff,
773 .gpio3 = 0xff,
774 .maxpwr_bg = 0x004c,
775 .itssi_bg = 0x00,
776 .boardflags_lo = 0x2848,
777 .boardflags_hi = 0x0000,
778};
779#endif
780
781static struct gpio_led_platform_data bcm63xx_led_data;
782
783static struct platform_device bcm63xx_gpio_leds = {
784 .name = "leds-gpio",
785 .id = 0,
786 .dev.platform_data = &bcm63xx_led_data,
787};
788
789/*
790 * third stage init callback, register all board devices.
791 */
792int __init board_register_devices(void)
793{
794 u32 val;
795
796 if (board.has_enet0 &&
797 !board_get_mac_address(board.enet0.mac_addr))
798 bcm63xx_enet_register(0, &board.enet0);
799
800 if (board.has_enet1 &&
801 !board_get_mac_address(board.enet1.mac_addr))
802 bcm63xx_enet_register(1, &board.enet1);
803
804 if (board.has_dsp)
805 bcm63xx_dsp_register(&board.dsp);
806
807 /* Generate MAC address for WLAN and
808 * register our SPROM */
809#ifdef CONFIG_SSB_PCIHOST
810 if (!board_get_mac_address(bcm63xx_sprom.il0mac)) {
811 memcpy(bcm63xx_sprom.et0mac, bcm63xx_sprom.il0mac, ETH_ALEN);
812 memcpy(bcm63xx_sprom.et1mac, bcm63xx_sprom.il0mac, ETH_ALEN);
813 if (ssb_arch_set_fallback_sprom(&bcm63xx_sprom) < 0)
814 printk(KERN_ERR "failed to register fallback SPROM\n");
815 }
816#endif
817
818 /* read base address of boot chip select (0) */
819 if (BCMCPU_IS_6345())
820 val = 0x1fc00000;
821 else {
822 val = bcm_mpi_readl(MPI_CSBASE_REG(0));
823 val &= MPI_CSBASE_BASE_MASK;
824 }
825 mtd_resources[0].start = val;
826 mtd_resources[0].end = 0x1FFFFFFF;
827
828 platform_device_register(&mtd_dev);
829
830 bcm63xx_led_data.num_leds = ARRAY_SIZE(board.leds);
831 bcm63xx_led_data.leds = board.leds;
832
833 platform_device_register(&bcm63xx_gpio_leds);
834
835 return 0;
836}
837
diff --git a/arch/mips/bcm63xx/clk.c b/arch/mips/bcm63xx/clk.c
new file mode 100644
index 000000000000..2c68ee9ccee2
--- /dev/null
+++ b/arch/mips/bcm63xx/clk.c
@@ -0,0 +1,226 @@
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) 2008 Maxime Bizon <mbizon@freebox.fr>
7 */
8
9#include <linux/module.h>
10#include <linux/mutex.h>
11#include <linux/err.h>
12#include <linux/clk.h>
13#include <bcm63xx_cpu.h>
14#include <bcm63xx_io.h>
15#include <bcm63xx_regs.h>
16#include <bcm63xx_clk.h>
17
18static DEFINE_MUTEX(clocks_mutex);
19
20
21static void clk_enable_unlocked(struct clk *clk)
22{
23 if (clk->set && (clk->usage++) == 0)
24 clk->set(clk, 1);
25}
26
27static void clk_disable_unlocked(struct clk *clk)
28{
29 if (clk->set && (--clk->usage) == 0)
30 clk->set(clk, 0);
31}
32
33static void bcm_hwclock_set(u32 mask, int enable)
34{
35 u32 reg;
36
37 reg = bcm_perf_readl(PERF_CKCTL_REG);
38 if (enable)
39 reg |= mask;
40 else
41 reg &= ~mask;
42 bcm_perf_writel(reg, PERF_CKCTL_REG);
43}
44
45/*
46 * Ethernet MAC "misc" clock: dma clocks and main clock on 6348
47 */
48static void enet_misc_set(struct clk *clk, int enable)
49{
50 u32 mask;
51
52 if (BCMCPU_IS_6338())
53 mask = CKCTL_6338_ENET_EN;
54 else if (BCMCPU_IS_6345())
55 mask = CKCTL_6345_ENET_EN;
56 else if (BCMCPU_IS_6348())
57 mask = CKCTL_6348_ENET_EN;
58 else
59 /* BCMCPU_IS_6358 */
60 mask = CKCTL_6358_EMUSB_EN;
61 bcm_hwclock_set(mask, enable);
62}
63
64static struct clk clk_enet_misc = {
65 .set = enet_misc_set,
66};
67
68/*
69 * Ethernet MAC clocks: only revelant on 6358, silently enable misc
70 * clocks
71 */
72static void enetx_set(struct clk *clk, int enable)
73{
74 if (enable)
75 clk_enable_unlocked(&clk_enet_misc);
76 else
77 clk_disable_unlocked(&clk_enet_misc);
78
79 if (BCMCPU_IS_6358()) {
80 u32 mask;
81
82 if (clk->id == 0)
83 mask = CKCTL_6358_ENET0_EN;
84 else
85 mask = CKCTL_6358_ENET1_EN;
86 bcm_hwclock_set(mask, enable);
87 }
88}
89
90static struct clk clk_enet0 = {
91 .id = 0,
92 .set = enetx_set,
93};
94
95static struct clk clk_enet1 = {
96 .id = 1,
97 .set = enetx_set,
98};
99
100/*
101 * Ethernet PHY clock
102 */
103static void ephy_set(struct clk *clk, int enable)
104{
105 if (!BCMCPU_IS_6358())
106 return;
107 bcm_hwclock_set(CKCTL_6358_EPHY_EN, enable);
108}
109
110
111static struct clk clk_ephy = {
112 .set = ephy_set,
113};
114
115/*
116 * PCM clock
117 */
118static void pcm_set(struct clk *clk, int enable)
119{
120 if (!BCMCPU_IS_6358())
121 return;
122 bcm_hwclock_set(CKCTL_6358_PCM_EN, enable);
123}
124
125static struct clk clk_pcm = {
126 .set = pcm_set,
127};
128
129/*
130 * USB host clock
131 */
132static void usbh_set(struct clk *clk, int enable)
133{
134 if (!BCMCPU_IS_6348())
135 return;
136 bcm_hwclock_set(CKCTL_6348_USBH_EN, enable);
137}
138
139static struct clk clk_usbh = {
140 .set = usbh_set,
141};
142
143/*
144 * SPI clock
145 */
146static void spi_set(struct clk *clk, int enable)
147{
148 u32 mask;
149
150 if (BCMCPU_IS_6338())
151 mask = CKCTL_6338_SPI_EN;
152 else if (BCMCPU_IS_6348())
153 mask = CKCTL_6348_SPI_EN;
154 else
155 /* BCMCPU_IS_6358 */
156 mask = CKCTL_6358_SPI_EN;
157 bcm_hwclock_set(mask, enable);
158}
159
160static struct clk clk_spi = {
161 .set = spi_set,
162};
163
164/*
165 * Internal peripheral clock
166 */
167static struct clk clk_periph = {
168 .rate = (50 * 1000 * 1000),
169};
170
171
172/*
173 * Linux clock API implementation
174 */
175int clk_enable(struct clk *clk)
176{
177 mutex_lock(&clocks_mutex);
178 clk_enable_unlocked(clk);
179 mutex_unlock(&clocks_mutex);
180 return 0;
181}
182
183EXPORT_SYMBOL(clk_enable);
184
185void clk_disable(struct clk *clk)
186{
187 mutex_lock(&clocks_mutex);
188 clk_disable_unlocked(clk);
189 mutex_unlock(&clocks_mutex);
190}
191
192EXPORT_SYMBOL(clk_disable);
193
194unsigned long clk_get_rate(struct clk *clk)
195{
196 return clk->rate;
197}
198
199EXPORT_SYMBOL(clk_get_rate);
200
201struct clk *clk_get(struct device *dev, const char *id)
202{
203 if (!strcmp(id, "enet0"))
204 return &clk_enet0;
205 if (!strcmp(id, "enet1"))
206 return &clk_enet1;
207 if (!strcmp(id, "ephy"))
208 return &clk_ephy;
209 if (!strcmp(id, "usbh"))
210 return &clk_usbh;
211 if (!strcmp(id, "spi"))
212 return &clk_spi;
213 if (!strcmp(id, "periph"))
214 return &clk_periph;
215 if (BCMCPU_IS_6358() && !strcmp(id, "pcm"))
216 return &clk_pcm;
217 return ERR_PTR(-ENOENT);
218}
219
220EXPORT_SYMBOL(clk_get);
221
222void clk_put(struct clk *clk)
223{
224}
225
226EXPORT_SYMBOL(clk_put);
diff --git a/arch/mips/bcm63xx/cpu.c b/arch/mips/bcm63xx/cpu.c
new file mode 100644
index 000000000000..6dc43f0483e8
--- /dev/null
+++ b/arch/mips/bcm63xx/cpu.c
@@ -0,0 +1,345 @@
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) 2008 Maxime Bizon <mbizon@freebox.fr>
7 * Copyright (C) 2009 Florian Fainelli <florian@openwrt.org>
8 */
9
10#include <linux/kernel.h>
11#include <linux/module.h>
12#include <linux/cpu.h>
13#include <bcm63xx_cpu.h>
14#include <bcm63xx_regs.h>
15#include <bcm63xx_io.h>
16#include <bcm63xx_irq.h>
17
18const unsigned long *bcm63xx_regs_base;
19EXPORT_SYMBOL(bcm63xx_regs_base);
20
21const int *bcm63xx_irqs;
22EXPORT_SYMBOL(bcm63xx_irqs);
23
24static u16 bcm63xx_cpu_id;
25static u16 bcm63xx_cpu_rev;
26static unsigned int bcm63xx_cpu_freq;
27static unsigned int bcm63xx_memory_size;
28
29/*
30 * 6338 register sets and irqs
31 */
32static const unsigned long bcm96338_regs_base[] = {
33 [RSET_DSL_LMEM] = BCM_6338_DSL_LMEM_BASE,
34 [RSET_PERF] = BCM_6338_PERF_BASE,
35 [RSET_TIMER] = BCM_6338_TIMER_BASE,
36 [RSET_WDT] = BCM_6338_WDT_BASE,
37 [RSET_UART0] = BCM_6338_UART0_BASE,
38 [RSET_GPIO] = BCM_6338_GPIO_BASE,
39 [RSET_SPI] = BCM_6338_SPI_BASE,
40 [RSET_OHCI0] = BCM_6338_OHCI0_BASE,
41 [RSET_OHCI_PRIV] = BCM_6338_OHCI_PRIV_BASE,
42 [RSET_USBH_PRIV] = BCM_6338_USBH_PRIV_BASE,
43 [RSET_UDC0] = BCM_6338_UDC0_BASE,
44 [RSET_MPI] = BCM_6338_MPI_BASE,
45 [RSET_PCMCIA] = BCM_6338_PCMCIA_BASE,
46 [RSET_SDRAM] = BCM_6338_SDRAM_BASE,
47 [RSET_DSL] = BCM_6338_DSL_BASE,
48 [RSET_ENET0] = BCM_6338_ENET0_BASE,
49 [RSET_ENET1] = BCM_6338_ENET1_BASE,
50 [RSET_ENETDMA] = BCM_6338_ENETDMA_BASE,
51 [RSET_MEMC] = BCM_6338_MEMC_BASE,
52 [RSET_DDR] = BCM_6338_DDR_BASE,
53};
54
55static const int bcm96338_irqs[] = {
56 [IRQ_TIMER] = BCM_6338_TIMER_IRQ,
57 [IRQ_UART0] = BCM_6338_UART0_IRQ,
58 [IRQ_DSL] = BCM_6338_DSL_IRQ,
59 [IRQ_ENET0] = BCM_6338_ENET0_IRQ,
60 [IRQ_ENET_PHY] = BCM_6338_ENET_PHY_IRQ,
61 [IRQ_ENET0_RXDMA] = BCM_6338_ENET0_RXDMA_IRQ,
62 [IRQ_ENET0_TXDMA] = BCM_6338_ENET0_TXDMA_IRQ,
63};
64
65/*
66 * 6345 register sets and irqs
67 */
68static const unsigned long bcm96345_regs_base[] = {
69 [RSET_DSL_LMEM] = BCM_6345_DSL_LMEM_BASE,
70 [RSET_PERF] = BCM_6345_PERF_BASE,
71 [RSET_TIMER] = BCM_6345_TIMER_BASE,
72 [RSET_WDT] = BCM_6345_WDT_BASE,
73 [RSET_UART0] = BCM_6345_UART0_BASE,
74 [RSET_GPIO] = BCM_6345_GPIO_BASE,
75 [RSET_SPI] = BCM_6345_SPI_BASE,
76 [RSET_UDC0] = BCM_6345_UDC0_BASE,
77 [RSET_OHCI0] = BCM_6345_OHCI0_BASE,
78 [RSET_OHCI_PRIV] = BCM_6345_OHCI_PRIV_BASE,
79 [RSET_USBH_PRIV] = BCM_6345_USBH_PRIV_BASE,
80 [RSET_MPI] = BCM_6345_MPI_BASE,
81 [RSET_PCMCIA] = BCM_6345_PCMCIA_BASE,
82 [RSET_DSL] = BCM_6345_DSL_BASE,
83 [RSET_ENET0] = BCM_6345_ENET0_BASE,
84 [RSET_ENET1] = BCM_6345_ENET1_BASE,
85 [RSET_ENETDMA] = BCM_6345_ENETDMA_BASE,
86 [RSET_EHCI0] = BCM_6345_EHCI0_BASE,
87 [RSET_SDRAM] = BCM_6345_SDRAM_BASE,
88 [RSET_MEMC] = BCM_6345_MEMC_BASE,
89 [RSET_DDR] = BCM_6345_DDR_BASE,
90};
91
92static const int bcm96345_irqs[] = {
93 [IRQ_TIMER] = BCM_6345_TIMER_IRQ,
94 [IRQ_UART0] = BCM_6345_UART0_IRQ,
95 [IRQ_DSL] = BCM_6345_DSL_IRQ,
96 [IRQ_ENET0] = BCM_6345_ENET0_IRQ,
97 [IRQ_ENET_PHY] = BCM_6345_ENET_PHY_IRQ,
98 [IRQ_ENET0_RXDMA] = BCM_6345_ENET0_RXDMA_IRQ,
99 [IRQ_ENET0_TXDMA] = BCM_6345_ENET0_TXDMA_IRQ,
100};
101
102/*
103 * 6348 register sets and irqs
104 */
105static const unsigned long bcm96348_regs_base[] = {
106 [RSET_DSL_LMEM] = BCM_6348_DSL_LMEM_BASE,
107 [RSET_PERF] = BCM_6348_PERF_BASE,
108 [RSET_TIMER] = BCM_6348_TIMER_BASE,
109 [RSET_WDT] = BCM_6348_WDT_BASE,
110 [RSET_UART0] = BCM_6348_UART0_BASE,
111 [RSET_GPIO] = BCM_6348_GPIO_BASE,
112 [RSET_SPI] = BCM_6348_SPI_BASE,
113 [RSET_OHCI0] = BCM_6348_OHCI0_BASE,
114 [RSET_OHCI_PRIV] = BCM_6348_OHCI_PRIV_BASE,
115 [RSET_USBH_PRIV] = BCM_6348_USBH_PRIV_BASE,
116 [RSET_MPI] = BCM_6348_MPI_BASE,
117 [RSET_PCMCIA] = BCM_6348_PCMCIA_BASE,
118 [RSET_SDRAM] = BCM_6348_SDRAM_BASE,
119 [RSET_DSL] = BCM_6348_DSL_BASE,
120 [RSET_ENET0] = BCM_6348_ENET0_BASE,
121 [RSET_ENET1] = BCM_6348_ENET1_BASE,
122 [RSET_ENETDMA] = BCM_6348_ENETDMA_BASE,
123 [RSET_MEMC] = BCM_6348_MEMC_BASE,
124 [RSET_DDR] = BCM_6348_DDR_BASE,
125};
126
127static const int bcm96348_irqs[] = {
128 [IRQ_TIMER] = BCM_6348_TIMER_IRQ,
129 [IRQ_UART0] = BCM_6348_UART0_IRQ,
130 [IRQ_DSL] = BCM_6348_DSL_IRQ,
131 [IRQ_ENET0] = BCM_6348_ENET0_IRQ,
132 [IRQ_ENET1] = BCM_6348_ENET1_IRQ,
133 [IRQ_ENET_PHY] = BCM_6348_ENET_PHY_IRQ,
134 [IRQ_OHCI0] = BCM_6348_OHCI0_IRQ,
135 [IRQ_PCMCIA] = BCM_6348_PCMCIA_IRQ,
136 [IRQ_ENET0_RXDMA] = BCM_6348_ENET0_RXDMA_IRQ,
137 [IRQ_ENET0_TXDMA] = BCM_6348_ENET0_TXDMA_IRQ,
138 [IRQ_ENET1_RXDMA] = BCM_6348_ENET1_RXDMA_IRQ,
139 [IRQ_ENET1_TXDMA] = BCM_6348_ENET1_TXDMA_IRQ,
140 [IRQ_PCI] = BCM_6348_PCI_IRQ,
141};
142
143/*
144 * 6358 register sets and irqs
145 */
146static const unsigned long bcm96358_regs_base[] = {
147 [RSET_DSL_LMEM] = BCM_6358_DSL_LMEM_BASE,
148 [RSET_PERF] = BCM_6358_PERF_BASE,
149 [RSET_TIMER] = BCM_6358_TIMER_BASE,
150 [RSET_WDT] = BCM_6358_WDT_BASE,
151 [RSET_UART0] = BCM_6358_UART0_BASE,
152 [RSET_GPIO] = BCM_6358_GPIO_BASE,
153 [RSET_SPI] = BCM_6358_SPI_BASE,
154 [RSET_OHCI0] = BCM_6358_OHCI0_BASE,
155 [RSET_EHCI0] = BCM_6358_EHCI0_BASE,
156 [RSET_OHCI_PRIV] = BCM_6358_OHCI_PRIV_BASE,
157 [RSET_USBH_PRIV] = BCM_6358_USBH_PRIV_BASE,
158 [RSET_MPI] = BCM_6358_MPI_BASE,
159 [RSET_PCMCIA] = BCM_6358_PCMCIA_BASE,
160 [RSET_SDRAM] = BCM_6358_SDRAM_BASE,
161 [RSET_DSL] = BCM_6358_DSL_BASE,
162 [RSET_ENET0] = BCM_6358_ENET0_BASE,
163 [RSET_ENET1] = BCM_6358_ENET1_BASE,
164 [RSET_ENETDMA] = BCM_6358_ENETDMA_BASE,
165 [RSET_MEMC] = BCM_6358_MEMC_BASE,
166 [RSET_DDR] = BCM_6358_DDR_BASE,
167};
168
169static const int bcm96358_irqs[] = {
170 [IRQ_TIMER] = BCM_6358_TIMER_IRQ,
171 [IRQ_UART0] = BCM_6358_UART0_IRQ,
172 [IRQ_DSL] = BCM_6358_DSL_IRQ,
173 [IRQ_ENET0] = BCM_6358_ENET0_IRQ,
174 [IRQ_ENET1] = BCM_6358_ENET1_IRQ,
175 [IRQ_ENET_PHY] = BCM_6358_ENET_PHY_IRQ,
176 [IRQ_OHCI0] = BCM_6358_OHCI0_IRQ,
177 [IRQ_EHCI0] = BCM_6358_EHCI0_IRQ,
178 [IRQ_PCMCIA] = BCM_6358_PCMCIA_IRQ,
179 [IRQ_ENET0_RXDMA] = BCM_6358_ENET0_RXDMA_IRQ,
180 [IRQ_ENET0_TXDMA] = BCM_6358_ENET0_TXDMA_IRQ,
181 [IRQ_ENET1_RXDMA] = BCM_6358_ENET1_RXDMA_IRQ,
182 [IRQ_ENET1_TXDMA] = BCM_6358_ENET1_TXDMA_IRQ,
183 [IRQ_PCI] = BCM_6358_PCI_IRQ,
184};
185
186u16 __bcm63xx_get_cpu_id(void)
187{
188 return bcm63xx_cpu_id;
189}
190
191EXPORT_SYMBOL(__bcm63xx_get_cpu_id);
192
193u16 bcm63xx_get_cpu_rev(void)
194{
195 return bcm63xx_cpu_rev;
196}
197
198EXPORT_SYMBOL(bcm63xx_get_cpu_rev);
199
200unsigned int bcm63xx_get_cpu_freq(void)
201{
202 return bcm63xx_cpu_freq;
203}
204
205unsigned int bcm63xx_get_memory_size(void)
206{
207 return bcm63xx_memory_size;
208}
209
210static unsigned int detect_cpu_clock(void)
211{
212 unsigned int tmp, n1 = 0, n2 = 0, m1 = 0;
213
214 /* BCM6338 has a fixed 240 Mhz frequency */
215 if (BCMCPU_IS_6338())
216 return 240000000;
217
218 /* BCM6345 has a fixed 140Mhz frequency */
219 if (BCMCPU_IS_6345())
220 return 140000000;
221
222 /*
223 * frequency depends on PLL configuration:
224 */
225 if (BCMCPU_IS_6348()) {
226 /* 16MHz * (N1 + 1) * (N2 + 2) / (M1_CPU + 1) */
227 tmp = bcm_perf_readl(PERF_MIPSPLLCTL_REG);
228 n1 = (tmp & MIPSPLLCTL_N1_MASK) >> MIPSPLLCTL_N1_SHIFT;
229 n2 = (tmp & MIPSPLLCTL_N2_MASK) >> MIPSPLLCTL_N2_SHIFT;
230 m1 = (tmp & MIPSPLLCTL_M1CPU_MASK) >> MIPSPLLCTL_M1CPU_SHIFT;
231 n1 += 1;
232 n2 += 2;
233 m1 += 1;
234 }
235
236 if (BCMCPU_IS_6358()) {
237 /* 16MHz * N1 * N2 / M1_CPU */
238 tmp = bcm_ddr_readl(DDR_DMIPSPLLCFG_REG);
239 n1 = (tmp & DMIPSPLLCFG_N1_MASK) >> DMIPSPLLCFG_N1_SHIFT;
240 n2 = (tmp & DMIPSPLLCFG_N2_MASK) >> DMIPSPLLCFG_N2_SHIFT;
241 m1 = (tmp & DMIPSPLLCFG_M1_MASK) >> DMIPSPLLCFG_M1_SHIFT;
242 }
243
244 return (16 * 1000000 * n1 * n2) / m1;
245}
246
247/*
248 * attempt to detect the amount of memory installed
249 */
250static unsigned int detect_memory_size(void)
251{
252 unsigned int cols = 0, rows = 0, is_32bits = 0, banks = 0;
253 u32 val;
254
255 if (BCMCPU_IS_6345())
256 return (8 * 1024 * 1024);
257
258 if (BCMCPU_IS_6338() || BCMCPU_IS_6348()) {
259 val = bcm_sdram_readl(SDRAM_CFG_REG);
260 rows = (val & SDRAM_CFG_ROW_MASK) >> SDRAM_CFG_ROW_SHIFT;
261 cols = (val & SDRAM_CFG_COL_MASK) >> SDRAM_CFG_COL_SHIFT;
262 is_32bits = (val & SDRAM_CFG_32B_MASK) ? 1 : 0;
263 banks = (val & SDRAM_CFG_BANK_MASK) ? 2 : 1;
264 }
265
266 if (BCMCPU_IS_6358()) {
267 val = bcm_memc_readl(MEMC_CFG_REG);
268 rows = (val & MEMC_CFG_ROW_MASK) >> MEMC_CFG_ROW_SHIFT;
269 cols = (val & MEMC_CFG_COL_MASK) >> MEMC_CFG_COL_SHIFT;
270 is_32bits = (val & MEMC_CFG_32B_MASK) ? 0 : 1;
271 banks = 2;
272 }
273
274 /* 0 => 11 address bits ... 2 => 13 address bits */
275 rows += 11;
276
277 /* 0 => 8 address bits ... 2 => 10 address bits */
278 cols += 8;
279
280 return 1 << (cols + rows + (is_32bits + 1) + banks);
281}
282
283void __init bcm63xx_cpu_init(void)
284{
285 unsigned int tmp, expected_cpu_id;
286 struct cpuinfo_mips *c = &current_cpu_data;
287
288 /* soc registers location depends on cpu type */
289 expected_cpu_id = 0;
290
291 switch (c->cputype) {
292 /*
293 * BCM6338 as the same PrId as BCM3302 see arch/mips/kernel/cpu-probe.c
294 */
295 case CPU_BCM3302:
296 expected_cpu_id = BCM6338_CPU_ID;
297 bcm63xx_regs_base = bcm96338_regs_base;
298 bcm63xx_irqs = bcm96338_irqs;
299 break;
300 case CPU_BCM6345:
301 expected_cpu_id = BCM6345_CPU_ID;
302 bcm63xx_regs_base = bcm96345_regs_base;
303 bcm63xx_irqs = bcm96345_irqs;
304 break;
305 case CPU_BCM6348:
306 expected_cpu_id = BCM6348_CPU_ID;
307 bcm63xx_regs_base = bcm96348_regs_base;
308 bcm63xx_irqs = bcm96348_irqs;
309 break;
310 case CPU_BCM6358:
311 expected_cpu_id = BCM6358_CPU_ID;
312 bcm63xx_regs_base = bcm96358_regs_base;
313 bcm63xx_irqs = bcm96358_irqs;
314 break;
315 }
316
317 /*
318 * really early to panic, but delaying panic would not help since we
319 * will never get any working console
320 */
321 if (!expected_cpu_id)
322 panic("unsupported Broadcom CPU");
323
324 /*
325 * bcm63xx_regs_base is set, we can access soc registers
326 */
327
328 /* double check CPU type */
329 tmp = bcm_perf_readl(PERF_REV_REG);
330 bcm63xx_cpu_id = (tmp & REV_CHIPID_MASK) >> REV_CHIPID_SHIFT;
331 bcm63xx_cpu_rev = (tmp & REV_REVID_MASK) >> REV_REVID_SHIFT;
332
333 if (bcm63xx_cpu_id != expected_cpu_id)
334 panic("bcm63xx CPU id mismatch");
335
336 bcm63xx_cpu_freq = detect_cpu_clock();
337 bcm63xx_memory_size = detect_memory_size();
338
339 printk(KERN_INFO "Detected Broadcom 0x%04x CPU revision %02x\n",
340 bcm63xx_cpu_id, bcm63xx_cpu_rev);
341 printk(KERN_INFO "CPU frequency is %u MHz\n",
342 bcm63xx_cpu_freq / 1000000);
343 printk(KERN_INFO "%uMB of RAM installed\n",
344 bcm63xx_memory_size >> 20);
345}
diff --git a/arch/mips/bcm63xx/cs.c b/arch/mips/bcm63xx/cs.c
new file mode 100644
index 000000000000..50d8190bbf7b
--- /dev/null
+++ b/arch/mips/bcm63xx/cs.c
@@ -0,0 +1,144 @@
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) 2008 Maxime Bizon <mbizon@freebox.fr>
7 */
8
9#include <linux/kernel.h>
10#include <linux/module.h>
11#include <linux/spinlock.h>
12#include <linux/log2.h>
13#include <bcm63xx_cpu.h>
14#include <bcm63xx_io.h>
15#include <bcm63xx_regs.h>
16#include <bcm63xx_cs.h>
17
18static DEFINE_SPINLOCK(bcm63xx_cs_lock);
19
20/*
21 * check if given chip select exists
22 */
23static int is_valid_cs(unsigned int cs)
24{
25 if (cs > 6)
26 return 0;
27 return 1;
28}
29
30/*
31 * Configure chipselect base address and size (bytes).
32 * Size must be a power of two between 8k and 256M.
33 */
34int bcm63xx_set_cs_base(unsigned int cs, u32 base, unsigned int size)
35{
36 unsigned long flags;
37 u32 val;
38
39 if (!is_valid_cs(cs))
40 return -EINVAL;
41
42 /* sanity check on size */
43 if (size != roundup_pow_of_two(size))
44 return -EINVAL;
45
46 if (size < 8 * 1024 || size > 256 * 1024 * 1024)
47 return -EINVAL;
48
49 val = (base & MPI_CSBASE_BASE_MASK);
50 /* 8k => 0 - 256M => 15 */
51 val |= (ilog2(size) - ilog2(8 * 1024)) << MPI_CSBASE_SIZE_SHIFT;
52
53 spin_lock_irqsave(&bcm63xx_cs_lock, flags);
54 bcm_mpi_writel(val, MPI_CSBASE_REG(cs));
55 spin_unlock_irqrestore(&bcm63xx_cs_lock, flags);
56
57 return 0;
58}
59
60EXPORT_SYMBOL(bcm63xx_set_cs_base);
61
62/*
63 * configure chipselect timing (ns)
64 */
65int bcm63xx_set_cs_timing(unsigned int cs, unsigned int wait,
66 unsigned int setup, unsigned int hold)
67{
68 unsigned long flags;
69 u32 val;
70
71 if (!is_valid_cs(cs))
72 return -EINVAL;
73
74 spin_lock_irqsave(&bcm63xx_cs_lock, flags);
75 val = bcm_mpi_readl(MPI_CSCTL_REG(cs));
76 val &= ~(MPI_CSCTL_WAIT_MASK);
77 val &= ~(MPI_CSCTL_SETUP_MASK);
78 val &= ~(MPI_CSCTL_HOLD_MASK);
79 val |= wait << MPI_CSCTL_WAIT_SHIFT;
80 val |= setup << MPI_CSCTL_SETUP_SHIFT;
81 val |= hold << MPI_CSCTL_HOLD_SHIFT;
82 bcm_mpi_writel(val, MPI_CSCTL_REG(cs));
83 spin_unlock_irqrestore(&bcm63xx_cs_lock, flags);
84
85 return 0;
86}
87
88EXPORT_SYMBOL(bcm63xx_set_cs_timing);
89
90/*
91 * configure other chipselect parameter (data bus size, ...)
92 */
93int bcm63xx_set_cs_param(unsigned int cs, u32 params)
94{
95 unsigned long flags;
96 u32 val;
97
98 if (!is_valid_cs(cs))
99 return -EINVAL;
100
101 /* none of this fields apply to pcmcia */
102 if (cs == MPI_CS_PCMCIA_COMMON ||
103 cs == MPI_CS_PCMCIA_ATTR ||
104 cs == MPI_CS_PCMCIA_IO)
105 return -EINVAL;
106
107 spin_lock_irqsave(&bcm63xx_cs_lock, flags);
108 val = bcm_mpi_readl(MPI_CSCTL_REG(cs));
109 val &= ~(MPI_CSCTL_DATA16_MASK);
110 val &= ~(MPI_CSCTL_SYNCMODE_MASK);
111 val &= ~(MPI_CSCTL_TSIZE_MASK);
112 val &= ~(MPI_CSCTL_ENDIANSWAP_MASK);
113 val |= params;
114 bcm_mpi_writel(val, MPI_CSCTL_REG(cs));
115 spin_unlock_irqrestore(&bcm63xx_cs_lock, flags);
116
117 return 0;
118}
119
120EXPORT_SYMBOL(bcm63xx_set_cs_param);
121
122/*
123 * set cs status (enable/disable)
124 */
125int bcm63xx_set_cs_status(unsigned int cs, int enable)
126{
127 unsigned long flags;
128 u32 val;
129
130 if (!is_valid_cs(cs))
131 return -EINVAL;
132
133 spin_lock_irqsave(&bcm63xx_cs_lock, flags);
134 val = bcm_mpi_readl(MPI_CSCTL_REG(cs));
135 if (enable)
136 val |= MPI_CSCTL_ENABLE_MASK;
137 else
138 val &= ~MPI_CSCTL_ENABLE_MASK;
139 bcm_mpi_writel(val, MPI_CSCTL_REG(cs));
140 spin_unlock_irqrestore(&bcm63xx_cs_lock, flags);
141 return 0;
142}
143
144EXPORT_SYMBOL(bcm63xx_set_cs_status);
diff --git a/arch/mips/bcm63xx/dev-dsp.c b/arch/mips/bcm63xx/dev-dsp.c
new file mode 100644
index 000000000000..da46d1d3c77c
--- /dev/null
+++ b/arch/mips/bcm63xx/dev-dsp.c
@@ -0,0 +1,56 @@
1/*
2 * Broadcom BCM63xx VoIP DSP registration
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 * Copyright (C) 2009 Florian Fainelli <florian@openwrt.org>
9 */
10
11#include <linux/init.h>
12#include <linux/kernel.h>
13#include <linux/platform_device.h>
14
15#include <bcm63xx_cpu.h>
16#include <bcm63xx_dev_dsp.h>
17#include <bcm63xx_regs.h>
18#include <bcm63xx_io.h>
19
20static struct resource voip_dsp_resources[] = {
21 {
22 .start = -1, /* filled at runtime */
23 .end = -1, /* filled at runtime */
24 .flags = IORESOURCE_MEM,
25 },
26 {
27 .start = -1, /* filled at runtime */
28 .flags = IORESOURCE_IRQ,
29 },
30};
31
32static struct platform_device bcm63xx_voip_dsp_device = {
33 .name = "bcm63xx-voip-dsp",
34 .id = 0,
35 .num_resources = ARRAY_SIZE(voip_dsp_resources),
36 .resource = voip_dsp_resources,
37};
38
39int __init bcm63xx_dsp_register(const struct bcm63xx_dsp_platform_data *pd)
40{
41 struct bcm63xx_dsp_platform_data *dpd;
42 u32 val;
43
44 /* Get the memory window */
45 val = bcm_mpi_readl(MPI_CSBASE_REG(pd->cs - 1));
46 val &= MPI_CSBASE_BASE_MASK;
47 voip_dsp_resources[0].start = val;
48 voip_dsp_resources[0].end = val + 0xFFFFFFF;
49 voip_dsp_resources[1].start = pd->ext_irq;
50
51 /* copy given platform data */
52 dpd = bcm63xx_voip_dsp_device.dev.platform_data;
53 memcpy(dpd, pd, sizeof (*pd));
54
55 return platform_device_register(&bcm63xx_voip_dsp_device);
56}
diff --git a/arch/mips/bcm63xx/dev-enet.c b/arch/mips/bcm63xx/dev-enet.c
new file mode 100644
index 000000000000..9f544badd0b4
--- /dev/null
+++ b/arch/mips/bcm63xx/dev-enet.c
@@ -0,0 +1,159 @@
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) 2008 Maxime Bizon <mbizon@freebox.fr>
7 */
8
9#include <linux/init.h>
10#include <linux/kernel.h>
11#include <linux/platform_device.h>
12#include <bcm63xx_dev_enet.h>
13#include <bcm63xx_io.h>
14#include <bcm63xx_regs.h>
15
16static struct resource shared_res[] = {
17 {
18 .start = -1, /* filled at runtime */
19 .end = -1, /* filled at runtime */
20 .flags = IORESOURCE_MEM,
21 },
22};
23
24static struct platform_device bcm63xx_enet_shared_device = {
25 .name = "bcm63xx_enet_shared",
26 .id = 0,
27 .num_resources = ARRAY_SIZE(shared_res),
28 .resource = shared_res,
29};
30
31static int shared_device_registered;
32
33static struct resource enet0_res[] = {
34 {
35 .start = -1, /* filled at runtime */
36 .end = -1, /* filled at runtime */
37 .flags = IORESOURCE_MEM,
38 },
39 {
40 .start = -1, /* filled at runtime */
41 .flags = IORESOURCE_IRQ,
42 },
43 {
44 .start = -1, /* filled at runtime */
45 .flags = IORESOURCE_IRQ,
46 },
47 {
48 .start = -1, /* filled at runtime */
49 .flags = IORESOURCE_IRQ,
50 },
51};
52
53static struct bcm63xx_enet_platform_data enet0_pd;
54
55static struct platform_device bcm63xx_enet0_device = {
56 .name = "bcm63xx_enet",
57 .id = 0,
58 .num_resources = ARRAY_SIZE(enet0_res),
59 .resource = enet0_res,
60 .dev = {
61 .platform_data = &enet0_pd,
62 },
63};
64
65static struct resource enet1_res[] = {
66 {
67 .start = -1, /* filled at runtime */
68 .end = -1, /* filled at runtime */
69 .flags = IORESOURCE_MEM,
70 },
71 {
72 .start = -1, /* filled at runtime */
73 .flags = IORESOURCE_IRQ,
74 },
75 {
76 .start = -1, /* filled at runtime */
77 .flags = IORESOURCE_IRQ,
78 },
79 {
80 .start = -1, /* filled at runtime */
81 .flags = IORESOURCE_IRQ,
82 },
83};
84
85static struct bcm63xx_enet_platform_data enet1_pd;
86
87static struct platform_device bcm63xx_enet1_device = {
88 .name = "bcm63xx_enet",
89 .id = 1,
90 .num_resources = ARRAY_SIZE(enet1_res),
91 .resource = enet1_res,
92 .dev = {
93 .platform_data = &enet1_pd,
94 },
95};
96
97int __init bcm63xx_enet_register(int unit,
98 const struct bcm63xx_enet_platform_data *pd)
99{
100 struct platform_device *pdev;
101 struct bcm63xx_enet_platform_data *dpd;
102 int ret;
103
104 if (unit > 1)
105 return -ENODEV;
106
107 if (!shared_device_registered) {
108 shared_res[0].start = bcm63xx_regset_address(RSET_ENETDMA);
109 shared_res[0].end = shared_res[0].start;
110 if (BCMCPU_IS_6338())
111 shared_res[0].end += (RSET_ENETDMA_SIZE / 2) - 1;
112 else
113 shared_res[0].end += (RSET_ENETDMA_SIZE) - 1;
114
115 ret = platform_device_register(&bcm63xx_enet_shared_device);
116 if (ret)
117 return ret;
118 shared_device_registered = 1;
119 }
120
121 if (unit == 0) {
122 enet0_res[0].start = bcm63xx_regset_address(RSET_ENET0);
123 enet0_res[0].end = enet0_res[0].start;
124 enet0_res[0].end += RSET_ENET_SIZE - 1;
125 enet0_res[1].start = bcm63xx_get_irq_number(IRQ_ENET0);
126 enet0_res[2].start = bcm63xx_get_irq_number(IRQ_ENET0_RXDMA);
127 enet0_res[3].start = bcm63xx_get_irq_number(IRQ_ENET0_TXDMA);
128 pdev = &bcm63xx_enet0_device;
129 } else {
130 enet1_res[0].start = bcm63xx_regset_address(RSET_ENET1);
131 enet1_res[0].end = enet1_res[0].start;
132 enet1_res[0].end += RSET_ENET_SIZE - 1;
133 enet1_res[1].start = bcm63xx_get_irq_number(IRQ_ENET1);
134 enet1_res[2].start = bcm63xx_get_irq_number(IRQ_ENET1_RXDMA);
135 enet1_res[3].start = bcm63xx_get_irq_number(IRQ_ENET1_TXDMA);
136 pdev = &bcm63xx_enet1_device;
137 }
138
139 /* copy given platform data */
140 dpd = pdev->dev.platform_data;
141 memcpy(dpd, pd, sizeof(*pd));
142
143 /* adjust them in case internal phy is used */
144 if (dpd->use_internal_phy) {
145
146 /* internal phy only exists for enet0 */
147 if (unit == 1)
148 return -ENODEV;
149
150 dpd->phy_id = 1;
151 dpd->has_phy_interrupt = 1;
152 dpd->phy_interrupt = bcm63xx_get_irq_number(IRQ_ENET_PHY);
153 }
154
155 ret = platform_device_register(pdev);
156 if (ret)
157 return ret;
158 return 0;
159}
diff --git a/arch/mips/bcm63xx/early_printk.c b/arch/mips/bcm63xx/early_printk.c
new file mode 100644
index 000000000000..bf353c937df2
--- /dev/null
+++ b/arch/mips/bcm63xx/early_printk.c
@@ -0,0 +1,30 @@
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) 2008 Maxime Bizon <mbizon@freebox.fr>
7 */
8
9#include <linux/init.h>
10#include <bcm63xx_io.h>
11#include <bcm63xx_regs.h>
12
13static void __init wait_xfered(void)
14{
15 unsigned int val;
16
17 /* wait for any previous char to be transmitted */
18 do {
19 val = bcm_uart0_readl(UART_IR_REG);
20 if (val & UART_IR_STAT(UART_IR_TXEMPTY))
21 break;
22 } while (1);
23}
24
25void __init prom_putchar(char c)
26{
27 wait_xfered();
28 bcm_uart0_writel(c, UART_FIFO_REG);
29 wait_xfered();
30}
diff --git a/arch/mips/bcm63xx/gpio.c b/arch/mips/bcm63xx/gpio.c
new file mode 100644
index 000000000000..87ca39046334
--- /dev/null
+++ b/arch/mips/bcm63xx/gpio.c
@@ -0,0 +1,134 @@
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) 2008 Maxime Bizon <mbizon@freebox.fr>
7 * Copyright (C) 2008 Florian Fainelli <florian@openwrt.org>
8 */
9
10#include <linux/kernel.h>
11#include <linux/module.h>
12#include <linux/spinlock.h>
13#include <linux/platform_device.h>
14#include <linux/gpio.h>
15
16#include <bcm63xx_cpu.h>
17#include <bcm63xx_gpio.h>
18#include <bcm63xx_io.h>
19#include <bcm63xx_regs.h>
20
21static DEFINE_SPINLOCK(bcm63xx_gpio_lock);
22static u32 gpio_out_low, gpio_out_high;
23
24static void bcm63xx_gpio_set(struct gpio_chip *chip,
25 unsigned gpio, int val)
26{
27 u32 reg;
28 u32 mask;
29 u32 *v;
30 unsigned long flags;
31
32 if (gpio >= chip->ngpio)
33 BUG();
34
35 if (gpio < 32) {
36 reg = GPIO_DATA_LO_REG;
37 mask = 1 << gpio;
38 v = &gpio_out_low;
39 } else {
40 reg = GPIO_DATA_HI_REG;
41 mask = 1 << (gpio - 32);
42 v = &gpio_out_high;
43 }
44
45 spin_lock_irqsave(&bcm63xx_gpio_lock, flags);
46 if (val)
47 *v |= mask;
48 else
49 *v &= ~mask;
50 bcm_gpio_writel(*v, reg);
51 spin_unlock_irqrestore(&bcm63xx_gpio_lock, flags);
52}
53
54static int bcm63xx_gpio_get(struct gpio_chip *chip, unsigned gpio)
55{
56 u32 reg;
57 u32 mask;
58
59 if (gpio >= chip->ngpio)
60 BUG();
61
62 if (gpio < 32) {
63 reg = GPIO_DATA_LO_REG;
64 mask = 1 << gpio;
65 } else {
66 reg = GPIO_DATA_HI_REG;
67 mask = 1 << (gpio - 32);
68 }
69
70 return !!(bcm_gpio_readl(reg) & mask);
71}
72
73static int bcm63xx_gpio_set_direction(struct gpio_chip *chip,
74 unsigned gpio, int dir)
75{
76 u32 reg;
77 u32 mask;
78 u32 tmp;
79 unsigned long flags;
80
81 if (gpio >= chip->ngpio)
82 BUG();
83
84 if (gpio < 32) {
85 reg = GPIO_CTL_LO_REG;
86 mask = 1 << gpio;
87 } else {
88 reg = GPIO_CTL_HI_REG;
89 mask = 1 << (gpio - 32);
90 }
91
92 spin_lock_irqsave(&bcm63xx_gpio_lock, flags);
93 tmp = bcm_gpio_readl(reg);
94 if (dir == GPIO_DIR_IN)
95 tmp &= ~mask;
96 else
97 tmp |= mask;
98 bcm_gpio_writel(tmp, reg);
99 spin_unlock_irqrestore(&bcm63xx_gpio_lock, flags);
100
101 return 0;
102}
103
104static int bcm63xx_gpio_direction_input(struct gpio_chip *chip, unsigned gpio)
105{
106 return bcm63xx_gpio_set_direction(chip, gpio, GPIO_DIR_IN);
107}
108
109static int bcm63xx_gpio_direction_output(struct gpio_chip *chip,
110 unsigned gpio, int value)
111{
112 bcm63xx_gpio_set(chip, gpio, value);
113 return bcm63xx_gpio_set_direction(chip, gpio, GPIO_DIR_OUT);
114}
115
116
117static struct gpio_chip bcm63xx_gpio_chip = {
118 .label = "bcm63xx-gpio",
119 .direction_input = bcm63xx_gpio_direction_input,
120 .direction_output = bcm63xx_gpio_direction_output,
121 .get = bcm63xx_gpio_get,
122 .set = bcm63xx_gpio_set,
123 .base = 0,
124};
125
126int __init bcm63xx_gpio_init(void)
127{
128 bcm63xx_gpio_chip.ngpio = bcm63xx_gpio_count();
129 pr_info("registering %d GPIOs\n", bcm63xx_gpio_chip.ngpio);
130
131 return gpiochip_add(&bcm63xx_gpio_chip);
132}
133
134arch_initcall(bcm63xx_gpio_init);
diff --git a/arch/mips/bcm63xx/irq.c b/arch/mips/bcm63xx/irq.c
new file mode 100644
index 000000000000..a0c5cd18c192
--- /dev/null
+++ b/arch/mips/bcm63xx/irq.c
@@ -0,0 +1,253 @@
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) 2008 Maxime Bizon <mbizon@freebox.fr>
7 * Copyright (C) 2008 Nicolas Schichan <nschichan@freebox.fr>
8 */
9
10#include <linux/kernel.h>
11#include <linux/init.h>
12#include <linux/interrupt.h>
13#include <linux/module.h>
14#include <asm/irq_cpu.h>
15#include <asm/mipsregs.h>
16#include <bcm63xx_cpu.h>
17#include <bcm63xx_regs.h>
18#include <bcm63xx_io.h>
19#include <bcm63xx_irq.h>
20
21/*
22 * dispatch internal devices IRQ (uart, enet, watchdog, ...). do not
23 * prioritize any interrupt relatively to another. the static counter
24 * will resume the loop where it ended the last time we left this
25 * function.
26 */
27static void bcm63xx_irq_dispatch_internal(void)
28{
29 u32 pending;
30 static int i;
31
32 pending = bcm_perf_readl(PERF_IRQMASK_REG) &
33 bcm_perf_readl(PERF_IRQSTAT_REG);
34
35 if (!pending)
36 return ;
37
38 while (1) {
39 int to_call = i;
40
41 i = (i + 1) & 0x1f;
42 if (pending & (1 << to_call)) {
43 do_IRQ(to_call + IRQ_INTERNAL_BASE);
44 break;
45 }
46 }
47}
48
49asmlinkage void plat_irq_dispatch(void)
50{
51 u32 cause;
52
53 do {
54 cause = read_c0_cause() & read_c0_status() & ST0_IM;
55
56 if (!cause)
57 break;
58
59 if (cause & CAUSEF_IP7)
60 do_IRQ(7);
61 if (cause & CAUSEF_IP2)
62 bcm63xx_irq_dispatch_internal();
63 if (cause & CAUSEF_IP3)
64 do_IRQ(IRQ_EXT_0);
65 if (cause & CAUSEF_IP4)
66 do_IRQ(IRQ_EXT_1);
67 if (cause & CAUSEF_IP5)
68 do_IRQ(IRQ_EXT_2);
69 if (cause & CAUSEF_IP6)
70 do_IRQ(IRQ_EXT_3);
71 } while (1);
72}
73
74/*
75 * internal IRQs operations: only mask/unmask on PERF irq mask
76 * register.
77 */
78static inline void bcm63xx_internal_irq_mask(unsigned int irq)
79{
80 u32 mask;
81
82 irq -= IRQ_INTERNAL_BASE;
83 mask = bcm_perf_readl(PERF_IRQMASK_REG);
84 mask &= ~(1 << irq);
85 bcm_perf_writel(mask, PERF_IRQMASK_REG);
86}
87
88static void bcm63xx_internal_irq_unmask(unsigned int irq)
89{
90 u32 mask;
91
92 irq -= IRQ_INTERNAL_BASE;
93 mask = bcm_perf_readl(PERF_IRQMASK_REG);
94 mask |= (1 << irq);
95 bcm_perf_writel(mask, PERF_IRQMASK_REG);
96}
97
98static unsigned int bcm63xx_internal_irq_startup(unsigned int irq)
99{
100 bcm63xx_internal_irq_unmask(irq);
101 return 0;
102}
103
104/*
105 * external IRQs operations: mask/unmask and clear on PERF external
106 * irq control register.
107 */
108static void bcm63xx_external_irq_mask(unsigned int irq)
109{
110 u32 reg;
111
112 irq -= IRQ_EXT_BASE;
113 reg = bcm_perf_readl(PERF_EXTIRQ_CFG_REG);
114 reg &= ~EXTIRQ_CFG_MASK(irq);
115 bcm_perf_writel(reg, PERF_EXTIRQ_CFG_REG);
116}
117
118static void bcm63xx_external_irq_unmask(unsigned int irq)
119{
120 u32 reg;
121
122 irq -= IRQ_EXT_BASE;
123 reg = bcm_perf_readl(PERF_EXTIRQ_CFG_REG);
124 reg |= EXTIRQ_CFG_MASK(irq);
125 bcm_perf_writel(reg, PERF_EXTIRQ_CFG_REG);
126}
127
128static void bcm63xx_external_irq_clear(unsigned int irq)
129{
130 u32 reg;
131
132 irq -= IRQ_EXT_BASE;
133 reg = bcm_perf_readl(PERF_EXTIRQ_CFG_REG);
134 reg |= EXTIRQ_CFG_CLEAR(irq);
135 bcm_perf_writel(reg, PERF_EXTIRQ_CFG_REG);
136}
137
138static unsigned int bcm63xx_external_irq_startup(unsigned int irq)
139{
140 set_c0_status(0x100 << (irq - IRQ_MIPS_BASE));
141 irq_enable_hazard();
142 bcm63xx_external_irq_unmask(irq);
143 return 0;
144}
145
146static void bcm63xx_external_irq_shutdown(unsigned int irq)
147{
148 bcm63xx_external_irq_mask(irq);
149 clear_c0_status(0x100 << (irq - IRQ_MIPS_BASE));
150 irq_disable_hazard();
151}
152
153static int bcm63xx_external_irq_set_type(unsigned int irq,
154 unsigned int flow_type)
155{
156 u32 reg;
157 struct irq_desc *desc = irq_desc + irq;
158
159 irq -= IRQ_EXT_BASE;
160
161 flow_type &= IRQ_TYPE_SENSE_MASK;
162
163 if (flow_type == IRQ_TYPE_NONE)
164 flow_type = IRQ_TYPE_LEVEL_LOW;
165
166 reg = bcm_perf_readl(PERF_EXTIRQ_CFG_REG);
167 switch (flow_type) {
168 case IRQ_TYPE_EDGE_BOTH:
169 reg &= ~EXTIRQ_CFG_LEVELSENSE(irq);
170 reg |= EXTIRQ_CFG_BOTHEDGE(irq);
171 break;
172
173 case IRQ_TYPE_EDGE_RISING:
174 reg &= ~EXTIRQ_CFG_LEVELSENSE(irq);
175 reg |= EXTIRQ_CFG_SENSE(irq);
176 reg &= ~EXTIRQ_CFG_BOTHEDGE(irq);
177 break;
178
179 case IRQ_TYPE_EDGE_FALLING:
180 reg &= ~EXTIRQ_CFG_LEVELSENSE(irq);
181 reg &= ~EXTIRQ_CFG_SENSE(irq);
182 reg &= ~EXTIRQ_CFG_BOTHEDGE(irq);
183 break;
184
185 case IRQ_TYPE_LEVEL_HIGH:
186 reg |= EXTIRQ_CFG_LEVELSENSE(irq);
187 reg |= EXTIRQ_CFG_SENSE(irq);
188 break;
189
190 case IRQ_TYPE_LEVEL_LOW:
191 reg |= EXTIRQ_CFG_LEVELSENSE(irq);
192 reg &= ~EXTIRQ_CFG_SENSE(irq);
193 break;
194
195 default:
196 printk(KERN_ERR "bogus flow type combination given !\n");
197 return -EINVAL;
198 }
199 bcm_perf_writel(reg, PERF_EXTIRQ_CFG_REG);
200
201 if (flow_type & (IRQ_TYPE_LEVEL_LOW | IRQ_TYPE_LEVEL_HIGH)) {
202 desc->status |= IRQ_LEVEL;
203 desc->handle_irq = handle_level_irq;
204 } else {
205 desc->handle_irq = handle_edge_irq;
206 }
207
208 return 0;
209}
210
211static struct irq_chip bcm63xx_internal_irq_chip = {
212 .name = "bcm63xx_ipic",
213 .startup = bcm63xx_internal_irq_startup,
214 .shutdown = bcm63xx_internal_irq_mask,
215
216 .mask = bcm63xx_internal_irq_mask,
217 .mask_ack = bcm63xx_internal_irq_mask,
218 .unmask = bcm63xx_internal_irq_unmask,
219};
220
221static struct irq_chip bcm63xx_external_irq_chip = {
222 .name = "bcm63xx_epic",
223 .startup = bcm63xx_external_irq_startup,
224 .shutdown = bcm63xx_external_irq_shutdown,
225
226 .ack = bcm63xx_external_irq_clear,
227
228 .mask = bcm63xx_external_irq_mask,
229 .unmask = bcm63xx_external_irq_unmask,
230
231 .set_type = bcm63xx_external_irq_set_type,
232};
233
234static struct irqaction cpu_ip2_cascade_action = {
235 .handler = no_action,
236 .name = "cascade_ip2",
237};
238
239void __init arch_init_irq(void)
240{
241 int i;
242
243 mips_cpu_irq_init();
244 for (i = IRQ_INTERNAL_BASE; i < NR_IRQS; ++i)
245 set_irq_chip_and_handler(i, &bcm63xx_internal_irq_chip,
246 handle_level_irq);
247
248 for (i = IRQ_EXT_BASE; i < IRQ_EXT_BASE + 4; ++i)
249 set_irq_chip_and_handler(i, &bcm63xx_external_irq_chip,
250 handle_edge_irq);
251
252 setup_irq(IRQ_MIPS_BASE + 2, &cpu_ip2_cascade_action);
253}
diff --git a/arch/mips/bcm63xx/prom.c b/arch/mips/bcm63xx/prom.c
new file mode 100644
index 000000000000..fb284fbc5853
--- /dev/null
+++ b/arch/mips/bcm63xx/prom.c
@@ -0,0 +1,55 @@
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) 2008 Maxime Bizon <mbizon@freebox.fr>
7 */
8
9#include <linux/init.h>
10#include <linux/bootmem.h>
11#include <asm/bootinfo.h>
12#include <bcm63xx_board.h>
13#include <bcm63xx_cpu.h>
14#include <bcm63xx_io.h>
15#include <bcm63xx_regs.h>
16#include <bcm63xx_gpio.h>
17
18void __init prom_init(void)
19{
20 u32 reg, mask;
21
22 bcm63xx_cpu_init();
23
24 /* stop any running watchdog */
25 bcm_wdt_writel(WDT_STOP_1, WDT_CTL_REG);
26 bcm_wdt_writel(WDT_STOP_2, WDT_CTL_REG);
27
28 /* disable all hardware blocks clock for now */
29 if (BCMCPU_IS_6338())
30 mask = CKCTL_6338_ALL_SAFE_EN;
31 else if (BCMCPU_IS_6345())
32 mask = CKCTL_6345_ALL_SAFE_EN;
33 else if (BCMCPU_IS_6348())
34 mask = CKCTL_6348_ALL_SAFE_EN;
35 else
36 /* BCMCPU_IS_6358() */
37 mask = CKCTL_6358_ALL_SAFE_EN;
38
39 reg = bcm_perf_readl(PERF_CKCTL_REG);
40 reg &= ~mask;
41 bcm_perf_writel(reg, PERF_CKCTL_REG);
42
43 /* assign command line from kernel config */
44 strcpy(arcs_cmdline, CONFIG_CMDLINE);
45
46 /* register gpiochip */
47 bcm63xx_gpio_init();
48
49 /* do low level board init */
50 board_prom_init();
51}
52
53void __init prom_free_prom_memory(void)
54{
55}
diff --git a/arch/mips/bcm63xx/setup.c b/arch/mips/bcm63xx/setup.c
new file mode 100644
index 000000000000..b18a0ca926fa
--- /dev/null
+++ b/arch/mips/bcm63xx/setup.c
@@ -0,0 +1,125 @@
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) 2008 Maxime Bizon <mbizon@freebox.fr>
7 */
8
9#include <linux/init.h>
10#include <linux/kernel.h>
11#include <linux/delay.h>
12#include <linux/bootmem.h>
13#include <linux/ioport.h>
14#include <linux/pm.h>
15#include <asm/bootinfo.h>
16#include <asm/time.h>
17#include <asm/reboot.h>
18#include <asm/cacheflush.h>
19#include <bcm63xx_board.h>
20#include <bcm63xx_cpu.h>
21#include <bcm63xx_regs.h>
22#include <bcm63xx_io.h>
23
24void bcm63xx_machine_halt(void)
25{
26 printk(KERN_INFO "System halted\n");
27 while (1)
28 ;
29}
30
31static void bcm6348_a1_reboot(void)
32{
33 u32 reg;
34
35 /* soft reset all blocks */
36 printk(KERN_INFO "soft-reseting all blocks ...\n");
37 reg = bcm_perf_readl(PERF_SOFTRESET_REG);
38 reg &= ~SOFTRESET_6348_ALL;
39 bcm_perf_writel(reg, PERF_SOFTRESET_REG);
40 mdelay(10);
41
42 reg = bcm_perf_readl(PERF_SOFTRESET_REG);
43 reg |= SOFTRESET_6348_ALL;
44 bcm_perf_writel(reg, PERF_SOFTRESET_REG);
45 mdelay(10);
46
47 /* Jump to the power on address. */
48 printk(KERN_INFO "jumping to reset vector.\n");
49 /* set high vectors (base at 0xbfc00000 */
50 set_c0_status(ST0_BEV | ST0_ERL);
51 /* run uncached in kseg0 */
52 change_c0_config(CONF_CM_CMASK, CONF_CM_UNCACHED);
53 __flush_cache_all();
54 /* remove all wired TLB entries */
55 write_c0_wired(0);
56 __asm__ __volatile__(
57 "jr\t%0"
58 :
59 : "r" (0xbfc00000));
60 while (1)
61 ;
62}
63
64void bcm63xx_machine_reboot(void)
65{
66 u32 reg;
67
68 /* mask and clear all external irq */
69 reg = bcm_perf_readl(PERF_EXTIRQ_CFG_REG);
70 reg &= ~EXTIRQ_CFG_MASK_ALL;
71 reg |= EXTIRQ_CFG_CLEAR_ALL;
72 bcm_perf_writel(reg, PERF_EXTIRQ_CFG_REG);
73
74 if (BCMCPU_IS_6348() && (bcm63xx_get_cpu_rev() == 0xa1))
75 bcm6348_a1_reboot();
76
77 printk(KERN_INFO "triggering watchdog soft-reset...\n");
78 bcm_perf_writel(SYS_PLL_SOFT_RESET, PERF_SYS_PLL_CTL_REG);
79 while (1)
80 ;
81}
82
83static void __bcm63xx_machine_reboot(char *p)
84{
85 bcm63xx_machine_reboot();
86}
87
88/*
89 * return system type in /proc/cpuinfo
90 */
91const char *get_system_type(void)
92{
93 static char buf[128];
94 snprintf(buf, sizeof(buf), "bcm63xx/%s (0x%04x/0x%04X)",
95 board_get_name(),
96 bcm63xx_get_cpu_id(), bcm63xx_get_cpu_rev());
97 return buf;
98}
99
100void __init plat_time_init(void)
101{
102 mips_hpt_frequency = bcm63xx_get_cpu_freq() / 2;
103}
104
105void __init plat_mem_setup(void)
106{
107 add_memory_region(0, bcm63xx_get_memory_size(), BOOT_MEM_RAM);
108
109 _machine_halt = bcm63xx_machine_halt;
110 _machine_restart = __bcm63xx_machine_reboot;
111 pm_power_off = bcm63xx_machine_halt;
112
113 set_io_port_base(0);
114 ioport_resource.start = 0;
115 ioport_resource.end = ~0;
116
117 board_setup();
118}
119
120int __init bcm63xx_register_devices(void)
121{
122 return board_register_devices();
123}
124
125arch_initcall(bcm63xx_register_devices);
diff --git a/arch/mips/bcm63xx/timer.c b/arch/mips/bcm63xx/timer.c
new file mode 100644
index 000000000000..ba522bdcde4b
--- /dev/null
+++ b/arch/mips/bcm63xx/timer.c
@@ -0,0 +1,205 @@
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) 2008 Maxime Bizon <mbizon@freebox.fr>
7 */
8
9#include <linux/kernel.h>
10#include <linux/err.h>
11#include <linux/module.h>
12#include <linux/spinlock.h>
13#include <linux/interrupt.h>
14#include <linux/clk.h>
15#include <bcm63xx_cpu.h>
16#include <bcm63xx_io.h>
17#include <bcm63xx_timer.h>
18#include <bcm63xx_regs.h>
19
20static DEFINE_SPINLOCK(timer_reg_lock);
21static DEFINE_SPINLOCK(timer_data_lock);
22static struct clk *periph_clk;
23
24static struct timer_data {
25 void (*cb)(void *);
26 void *data;
27} timer_data[BCM63XX_TIMER_COUNT];
28
29static irqreturn_t timer_interrupt(int irq, void *dev_id)
30{
31 u32 stat;
32 int i;
33
34 spin_lock(&timer_reg_lock);
35 stat = bcm_timer_readl(TIMER_IRQSTAT_REG);
36 bcm_timer_writel(stat, TIMER_IRQSTAT_REG);
37 spin_unlock(&timer_reg_lock);
38
39 for (i = 0; i < BCM63XX_TIMER_COUNT; i++) {
40 if (!(stat & TIMER_IRQSTAT_TIMER_CAUSE(i)))
41 continue;
42
43 spin_lock(&timer_data_lock);
44 if (!timer_data[i].cb) {
45 spin_unlock(&timer_data_lock);
46 continue;
47 }
48
49 timer_data[i].cb(timer_data[i].data);
50 spin_unlock(&timer_data_lock);
51 }
52
53 return IRQ_HANDLED;
54}
55
56int bcm63xx_timer_enable(int id)
57{
58 u32 reg;
59 unsigned long flags;
60
61 if (id >= BCM63XX_TIMER_COUNT)
62 return -EINVAL;
63
64 spin_lock_irqsave(&timer_reg_lock, flags);
65
66 reg = bcm_timer_readl(TIMER_CTLx_REG(id));
67 reg |= TIMER_CTL_ENABLE_MASK;
68 bcm_timer_writel(reg, TIMER_CTLx_REG(id));
69
70 reg = bcm_timer_readl(TIMER_IRQSTAT_REG);
71 reg |= TIMER_IRQSTAT_TIMER_IR_EN(id);
72 bcm_timer_writel(reg, TIMER_IRQSTAT_REG);
73
74 spin_unlock_irqrestore(&timer_reg_lock, flags);
75 return 0;
76}
77
78EXPORT_SYMBOL(bcm63xx_timer_enable);
79
80int bcm63xx_timer_disable(int id)
81{
82 u32 reg;
83 unsigned long flags;
84
85 if (id >= BCM63XX_TIMER_COUNT)
86 return -EINVAL;
87
88 spin_lock_irqsave(&timer_reg_lock, flags);
89
90 reg = bcm_timer_readl(TIMER_CTLx_REG(id));
91 reg &= ~TIMER_CTL_ENABLE_MASK;
92 bcm_timer_writel(reg, TIMER_CTLx_REG(id));
93
94 reg = bcm_timer_readl(TIMER_IRQSTAT_REG);
95 reg &= ~TIMER_IRQSTAT_TIMER_IR_EN(id);
96 bcm_timer_writel(reg, TIMER_IRQSTAT_REG);
97
98 spin_unlock_irqrestore(&timer_reg_lock, flags);
99 return 0;
100}
101
102EXPORT_SYMBOL(bcm63xx_timer_disable);
103
104int bcm63xx_timer_register(int id, void (*callback)(void *data), void *data)
105{
106 unsigned long flags;
107 int ret;
108
109 if (id >= BCM63XX_TIMER_COUNT || !callback)
110 return -EINVAL;
111
112 ret = 0;
113 spin_lock_irqsave(&timer_data_lock, flags);
114 if (timer_data[id].cb) {
115 ret = -EBUSY;
116 goto out;
117 }
118
119 timer_data[id].cb = callback;
120 timer_data[id].data = data;
121
122out:
123 spin_unlock_irqrestore(&timer_data_lock, flags);
124 return ret;
125}
126
127EXPORT_SYMBOL(bcm63xx_timer_register);
128
129void bcm63xx_timer_unregister(int id)
130{
131 unsigned long flags;
132
133 if (id >= BCM63XX_TIMER_COUNT)
134 return;
135
136 spin_lock_irqsave(&timer_data_lock, flags);
137 timer_data[id].cb = NULL;
138 spin_unlock_irqrestore(&timer_data_lock, flags);
139}
140
141EXPORT_SYMBOL(bcm63xx_timer_unregister);
142
143unsigned int bcm63xx_timer_countdown(unsigned int countdown_us)
144{
145 return (clk_get_rate(periph_clk) / (1000 * 1000)) * countdown_us;
146}
147
148EXPORT_SYMBOL(bcm63xx_timer_countdown);
149
150int bcm63xx_timer_set(int id, int monotonic, unsigned int countdown_us)
151{
152 u32 reg, countdown;
153 unsigned long flags;
154
155 if (id >= BCM63XX_TIMER_COUNT)
156 return -EINVAL;
157
158 countdown = bcm63xx_timer_countdown(countdown_us);
159 if (countdown & ~TIMER_CTL_COUNTDOWN_MASK)
160 return -EINVAL;
161
162 spin_lock_irqsave(&timer_reg_lock, flags);
163 reg = bcm_timer_readl(TIMER_CTLx_REG(id));
164
165 if (monotonic)
166 reg &= ~TIMER_CTL_MONOTONIC_MASK;
167 else
168 reg |= TIMER_CTL_MONOTONIC_MASK;
169
170 reg &= ~TIMER_CTL_COUNTDOWN_MASK;
171 reg |= countdown;
172 bcm_timer_writel(reg, TIMER_CTLx_REG(id));
173
174 spin_unlock_irqrestore(&timer_reg_lock, flags);
175 return 0;
176}
177
178EXPORT_SYMBOL(bcm63xx_timer_set);
179
180int bcm63xx_timer_init(void)
181{
182 int ret, irq;
183 u32 reg;
184
185 reg = bcm_timer_readl(TIMER_IRQSTAT_REG);
186 reg &= ~TIMER_IRQSTAT_TIMER0_IR_EN;
187 reg &= ~TIMER_IRQSTAT_TIMER1_IR_EN;
188 reg &= ~TIMER_IRQSTAT_TIMER2_IR_EN;
189 bcm_timer_writel(reg, TIMER_IRQSTAT_REG);
190
191 periph_clk = clk_get(NULL, "periph");
192 if (IS_ERR(periph_clk))
193 return -ENODEV;
194
195 irq = bcm63xx_get_irq_number(IRQ_TIMER);
196 ret = request_irq(irq, timer_interrupt, 0, "bcm63xx_timer", NULL);
197 if (ret) {
198 printk(KERN_ERR "bcm63xx_timer: failed to register irq\n");
199 return ret;
200 }
201
202 return 0;
203}
204
205arch_initcall(bcm63xx_timer_init);
diff --git a/arch/mips/boot/elf2ecoff.c b/arch/mips/boot/elf2ecoff.c
index c5a7f308c405..e19d906236af 100644
--- a/arch/mips/boot/elf2ecoff.c
+++ b/arch/mips/boot/elf2ecoff.c
@@ -59,8 +59,8 @@ struct sect {
59}; 59};
60 60
61int *symTypeTable; 61int *symTypeTable;
62int must_convert_endian = 0; 62int must_convert_endian;
63int format_bigendian = 0; 63int format_bigendian;
64 64
65static void copy(int out, int in, off_t offset, off_t size) 65static void copy(int out, int in, off_t offset, off_t size)
66{ 66{
diff --git a/arch/mips/cavium-octeon/Makefile b/arch/mips/cavium-octeon/Makefile
index d6903c3f3d51..139436280520 100644
--- a/arch/mips/cavium-octeon/Makefile
+++ b/arch/mips/cavium-octeon/Makefile
@@ -6,10 +6,10 @@
6# License. See the file "COPYING" in the main directory of this archive 6# License. See the file "COPYING" in the main directory of this archive
7# for more details. 7# for more details.
8# 8#
9# Copyright (C) 2005-2008 Cavium Networks 9# Copyright (C) 2005-2009 Cavium Networks
10# 10#
11 11
12obj-y := setup.o serial.o octeon-irq.o csrc-octeon.o 12obj-y := setup.o serial.o octeon-platform.o octeon-irq.o csrc-octeon.o
13obj-y += dma-octeon.o flash_setup.o 13obj-y += dma-octeon.o flash_setup.o
14obj-y += octeon-memcpy.o 14obj-y += octeon-memcpy.o
15 15
diff --git a/arch/mips/cavium-octeon/octeon-platform.c b/arch/mips/cavium-octeon/octeon-platform.c
new file mode 100644
index 000000000000..be711dd2d918
--- /dev/null
+++ b/arch/mips/cavium-octeon/octeon-platform.c
@@ -0,0 +1,164 @@
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) 2004-2009 Cavium Networks
7 * Copyright (C) 2008 Wind River Systems
8 */
9
10#include <linux/init.h>
11#include <linux/irq.h>
12#include <linux/module.h>
13#include <linux/platform_device.h>
14
15#include <asm/octeon/octeon.h>
16#include <asm/octeon/cvmx-rnm-defs.h>
17
18static struct octeon_cf_data octeon_cf_data;
19
20static int __init octeon_cf_device_init(void)
21{
22 union cvmx_mio_boot_reg_cfgx mio_boot_reg_cfg;
23 unsigned long base_ptr, region_base, region_size;
24 struct platform_device *pd;
25 struct resource cf_resources[3];
26 unsigned int num_resources;
27 int i;
28 int ret = 0;
29
30 /* Setup octeon-cf platform device if present. */
31 base_ptr = 0;
32 if (octeon_bootinfo->major_version == 1
33 && octeon_bootinfo->minor_version >= 1) {
34 if (octeon_bootinfo->compact_flash_common_base_addr)
35 base_ptr =
36 octeon_bootinfo->compact_flash_common_base_addr;
37 } else {
38 base_ptr = 0x1d000800;
39 }
40
41 if (!base_ptr)
42 return ret;
43
44 /* Find CS0 region. */
45 for (i = 0; i < 8; i++) {
46 mio_boot_reg_cfg.u64 = cvmx_read_csr(CVMX_MIO_BOOT_REG_CFGX(i));
47 region_base = mio_boot_reg_cfg.s.base << 16;
48 region_size = (mio_boot_reg_cfg.s.size + 1) << 16;
49 if (mio_boot_reg_cfg.s.en && base_ptr >= region_base
50 && base_ptr < region_base + region_size)
51 break;
52 }
53 if (i >= 7) {
54 /* i and i + 1 are CS0 and CS1, both must be less than 8. */
55 goto out;
56 }
57 octeon_cf_data.base_region = i;
58 octeon_cf_data.is16bit = mio_boot_reg_cfg.s.width;
59 octeon_cf_data.base_region_bias = base_ptr - region_base;
60 memset(cf_resources, 0, sizeof(cf_resources));
61 num_resources = 0;
62 cf_resources[num_resources].flags = IORESOURCE_MEM;
63 cf_resources[num_resources].start = region_base;
64 cf_resources[num_resources].end = region_base + region_size - 1;
65 num_resources++;
66
67
68 if (!(base_ptr & 0xfffful)) {
69 /*
70 * Boot loader signals availability of DMA (true_ide
71 * mode) by setting low order bits of base_ptr to
72 * zero.
73 */
74
75 /* Asume that CS1 immediately follows. */
76 mio_boot_reg_cfg.u64 =
77 cvmx_read_csr(CVMX_MIO_BOOT_REG_CFGX(i + 1));
78 region_base = mio_boot_reg_cfg.s.base << 16;
79 region_size = (mio_boot_reg_cfg.s.size + 1) << 16;
80 if (!mio_boot_reg_cfg.s.en)
81 goto out;
82
83 cf_resources[num_resources].flags = IORESOURCE_MEM;
84 cf_resources[num_resources].start = region_base;
85 cf_resources[num_resources].end = region_base + region_size - 1;
86 num_resources++;
87
88 octeon_cf_data.dma_engine = 0;
89 cf_resources[num_resources].flags = IORESOURCE_IRQ;
90 cf_resources[num_resources].start = OCTEON_IRQ_BOOTDMA;
91 cf_resources[num_resources].end = OCTEON_IRQ_BOOTDMA;
92 num_resources++;
93 } else {
94 octeon_cf_data.dma_engine = -1;
95 }
96
97 pd = platform_device_alloc("pata_octeon_cf", -1);
98 if (!pd) {
99 ret = -ENOMEM;
100 goto out;
101 }
102 pd->dev.platform_data = &octeon_cf_data;
103
104 ret = platform_device_add_resources(pd, cf_resources, num_resources);
105 if (ret)
106 goto fail;
107
108 ret = platform_device_add(pd);
109 if (ret)
110 goto fail;
111
112 return ret;
113fail:
114 platform_device_put(pd);
115out:
116 return ret;
117}
118device_initcall(octeon_cf_device_init);
119
120/* Octeon Random Number Generator. */
121static int __init octeon_rng_device_init(void)
122{
123 struct platform_device *pd;
124 int ret = 0;
125
126 struct resource rng_resources[] = {
127 {
128 .flags = IORESOURCE_MEM,
129 .start = XKPHYS_TO_PHYS(CVMX_RNM_CTL_STATUS),
130 .end = XKPHYS_TO_PHYS(CVMX_RNM_CTL_STATUS) + 0xf
131 }, {
132 .flags = IORESOURCE_MEM,
133 .start = cvmx_build_io_address(8, 0),
134 .end = cvmx_build_io_address(8, 0) + 0x7
135 }
136 };
137
138 pd = platform_device_alloc("octeon_rng", -1);
139 if (!pd) {
140 ret = -ENOMEM;
141 goto out;
142 }
143
144 ret = platform_device_add_resources(pd, rng_resources,
145 ARRAY_SIZE(rng_resources));
146 if (ret)
147 goto fail;
148
149 ret = platform_device_add(pd);
150 if (ret)
151 goto fail;
152
153 return ret;
154fail:
155 platform_device_put(pd);
156
157out:
158 return ret;
159}
160device_initcall(octeon_rng_device_init);
161
162MODULE_AUTHOR("David Daney <ddaney@caviumnetworks.com>");
163MODULE_LICENSE("GPL");
164MODULE_DESCRIPTION("Platform driver for Octeon SOC");
diff --git a/arch/mips/cavium-octeon/setup.c b/arch/mips/cavium-octeon/setup.c
index da559249cc2f..b321d3b16877 100644
--- a/arch/mips/cavium-octeon/setup.c
+++ b/arch/mips/cavium-octeon/setup.c
@@ -11,7 +11,6 @@
11#include <linux/delay.h> 11#include <linux/delay.h>
12#include <linux/interrupt.h> 12#include <linux/interrupt.h>
13#include <linux/io.h> 13#include <linux/io.h>
14#include <linux/irq.h>
15#include <linux/serial.h> 14#include <linux/serial.h>
16#include <linux/smp.h> 15#include <linux/smp.h>
17#include <linux/types.h> 16#include <linux/types.h>
@@ -824,105 +823,3 @@ void prom_free_prom_memory(void)
824 CONFIG_CAVIUM_RESERVE32_USE_WIRED_TLB option is set */ 823 CONFIG_CAVIUM_RESERVE32_USE_WIRED_TLB option is set */
825 octeon_hal_setup_reserved32(); 824 octeon_hal_setup_reserved32();
826} 825}
827
828static struct octeon_cf_data octeon_cf_data;
829
830static int __init octeon_cf_device_init(void)
831{
832 union cvmx_mio_boot_reg_cfgx mio_boot_reg_cfg;
833 unsigned long base_ptr, region_base, region_size;
834 struct platform_device *pd;
835 struct resource cf_resources[3];
836 unsigned int num_resources;
837 int i;
838 int ret = 0;
839
840 /* Setup octeon-cf platform device if present. */
841 base_ptr = 0;
842 if (octeon_bootinfo->major_version == 1
843 && octeon_bootinfo->minor_version >= 1) {
844 if (octeon_bootinfo->compact_flash_common_base_addr)
845 base_ptr =
846 octeon_bootinfo->compact_flash_common_base_addr;
847 } else {
848 base_ptr = 0x1d000800;
849 }
850
851 if (!base_ptr)
852 return ret;
853
854 /* Find CS0 region. */
855 for (i = 0; i < 8; i++) {
856 mio_boot_reg_cfg.u64 = cvmx_read_csr(CVMX_MIO_BOOT_REG_CFGX(i));
857 region_base = mio_boot_reg_cfg.s.base << 16;
858 region_size = (mio_boot_reg_cfg.s.size + 1) << 16;
859 if (mio_boot_reg_cfg.s.en && base_ptr >= region_base
860 && base_ptr < region_base + region_size)
861 break;
862 }
863 if (i >= 7) {
864 /* i and i + 1 are CS0 and CS1, both must be less than 8. */
865 goto out;
866 }
867 octeon_cf_data.base_region = i;
868 octeon_cf_data.is16bit = mio_boot_reg_cfg.s.width;
869 octeon_cf_data.base_region_bias = base_ptr - region_base;
870 memset(cf_resources, 0, sizeof(cf_resources));
871 num_resources = 0;
872 cf_resources[num_resources].flags = IORESOURCE_MEM;
873 cf_resources[num_resources].start = region_base;
874 cf_resources[num_resources].end = region_base + region_size - 1;
875 num_resources++;
876
877
878 if (!(base_ptr & 0xfffful)) {
879 /*
880 * Boot loader signals availability of DMA (true_ide
881 * mode) by setting low order bits of base_ptr to
882 * zero.
883 */
884
885 /* Asume that CS1 immediately follows. */
886 mio_boot_reg_cfg.u64 =
887 cvmx_read_csr(CVMX_MIO_BOOT_REG_CFGX(i + 1));
888 region_base = mio_boot_reg_cfg.s.base << 16;
889 region_size = (mio_boot_reg_cfg.s.size + 1) << 16;
890 if (!mio_boot_reg_cfg.s.en)
891 goto out;
892
893 cf_resources[num_resources].flags = IORESOURCE_MEM;
894 cf_resources[num_resources].start = region_base;
895 cf_resources[num_resources].end = region_base + region_size - 1;
896 num_resources++;
897
898 octeon_cf_data.dma_engine = 0;
899 cf_resources[num_resources].flags = IORESOURCE_IRQ;
900 cf_resources[num_resources].start = OCTEON_IRQ_BOOTDMA;
901 cf_resources[num_resources].end = OCTEON_IRQ_BOOTDMA;
902 num_resources++;
903 } else {
904 octeon_cf_data.dma_engine = -1;
905 }
906
907 pd = platform_device_alloc("pata_octeon_cf", -1);
908 if (!pd) {
909 ret = -ENOMEM;
910 goto out;
911 }
912 pd->dev.platform_data = &octeon_cf_data;
913
914 ret = platform_device_add_resources(pd, cf_resources, num_resources);
915 if (ret)
916 goto fail;
917
918 ret = platform_device_add(pd);
919 if (ret)
920 goto fail;
921
922 return ret;
923fail:
924 platform_device_put(pd);
925out:
926 return ret;
927}
928device_initcall(octeon_cf_device_init);
diff --git a/arch/mips/configs/ar7_defconfig b/arch/mips/configs/ar7_defconfig
index dad5b6769d74..35648302f7cc 100644
--- a/arch/mips/configs/ar7_defconfig
+++ b/arch/mips/configs/ar7_defconfig
@@ -125,7 +125,6 @@ CONFIG_CPU_HAS_PREFETCH=y
125CONFIG_MIPS_MT_DISABLED=y 125CONFIG_MIPS_MT_DISABLED=y
126# CONFIG_MIPS_MT_SMP is not set 126# CONFIG_MIPS_MT_SMP is not set
127# CONFIG_MIPS_MT_SMTC is not set 127# CONFIG_MIPS_MT_SMTC is not set
128CONFIG_CPU_HAS_LLSC=y
129CONFIG_CPU_HAS_SYNC=y 128CONFIG_CPU_HAS_SYNC=y
130CONFIG_GENERIC_HARDIRQS=y 129CONFIG_GENERIC_HARDIRQS=y
131CONFIG_GENERIC_IRQ_PROBE=y 130CONFIG_GENERIC_IRQ_PROBE=y
diff --git a/arch/mips/configs/bcm47xx_defconfig b/arch/mips/configs/bcm47xx_defconfig
index d8694332b344..94b7d57f906d 100644
--- a/arch/mips/configs/bcm47xx_defconfig
+++ b/arch/mips/configs/bcm47xx_defconfig
@@ -111,7 +111,6 @@ CONFIG_CPU_HAS_PREFETCH=y
111CONFIG_MIPS_MT_DISABLED=y 111CONFIG_MIPS_MT_DISABLED=y
112# CONFIG_MIPS_MT_SMP is not set 112# CONFIG_MIPS_MT_SMP is not set
113# CONFIG_MIPS_MT_SMTC is not set 113# CONFIG_MIPS_MT_SMTC is not set
114CONFIG_CPU_HAS_LLSC=y
115CONFIG_CPU_HAS_SYNC=y 114CONFIG_CPU_HAS_SYNC=y
116CONFIG_GENERIC_HARDIRQS=y 115CONFIG_GENERIC_HARDIRQS=y
117CONFIG_GENERIC_IRQ_PROBE=y 116CONFIG_GENERIC_IRQ_PROBE=y
diff --git a/arch/mips/configs/bcm63xx_defconfig b/arch/mips/configs/bcm63xx_defconfig
new file mode 100644
index 000000000000..ea00c18d1f7b
--- /dev/null
+++ b/arch/mips/configs/bcm63xx_defconfig
@@ -0,0 +1,972 @@
1#
2# Automatically generated make config: don't edit
3# Linux kernel version: 2.6.30-rc6
4# Sun May 31 20:17:18 2009
5#
6CONFIG_MIPS=y
7
8#
9# Machine selection
10#
11# CONFIG_MACH_ALCHEMY is not set
12# CONFIG_BASLER_EXCITE is not set
13# CONFIG_BCM47XX is not set
14CONFIG_BCM63XX=y
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
50#
51# CPU support
52#
53CONFIG_BCM63XX_CPU_6348=y
54CONFIG_BCM63XX_CPU_6358=y
55CONFIG_BOARD_BCM963XX=y
56CONFIG_RWSEM_GENERIC_SPINLOCK=y
57# CONFIG_ARCH_HAS_ILOG2_U32 is not set
58# CONFIG_ARCH_HAS_ILOG2_U64 is not set
59CONFIG_ARCH_SUPPORTS_OPROFILE=y
60CONFIG_GENERIC_FIND_NEXT_BIT=y
61CONFIG_GENERIC_HWEIGHT=y
62CONFIG_GENERIC_CALIBRATE_DELAY=y
63CONFIG_GENERIC_CLOCKEVENTS=y
64CONFIG_GENERIC_TIME=y
65CONFIG_GENERIC_CMOS_UPDATE=y
66CONFIG_SCHED_OMIT_FRAME_POINTER=y
67CONFIG_GENERIC_HARDIRQS_NO__DO_IRQ=y
68CONFIG_CEVT_R4K_LIB=y
69CONFIG_CEVT_R4K=y
70CONFIG_CSRC_R4K_LIB=y
71CONFIG_CSRC_R4K=y
72CONFIG_DMA_NONCOHERENT=y
73CONFIG_DMA_NEED_PCI_MAP_STATE=y
74CONFIG_EARLY_PRINTK=y
75CONFIG_SYS_HAS_EARLY_PRINTK=y
76# CONFIG_HOTPLUG_CPU is not set
77# CONFIG_NO_IOPORT is not set
78CONFIG_GENERIC_GPIO=y
79CONFIG_CPU_BIG_ENDIAN=y
80# CONFIG_CPU_LITTLE_ENDIAN is not set
81CONFIG_SYS_SUPPORTS_BIG_ENDIAN=y
82CONFIG_IRQ_CPU=y
83CONFIG_SWAP_IO_SPACE=y
84CONFIG_MIPS_L1_CACHE_SHIFT=5
85
86#
87# CPU selection
88#
89# CONFIG_CPU_LOONGSON2 is not set
90CONFIG_CPU_MIPS32_R1=y
91# CONFIG_CPU_MIPS32_R2 is not set
92# CONFIG_CPU_MIPS64_R1 is not set
93# CONFIG_CPU_MIPS64_R2 is not set
94# CONFIG_CPU_R3000 is not set
95# CONFIG_CPU_TX39XX is not set
96# CONFIG_CPU_VR41XX is not set
97# CONFIG_CPU_R4300 is not set
98# CONFIG_CPU_R4X00 is not set
99# CONFIG_CPU_TX49XX is not set
100# CONFIG_CPU_R5000 is not set
101# CONFIG_CPU_R5432 is not set
102# CONFIG_CPU_R5500 is not set
103# CONFIG_CPU_R6000 is not set
104# CONFIG_CPU_NEVADA is not set
105# CONFIG_CPU_R8000 is not set
106# CONFIG_CPU_R10000 is not set
107# CONFIG_CPU_RM7000 is not set
108# CONFIG_CPU_RM9000 is not set
109# CONFIG_CPU_SB1 is not set
110# CONFIG_CPU_CAVIUM_OCTEON is not set
111CONFIG_SYS_HAS_CPU_MIPS32_R1=y
112CONFIG_CPU_MIPS32=y
113CONFIG_CPU_MIPSR1=y
114CONFIG_SYS_SUPPORTS_32BIT_KERNEL=y
115CONFIG_CPU_SUPPORTS_32BIT_KERNEL=y
116CONFIG_HARDWARE_WATCHPOINTS=y
117
118#
119# Kernel type
120#
121CONFIG_32BIT=y
122# CONFIG_64BIT is not set
123CONFIG_PAGE_SIZE_4KB=y
124# CONFIG_PAGE_SIZE_8KB is not set
125# CONFIG_PAGE_SIZE_16KB is not set
126# CONFIG_PAGE_SIZE_32KB is not set
127# CONFIG_PAGE_SIZE_64KB is not set
128CONFIG_CPU_HAS_PREFETCH=y
129CONFIG_MIPS_MT_DISABLED=y
130# CONFIG_MIPS_MT_SMP is not set
131# CONFIG_MIPS_MT_SMTC is not set
132CONFIG_CPU_HAS_LLSC=y
133CONFIG_CPU_HAS_SYNC=y
134CONFIG_GENERIC_HARDIRQS=y
135CONFIG_GENERIC_IRQ_PROBE=y
136CONFIG_CPU_SUPPORTS_HIGHMEM=y
137CONFIG_ARCH_FLATMEM_ENABLE=y
138CONFIG_ARCH_POPULATES_NODE_MAP=y
139CONFIG_SELECT_MEMORY_MODEL=y
140CONFIG_FLATMEM_MANUAL=y
141# CONFIG_DISCONTIGMEM_MANUAL is not set
142# CONFIG_SPARSEMEM_MANUAL is not set
143CONFIG_FLATMEM=y
144CONFIG_FLAT_NODE_MEM_MAP=y
145CONFIG_PAGEFLAGS_EXTENDED=y
146CONFIG_SPLIT_PTLOCK_CPUS=4
147# CONFIG_PHYS_ADDR_T_64BIT is not set
148CONFIG_ZONE_DMA_FLAG=0
149CONFIG_VIRT_TO_BUS=y
150CONFIG_UNEVICTABLE_LRU=y
151CONFIG_HAVE_MLOCK=y
152CONFIG_HAVE_MLOCKED_PAGE_BIT=y
153CONFIG_TICK_ONESHOT=y
154CONFIG_NO_HZ=y
155# CONFIG_HIGH_RES_TIMERS is not set
156CONFIG_GENERIC_CLOCKEVENTS_BUILD=y
157# CONFIG_HZ_48 is not set
158# CONFIG_HZ_100 is not set
159# CONFIG_HZ_128 is not set
160CONFIG_HZ_250=y
161# CONFIG_HZ_256 is not set
162# CONFIG_HZ_1000 is not set
163# CONFIG_HZ_1024 is not set
164CONFIG_SYS_SUPPORTS_ARBIT_HZ=y
165CONFIG_HZ=250
166CONFIG_PREEMPT_NONE=y
167# CONFIG_PREEMPT_VOLUNTARY is not set
168# CONFIG_PREEMPT is not set
169# CONFIG_KEXEC is not set
170# CONFIG_SECCOMP is not set
171CONFIG_LOCKDEP_SUPPORT=y
172CONFIG_STACKTRACE_SUPPORT=y
173CONFIG_DEFCONFIG_LIST="/lib/modules/$UNAME_RELEASE/.config"
174
175#
176# General setup
177#
178CONFIG_EXPERIMENTAL=y
179CONFIG_BROKEN_ON_SMP=y
180CONFIG_INIT_ENV_ARG_LIMIT=32
181CONFIG_LOCALVERSION=""
182# CONFIG_LOCALVERSION_AUTO is not set
183# CONFIG_SWAP is not set
184# CONFIG_SYSVIPC is not set
185# CONFIG_POSIX_MQUEUE is not set
186# CONFIG_BSD_PROCESS_ACCT is not set
187# CONFIG_TASKSTATS is not set
188# CONFIG_AUDIT is not set
189
190#
191# RCU Subsystem
192#
193CONFIG_CLASSIC_RCU=y
194# CONFIG_TREE_RCU is not set
195# CONFIG_PREEMPT_RCU is not set
196# CONFIG_TREE_RCU_TRACE is not set
197# CONFIG_PREEMPT_RCU_TRACE is not set
198# CONFIG_IKCONFIG is not set
199CONFIG_LOG_BUF_SHIFT=17
200# CONFIG_GROUP_SCHED is not set
201# CONFIG_CGROUPS is not set
202CONFIG_SYSFS_DEPRECATED=y
203CONFIG_SYSFS_DEPRECATED_V2=y
204# CONFIG_RELAY is not set
205# CONFIG_NAMESPACES is not set
206# CONFIG_BLK_DEV_INITRD is not set
207CONFIG_CC_OPTIMIZE_FOR_SIZE=y
208CONFIG_SYSCTL=y
209CONFIG_EMBEDDED=y
210CONFIG_SYSCTL_SYSCALL=y
211CONFIG_KALLSYMS=y
212# CONFIG_KALLSYMS_EXTRA_PASS is not set
213# CONFIG_STRIP_ASM_SYMS is not set
214CONFIG_HOTPLUG=y
215CONFIG_PRINTK=y
216CONFIG_BUG=y
217CONFIG_ELF_CORE=y
218# CONFIG_PCSPKR_PLATFORM is not set
219CONFIG_BASE_FULL=y
220# CONFIG_FUTEX is not set
221# CONFIG_EPOLL is not set
222# CONFIG_SIGNALFD is not set
223# CONFIG_TIMERFD is not set
224# CONFIG_EVENTFD is not set
225# CONFIG_SHMEM is not set
226# CONFIG_AIO is not set
227# CONFIG_VM_EVENT_COUNTERS is not set
228CONFIG_PCI_QUIRKS=y
229# CONFIG_SLUB_DEBUG is not set
230CONFIG_COMPAT_BRK=y
231# CONFIG_SLAB is not set
232CONFIG_SLUB=y
233# CONFIG_SLOB is not set
234# CONFIG_PROFILING is not set
235# CONFIG_MARKERS is not set
236CONFIG_HAVE_OPROFILE=y
237# CONFIG_SLOW_WORK is not set
238# CONFIG_HAVE_GENERIC_DMA_COHERENT is not set
239CONFIG_BASE_SMALL=0
240# CONFIG_MODULES is not set
241CONFIG_BLOCK=y
242# CONFIG_LBD is not set
243# CONFIG_BLK_DEV_BSG is not set
244# CONFIG_BLK_DEV_INTEGRITY is not set
245
246#
247# IO Schedulers
248#
249CONFIG_IOSCHED_NOOP=y
250# CONFIG_IOSCHED_AS is not set
251# CONFIG_IOSCHED_DEADLINE is not set
252# CONFIG_IOSCHED_CFQ is not set
253# CONFIG_DEFAULT_AS is not set
254# CONFIG_DEFAULT_DEADLINE is not set
255# CONFIG_DEFAULT_CFQ is not set
256CONFIG_DEFAULT_NOOP=y
257CONFIG_DEFAULT_IOSCHED="noop"
258# CONFIG_FREEZER is not set
259
260#
261# Bus options (PCI, PCMCIA, EISA, ISA, TC)
262#
263CONFIG_HW_HAS_PCI=y
264CONFIG_PCI=y
265CONFIG_PCI_DOMAINS=y
266# CONFIG_ARCH_SUPPORTS_MSI is not set
267# CONFIG_PCI_LEGACY is not set
268# CONFIG_PCI_STUB is not set
269# CONFIG_PCI_IOV is not set
270CONFIG_MMU=y
271CONFIG_PCCARD=y
272# CONFIG_PCMCIA_DEBUG is not set
273CONFIG_PCMCIA=y
274CONFIG_PCMCIA_LOAD_CIS=y
275CONFIG_PCMCIA_IOCTL=y
276CONFIG_CARDBUS=y
277
278#
279# PC-card bridges
280#
281# CONFIG_YENTA is not set
282# CONFIG_PD6729 is not set
283# CONFIG_I82092 is not set
284CONFIG_PCMCIA_BCM63XX=y
285# CONFIG_HOTPLUG_PCI is not set
286
287#
288# Executable file formats
289#
290CONFIG_BINFMT_ELF=y
291# CONFIG_CORE_DUMP_DEFAULT_ELF_HEADERS is not set
292# CONFIG_HAVE_AOUT is not set
293# CONFIG_BINFMT_MISC is not set
294CONFIG_TRAD_SIGNALS=y
295
296#
297# Power management options
298#
299CONFIG_ARCH_SUSPEND_POSSIBLE=y
300# CONFIG_PM is not set
301CONFIG_NET=y
302
303#
304# Networking options
305#
306# CONFIG_PACKET is not set
307CONFIG_UNIX=y
308# CONFIG_NET_KEY is not set
309CONFIG_INET=y
310# CONFIG_IP_MULTICAST is not set
311# CONFIG_IP_ADVANCED_ROUTER is not set
312CONFIG_IP_FIB_HASH=y
313# CONFIG_IP_PNP is not set
314# CONFIG_NET_IPIP is not set
315# CONFIG_NET_IPGRE is not set
316# CONFIG_ARPD is not set
317# CONFIG_SYN_COOKIES is not set
318# CONFIG_INET_AH is not set
319# CONFIG_INET_ESP is not set
320# CONFIG_INET_IPCOMP is not set
321# CONFIG_INET_XFRM_TUNNEL is not set
322# CONFIG_INET_TUNNEL is not set
323# CONFIG_INET_XFRM_MODE_TRANSPORT is not set
324# CONFIG_INET_XFRM_MODE_TUNNEL is not set
325# CONFIG_INET_XFRM_MODE_BEET is not set
326# CONFIG_INET_LRO is not set
327# CONFIG_INET_DIAG is not set
328# CONFIG_TCP_CONG_ADVANCED is not set
329CONFIG_TCP_CONG_CUBIC=y
330CONFIG_DEFAULT_TCP_CONG="cubic"
331# CONFIG_TCP_MD5SIG is not set
332# CONFIG_IPV6 is not set
333# CONFIG_NETWORK_SECMARK is not set
334# CONFIG_NETFILTER is not set
335# CONFIG_IP_DCCP is not set
336# CONFIG_IP_SCTP is not set
337# CONFIG_TIPC is not set
338# CONFIG_ATM is not set
339# CONFIG_BRIDGE is not set
340# CONFIG_NET_DSA is not set
341# CONFIG_VLAN_8021Q is not set
342# CONFIG_DECNET is not set
343# CONFIG_LLC2 is not set
344# CONFIG_IPX is not set
345# CONFIG_ATALK is not set
346# CONFIG_X25 is not set
347# CONFIG_LAPB is not set
348# CONFIG_ECONET is not set
349# CONFIG_WAN_ROUTER is not set
350# CONFIG_PHONET is not set
351# CONFIG_NET_SCHED is not set
352# CONFIG_DCB is not set
353
354#
355# Network testing
356#
357# CONFIG_NET_PKTGEN is not set
358# CONFIG_HAMRADIO is not set
359# CONFIG_CAN is not set
360# CONFIG_IRDA is not set
361# CONFIG_BT is not set
362# CONFIG_AF_RXRPC is not set
363# CONFIG_WIRELESS is not set
364# CONFIG_WIMAX is not set
365# CONFIG_RFKILL is not set
366# CONFIG_NET_9P is not set
367
368#
369# Device Drivers
370#
371
372#
373# Generic Driver Options
374#
375CONFIG_UEVENT_HELPER_PATH="/sbin/hotplug"
376# CONFIG_STANDALONE is not set
377# CONFIG_PREVENT_FIRMWARE_BUILD is not set
378CONFIG_FW_LOADER=y
379CONFIG_FIRMWARE_IN_KERNEL=y
380CONFIG_EXTRA_FIRMWARE=""
381# CONFIG_SYS_HYPERVISOR is not set
382# CONFIG_CONNECTOR is not set
383CONFIG_MTD=y
384# CONFIG_MTD_DEBUG is not set
385# CONFIG_MTD_CONCAT is not set
386CONFIG_MTD_PARTITIONS=y
387# CONFIG_MTD_REDBOOT_PARTS is not set
388# CONFIG_MTD_CMDLINE_PARTS is not set
389# CONFIG_MTD_AR7_PARTS is not set
390
391#
392# User Modules And Translation Layers
393#
394# CONFIG_MTD_CHAR is not set
395# CONFIG_MTD_BLKDEVS is not set
396# CONFIG_MTD_BLOCK is not set
397# CONFIG_MTD_BLOCK_RO is not set
398# CONFIG_FTL is not set
399# CONFIG_NFTL is not set
400# CONFIG_INFTL is not set
401# CONFIG_RFD_FTL is not set
402# CONFIG_SSFDC is not set
403# CONFIG_MTD_OOPS is not set
404
405#
406# RAM/ROM/Flash chip drivers
407#
408CONFIG_MTD_CFI=y
409# CONFIG_MTD_JEDECPROBE is not set
410CONFIG_MTD_GEN_PROBE=y
411# CONFIG_MTD_CFI_ADV_OPTIONS is not set
412CONFIG_MTD_MAP_BANK_WIDTH_1=y
413CONFIG_MTD_MAP_BANK_WIDTH_2=y
414CONFIG_MTD_MAP_BANK_WIDTH_4=y
415# CONFIG_MTD_MAP_BANK_WIDTH_8 is not set
416# CONFIG_MTD_MAP_BANK_WIDTH_16 is not set
417# CONFIG_MTD_MAP_BANK_WIDTH_32 is not set
418CONFIG_MTD_CFI_I1=y
419CONFIG_MTD_CFI_I2=y
420# CONFIG_MTD_CFI_I4 is not set
421# CONFIG_MTD_CFI_I8 is not set
422CONFIG_MTD_CFI_INTELEXT=y
423CONFIG_MTD_CFI_AMDSTD=y
424# CONFIG_MTD_CFI_STAA is not set
425CONFIG_MTD_CFI_UTIL=y
426# CONFIG_MTD_RAM is not set
427# CONFIG_MTD_ROM is not set
428# CONFIG_MTD_ABSENT is not set
429
430#
431# Mapping drivers for chip access
432#
433# CONFIG_MTD_COMPLEX_MAPPINGS is not set
434CONFIG_MTD_PHYSMAP=y
435# CONFIG_MTD_PHYSMAP_COMPAT is not set
436# CONFIG_MTD_INTEL_VR_NOR is not set
437# CONFIG_MTD_PLATRAM is not set
438
439#
440# Self-contained MTD device drivers
441#
442# CONFIG_MTD_PMC551 is not set
443# CONFIG_MTD_SLRAM is not set
444# CONFIG_MTD_PHRAM is not set
445# CONFIG_MTD_MTDRAM is not set
446# CONFIG_MTD_BLOCK2MTD is not set
447
448#
449# Disk-On-Chip Device Drivers
450#
451# CONFIG_MTD_DOC2000 is not set
452# CONFIG_MTD_DOC2001 is not set
453# CONFIG_MTD_DOC2001PLUS is not set
454# CONFIG_MTD_NAND is not set
455# CONFIG_MTD_ONENAND is not set
456
457#
458# LPDDR flash memory drivers
459#
460# CONFIG_MTD_LPDDR is not set
461
462#
463# UBI - Unsorted block images
464#
465# CONFIG_MTD_UBI is not set
466# CONFIG_PARPORT is not set
467# CONFIG_BLK_DEV is not set
468# CONFIG_MISC_DEVICES is not set
469CONFIG_HAVE_IDE=y
470# CONFIG_IDE is not set
471
472#
473# SCSI device support
474#
475# CONFIG_RAID_ATTRS is not set
476# CONFIG_SCSI is not set
477# CONFIG_SCSI_DMA is not set
478# CONFIG_SCSI_NETLINK is not set
479# CONFIG_ATA is not set
480# CONFIG_MD is not set
481# CONFIG_FUSION is not set
482
483#
484# IEEE 1394 (FireWire) support
485#
486
487#
488# Enable only one of the two stacks, unless you know what you are doing
489#
490# CONFIG_FIREWIRE is not set
491# CONFIG_IEEE1394 is not set
492# CONFIG_I2O is not set
493CONFIG_NETDEVICES=y
494CONFIG_COMPAT_NET_DEV_OPS=y
495# CONFIG_DUMMY is not set
496# CONFIG_BONDING is not set
497# CONFIG_MACVLAN is not set
498# CONFIG_EQUALIZER is not set
499# CONFIG_TUN is not set
500# CONFIG_VETH is not set
501# CONFIG_ARCNET is not set
502CONFIG_PHYLIB=y
503
504#
505# MII PHY device drivers
506#
507# CONFIG_MARVELL_PHY is not set
508# CONFIG_DAVICOM_PHY is not set
509# CONFIG_QSEMI_PHY is not set
510# CONFIG_LXT_PHY is not set
511# CONFIG_CICADA_PHY is not set
512# CONFIG_VITESSE_PHY is not set
513# CONFIG_SMSC_PHY is not set
514# CONFIG_BROADCOM_PHY is not set
515CONFIG_BCM63XX_PHY=y
516# CONFIG_ICPLUS_PHY is not set
517# CONFIG_REALTEK_PHY is not set
518# CONFIG_NATIONAL_PHY is not set
519# CONFIG_STE10XP is not set
520# CONFIG_LSI_ET1011C_PHY is not set
521# CONFIG_FIXED_PHY is not set
522# CONFIG_MDIO_BITBANG is not set
523CONFIG_NET_ETHERNET=y
524CONFIG_MII=y
525# CONFIG_AX88796 is not set
526# CONFIG_HAPPYMEAL is not set
527# CONFIG_SUNGEM is not set
528# CONFIG_CASSINI is not set
529# CONFIG_NET_VENDOR_3COM is not set
530# CONFIG_SMC91X is not set
531# CONFIG_DM9000 is not set
532# CONFIG_ETHOC is not set
533# CONFIG_DNET is not set
534# CONFIG_NET_TULIP is not set
535# CONFIG_HP100 is not set
536# CONFIG_IBM_NEW_EMAC_ZMII is not set
537# CONFIG_IBM_NEW_EMAC_RGMII is not set
538# CONFIG_IBM_NEW_EMAC_TAH is not set
539# CONFIG_IBM_NEW_EMAC_EMAC4 is not set
540# CONFIG_IBM_NEW_EMAC_NO_FLOW_CTRL is not set
541# CONFIG_IBM_NEW_EMAC_MAL_CLR_ICINTSTAT is not set
542# CONFIG_IBM_NEW_EMAC_MAL_COMMON_ERR is not set
543# CONFIG_NET_PCI is not set
544# CONFIG_B44 is not set
545# CONFIG_ATL2 is not set
546CONFIG_BCM63XX_ENET=y
547# CONFIG_NETDEV_1000 is not set
548# CONFIG_NETDEV_10000 is not set
549# CONFIG_TR is not set
550
551#
552# Wireless LAN
553#
554# CONFIG_WLAN_PRE80211 is not set
555# CONFIG_WLAN_80211 is not set
556
557#
558# Enable WiMAX (Networking options) to see the WiMAX drivers
559#
560
561#
562# USB Network Adapters
563#
564# CONFIG_USB_CATC is not set
565# CONFIG_USB_KAWETH is not set
566# CONFIG_USB_PEGASUS is not set
567# CONFIG_USB_RTL8150 is not set
568# CONFIG_USB_USBNET is not set
569# CONFIG_NET_PCMCIA is not set
570# CONFIG_WAN is not set
571# CONFIG_FDDI is not set
572# CONFIG_HIPPI is not set
573# CONFIG_PPP is not set
574# CONFIG_SLIP is not set
575# CONFIG_NETCONSOLE is not set
576# CONFIG_NETPOLL is not set
577# CONFIG_NET_POLL_CONTROLLER is not set
578# CONFIG_ISDN is not set
579# CONFIG_PHONE is not set
580
581#
582# Input device support
583#
584# CONFIG_INPUT is not set
585
586#
587# Hardware I/O ports
588#
589# CONFIG_SERIO is not set
590# CONFIG_GAMEPORT is not set
591
592#
593# Character devices
594#
595# CONFIG_VT is not set
596# CONFIG_DEVKMEM is not set
597# CONFIG_SERIAL_NONSTANDARD is not set
598# CONFIG_NOZOMI is not set
599
600#
601# Serial drivers
602#
603# CONFIG_SERIAL_8250 is not set
604
605#
606# Non-8250 serial port support
607#
608CONFIG_SERIAL_CORE=y
609CONFIG_SERIAL_CORE_CONSOLE=y
610# CONFIG_SERIAL_JSM is not set
611CONFIG_SERIAL_BCM63XX=y
612CONFIG_SERIAL_BCM63XX_CONSOLE=y
613# CONFIG_UNIX98_PTYS is not set
614CONFIG_LEGACY_PTYS=y
615CONFIG_LEGACY_PTY_COUNT=256
616# CONFIG_IPMI_HANDLER is not set
617# CONFIG_HW_RANDOM is not set
618# CONFIG_R3964 is not set
619# CONFIG_APPLICOM is not set
620
621#
622# PCMCIA character devices
623#
624# CONFIG_SYNCLINK_CS is not set
625# CONFIG_CARDMAN_4000 is not set
626# CONFIG_CARDMAN_4040 is not set
627# CONFIG_IPWIRELESS is not set
628# CONFIG_RAW_DRIVER is not set
629# CONFIG_TCG_TPM is not set
630CONFIG_DEVPORT=y
631# CONFIG_I2C is not set
632# CONFIG_SPI is not set
633CONFIG_ARCH_REQUIRE_GPIOLIB=y
634CONFIG_GPIOLIB=y
635# CONFIG_GPIO_SYSFS is not set
636
637#
638# Memory mapped GPIO expanders:
639#
640
641#
642# I2C GPIO expanders:
643#
644
645#
646# PCI GPIO expanders:
647#
648# CONFIG_GPIO_BT8XX is not set
649
650#
651# SPI GPIO expanders:
652#
653# CONFIG_W1 is not set
654# CONFIG_POWER_SUPPLY is not set
655# CONFIG_HWMON is not set
656# CONFIG_THERMAL is not set
657# CONFIG_THERMAL_HWMON is not set
658# CONFIG_WATCHDOG is not set
659CONFIG_SSB_POSSIBLE=y
660
661#
662# Sonics Silicon Backplane
663#
664CONFIG_SSB=y
665CONFIG_SSB_SPROM=y
666CONFIG_SSB_PCIHOST_POSSIBLE=y
667CONFIG_SSB_PCIHOST=y
668# CONFIG_SSB_B43_PCI_BRIDGE is not set
669CONFIG_SSB_PCMCIAHOST_POSSIBLE=y
670# CONFIG_SSB_PCMCIAHOST is not set
671# CONFIG_SSB_SILENT is not set
672# CONFIG_SSB_DEBUG is not set
673CONFIG_SSB_DRIVER_PCICORE_POSSIBLE=y
674# CONFIG_SSB_DRIVER_PCICORE is not set
675# CONFIG_SSB_DRIVER_MIPS is not set
676
677#
678# Multifunction device drivers
679#
680# CONFIG_MFD_CORE is not set
681# CONFIG_MFD_SM501 is not set
682# CONFIG_HTC_PASIC3 is not set
683# CONFIG_MFD_TMIO is not set
684# CONFIG_REGULATOR is not set
685
686#
687# Multimedia devices
688#
689
690#
691# Multimedia core support
692#
693# CONFIG_VIDEO_DEV is not set
694# CONFIG_DVB_CORE is not set
695# CONFIG_VIDEO_MEDIA is not set
696
697#
698# Multimedia drivers
699#
700# CONFIG_DAB is not set
701
702#
703# Graphics support
704#
705# CONFIG_DRM is not set
706# CONFIG_VGASTATE is not set
707# CONFIG_VIDEO_OUTPUT_CONTROL is not set
708# CONFIG_FB is not set
709# CONFIG_BACKLIGHT_LCD_SUPPORT is not set
710
711#
712# Display device support
713#
714CONFIG_DISPLAY_SUPPORT=y
715
716#
717# Display hardware drivers
718#
719# CONFIG_SOUND is not set
720CONFIG_USB_SUPPORT=y
721CONFIG_USB_ARCH_HAS_HCD=y
722CONFIG_USB_ARCH_HAS_OHCI=y
723CONFIG_USB_ARCH_HAS_EHCI=y
724CONFIG_USB=y
725# CONFIG_USB_DEBUG is not set
726# CONFIG_USB_ANNOUNCE_NEW_DEVICES is not set
727
728#
729# Miscellaneous USB options
730#
731# CONFIG_USB_DEVICEFS is not set
732# CONFIG_USB_DEVICE_CLASS is not set
733# CONFIG_USB_DYNAMIC_MINORS is not set
734# CONFIG_USB_OTG is not set
735# CONFIG_USB_OTG_WHITELIST is not set
736# CONFIG_USB_OTG_BLACKLIST_HUB is not set
737# CONFIG_USB_MON is not set
738# CONFIG_USB_WUSB is not set
739# CONFIG_USB_WUSB_CBAF is not set
740
741#
742# USB Host Controller Drivers
743#
744# CONFIG_USB_C67X00_HCD is not set
745CONFIG_USB_EHCI_HCD=y
746# CONFIG_USB_EHCI_ROOT_HUB_TT is not set
747# CONFIG_USB_EHCI_TT_NEWSCHED is not set
748CONFIG_USB_EHCI_BIG_ENDIAN_MMIO=y
749# CONFIG_USB_OXU210HP_HCD is not set
750# CONFIG_USB_ISP116X_HCD is not set
751# CONFIG_USB_ISP1760_HCD is not set
752CONFIG_USB_OHCI_HCD=y
753# CONFIG_USB_OHCI_HCD_SSB is not set
754CONFIG_USB_OHCI_BIG_ENDIAN_DESC=y
755CONFIG_USB_OHCI_BIG_ENDIAN_MMIO=y
756CONFIG_USB_OHCI_LITTLE_ENDIAN=y
757# CONFIG_USB_UHCI_HCD is not set
758# CONFIG_USB_SL811_HCD is not set
759# CONFIG_USB_R8A66597_HCD is not set
760# CONFIG_USB_WHCI_HCD is not set
761# CONFIG_USB_HWA_HCD is not set
762
763#
764# USB Device Class drivers
765#
766# CONFIG_USB_ACM is not set
767# CONFIG_USB_PRINTER is not set
768# CONFIG_USB_WDM is not set
769# CONFIG_USB_TMC is not set
770
771#
772# NOTE: USB_STORAGE depends on SCSI but BLK_DEV_SD may
773#
774
775#
776# also be needed; see USB_STORAGE Help for more info
777#
778# CONFIG_USB_LIBUSUAL is not set
779
780#
781# USB Imaging devices
782#
783# CONFIG_USB_MDC800 is not set
784
785#
786# USB port drivers
787#
788# CONFIG_USB_SERIAL is not set
789
790#
791# USB Miscellaneous drivers
792#
793# CONFIG_USB_EMI62 is not set
794# CONFIG_USB_EMI26 is not set
795# CONFIG_USB_ADUTUX is not set
796# CONFIG_USB_SEVSEG is not set
797# CONFIG_USB_RIO500 is not set
798# CONFIG_USB_LEGOTOWER is not set
799# CONFIG_USB_LCD is not set
800# CONFIG_USB_BERRY_CHARGE is not set
801# CONFIG_USB_LED is not set
802# CONFIG_USB_CYPRESS_CY7C63 is not set
803# CONFIG_USB_CYTHERM is not set
804# CONFIG_USB_IDMOUSE is not set
805# CONFIG_USB_FTDI_ELAN is not set
806# CONFIG_USB_APPLEDISPLAY is not set
807# CONFIG_USB_SISUSBVGA is not set
808# CONFIG_USB_LD is not set
809# CONFIG_USB_TRANCEVIBRATOR is not set
810# CONFIG_USB_IOWARRIOR is not set
811# CONFIG_USB_ISIGHTFW is not set
812# CONFIG_USB_VST is not set
813# CONFIG_USB_GADGET is not set
814
815#
816# OTG and related infrastructure
817#
818# CONFIG_USB_GPIO_VBUS is not set
819# CONFIG_NOP_USB_XCEIV is not set
820# CONFIG_UWB is not set
821# CONFIG_MMC is not set
822# CONFIG_MEMSTICK is not set
823# CONFIG_NEW_LEDS is not set
824# CONFIG_ACCESSIBILITY is not set
825# CONFIG_INFINIBAND is not set
826CONFIG_RTC_LIB=y
827# CONFIG_RTC_CLASS is not set
828# CONFIG_DMADEVICES is not set
829# CONFIG_AUXDISPLAY is not set
830# CONFIG_UIO is not set
831# CONFIG_STAGING is not set
832
833#
834# File systems
835#
836# CONFIG_EXT2_FS is not set
837# CONFIG_EXT3_FS is not set
838# CONFIG_EXT4_FS is not set
839# CONFIG_REISERFS_FS is not set
840# CONFIG_JFS_FS is not set
841# CONFIG_FS_POSIX_ACL is not set
842# CONFIG_FILE_LOCKING is not set
843# CONFIG_XFS_FS is not set
844# CONFIG_OCFS2_FS is not set
845# CONFIG_BTRFS_FS is not set
846# CONFIG_DNOTIFY is not set
847# CONFIG_INOTIFY is not set
848# CONFIG_QUOTA is not set
849# CONFIG_AUTOFS_FS is not set
850# CONFIG_AUTOFS4_FS is not set
851# CONFIG_FUSE_FS is not set
852
853#
854# Caches
855#
856# CONFIG_FSCACHE is not set
857
858#
859# CD-ROM/DVD Filesystems
860#
861# CONFIG_ISO9660_FS is not set
862# CONFIG_UDF_FS is not set
863
864#
865# DOS/FAT/NT Filesystems
866#
867# CONFIG_MSDOS_FS is not set
868# CONFIG_VFAT_FS is not set
869# CONFIG_NTFS_FS is not set
870
871#
872# Pseudo filesystems
873#
874CONFIG_PROC_FS=y
875CONFIG_PROC_KCORE=y
876CONFIG_PROC_SYSCTL=y
877CONFIG_PROC_PAGE_MONITOR=y
878CONFIG_SYSFS=y
879CONFIG_TMPFS=y
880# CONFIG_TMPFS_POSIX_ACL is not set
881# CONFIG_HUGETLB_PAGE is not set
882# CONFIG_CONFIGFS_FS is not set
883CONFIG_MISC_FILESYSTEMS=y
884# CONFIG_ADFS_FS is not set
885# CONFIG_AFFS_FS is not set
886# CONFIG_HFS_FS is not set
887# CONFIG_HFSPLUS_FS is not set
888# CONFIG_BEFS_FS is not set
889# CONFIG_BFS_FS is not set
890# CONFIG_EFS_FS is not set
891# CONFIG_JFFS2_FS is not set
892# CONFIG_CRAMFS is not set
893# CONFIG_SQUASHFS is not set
894# CONFIG_VXFS_FS is not set
895# CONFIG_MINIX_FS is not set
896# CONFIG_OMFS_FS is not set
897# CONFIG_HPFS_FS is not set
898# CONFIG_QNX4FS_FS is not set
899# CONFIG_ROMFS_FS is not set
900# CONFIG_SYSV_FS is not set
901# CONFIG_UFS_FS is not set
902# CONFIG_NILFS2_FS is not set
903# CONFIG_NETWORK_FILESYSTEMS is not set
904
905#
906# Partition Types
907#
908# CONFIG_PARTITION_ADVANCED is not set
909CONFIG_MSDOS_PARTITION=y
910# CONFIG_NLS is not set
911# CONFIG_DLM is not set
912
913#
914# Kernel hacking
915#
916CONFIG_TRACE_IRQFLAGS_SUPPORT=y
917# CONFIG_PRINTK_TIME is not set
918CONFIG_ENABLE_WARN_DEPRECATED=y
919CONFIG_ENABLE_MUST_CHECK=y
920CONFIG_FRAME_WARN=1024
921CONFIG_MAGIC_SYSRQ=y
922# CONFIG_UNUSED_SYMBOLS is not set
923# CONFIG_DEBUG_FS is not set
924# CONFIG_HEADERS_CHECK is not set
925# CONFIG_DEBUG_KERNEL is not set
926# CONFIG_DEBUG_MEMORY_INIT is not set
927# CONFIG_RCU_CPU_STALL_DETECTOR is not set
928CONFIG_SYSCTL_SYSCALL_CHECK=y
929CONFIG_TRACING_SUPPORT=y
930
931#
932# Tracers
933#
934# CONFIG_IRQSOFF_TRACER is not set
935# CONFIG_SCHED_TRACER is not set
936# CONFIG_CONTEXT_SWITCH_TRACER is not set
937# CONFIG_EVENT_TRACER is not set
938# CONFIG_BOOT_TRACER is not set
939# CONFIG_TRACE_BRANCH_PROFILING is not set
940# CONFIG_KMEMTRACE is not set
941# CONFIG_WORKQUEUE_TRACER is not set
942# CONFIG_BLK_DEV_IO_TRACE is not set
943# CONFIG_SAMPLES is not set
944CONFIG_HAVE_ARCH_KGDB=y
945CONFIG_CMDLINE="console=ttyS0,115200"
946
947#
948# Security options
949#
950# CONFIG_KEYS is not set
951# CONFIG_SECURITY is not set
952# CONFIG_SECURITYFS is not set
953# CONFIG_SECURITY_FILE_CAPABILITIES is not set
954# CONFIG_CRYPTO is not set
955# CONFIG_BINARY_PRINTF is not set
956
957#
958# Library routines
959#
960CONFIG_BITREVERSE=y
961CONFIG_GENERIC_FIND_LAST_BIT=y
962# CONFIG_CRC_CCITT is not set
963# CONFIG_CRC16 is not set
964# CONFIG_CRC_T10DIF is not set
965# CONFIG_CRC_ITU_T is not set
966CONFIG_CRC32=y
967# CONFIG_CRC7 is not set
968# CONFIG_LIBCRC32C is not set
969CONFIG_HAS_IOMEM=y
970CONFIG_HAS_IOPORT=y
971CONFIG_HAS_DMA=y
972CONFIG_NLATTR=y
diff --git a/arch/mips/configs/bigsur_defconfig b/arch/mips/configs/bigsur_defconfig
index d6d35b2e5fe8..13d9eb4736c0 100644
--- a/arch/mips/configs/bigsur_defconfig
+++ b/arch/mips/configs/bigsur_defconfig
@@ -129,7 +129,6 @@ CONFIG_PAGE_SIZE_4KB=y
129CONFIG_MIPS_MT_DISABLED=y 129CONFIG_MIPS_MT_DISABLED=y
130# CONFIG_MIPS_MT_SMP is not set 130# CONFIG_MIPS_MT_SMP is not set
131# CONFIG_MIPS_MT_SMTC is not set 131# CONFIG_MIPS_MT_SMTC is not set
132CONFIG_CPU_HAS_LLSC=y
133CONFIG_CPU_HAS_SYNC=y 132CONFIG_CPU_HAS_SYNC=y
134CONFIG_GENERIC_HARDIRQS=y 133CONFIG_GENERIC_HARDIRQS=y
135CONFIG_GENERIC_IRQ_PROBE=y 134CONFIG_GENERIC_IRQ_PROBE=y
diff --git a/arch/mips/configs/cobalt_defconfig b/arch/mips/configs/cobalt_defconfig
index eb44b72254af..6c8cca8589ba 100644
--- a/arch/mips/configs/cobalt_defconfig
+++ b/arch/mips/configs/cobalt_defconfig
@@ -112,7 +112,6 @@ CONFIG_PAGE_SIZE_4KB=y
112CONFIG_MIPS_MT_DISABLED=y 112CONFIG_MIPS_MT_DISABLED=y
113# CONFIG_MIPS_MT_SMP is not set 113# CONFIG_MIPS_MT_SMP is not set
114# CONFIG_MIPS_MT_SMTC is not set 114# CONFIG_MIPS_MT_SMTC is not set
115CONFIG_CPU_HAS_LLSC=y
116CONFIG_CPU_HAS_SYNC=y 115CONFIG_CPU_HAS_SYNC=y
117CONFIG_GENERIC_HARDIRQS=y 116CONFIG_GENERIC_HARDIRQS=y
118CONFIG_GENERIC_IRQ_PROBE=y 117CONFIG_GENERIC_IRQ_PROBE=y
diff --git a/arch/mips/configs/db1000_defconfig b/arch/mips/configs/db1000_defconfig
index a279165e3a7d..dbdf3bb1a34a 100644
--- a/arch/mips/configs/db1000_defconfig
+++ b/arch/mips/configs/db1000_defconfig
@@ -114,7 +114,6 @@ CONFIG_MIPS_MT_DISABLED=y
114# CONFIG_MIPS_MT_SMTC is not set 114# CONFIG_MIPS_MT_SMTC is not set
115# CONFIG_MIPS_VPE_LOADER is not set 115# CONFIG_MIPS_VPE_LOADER is not set
116CONFIG_64BIT_PHYS_ADDR=y 116CONFIG_64BIT_PHYS_ADDR=y
117CONFIG_CPU_HAS_LLSC=y
118CONFIG_CPU_HAS_SYNC=y 117CONFIG_CPU_HAS_SYNC=y
119CONFIG_GENERIC_HARDIRQS=y 118CONFIG_GENERIC_HARDIRQS=y
120CONFIG_GENERIC_IRQ_PROBE=y 119CONFIG_GENERIC_IRQ_PROBE=y
diff --git a/arch/mips/configs/db1100_defconfig b/arch/mips/configs/db1100_defconfig
index 8944d15caf13..fa6814475898 100644
--- a/arch/mips/configs/db1100_defconfig
+++ b/arch/mips/configs/db1100_defconfig
@@ -114,7 +114,6 @@ CONFIG_MIPS_MT_DISABLED=y
114# CONFIG_MIPS_MT_SMTC is not set 114# CONFIG_MIPS_MT_SMTC is not set
115# CONFIG_MIPS_VPE_LOADER is not set 115# CONFIG_MIPS_VPE_LOADER is not set
116CONFIG_64BIT_PHYS_ADDR=y 116CONFIG_64BIT_PHYS_ADDR=y
117CONFIG_CPU_HAS_LLSC=y
118CONFIG_CPU_HAS_SYNC=y 117CONFIG_CPU_HAS_SYNC=y
119CONFIG_GENERIC_HARDIRQS=y 118CONFIG_GENERIC_HARDIRQS=y
120CONFIG_GENERIC_IRQ_PROBE=y 119CONFIG_GENERIC_IRQ_PROBE=y
diff --git a/arch/mips/configs/db1200_defconfig b/arch/mips/configs/db1200_defconfig
index ab17973107fd..d73f1de43b5d 100644
--- a/arch/mips/configs/db1200_defconfig
+++ b/arch/mips/configs/db1200_defconfig
@@ -114,7 +114,6 @@ CONFIG_MIPS_MT_DISABLED=y
114# CONFIG_MIPS_MT_SMTC is not set 114# CONFIG_MIPS_MT_SMTC is not set
115# CONFIG_MIPS_VPE_LOADER is not set 115# CONFIG_MIPS_VPE_LOADER is not set
116CONFIG_64BIT_PHYS_ADDR=y 116CONFIG_64BIT_PHYS_ADDR=y
117CONFIG_CPU_HAS_LLSC=y
118CONFIG_CPU_HAS_SYNC=y 117CONFIG_CPU_HAS_SYNC=y
119CONFIG_GENERIC_HARDIRQS=y 118CONFIG_GENERIC_HARDIRQS=y
120CONFIG_GENERIC_IRQ_PROBE=y 119CONFIG_GENERIC_IRQ_PROBE=y
diff --git a/arch/mips/configs/db1500_defconfig b/arch/mips/configs/db1500_defconfig
index b65803f19352..ec3e028a5b2e 100644
--- a/arch/mips/configs/db1500_defconfig
+++ b/arch/mips/configs/db1500_defconfig
@@ -116,7 +116,6 @@ CONFIG_MIPS_MT_DISABLED=y
116# CONFIG_MIPS_MT_SMTC is not set 116# CONFIG_MIPS_MT_SMTC is not set
117# CONFIG_MIPS_VPE_LOADER is not set 117# CONFIG_MIPS_VPE_LOADER is not set
118CONFIG_64BIT_PHYS_ADDR=y 118CONFIG_64BIT_PHYS_ADDR=y
119CONFIG_CPU_HAS_LLSC=y
120CONFIG_CPU_HAS_SYNC=y 119CONFIG_CPU_HAS_SYNC=y
121CONFIG_GENERIC_HARDIRQS=y 120CONFIG_GENERIC_HARDIRQS=y
122CONFIG_GENERIC_IRQ_PROBE=y 121CONFIG_GENERIC_IRQ_PROBE=y
diff --git a/arch/mips/configs/db1550_defconfig b/arch/mips/configs/db1550_defconfig
index a190ac07740b..7631dae51be9 100644
--- a/arch/mips/configs/db1550_defconfig
+++ b/arch/mips/configs/db1550_defconfig
@@ -115,7 +115,6 @@ CONFIG_MIPS_MT_DISABLED=y
115# CONFIG_MIPS_MT_SMTC is not set 115# CONFIG_MIPS_MT_SMTC is not set
116# CONFIG_MIPS_VPE_LOADER is not set 116# CONFIG_MIPS_VPE_LOADER is not set
117CONFIG_64BIT_PHYS_ADDR=y 117CONFIG_64BIT_PHYS_ADDR=y
118CONFIG_CPU_HAS_LLSC=y
119CONFIG_CPU_HAS_SYNC=y 118CONFIG_CPU_HAS_SYNC=y
120CONFIG_GENERIC_HARDIRQS=y 119CONFIG_GENERIC_HARDIRQS=y
121CONFIG_GENERIC_IRQ_PROBE=y 120CONFIG_GENERIC_IRQ_PROBE=y
diff --git a/arch/mips/configs/excite_defconfig b/arch/mips/configs/excite_defconfig
index 4e465e945991..1995d43a2ed1 100644
--- a/arch/mips/configs/excite_defconfig
+++ b/arch/mips/configs/excite_defconfig
@@ -118,7 +118,6 @@ CONFIG_MIPS_MT_DISABLED=y
118# CONFIG_MIPS_MT_SMTC is not set 118# CONFIG_MIPS_MT_SMTC is not set
119# CONFIG_MIPS_VPE_LOADER is not set 119# CONFIG_MIPS_VPE_LOADER is not set
120# CONFIG_64BIT_PHYS_ADDR is not set 120# CONFIG_64BIT_PHYS_ADDR is not set
121CONFIG_CPU_HAS_LLSC=y
122CONFIG_CPU_HAS_SYNC=y 121CONFIG_CPU_HAS_SYNC=y
123CONFIG_GENERIC_HARDIRQS=y 122CONFIG_GENERIC_HARDIRQS=y
124CONFIG_GENERIC_IRQ_PROBE=y 123CONFIG_GENERIC_IRQ_PROBE=y
diff --git a/arch/mips/configs/fulong_defconfig b/arch/mips/configs/fuloong2e_defconfig
index 786a9bc9a696..0197f0de6b3f 100644
--- a/arch/mips/configs/fulong_defconfig
+++ b/arch/mips/configs/fuloong2e_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.28-rc6 3# Linux kernel version: 2.6.31-rc1
4# Fri Nov 28 17:53:48 2008 4# Thu Jul 2 22:37:00 2009
5# 5#
6CONFIG_MIPS=y 6CONFIG_MIPS=y
7 7
@@ -9,16 +9,17 @@ CONFIG_MIPS=y
9# Machine selection 9# Machine selection
10# 10#
11# CONFIG_MACH_ALCHEMY is not set 11# CONFIG_MACH_ALCHEMY is not set
12# CONFIG_AR7 is not set
12# CONFIG_BASLER_EXCITE is not set 13# CONFIG_BASLER_EXCITE is not set
13# CONFIG_BCM47XX is not set 14# CONFIG_BCM47XX is not set
14# CONFIG_MIPS_COBALT is not set 15# CONFIG_MIPS_COBALT is not set
15# CONFIG_MACH_DECSTATION is not set 16# CONFIG_MACH_DECSTATION is not set
16# CONFIG_MACH_JAZZ is not set 17# CONFIG_MACH_JAZZ is not set
17# CONFIG_LASAT is not set 18# CONFIG_LASAT is not set
18CONFIG_LEMOTE_FULONG=y 19CONFIG_MACH_LOONGSON=y
19# CONFIG_MIPS_MALTA is not set 20# CONFIG_MIPS_MALTA is not set
20# CONFIG_MIPS_SIM is not set 21# CONFIG_MIPS_SIM is not set
21# CONFIG_MACH_EMMA is not set 22# CONFIG_NEC_MARKEINS is not set
22# CONFIG_MACH_VR41XX is not set 23# CONFIG_MACH_VR41XX is not set
23# CONFIG_NXP_STB220 is not set 24# CONFIG_NXP_STB220 is not set
24# CONFIG_NXP_STB225 is not set 25# CONFIG_NXP_STB225 is not set
@@ -43,6 +44,11 @@ CONFIG_LEMOTE_FULONG=y
43# CONFIG_MACH_TX49XX is not set 44# CONFIG_MACH_TX49XX is not set
44# CONFIG_MIKROTIK_RB532 is not set 45# CONFIG_MIKROTIK_RB532 is not set
45# CONFIG_WR_PPMC 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_ARCH_SPARSEMEM_ENABLE=y
51CONFIG_LEMOTE_FULOONG2E=y
46CONFIG_RWSEM_GENERIC_SPINLOCK=y 52CONFIG_RWSEM_GENERIC_SPINLOCK=y
47# CONFIG_ARCH_HAS_ILOG2_U32 is not set 53# CONFIG_ARCH_HAS_ILOG2_U32 is not set
48# CONFIG_ARCH_HAS_ILOG2_U64 is not set 54# CONFIG_ARCH_HAS_ILOG2_U64 is not set
@@ -53,15 +59,16 @@ CONFIG_GENERIC_CALIBRATE_DELAY=y
53CONFIG_GENERIC_CLOCKEVENTS=y 59CONFIG_GENERIC_CLOCKEVENTS=y
54CONFIG_GENERIC_TIME=y 60CONFIG_GENERIC_TIME=y
55CONFIG_GENERIC_CMOS_UPDATE=y 61CONFIG_GENERIC_CMOS_UPDATE=y
56CONFIG_SCHED_NO_NO_OMIT_FRAME_POINTER=y 62CONFIG_SCHED_OMIT_FRAME_POINTER=y
57CONFIG_GENERIC_HARDIRQS_NO__DO_IRQ=y 63CONFIG_GENERIC_HARDIRQS_NO__DO_IRQ=y
64CONFIG_CEVT_R4K_LIB=y
58CONFIG_CEVT_R4K=y 65CONFIG_CEVT_R4K=y
66CONFIG_CSRC_R4K_LIB=y
59CONFIG_CSRC_R4K=y 67CONFIG_CSRC_R4K=y
60CONFIG_DMA_NONCOHERENT=y 68CONFIG_DMA_NONCOHERENT=y
61CONFIG_DMA_NEED_PCI_MAP_STATE=y 69CONFIG_DMA_NEED_PCI_MAP_STATE=y
62CONFIG_EARLY_PRINTK=y 70CONFIG_EARLY_PRINTK=y
63CONFIG_SYS_HAS_EARLY_PRINTK=y 71CONFIG_SYS_HAS_EARLY_PRINTK=y
64# CONFIG_HOTPLUG_CPU is not set
65CONFIG_I8259=y 72CONFIG_I8259=y
66# CONFIG_NO_IOPORT is not set 73# CONFIG_NO_IOPORT is not set
67CONFIG_GENERIC_ISA_DMA=y 74CONFIG_GENERIC_ISA_DMA=y
@@ -72,12 +79,11 @@ CONFIG_SYS_SUPPORTS_LITTLE_ENDIAN=y
72CONFIG_IRQ_CPU=y 79CONFIG_IRQ_CPU=y
73CONFIG_BOOT_ELF32=y 80CONFIG_BOOT_ELF32=y
74CONFIG_MIPS_L1_CACHE_SHIFT=5 81CONFIG_MIPS_L1_CACHE_SHIFT=5
75CONFIG_HAVE_STD_PC_SERIAL_PORT=y
76 82
77# 83#
78# CPU selection 84# CPU selection
79# 85#
80CONFIG_CPU_LOONGSON2=y 86CONFIG_CPU_LOONGSON2E=y
81# CONFIG_CPU_MIPS32_R1 is not set 87# CONFIG_CPU_MIPS32_R1 is not set
82# CONFIG_CPU_MIPS32_R2 is not set 88# CONFIG_CPU_MIPS32_R2 is not set
83# CONFIG_CPU_MIPS64_R1 is not set 89# CONFIG_CPU_MIPS64_R1 is not set
@@ -98,7 +104,9 @@ CONFIG_CPU_LOONGSON2=y
98# CONFIG_CPU_RM7000 is not set 104# CONFIG_CPU_RM7000 is not set
99# CONFIG_CPU_RM9000 is not set 105# CONFIG_CPU_RM9000 is not set
100# CONFIG_CPU_SB1 is not set 106# CONFIG_CPU_SB1 is not set
101CONFIG_SYS_HAS_CPU_LOONGSON2=y 107# CONFIG_CPU_CAVIUM_OCTEON is not set
108CONFIG_CPU_LOONGSON2=y
109CONFIG_SYS_HAS_CPU_LOONGSON2E=y
102CONFIG_SYS_SUPPORTS_32BIT_KERNEL=y 110CONFIG_SYS_SUPPORTS_32BIT_KERNEL=y
103CONFIG_SYS_SUPPORTS_64BIT_KERNEL=y 111CONFIG_SYS_SUPPORTS_64BIT_KERNEL=y
104CONFIG_CPU_SUPPORTS_32BIT_KERNEL=y 112CONFIG_CPU_SUPPORTS_32BIT_KERNEL=y
@@ -112,6 +120,7 @@ CONFIG_64BIT=y
112# CONFIG_PAGE_SIZE_4KB is not set 120# CONFIG_PAGE_SIZE_4KB is not set
113# CONFIG_PAGE_SIZE_8KB is not set 121# CONFIG_PAGE_SIZE_8KB is not set
114CONFIG_PAGE_SIZE_16KB=y 122CONFIG_PAGE_SIZE_16KB=y
123# CONFIG_PAGE_SIZE_32KB is not set
115# CONFIG_PAGE_SIZE_64KB is not set 124# CONFIG_PAGE_SIZE_64KB is not set
116CONFIG_BOARD_SCACHE=y 125CONFIG_BOARD_SCACHE=y
117CONFIG_MIPS_MT_DISABLED=y 126CONFIG_MIPS_MT_DISABLED=y
@@ -125,7 +134,6 @@ CONFIG_CPU_SUPPORTS_HIGHMEM=y
125CONFIG_SYS_SUPPORTS_HIGHMEM=y 134CONFIG_SYS_SUPPORTS_HIGHMEM=y
126CONFIG_ARCH_FLATMEM_ENABLE=y 135CONFIG_ARCH_FLATMEM_ENABLE=y
127CONFIG_ARCH_POPULATES_NODE_MAP=y 136CONFIG_ARCH_POPULATES_NODE_MAP=y
128CONFIG_ARCH_SPARSEMEM_ENABLE=y
129CONFIG_SELECT_MEMORY_MODEL=y 137CONFIG_SELECT_MEMORY_MODEL=y
130CONFIG_FLATMEM_MANUAL=y 138CONFIG_FLATMEM_MANUAL=y
131# CONFIG_DISCONTIGMEM_MANUAL is not set 139# CONFIG_DISCONTIGMEM_MANUAL is not set
@@ -135,11 +143,12 @@ CONFIG_FLAT_NODE_MEM_MAP=y
135CONFIG_SPARSEMEM_STATIC=y 143CONFIG_SPARSEMEM_STATIC=y
136CONFIG_PAGEFLAGS_EXTENDED=y 144CONFIG_PAGEFLAGS_EXTENDED=y
137CONFIG_SPLIT_PTLOCK_CPUS=4 145CONFIG_SPLIT_PTLOCK_CPUS=4
138CONFIG_RESOURCES_64BIT=y
139CONFIG_PHYS_ADDR_T_64BIT=y 146CONFIG_PHYS_ADDR_T_64BIT=y
140CONFIG_ZONE_DMA_FLAG=0 147CONFIG_ZONE_DMA_FLAG=0
141CONFIG_VIRT_TO_BUS=y 148CONFIG_VIRT_TO_BUS=y
142CONFIG_UNEVICTABLE_LRU=y 149CONFIG_HAVE_MLOCK=y
150CONFIG_HAVE_MLOCKED_PAGE_BIT=y
151CONFIG_DEFAULT_MMAP_MIN_ADDR=4096
143CONFIG_TICK_ONESHOT=y 152CONFIG_TICK_ONESHOT=y
144CONFIG_NO_HZ=y 153CONFIG_NO_HZ=y
145CONFIG_HIGH_RES_TIMERS=y 154CONFIG_HIGH_RES_TIMERS=y
@@ -161,6 +170,7 @@ CONFIG_SECCOMP=y
161CONFIG_LOCKDEP_SUPPORT=y 170CONFIG_LOCKDEP_SUPPORT=y
162CONFIG_STACKTRACE_SUPPORT=y 171CONFIG_STACKTRACE_SUPPORT=y
163CONFIG_DEFCONFIG_LIST="/lib/modules/$UNAME_RELEASE/.config" 172CONFIG_DEFCONFIG_LIST="/lib/modules/$UNAME_RELEASE/.config"
173CONFIG_CONSTRUCTORS=y
164 174
165# 175#
166# General setup 176# General setup
@@ -168,21 +178,31 @@ CONFIG_DEFCONFIG_LIST="/lib/modules/$UNAME_RELEASE/.config"
168CONFIG_EXPERIMENTAL=y 178CONFIG_EXPERIMENTAL=y
169CONFIG_BROKEN_ON_SMP=y 179CONFIG_BROKEN_ON_SMP=y
170CONFIG_INIT_ENV_ARG_LIMIT=32 180CONFIG_INIT_ENV_ARG_LIMIT=32
171CONFIG_LOCALVERSION="lm32" 181CONFIG_LOCALVERSION="-fuloong2e"
172# CONFIG_LOCALVERSION_AUTO is not set 182# CONFIG_LOCALVERSION_AUTO is not set
173CONFIG_SWAP=y 183CONFIG_SWAP=y
174CONFIG_SYSVIPC=y 184CONFIG_SYSVIPC=y
175CONFIG_SYSVIPC_SYSCTL=y 185CONFIG_SYSVIPC_SYSCTL=y
176CONFIG_POSIX_MQUEUE=y 186CONFIG_POSIX_MQUEUE=y
187CONFIG_POSIX_MQUEUE_SYSCTL=y
177CONFIG_BSD_PROCESS_ACCT=y 188CONFIG_BSD_PROCESS_ACCT=y
178# CONFIG_BSD_PROCESS_ACCT_V3 is not set 189# CONFIG_BSD_PROCESS_ACCT_V3 is not set
179# CONFIG_TASKSTATS is not set 190# CONFIG_TASKSTATS is not set
180# CONFIG_AUDIT is not set 191# CONFIG_AUDIT is not set
192
193#
194# RCU Subsystem
195#
196CONFIG_CLASSIC_RCU=y
197# CONFIG_TREE_RCU is not set
198# CONFIG_PREEMPT_RCU is not set
199# CONFIG_TREE_RCU_TRACE is not set
200# CONFIG_PREEMPT_RCU_TRACE is not set
181CONFIG_IKCONFIG=y 201CONFIG_IKCONFIG=y
182CONFIG_IKCONFIG_PROC=y 202CONFIG_IKCONFIG_PROC=y
183CONFIG_LOG_BUF_SHIFT=14 203CONFIG_LOG_BUF_SHIFT=14
184# CONFIG_CGROUPS is not set
185# CONFIG_GROUP_SCHED is not set 204# CONFIG_GROUP_SCHED is not set
205# CONFIG_CGROUPS is not set
186CONFIG_SYSFS_DEPRECATED=y 206CONFIG_SYSFS_DEPRECATED=y
187CONFIG_SYSFS_DEPRECATED_V2=y 207CONFIG_SYSFS_DEPRECATED_V2=y
188# CONFIG_RELAY is not set 208# CONFIG_RELAY is not set
@@ -191,9 +211,11 @@ CONFIG_NAMESPACES=y
191# CONFIG_IPC_NS is not set 211# CONFIG_IPC_NS is not set
192CONFIG_USER_NS=y 212CONFIG_USER_NS=y
193CONFIG_PID_NS=y 213CONFIG_PID_NS=y
214# CONFIG_NET_NS is not set
194# CONFIG_BLK_DEV_INITRD is not set 215# CONFIG_BLK_DEV_INITRD is not set
195# CONFIG_CC_OPTIMIZE_FOR_SIZE is not set 216# CONFIG_CC_OPTIMIZE_FOR_SIZE is not set
196CONFIG_SYSCTL=y 217CONFIG_SYSCTL=y
218CONFIG_ANON_INODES=y
197CONFIG_EMBEDDED=y 219CONFIG_EMBEDDED=y
198CONFIG_SYSCTL_SYSCALL=y 220CONFIG_SYSCTL_SYSCALL=y
199CONFIG_KALLSYMS=y 221CONFIG_KALLSYMS=y
@@ -203,29 +225,40 @@ CONFIG_PRINTK=y
203CONFIG_BUG=y 225CONFIG_BUG=y
204CONFIG_ELF_CORE=y 226CONFIG_ELF_CORE=y
205# CONFIG_PCSPKR_PLATFORM is not set 227# CONFIG_PCSPKR_PLATFORM is not set
206# CONFIG_COMPAT_BRK is not set
207CONFIG_BASE_FULL=y 228CONFIG_BASE_FULL=y
208CONFIG_FUTEX=y 229CONFIG_FUTEX=y
209CONFIG_ANON_INODES=y
210CONFIG_EPOLL=y 230CONFIG_EPOLL=y
211CONFIG_SIGNALFD=y 231CONFIG_SIGNALFD=y
212CONFIG_TIMERFD=y 232CONFIG_TIMERFD=y
213CONFIG_EVENTFD=y 233CONFIG_EVENTFD=y
214CONFIG_SHMEM=y 234CONFIG_SHMEM=y
215CONFIG_AIO=y 235CONFIG_AIO=y
236
237#
238# Performance Counters
239#
216CONFIG_VM_EVENT_COUNTERS=y 240CONFIG_VM_EVENT_COUNTERS=y
217CONFIG_PCI_QUIRKS=y 241CONFIG_PCI_QUIRKS=y
242# CONFIG_STRIP_ASM_SYMS is not set
243# CONFIG_COMPAT_BRK is not set
218CONFIG_SLAB=y 244CONFIG_SLAB=y
219# CONFIG_SLUB is not set 245# CONFIG_SLUB is not set
220# CONFIG_SLOB is not set 246# CONFIG_SLOB is not set
221CONFIG_PROFILING=y 247CONFIG_PROFILING=y
222# CONFIG_MARKERS is not set 248CONFIG_TRACEPOINTS=y
249CONFIG_MARKERS=y
223CONFIG_OPROFILE=m 250CONFIG_OPROFILE=m
224CONFIG_HAVE_OPROFILE=y 251CONFIG_HAVE_OPROFILE=y
252CONFIG_HAVE_SYSCALL_WRAPPERS=y
253
254#
255# GCOV-based kernel profiling
256#
257# CONFIG_GCOV_KERNEL is not set
258# CONFIG_SLOW_WORK is not set
225# CONFIG_HAVE_GENERIC_DMA_COHERENT is not set 259# CONFIG_HAVE_GENERIC_DMA_COHERENT is not set
226CONFIG_SLABINFO=y 260CONFIG_SLABINFO=y
227CONFIG_RT_MUTEXES=y 261CONFIG_RT_MUTEXES=y
228# CONFIG_TINY_SHMEM is not set
229CONFIG_BASE_SMALL=0 262CONFIG_BASE_SMALL=0
230CONFIG_MODULES=y 263CONFIG_MODULES=y
231# CONFIG_MODULE_FORCE_LOAD is not set 264# CONFIG_MODULE_FORCE_LOAD is not set
@@ -233,9 +266,7 @@ CONFIG_MODULE_UNLOAD=y
233CONFIG_MODULE_FORCE_UNLOAD=y 266CONFIG_MODULE_FORCE_UNLOAD=y
234# CONFIG_MODVERSIONS is not set 267# CONFIG_MODVERSIONS is not set
235# CONFIG_MODULE_SRCVERSION_ALL is not set 268# CONFIG_MODULE_SRCVERSION_ALL is not set
236CONFIG_KMOD=y
237CONFIG_BLOCK=y 269CONFIG_BLOCK=y
238# CONFIG_BLK_DEV_IO_TRACE is not set
239CONFIG_BLK_DEV_BSG=y 270CONFIG_BLK_DEV_BSG=y
240# CONFIG_BLK_DEV_INTEGRITY is not set 271# CONFIG_BLK_DEV_INTEGRITY is not set
241CONFIG_BLOCK_COMPAT=y 272CONFIG_BLOCK_COMPAT=y
@@ -252,8 +283,7 @@ CONFIG_IOSCHED_CFQ=y
252CONFIG_DEFAULT_CFQ=y 283CONFIG_DEFAULT_CFQ=y
253# CONFIG_DEFAULT_NOOP is not set 284# CONFIG_DEFAULT_NOOP is not set
254CONFIG_DEFAULT_IOSCHED="cfq" 285CONFIG_DEFAULT_IOSCHED="cfq"
255CONFIG_CLASSIC_RCU=y 286# CONFIG_FREEZER is not set
256CONFIG_FREEZER=y
257 287
258# 288#
259# Bus options (PCI, PCMCIA, EISA, ISA, TC) 289# Bus options (PCI, PCMCIA, EISA, ISA, TC)
@@ -263,6 +293,8 @@ CONFIG_PCI=y
263CONFIG_PCI_DOMAINS=y 293CONFIG_PCI_DOMAINS=y
264# CONFIG_ARCH_SUPPORTS_MSI is not set 294# CONFIG_ARCH_SUPPORTS_MSI is not set
265CONFIG_PCI_LEGACY=y 295CONFIG_PCI_LEGACY=y
296# CONFIG_PCI_STUB is not set
297# CONFIG_PCI_IOV is not set
266CONFIG_ISA=y 298CONFIG_ISA=y
267CONFIG_MMU=y 299CONFIG_MMU=y
268# CONFIG_PCCARD is not set 300# CONFIG_PCCARD is not set
@@ -285,12 +317,12 @@ CONFIG_BINFMT_ELF32=y
285# 317#
286# Power management options 318# Power management options
287# 319#
320CONFIG_ARCH_HIBERNATION_POSSIBLE=y
288CONFIG_ARCH_SUSPEND_POSSIBLE=y 321CONFIG_ARCH_SUSPEND_POSSIBLE=y
289CONFIG_PM=y 322CONFIG_PM=y
290# CONFIG_PM_DEBUG is not set 323# CONFIG_PM_DEBUG is not set
291CONFIG_PM_SLEEP=y 324# CONFIG_SUSPEND is not set
292CONFIG_SUSPEND=y 325# CONFIG_HIBERNATION is not set
293CONFIG_SUSPEND_FREEZER=y
294CONFIG_NET=y 326CONFIG_NET=y
295 327
296# 328#
@@ -346,9 +378,11 @@ CONFIG_NETFILTER_NETLINK=m
346CONFIG_NETFILTER_NETLINK_QUEUE=m 378CONFIG_NETFILTER_NETLINK_QUEUE=m
347CONFIG_NETFILTER_NETLINK_LOG=m 379CONFIG_NETFILTER_NETLINK_LOG=m
348# CONFIG_NF_CONNTRACK is not set 380# CONFIG_NF_CONNTRACK is not set
381# CONFIG_NETFILTER_TPROXY is not set
349CONFIG_NETFILTER_XTABLES=m 382CONFIG_NETFILTER_XTABLES=m
350CONFIG_NETFILTER_XT_TARGET_CLASSIFY=m 383CONFIG_NETFILTER_XT_TARGET_CLASSIFY=m
351# CONFIG_NETFILTER_XT_TARGET_DSCP is not set 384# CONFIG_NETFILTER_XT_TARGET_DSCP is not set
385CONFIG_NETFILTER_XT_TARGET_HL=m
352CONFIG_NETFILTER_XT_TARGET_MARK=m 386CONFIG_NETFILTER_XT_TARGET_MARK=m
353# CONFIG_NETFILTER_XT_TARGET_NFLOG is not set 387# CONFIG_NETFILTER_XT_TARGET_NFLOG is not set
354CONFIG_NETFILTER_XT_TARGET_NFQUEUE=m 388CONFIG_NETFILTER_XT_TARGET_NFQUEUE=m
@@ -361,6 +395,7 @@ CONFIG_NETFILTER_XT_MATCH_DCCP=m
361# CONFIG_NETFILTER_XT_MATCH_DSCP is not set 395# CONFIG_NETFILTER_XT_MATCH_DSCP is not set
362CONFIG_NETFILTER_XT_MATCH_ESP=m 396CONFIG_NETFILTER_XT_MATCH_ESP=m
363# CONFIG_NETFILTER_XT_MATCH_HASHLIMIT is not set 397# CONFIG_NETFILTER_XT_MATCH_HASHLIMIT is not set
398CONFIG_NETFILTER_XT_MATCH_HL=m
364CONFIG_NETFILTER_XT_MATCH_IPRANGE=m 399CONFIG_NETFILTER_XT_MATCH_IPRANGE=m
365CONFIG_NETFILTER_XT_MATCH_LENGTH=m 400CONFIG_NETFILTER_XT_MATCH_LENGTH=m
366CONFIG_NETFILTER_XT_MATCH_LIMIT=m 401CONFIG_NETFILTER_XT_MATCH_LIMIT=m
@@ -381,6 +416,7 @@ CONFIG_NETFILTER_XT_MATCH_STRING=m
381CONFIG_NETFILTER_XT_MATCH_TCPMSS=m 416CONFIG_NETFILTER_XT_MATCH_TCPMSS=m
382CONFIG_NETFILTER_XT_MATCH_TIME=m 417CONFIG_NETFILTER_XT_MATCH_TIME=m
383CONFIG_NETFILTER_XT_MATCH_U32=m 418CONFIG_NETFILTER_XT_MATCH_U32=m
419# CONFIG_NETFILTER_XT_MATCH_OSF is not set
384# CONFIG_IP_VS is not set 420# CONFIG_IP_VS is not set
385 421
386# 422#
@@ -419,30 +455,34 @@ CONFIG_IP_NF_ARP_MANGLE=m
419# CONFIG_LAPB is not set 455# CONFIG_LAPB is not set
420# CONFIG_ECONET is not set 456# CONFIG_ECONET is not set
421# CONFIG_WAN_ROUTER is not set 457# CONFIG_WAN_ROUTER is not set
458CONFIG_PHONET=m
459# CONFIG_IEEE802154 is not set
422# CONFIG_NET_SCHED is not set 460# CONFIG_NET_SCHED is not set
423CONFIG_NET_CLS_ROUTE=y 461CONFIG_NET_CLS_ROUTE=y
462# CONFIG_DCB is not set
424 463
425# 464#
426# Network testing 465# Network testing
427# 466#
428# CONFIG_NET_PKTGEN is not set 467# CONFIG_NET_PKTGEN is not set
468# CONFIG_NET_DROP_MONITOR is not set
429# CONFIG_HAMRADIO is not set 469# CONFIG_HAMRADIO is not set
430# CONFIG_CAN is not set 470# CONFIG_CAN is not set
431# CONFIG_IRDA is not set 471# CONFIG_IRDA is not set
432# CONFIG_BT is not set 472# CONFIG_BT is not set
433# CONFIG_AF_RXRPC is not set 473# CONFIG_AF_RXRPC is not set
434CONFIG_PHONET=m
435CONFIG_WIRELESS=y 474CONFIG_WIRELESS=y
436# CONFIG_CFG80211 is not set 475# CONFIG_CFG80211 is not set
437CONFIG_WIRELESS_OLD_REGULATORY=y 476CONFIG_WIRELESS_OLD_REGULATORY=y
438CONFIG_WIRELESS_EXT=y 477CONFIG_WIRELESS_EXT=y
439CONFIG_WIRELESS_EXT_SYSFS=y 478CONFIG_WIRELESS_EXT_SYSFS=y
440# CONFIG_MAC80211 is not set 479# CONFIG_LIB80211 is not set
441CONFIG_IEEE80211=m 480
442# CONFIG_IEEE80211_DEBUG is not set 481#
443CONFIG_IEEE80211_CRYPT_WEP=m 482# CFG80211 needs to be enabled for MAC80211
444# CONFIG_IEEE80211_CRYPT_CCMP is not set 483#
445# CONFIG_IEEE80211_CRYPT_TKIP is not set 484CONFIG_MAC80211_DEFAULT_PS_VALUE=0
485# CONFIG_WIMAX is not set
446# CONFIG_RFKILL is not set 486# CONFIG_RFKILL is not set
447CONFIG_NET_9P=m 487CONFIG_NET_9P=m
448# CONFIG_NET_9P_DEBUG is not set 488# CONFIG_NET_9P_DEBUG is not set
@@ -466,6 +506,7 @@ CONFIG_MTD=m
466# CONFIG_MTD_DEBUG is not set 506# CONFIG_MTD_DEBUG is not set
467# CONFIG_MTD_CONCAT is not set 507# CONFIG_MTD_CONCAT is not set
468# CONFIG_MTD_PARTITIONS is not set 508# CONFIG_MTD_PARTITIONS is not set
509# CONFIG_MTD_TESTS is not set
469 510
470# 511#
471# User Modules And Translation Layers 512# User Modules And Translation Layers
@@ -516,9 +557,7 @@ CONFIG_MTD_CFI_UTIL=m
516# 557#
517# CONFIG_MTD_COMPLEX_MAPPINGS is not set 558# CONFIG_MTD_COMPLEX_MAPPINGS is not set
518CONFIG_MTD_PHYSMAP=m 559CONFIG_MTD_PHYSMAP=m
519CONFIG_MTD_PHYSMAP_START=0x1fc00000 560# CONFIG_MTD_PHYSMAP_COMPAT is not set
520CONFIG_MTD_PHYSMAP_LEN=0x80000
521CONFIG_MTD_PHYSMAP_BANKWIDTH=1
522# CONFIG_MTD_INTEL_VR_NOR is not set 561# CONFIG_MTD_INTEL_VR_NOR is not set
523# CONFIG_MTD_PLATRAM is not set 562# CONFIG_MTD_PLATRAM is not set
524 563
@@ -541,6 +580,11 @@ CONFIG_MTD_PHYSMAP_BANKWIDTH=1
541# CONFIG_MTD_ONENAND is not set 580# CONFIG_MTD_ONENAND is not set
542 581
543# 582#
583# LPDDR flash memory drivers
584#
585# CONFIG_MTD_LPDDR is not set
586
587#
544# UBI - Unsorted block images 588# UBI - Unsorted block images
545# 589#
546# CONFIG_MTD_UBI is not set 590# CONFIG_MTD_UBI is not set
@@ -573,6 +617,7 @@ CONFIG_IDE=y
573# 617#
574# Please see Documentation/ide/ide.txt for help/info on IDE drives 618# Please see Documentation/ide/ide.txt for help/info on IDE drives
575# 619#
620CONFIG_IDE_XFER_MODE=y
576CONFIG_IDE_TIMINGS=y 621CONFIG_IDE_TIMINGS=y
577CONFIG_IDE_ATAPI=y 622CONFIG_IDE_ATAPI=y
578# CONFIG_BLK_DEV_IDE_SATA is not set 623# CONFIG_BLK_DEV_IDE_SATA is not set
@@ -582,7 +627,6 @@ CONFIG_IDE_GD_ATA=y
582CONFIG_BLK_DEV_IDECD=y 627CONFIG_BLK_DEV_IDECD=y
583CONFIG_BLK_DEV_IDECD_VERBOSE_ERRORS=y 628CONFIG_BLK_DEV_IDECD_VERBOSE_ERRORS=y
584# CONFIG_BLK_DEV_IDETAPE is not set 629# CONFIG_BLK_DEV_IDETAPE is not set
585CONFIG_BLK_DEV_IDESCSI=y
586CONFIG_IDE_TASK_IOCTL=y 630CONFIG_IDE_TASK_IOCTL=y
587CONFIG_IDE_PROC_FS=y 631CONFIG_IDE_PROC_FS=y
588 632
@@ -613,6 +657,7 @@ CONFIG_BLK_DEV_IDEDMA_PCI=y
613# CONFIG_BLK_DEV_JMICRON is not set 657# CONFIG_BLK_DEV_JMICRON is not set
614# CONFIG_BLK_DEV_SC1200 is not set 658# CONFIG_BLK_DEV_SC1200 is not set
615# CONFIG_BLK_DEV_PIIX is not set 659# CONFIG_BLK_DEV_PIIX is not set
660# CONFIG_BLK_DEV_IT8172 is not set
616# CONFIG_BLK_DEV_IT8213 is not set 661# CONFIG_BLK_DEV_IT8213 is not set
617# CONFIG_BLK_DEV_IT821X is not set 662# CONFIG_BLK_DEV_IT821X is not set
618# CONFIG_BLK_DEV_NS87415 is not set 663# CONFIG_BLK_DEV_NS87415 is not set
@@ -660,10 +705,6 @@ CONFIG_BLK_DEV_SR=y
660CONFIG_BLK_DEV_SR_VENDOR=y 705CONFIG_BLK_DEV_SR_VENDOR=y
661CONFIG_CHR_DEV_SG=y 706CONFIG_CHR_DEV_SG=y
662# CONFIG_CHR_DEV_SCH is not set 707# CONFIG_CHR_DEV_SCH is not set
663
664#
665# Some SCSI devices (e.g. CD jukebox) support multiple LUNs
666#
667# CONFIG_SCSI_MULTI_LUN is not set 708# CONFIG_SCSI_MULTI_LUN is not set
668CONFIG_SCSI_CONSTANTS=y 709CONFIG_SCSI_CONSTANTS=y
669# CONFIG_SCSI_LOGGING is not set 710# CONFIG_SCSI_LOGGING is not set
@@ -681,6 +722,7 @@ CONFIG_SCSI_WAIT_SCAN=m
681# CONFIG_SCSI_SRP_ATTRS is not set 722# CONFIG_SCSI_SRP_ATTRS is not set
682# CONFIG_SCSI_LOWLEVEL is not set 723# CONFIG_SCSI_LOWLEVEL is not set
683# CONFIG_SCSI_DH is not set 724# CONFIG_SCSI_DH is not set
725# CONFIG_SCSI_OSD_INITIATOR is not set
684# CONFIG_ATA is not set 726# CONFIG_ATA is not set
685# CONFIG_MD is not set 727# CONFIG_MD is not set
686# CONFIG_FUSION is not set 728# CONFIG_FUSION is not set
@@ -690,7 +732,11 @@ CONFIG_SCSI_WAIT_SCAN=m
690# 732#
691 733
692# 734#
693# Enable only one of the two stacks, unless you know what you are doing 735# You can enable one or both FireWire driver stacks.
736#
737
738#
739# See the help texts for more information.
694# 740#
695# CONFIG_FIREWIRE is not set 741# CONFIG_FIREWIRE is not set
696# CONFIG_IEEE1394 is not set 742# CONFIG_IEEE1394 is not set
@@ -718,6 +764,9 @@ CONFIG_CICADA_PHY=m
718# CONFIG_BROADCOM_PHY is not set 764# CONFIG_BROADCOM_PHY is not set
719# CONFIG_ICPLUS_PHY is not set 765# CONFIG_ICPLUS_PHY is not set
720# CONFIG_REALTEK_PHY is not set 766# CONFIG_REALTEK_PHY is not set
767# CONFIG_NATIONAL_PHY is not set
768# CONFIG_STE10XP is not set
769# CONFIG_LSI_ET1011C_PHY is not set
721# CONFIG_MDIO_BITBANG is not set 770# CONFIG_MDIO_BITBANG is not set
722CONFIG_NET_ETHERNET=y 771CONFIG_NET_ETHERNET=y
723CONFIG_MII=y 772CONFIG_MII=y
@@ -729,7 +778,9 @@ CONFIG_MII=y
729# CONFIG_NET_VENDOR_SMC is not set 778# CONFIG_NET_VENDOR_SMC is not set
730# CONFIG_SMC91X is not set 779# CONFIG_SMC91X is not set
731# CONFIG_DM9000 is not set 780# CONFIG_DM9000 is not set
781# CONFIG_ETHOC is not set
732# CONFIG_NET_VENDOR_RACAL is not set 782# CONFIG_NET_VENDOR_RACAL is not set
783# CONFIG_DNET is not set
733# CONFIG_NET_TULIP is not set 784# CONFIG_NET_TULIP is not set
734# CONFIG_AT1700 is not set 785# CONFIG_AT1700 is not set
735# CONFIG_DEPCA is not set 786# CONFIG_DEPCA is not set
@@ -752,7 +803,6 @@ CONFIG_NET_PCI=y
752# CONFIG_FORCEDETH is not set 803# CONFIG_FORCEDETH is not set
753# CONFIG_CS89x0 is not set 804# CONFIG_CS89x0 is not set
754# CONFIG_TC35815 is not set 805# CONFIG_TC35815 is not set
755# CONFIG_EEPRO100 is not set
756# CONFIG_E100 is not set 806# CONFIG_E100 is not set
757# CONFIG_FEALNX is not set 807# CONFIG_FEALNX is not set
758# CONFIG_NATSEMI is not set 808# CONFIG_NATSEMI is not set
@@ -766,8 +816,10 @@ CONFIG_8139TOO=y
766# CONFIG_R6040 is not set 816# CONFIG_R6040 is not set
767# CONFIG_SIS900 is not set 817# CONFIG_SIS900 is not set
768# CONFIG_EPIC100 is not set 818# CONFIG_EPIC100 is not set
819# CONFIG_SMSC9420 is not set
769# CONFIG_SUNDANCE is not set 820# CONFIG_SUNDANCE is not set
770# CONFIG_TLAN is not set 821# CONFIG_TLAN is not set
822# CONFIG_KS8842 is not set
771# CONFIG_VIA_RHINE is not set 823# CONFIG_VIA_RHINE is not set
772# CONFIG_SC92031 is not set 824# CONFIG_SC92031 is not set
773# CONFIG_ATL2 is not set 825# CONFIG_ATL2 is not set
@@ -778,6 +830,7 @@ CONFIG_NETDEV_1000=y
778# CONFIG_E1000E is not set 830# CONFIG_E1000E is not set
779# CONFIG_IP1000 is not set 831# CONFIG_IP1000 is not set
780# CONFIG_IGB is not set 832# CONFIG_IGB is not set
833# CONFIG_IGBVF is not set
781# CONFIG_NS83820 is not set 834# CONFIG_NS83820 is not set
782# CONFIG_HAMACHI is not set 835# CONFIG_HAMACHI is not set
783# CONFIG_YELLOWFIN is not set 836# CONFIG_YELLOWFIN is not set
@@ -788,17 +841,21 @@ CONFIG_NETDEV_1000=y
788# CONFIG_VIA_VELOCITY is not set 841# CONFIG_VIA_VELOCITY is not set
789# CONFIG_TIGON3 is not set 842# CONFIG_TIGON3 is not set
790# CONFIG_BNX2 is not set 843# CONFIG_BNX2 is not set
844# CONFIG_CNIC is not set
791# CONFIG_QLA3XXX is not set 845# CONFIG_QLA3XXX is not set
792# CONFIG_ATL1 is not set 846# CONFIG_ATL1 is not set
793# CONFIG_ATL1E is not set 847# CONFIG_ATL1E is not set
848# CONFIG_ATL1C is not set
794# CONFIG_JME is not set 849# CONFIG_JME is not set
795CONFIG_NETDEV_10000=y 850CONFIG_NETDEV_10000=y
796# CONFIG_CHELSIO_T1 is not set 851# CONFIG_CHELSIO_T1 is not set
852CONFIG_CHELSIO_T3_DEPENDS=y
797# CONFIG_CHELSIO_T3 is not set 853# CONFIG_CHELSIO_T3 is not set
798# CONFIG_ENIC is not set 854# CONFIG_ENIC is not set
799# CONFIG_IXGBE is not set 855# CONFIG_IXGBE is not set
800# CONFIG_IXGB is not set 856# CONFIG_IXGB is not set
801# CONFIG_S2IO is not set 857# CONFIG_S2IO is not set
858# CONFIG_VXGE is not set
802# CONFIG_MYRI10GE is not set 859# CONFIG_MYRI10GE is not set
803# CONFIG_NETXEN_NIC is not set 860# CONFIG_NETXEN_NIC is not set
804# CONFIG_NIU is not set 861# CONFIG_NIU is not set
@@ -808,6 +865,7 @@ CONFIG_NETDEV_10000=y
808# CONFIG_BNX2X is not set 865# CONFIG_BNX2X is not set
809# CONFIG_QLGE is not set 866# CONFIG_QLGE is not set
810# CONFIG_SFC is not set 867# CONFIG_SFC is not set
868# CONFIG_BE2NET is not set
811# CONFIG_TR is not set 869# CONFIG_TR is not set
812 870
813# 871#
@@ -815,7 +873,10 @@ CONFIG_NETDEV_10000=y
815# 873#
816# CONFIG_WLAN_PRE80211 is not set 874# CONFIG_WLAN_PRE80211 is not set
817# CONFIG_WLAN_80211 is not set 875# CONFIG_WLAN_80211 is not set
818# CONFIG_IWLWIFI_LEDS is not set 876
877#
878# Enable WiMAX (Networking options) to see the WiMAX drivers
879#
819 880
820# 881#
821# USB Network Adapters 882# USB Network Adapters
@@ -872,7 +933,7 @@ CONFIG_INPUT_MOUSEDEV_SCREEN_Y=768
872# Input Device Drivers 933# Input Device Drivers
873# 934#
874CONFIG_INPUT_KEYBOARD=y 935CONFIG_INPUT_KEYBOARD=y
875CONFIG_KEYBOARD_ATKBD=m 936CONFIG_KEYBOARD_ATKBD=y
876# CONFIG_KEYBOARD_SUNKBD is not set 937# CONFIG_KEYBOARD_SUNKBD is not set
877# CONFIG_KEYBOARD_LKKBD is not set 938# CONFIG_KEYBOARD_LKKBD is not set
878# CONFIG_KEYBOARD_XTKBD is not set 939# CONFIG_KEYBOARD_XTKBD is not set
@@ -883,7 +944,6 @@ CONFIG_MOUSE_PS2=y
883CONFIG_MOUSE_PS2_ALPS=y 944CONFIG_MOUSE_PS2_ALPS=y
884CONFIG_MOUSE_PS2_LOGIPS2PP=y 945CONFIG_MOUSE_PS2_LOGIPS2PP=y
885CONFIG_MOUSE_PS2_SYNAPTICS=y 946CONFIG_MOUSE_PS2_SYNAPTICS=y
886CONFIG_MOUSE_PS2_LIFEBOOK=y
887CONFIG_MOUSE_PS2_TRACKPOINT=y 947CONFIG_MOUSE_PS2_TRACKPOINT=y
888# CONFIG_MOUSE_PS2_ELANTECH is not set 948# CONFIG_MOUSE_PS2_ELANTECH is not set
889# CONFIG_MOUSE_PS2_TOUCHKIT is not set 949# CONFIG_MOUSE_PS2_TOUCHKIT is not set
@@ -894,6 +954,7 @@ CONFIG_MOUSE_SERIAL=y
894# CONFIG_MOUSE_LOGIBM is not set 954# CONFIG_MOUSE_LOGIBM is not set
895# CONFIG_MOUSE_PC110PAD is not set 955# CONFIG_MOUSE_PC110PAD is not set
896# CONFIG_MOUSE_VSXXXAA is not set 956# CONFIG_MOUSE_VSXXXAA is not set
957# CONFIG_MOUSE_SYNAPTICS_I2C is not set
897# CONFIG_INPUT_JOYSTICK is not set 958# CONFIG_INPUT_JOYSTICK is not set
898# CONFIG_INPUT_TABLET is not set 959# CONFIG_INPUT_TABLET is not set
899# CONFIG_INPUT_TOUCHSCREEN is not set 960# CONFIG_INPUT_TOUCHSCREEN is not set
@@ -939,10 +1000,13 @@ CONFIG_SERIAL_CORE=y
939CONFIG_SERIAL_CORE_CONSOLE=y 1000CONFIG_SERIAL_CORE_CONSOLE=y
940# CONFIG_SERIAL_JSM is not set 1001# CONFIG_SERIAL_JSM is not set
941CONFIG_UNIX98_PTYS=y 1002CONFIG_UNIX98_PTYS=y
1003# CONFIG_DEVPTS_MULTIPLE_INSTANCES is not set
942CONFIG_LEGACY_PTYS=y 1004CONFIG_LEGACY_PTYS=y
943CONFIG_LEGACY_PTY_COUNT=256 1005CONFIG_LEGACY_PTY_COUNT=256
944# CONFIG_IPMI_HANDLER is not set 1006# CONFIG_IPMI_HANDLER is not set
945CONFIG_HW_RANDOM=y 1007CONFIG_HW_RANDOM=y
1008# CONFIG_HW_RANDOM_TIMERIOMEM is not set
1009CONFIG_RTC=y
946# CONFIG_DTLK is not set 1010# CONFIG_DTLK is not set
947# CONFIG_R3964 is not set 1011# CONFIG_R3964 is not set
948# CONFIG_APPLICOM is not set 1012# CONFIG_APPLICOM is not set
@@ -1006,19 +1070,20 @@ CONFIG_I2C_VIAPRO=m
1006# Miscellaneous I2C Chip support 1070# Miscellaneous I2C Chip support
1007# 1071#
1008# CONFIG_DS1682 is not set 1072# CONFIG_DS1682 is not set
1009# CONFIG_EEPROM_AT24 is not set
1010# CONFIG_EEPROM_LEGACY is not set
1011# CONFIG_SENSORS_PCF8574 is not set 1073# CONFIG_SENSORS_PCF8574 is not set
1012# CONFIG_PCF8575 is not set 1074# CONFIG_PCF8575 is not set
1013# CONFIG_SENSORS_PCA9539 is not set 1075# CONFIG_SENSORS_PCA9539 is not set
1014# CONFIG_SENSORS_PCF8591 is not set
1015# CONFIG_SENSORS_MAX6875 is not set
1016# CONFIG_SENSORS_TSL2550 is not set 1076# CONFIG_SENSORS_TSL2550 is not set
1017# CONFIG_I2C_DEBUG_CORE is not set 1077# CONFIG_I2C_DEBUG_CORE is not set
1018# CONFIG_I2C_DEBUG_ALGO is not set 1078# CONFIG_I2C_DEBUG_ALGO is not set
1019# CONFIG_I2C_DEBUG_BUS is not set 1079# CONFIG_I2C_DEBUG_BUS is not set
1020# CONFIG_I2C_DEBUG_CHIP is not set 1080# CONFIG_I2C_DEBUG_CHIP is not set
1021# CONFIG_SPI is not set 1081# CONFIG_SPI is not set
1082
1083#
1084# PPS support
1085#
1086# CONFIG_PPS is not set
1022# CONFIG_W1 is not set 1087# CONFIG_W1 is not set
1023# CONFIG_POWER_SUPPLY is not set 1088# CONFIG_POWER_SUPPLY is not set
1024# CONFIG_HWMON is not set 1089# CONFIG_HWMON is not set
@@ -1041,140 +1106,10 @@ CONFIG_SSB_POSSIBLE=y
1041# CONFIG_MFD_TMIO is not set 1106# CONFIG_MFD_TMIO is not set
1042# CONFIG_MFD_WM8400 is not set 1107# CONFIG_MFD_WM8400 is not set
1043# CONFIG_MFD_WM8350_I2C is not set 1108# CONFIG_MFD_WM8350_I2C is not set
1109# CONFIG_MFD_PCF50633 is not set
1110# CONFIG_AB3100_CORE is not set
1044# CONFIG_REGULATOR is not set 1111# CONFIG_REGULATOR is not set
1045 1112# CONFIG_MEDIA_SUPPORT is not set
1046#
1047# Multimedia devices
1048#
1049
1050#
1051# Multimedia core support
1052#
1053CONFIG_VIDEO_DEV=m
1054CONFIG_VIDEO_V4L2_COMMON=m
1055CONFIG_VIDEO_ALLOW_V4L1=y
1056CONFIG_VIDEO_V4L1_COMPAT=y
1057# CONFIG_DVB_CORE is not set
1058CONFIG_VIDEO_MEDIA=m
1059
1060#
1061# Multimedia drivers
1062#
1063CONFIG_MEDIA_ATTACH=y
1064CONFIG_MEDIA_TUNER=m
1065CONFIG_MEDIA_TUNER_CUSTOMIZE=y
1066CONFIG_MEDIA_TUNER_SIMPLE=m
1067CONFIG_MEDIA_TUNER_TDA8290=m
1068CONFIG_MEDIA_TUNER_TDA827X=m
1069CONFIG_MEDIA_TUNER_TDA18271=m
1070CONFIG_MEDIA_TUNER_TDA9887=m
1071CONFIG_MEDIA_TUNER_TEA5761=m
1072CONFIG_MEDIA_TUNER_TEA5767=m
1073CONFIG_MEDIA_TUNER_MT20XX=m
1074CONFIG_MEDIA_TUNER_MT2060=m
1075CONFIG_MEDIA_TUNER_MT2266=m
1076CONFIG_MEDIA_TUNER_MT2131=m
1077CONFIG_MEDIA_TUNER_QT1010=m
1078CONFIG_MEDIA_TUNER_XC2028=m
1079CONFIG_MEDIA_TUNER_XC5000=m
1080CONFIG_MEDIA_TUNER_MXL5005S=m
1081CONFIG_MEDIA_TUNER_MXL5007T=m
1082CONFIG_VIDEO_V4L2=m
1083CONFIG_VIDEO_V4L1=m
1084CONFIG_VIDEOBUF_GEN=m
1085CONFIG_VIDEOBUF_VMALLOC=m
1086CONFIG_VIDEOBUF_DMA_CONTIG=m
1087CONFIG_VIDEO_CAPTURE_DRIVERS=y
1088# CONFIG_VIDEO_ADV_DEBUG is not set
1089# CONFIG_VIDEO_FIXED_MINOR_RANGES is not set
1090CONFIG_VIDEO_HELPER_CHIPS_AUTO=y
1091# CONFIG_VIDEO_VIVI is not set
1092# CONFIG_VIDEO_BT848 is not set
1093# CONFIG_VIDEO_PMS is not set
1094# CONFIG_VIDEO_CPIA is not set
1095# CONFIG_VIDEO_CPIA2 is not set
1096# CONFIG_VIDEO_SAA5246A is not set
1097# CONFIG_VIDEO_SAA5249 is not set
1098# CONFIG_VIDEO_STRADIS is not set
1099# CONFIG_VIDEO_SAA7134 is not set
1100# CONFIG_VIDEO_MXB is not set
1101# CONFIG_VIDEO_HEXIUM_ORION is not set
1102# CONFIG_VIDEO_HEXIUM_GEMINI is not set
1103# CONFIG_VIDEO_CX88 is not set
1104# CONFIG_VIDEO_IVTV is not set
1105# CONFIG_VIDEO_CAFE_CCIC is not set
1106CONFIG_SOC_CAMERA=m
1107CONFIG_SOC_CAMERA_MT9M001=m
1108CONFIG_SOC_CAMERA_MT9M111=m
1109CONFIG_SOC_CAMERA_MT9V022=m
1110CONFIG_SOC_CAMERA_PLATFORM=m
1111CONFIG_VIDEO_SH_MOBILE_CEU=m
1112CONFIG_V4L_USB_DRIVERS=y
1113CONFIG_USB_VIDEO_CLASS=m
1114CONFIG_USB_VIDEO_CLASS_INPUT_EVDEV=y
1115CONFIG_USB_GSPCA=m
1116CONFIG_USB_M5602=m
1117CONFIG_USB_GSPCA_CONEX=m
1118CONFIG_USB_GSPCA_ETOMS=m
1119CONFIG_USB_GSPCA_FINEPIX=m
1120CONFIG_USB_GSPCA_MARS=m
1121CONFIG_USB_GSPCA_OV519=m
1122CONFIG_USB_GSPCA_PAC207=m
1123CONFIG_USB_GSPCA_PAC7311=m
1124CONFIG_USB_GSPCA_SONIXB=m
1125CONFIG_USB_GSPCA_SONIXJ=m
1126CONFIG_USB_GSPCA_SPCA500=m
1127CONFIG_USB_GSPCA_SPCA501=m
1128CONFIG_USB_GSPCA_SPCA505=m
1129CONFIG_USB_GSPCA_SPCA506=m
1130CONFIG_USB_GSPCA_SPCA508=m
1131CONFIG_USB_GSPCA_SPCA561=m
1132CONFIG_USB_GSPCA_STK014=m
1133CONFIG_USB_GSPCA_SUNPLUS=m
1134CONFIG_USB_GSPCA_T613=m
1135CONFIG_USB_GSPCA_TV8532=m
1136CONFIG_USB_GSPCA_VC032X=m
1137CONFIG_USB_GSPCA_ZC3XX=m
1138# CONFIG_VIDEO_PVRUSB2 is not set
1139# CONFIG_VIDEO_EM28XX is not set
1140# CONFIG_VIDEO_USBVISION is not set
1141CONFIG_VIDEO_USBVIDEO=m
1142CONFIG_USB_VICAM=m
1143CONFIG_USB_IBMCAM=m
1144CONFIG_USB_KONICAWC=m
1145CONFIG_USB_QUICKCAM_MESSENGER=m
1146CONFIG_USB_ET61X251=m
1147# CONFIG_VIDEO_OVCAMCHIP is not set
1148CONFIG_USB_OV511=m
1149CONFIG_USB_SE401=m
1150CONFIG_USB_SN9C102=m
1151CONFIG_USB_STV680=m
1152CONFIG_USB_ZC0301=m
1153CONFIG_USB_PWC=m
1154# CONFIG_USB_PWC_DEBUG is not set
1155# CONFIG_USB_ZR364XX is not set
1156CONFIG_USB_STKWEBCAM=m
1157CONFIG_USB_S2255=m
1158CONFIG_RADIO_ADAPTERS=y
1159# CONFIG_RADIO_CADET is not set
1160# CONFIG_RADIO_RTRACK is not set
1161# CONFIG_RADIO_RTRACK2 is not set
1162# CONFIG_RADIO_AZTECH is not set
1163# CONFIG_RADIO_GEMTEK is not set
1164# CONFIG_RADIO_GEMTEK_PCI is not set
1165# CONFIG_RADIO_MAXIRADIO is not set
1166# CONFIG_RADIO_MAESTRO is not set
1167# CONFIG_RADIO_SF16FMI is not set
1168# CONFIG_RADIO_SF16FMR2 is not set
1169# CONFIG_RADIO_TERRATEC is not set
1170# CONFIG_RADIO_TRUST is not set
1171# CONFIG_RADIO_TYPHOON is not set
1172# CONFIG_RADIO_ZOLTRIX is not set
1173# CONFIG_USB_DSBR is not set
1174CONFIG_USB_SI470X=m
1175CONFIG_USB_MR800=m
1176CONFIG_DAB=y
1177# CONFIG_USB_DABUSB is not set
1178 1113
1179# 1114#
1180# Graphics support 1115# Graphics support
@@ -1235,12 +1170,13 @@ CONFIG_FB_RADEON_BACKLIGHT=y
1235# CONFIG_FB_VIRTUAL is not set 1170# CONFIG_FB_VIRTUAL is not set
1236# CONFIG_FB_METRONOME is not set 1171# CONFIG_FB_METRONOME is not set
1237# CONFIG_FB_MB862XX is not set 1172# CONFIG_FB_MB862XX is not set
1173# CONFIG_FB_BROADSHEET is not set
1238CONFIG_BACKLIGHT_LCD_SUPPORT=y 1174CONFIG_BACKLIGHT_LCD_SUPPORT=y
1239CONFIG_LCD_CLASS_DEVICE=m 1175CONFIG_LCD_CLASS_DEVICE=m
1240# CONFIG_LCD_ILI9320 is not set 1176# CONFIG_LCD_ILI9320 is not set
1241# CONFIG_LCD_PLATFORM is not set 1177# CONFIG_LCD_PLATFORM is not set
1242CONFIG_BACKLIGHT_CLASS_DEVICE=y 1178CONFIG_BACKLIGHT_CLASS_DEVICE=y
1243# CONFIG_BACKLIGHT_CORGI is not set 1179CONFIG_BACKLIGHT_GENERIC=y
1244 1180
1245# 1181#
1246# Display device support 1182# Display device support
@@ -1273,12 +1209,19 @@ CONFIG_SND_MIXER_OSS=m
1273CONFIG_SND_PCM_OSS=m 1209CONFIG_SND_PCM_OSS=m
1274CONFIG_SND_PCM_OSS_PLUGINS=y 1210CONFIG_SND_PCM_OSS_PLUGINS=y
1275CONFIG_SND_SEQUENCER_OSS=y 1211CONFIG_SND_SEQUENCER_OSS=y
1212# CONFIG_SND_HRTIMER is not set
1213# CONFIG_SND_RTCTIMER is not set
1276# CONFIG_SND_DYNAMIC_MINORS is not set 1214# CONFIG_SND_DYNAMIC_MINORS is not set
1277CONFIG_SND_SUPPORT_OLD_API=y 1215CONFIG_SND_SUPPORT_OLD_API=y
1278CONFIG_SND_VERBOSE_PROCFS=y 1216CONFIG_SND_VERBOSE_PROCFS=y
1279# CONFIG_SND_VERBOSE_PRINTK is not set 1217# CONFIG_SND_VERBOSE_PRINTK is not set
1280# CONFIG_SND_DEBUG is not set 1218# CONFIG_SND_DEBUG is not set
1281CONFIG_SND_VMASTER=y 1219CONFIG_SND_VMASTER=y
1220CONFIG_SND_RAWMIDI_SEQ=m
1221# CONFIG_SND_OPL3_LIB_SEQ is not set
1222# CONFIG_SND_OPL4_LIB_SEQ is not set
1223# CONFIG_SND_SBAWE_SEQ is not set
1224# CONFIG_SND_EMU10K1_SEQ is not set
1282CONFIG_SND_MPU401_UART=m 1225CONFIG_SND_MPU401_UART=m
1283CONFIG_SND_AC97_CODEC=m 1226CONFIG_SND_AC97_CODEC=m
1284CONFIG_SND_DRIVERS=y 1227CONFIG_SND_DRIVERS=y
@@ -1305,6 +1248,7 @@ CONFIG_SND_PCI=y
1305# CONFIG_SND_OXYGEN is not set 1248# CONFIG_SND_OXYGEN is not set
1306# CONFIG_SND_CS4281 is not set 1249# CONFIG_SND_CS4281 is not set
1307# CONFIG_SND_CS46XX is not set 1250# CONFIG_SND_CS46XX is not set
1251# CONFIG_SND_CTXFI is not set
1308# CONFIG_SND_DARLA20 is not set 1252# CONFIG_SND_DARLA20 is not set
1309# CONFIG_SND_GINA20 is not set 1253# CONFIG_SND_GINA20 is not set
1310# CONFIG_SND_LAYLA20 is not set 1254# CONFIG_SND_LAYLA20 is not set
@@ -1317,6 +1261,8 @@ CONFIG_SND_PCI=y
1317# CONFIG_SND_INDIGO is not set 1261# CONFIG_SND_INDIGO is not set
1318# CONFIG_SND_INDIGOIO is not set 1262# CONFIG_SND_INDIGOIO is not set
1319# CONFIG_SND_INDIGODJ is not set 1263# CONFIG_SND_INDIGODJ is not set
1264# CONFIG_SND_INDIGOIOX is not set
1265# CONFIG_SND_INDIGODJX is not set
1320# CONFIG_SND_EMU10K1 is not set 1266# CONFIG_SND_EMU10K1 is not set
1321# CONFIG_SND_EMU10K1X is not set 1267# CONFIG_SND_EMU10K1X is not set
1322# CONFIG_SND_ENS1370 is not set 1268# CONFIG_SND_ENS1370 is not set
@@ -1333,6 +1279,7 @@ CONFIG_SND_PCI=y
1333# CONFIG_SND_INTEL8X0 is not set 1279# CONFIG_SND_INTEL8X0 is not set
1334# CONFIG_SND_INTEL8X0M is not set 1280# CONFIG_SND_INTEL8X0M is not set
1335# CONFIG_SND_KORG1212 is not set 1281# CONFIG_SND_KORG1212 is not set
1282# CONFIG_SND_LX6464ES is not set
1336# CONFIG_SND_MAESTRO3 is not set 1283# CONFIG_SND_MAESTRO3 is not set
1337# CONFIG_SND_MIXART is not set 1284# CONFIG_SND_MIXART is not set
1338# CONFIG_SND_NM256 is not set 1285# CONFIG_SND_NM256 is not set
@@ -1363,43 +1310,18 @@ CONFIG_HIDRAW=y
1363# 1310#
1364# USB Input Devices 1311# USB Input Devices
1365# 1312#
1366CONFIG_USB_HID=m 1313# CONFIG_USB_HID is not set
1367CONFIG_HID_PID=y 1314CONFIG_HID_PID=y
1368CONFIG_USB_HIDDEV=y
1369 1315
1370# 1316#
1371# USB HID Boot Protocol drivers 1317# USB HID Boot Protocol drivers
1372# 1318#
1373# CONFIG_USB_KBD is not set 1319CONFIG_USB_KBD=y
1374# CONFIG_USB_MOUSE is not set 1320CONFIG_USB_MOUSE=y
1375 1321
1376# 1322#
1377# Special HID drivers 1323# Special HID drivers
1378# 1324#
1379CONFIG_HID_COMPAT=y
1380CONFIG_HID_A4TECH=m
1381CONFIG_HID_APPLE=m
1382CONFIG_HID_BELKIN=m
1383CONFIG_HID_BRIGHT=m
1384CONFIG_HID_CHERRY=m
1385CONFIG_HID_CHICONY=m
1386CONFIG_HID_CYPRESS=m
1387CONFIG_HID_DELL=m
1388CONFIG_HID_EZKEY=m
1389CONFIG_HID_GYRATION=m
1390CONFIG_HID_LOGITECH=m
1391CONFIG_LOGITECH_FF=y
1392CONFIG_LOGIRUMBLEPAD2_FF=y
1393CONFIG_HID_MICROSOFT=m
1394CONFIG_HID_MONTEREY=m
1395CONFIG_HID_PANTHERLORD=m
1396# CONFIG_PANTHERLORD_FF is not set
1397CONFIG_HID_PETALYNX=m
1398CONFIG_HID_SAMSUNG=m
1399CONFIG_HID_SONY=m
1400CONFIG_HID_SUNPLUS=m
1401# CONFIG_THRUSTMASTER_FF is not set
1402CONFIG_ZEROPLUS_FF=m
1403CONFIG_USB_SUPPORT=y 1325CONFIG_USB_SUPPORT=y
1404CONFIG_USB_ARCH_HAS_HCD=y 1326CONFIG_USB_ARCH_HAS_HCD=y
1405CONFIG_USB_ARCH_HAS_OHCI=y 1327CONFIG_USB_ARCH_HAS_OHCI=y
@@ -1427,9 +1349,11 @@ CONFIG_USB_WUSB_CBAF=m
1427# USB Host Controller Drivers 1349# USB Host Controller Drivers
1428# 1350#
1429CONFIG_USB_C67X00_HCD=m 1351CONFIG_USB_C67X00_HCD=m
1352# CONFIG_USB_XHCI_HCD is not set
1430CONFIG_USB_EHCI_HCD=y 1353CONFIG_USB_EHCI_HCD=y
1431CONFIG_USB_EHCI_ROOT_HUB_TT=y 1354CONFIG_USB_EHCI_ROOT_HUB_TT=y
1432CONFIG_USB_EHCI_TT_NEWSCHED=y 1355CONFIG_USB_EHCI_TT_NEWSCHED=y
1356# CONFIG_USB_OXU210HP_HCD is not set
1433# CONFIG_USB_ISP116X_HCD is not set 1357# CONFIG_USB_ISP116X_HCD is not set
1434CONFIG_USB_ISP1760_HCD=m 1358CONFIG_USB_ISP1760_HCD=m
1435CONFIG_USB_OHCI_HCD=y 1359CONFIG_USB_OHCI_HCD=y
@@ -1451,18 +1375,17 @@ CONFIG_USB_WDM=m
1451CONFIG_USB_TMC=m 1375CONFIG_USB_TMC=m
1452 1376
1453# 1377#
1454# NOTE: USB_STORAGE depends on SCSI but BLK_DEV_SD may also be needed; 1378# NOTE: USB_STORAGE depends on SCSI but BLK_DEV_SD may
1455# 1379#
1456 1380
1457# 1381#
1458# see USB_STORAGE Help for more information 1382# also be needed; see USB_STORAGE Help for more info
1459# 1383#
1460CONFIG_USB_STORAGE=y 1384CONFIG_USB_STORAGE=y
1461# CONFIG_USB_STORAGE_DEBUG is not set 1385# CONFIG_USB_STORAGE_DEBUG is not set
1462# CONFIG_USB_STORAGE_DATAFAB is not set 1386# CONFIG_USB_STORAGE_DATAFAB is not set
1463# CONFIG_USB_STORAGE_FREECOM is not set 1387# CONFIG_USB_STORAGE_FREECOM is not set
1464# CONFIG_USB_STORAGE_ISD200 is not set 1388# CONFIG_USB_STORAGE_ISD200 is not set
1465# CONFIG_USB_STORAGE_DPCM is not set
1466# CONFIG_USB_STORAGE_USBAT is not set 1389# CONFIG_USB_STORAGE_USBAT is not set
1467# CONFIG_USB_STORAGE_SDDR09 is not set 1390# CONFIG_USB_STORAGE_SDDR09 is not set
1468# CONFIG_USB_STORAGE_SDDR55 is not set 1391# CONFIG_USB_STORAGE_SDDR55 is not set
@@ -1498,7 +1421,6 @@ CONFIG_USB_SEVSEG=m
1498# CONFIG_USB_LED is not set 1421# CONFIG_USB_LED is not set
1499# CONFIG_USB_CYPRESS_CY7C63 is not set 1422# CONFIG_USB_CYPRESS_CY7C63 is not set
1500# CONFIG_USB_CYTHERM is not set 1423# CONFIG_USB_CYTHERM is not set
1501# CONFIG_USB_PHIDGET is not set
1502# CONFIG_USB_IDMOUSE is not set 1424# CONFIG_USB_IDMOUSE is not set
1503# CONFIG_USB_FTDI_ELAN is not set 1425# CONFIG_USB_FTDI_ELAN is not set
1504# CONFIG_USB_APPLEDISPLAY is not set 1426# CONFIG_USB_APPLEDISPLAY is not set
@@ -1510,72 +1432,32 @@ CONFIG_USB_SEVSEG=m
1510CONFIG_USB_ISIGHTFW=m 1432CONFIG_USB_ISIGHTFW=m
1511CONFIG_USB_VST=m 1433CONFIG_USB_VST=m
1512# CONFIG_USB_GADGET is not set 1434# CONFIG_USB_GADGET is not set
1435
1436#
1437# OTG and related infrastructure
1438#
1439# CONFIG_NOP_USB_XCEIV is not set
1513# CONFIG_UWB is not set 1440# CONFIG_UWB is not set
1514# CONFIG_MMC is not set 1441# CONFIG_MMC is not set
1515# CONFIG_MEMSTICK is not set 1442# CONFIG_MEMSTICK is not set
1516# CONFIG_NEW_LEDS is not set 1443# CONFIG_NEW_LEDS is not set
1517# CONFIG_ACCESSIBILITY is not set 1444# CONFIG_ACCESSIBILITY is not set
1518# CONFIG_INFINIBAND is not set 1445# CONFIG_INFINIBAND is not set
1519CONFIG_RTC_LIB=y 1446# CONFIG_RTC_CLASS is not set
1520CONFIG_RTC_CLASS=m
1521
1522#
1523# RTC interfaces
1524#
1525CONFIG_RTC_INTF_SYSFS=y
1526CONFIG_RTC_INTF_PROC=y
1527CONFIG_RTC_INTF_DEV=y
1528CONFIG_RTC_INTF_DEV_UIE_EMUL=y
1529# CONFIG_RTC_DRV_TEST is not set
1530
1531#
1532# I2C RTC drivers
1533#
1534# CONFIG_RTC_DRV_DS1307 is not set
1535# CONFIG_RTC_DRV_DS1374 is not set
1536# CONFIG_RTC_DRV_DS1672 is not set
1537# CONFIG_RTC_DRV_MAX6900 is not set
1538# CONFIG_RTC_DRV_RS5C372 is not set
1539# CONFIG_RTC_DRV_ISL1208 is not set
1540# CONFIG_RTC_DRV_X1205 is not set
1541# CONFIG_RTC_DRV_PCF8563 is not set
1542# CONFIG_RTC_DRV_PCF8583 is not set
1543# CONFIG_RTC_DRV_M41T80 is not set
1544# CONFIG_RTC_DRV_S35390A is not set
1545# CONFIG_RTC_DRV_FM3130 is not set
1546# CONFIG_RTC_DRV_RX8581 is not set
1547
1548#
1549# SPI RTC drivers
1550#
1551
1552#
1553# Platform RTC drivers
1554#
1555CONFIG_RTC_DRV_CMOS=m
1556# CONFIG_RTC_DRV_DS1286 is not set
1557# CONFIG_RTC_DRV_DS1511 is not set
1558# CONFIG_RTC_DRV_DS1553 is not set
1559# CONFIG_RTC_DRV_DS1742 is not set
1560# CONFIG_RTC_DRV_STK17TA8 is not set
1561# CONFIG_RTC_DRV_M48T86 is not set
1562# CONFIG_RTC_DRV_M48T35 is not set
1563# CONFIG_RTC_DRV_M48T59 is not set
1564# CONFIG_RTC_DRV_BQ4802 is not set
1565# CONFIG_RTC_DRV_V3020 is not set
1566
1567#
1568# on-CPU RTC drivers
1569#
1570# CONFIG_DMADEVICES is not set 1447# CONFIG_DMADEVICES is not set
1448# CONFIG_AUXDISPLAY is not set
1571CONFIG_UIO=m 1449CONFIG_UIO=m
1572CONFIG_UIO_CIF=m 1450CONFIG_UIO_CIF=m
1573# CONFIG_UIO_PDRV is not set 1451# CONFIG_UIO_PDRV is not set
1574# CONFIG_UIO_PDRV_GENIRQ is not set 1452# CONFIG_UIO_PDRV_GENIRQ is not set
1575# CONFIG_UIO_SMX is not set 1453# CONFIG_UIO_SMX is not set
1454# CONFIG_UIO_AEC is not set
1576# CONFIG_UIO_SERCOS3 is not set 1455# CONFIG_UIO_SERCOS3 is not set
1456
1457#
1458# TI VLYNQ
1459#
1577# CONFIG_STAGING is not set 1460# CONFIG_STAGING is not set
1578CONFIG_STAGING_EXCLUDE_BUILD=y
1579 1461
1580# 1462#
1581# File systems 1463# File systems
@@ -1584,6 +1466,7 @@ CONFIG_EXT2_FS=y
1584# CONFIG_EXT2_FS_XATTR is not set 1466# CONFIG_EXT2_FS_XATTR is not set
1585CONFIG_EXT2_FS_XIP=y 1467CONFIG_EXT2_FS_XIP=y
1586CONFIG_EXT3_FS=y 1468CONFIG_EXT3_FS=y
1469# CONFIG_EXT3_DEFAULTS_TO_ORDERED is not set
1587# CONFIG_EXT3_FS_XATTR is not set 1470# CONFIG_EXT3_FS_XATTR is not set
1588CONFIG_EXT4_FS=m 1471CONFIG_EXT4_FS=m
1589CONFIG_EXT4DEV_COMPAT=y 1472CONFIG_EXT4DEV_COMPAT=y
@@ -1592,7 +1475,9 @@ CONFIG_EXT4_FS_POSIX_ACL=y
1592CONFIG_EXT4_FS_SECURITY=y 1475CONFIG_EXT4_FS_SECURITY=y
1593CONFIG_FS_XIP=y 1476CONFIG_FS_XIP=y
1594CONFIG_JBD=y 1477CONFIG_JBD=y
1478# CONFIG_JBD_DEBUG is not set
1595CONFIG_JBD2=m 1479CONFIG_JBD2=m
1480# CONFIG_JBD2_DEBUG is not set
1596CONFIG_FS_MBCACHE=m 1481CONFIG_FS_MBCACHE=m
1597CONFIG_REISERFS_FS=m 1482CONFIG_REISERFS_FS=m
1598# CONFIG_REISERFS_CHECK is not set 1483# CONFIG_REISERFS_CHECK is not set
@@ -1600,10 +1485,12 @@ CONFIG_REISERFS_FS=m
1600# CONFIG_REISERFS_FS_XATTR is not set 1485# CONFIG_REISERFS_FS_XATTR is not set
1601# CONFIG_JFS_FS is not set 1486# CONFIG_JFS_FS is not set
1602CONFIG_FS_POSIX_ACL=y 1487CONFIG_FS_POSIX_ACL=y
1603CONFIG_FILE_LOCKING=y
1604# CONFIG_XFS_FS is not set 1488# CONFIG_XFS_FS is not set
1605# CONFIG_GFS2_FS is not set 1489# CONFIG_GFS2_FS is not set
1606# CONFIG_OCFS2_FS is not set 1490# CONFIG_OCFS2_FS is not set
1491# CONFIG_BTRFS_FS is not set
1492CONFIG_FILE_LOCKING=y
1493CONFIG_FSNOTIFY=y
1607CONFIG_DNOTIFY=y 1494CONFIG_DNOTIFY=y
1608CONFIG_INOTIFY=y 1495CONFIG_INOTIFY=y
1609CONFIG_INOTIFY_USER=y 1496CONFIG_INOTIFY_USER=y
@@ -1611,6 +1498,12 @@ CONFIG_INOTIFY_USER=y
1611CONFIG_AUTOFS_FS=y 1498CONFIG_AUTOFS_FS=y
1612CONFIG_AUTOFS4_FS=y 1499CONFIG_AUTOFS4_FS=y
1613CONFIG_FUSE_FS=y 1500CONFIG_FUSE_FS=y
1501# CONFIG_CUSE is not set
1502
1503#
1504# Caches
1505#
1506# CONFIG_FSCACHE is not set
1614 1507
1615# 1508#
1616# CD-ROM/DVD Filesystems 1509# CD-ROM/DVD Filesystems
@@ -1645,10 +1538,7 @@ CONFIG_TMPFS=y
1645# CONFIG_TMPFS_POSIX_ACL is not set 1538# CONFIG_TMPFS_POSIX_ACL is not set
1646# CONFIG_HUGETLB_PAGE is not set 1539# CONFIG_HUGETLB_PAGE is not set
1647# CONFIG_CONFIGFS_FS is not set 1540# CONFIG_CONFIGFS_FS is not set
1648 1541CONFIG_MISC_FILESYSTEMS=y
1649#
1650# Miscellaneous filesystems
1651#
1652# CONFIG_ADFS_FS is not set 1542# CONFIG_ADFS_FS is not set
1653# CONFIG_AFFS_FS is not set 1543# CONFIG_AFFS_FS is not set
1654# CONFIG_HFS_FS is not set 1544# CONFIG_HFS_FS is not set
@@ -1658,6 +1548,7 @@ CONFIG_TMPFS=y
1658# CONFIG_EFS_FS is not set 1548# CONFIG_EFS_FS is not set
1659# CONFIG_JFFS2_FS is not set 1549# CONFIG_JFFS2_FS is not set
1660# CONFIG_CRAMFS is not set 1550# CONFIG_CRAMFS is not set
1551# CONFIG_SQUASHFS is not set
1661# CONFIG_VXFS_FS is not set 1552# CONFIG_VXFS_FS is not set
1662# CONFIG_MINIX_FS is not set 1553# CONFIG_MINIX_FS is not set
1663CONFIG_OMFS_FS=m 1554CONFIG_OMFS_FS=m
@@ -1666,11 +1557,13 @@ CONFIG_OMFS_FS=m
1666# CONFIG_ROMFS_FS is not set 1557# CONFIG_ROMFS_FS is not set
1667# CONFIG_SYSV_FS is not set 1558# CONFIG_SYSV_FS is not set
1668# CONFIG_UFS_FS is not set 1559# CONFIG_UFS_FS is not set
1560# CONFIG_NILFS2_FS is not set
1669CONFIG_NETWORK_FILESYSTEMS=y 1561CONFIG_NETWORK_FILESYSTEMS=y
1670CONFIG_NFS_FS=m 1562CONFIG_NFS_FS=m
1671CONFIG_NFS_V3=y 1563CONFIG_NFS_V3=y
1672CONFIG_NFS_V3_ACL=y 1564CONFIG_NFS_V3_ACL=y
1673CONFIG_NFS_V4=y 1565CONFIG_NFS_V4=y
1566# CONFIG_NFS_V4_1 is not set
1674CONFIG_NFSD=m 1567CONFIG_NFSD=m
1675CONFIG_NFSD_V2_ACL=y 1568CONFIG_NFSD_V2_ACL=y
1676CONFIG_NFSD_V3=y 1569CONFIG_NFSD_V3=y
@@ -1683,7 +1576,6 @@ CONFIG_NFS_ACL_SUPPORT=m
1683CONFIG_NFS_COMMON=y 1576CONFIG_NFS_COMMON=y
1684CONFIG_SUNRPC=m 1577CONFIG_SUNRPC=m
1685CONFIG_SUNRPC_GSS=m 1578CONFIG_SUNRPC_GSS=m
1686# CONFIG_SUNRPC_REGISTER_V4 is not set
1687CONFIG_RPCSEC_GSS_KRB5=m 1579CONFIG_RPCSEC_GSS_KRB5=m
1688# CONFIG_RPCSEC_GSS_SPKM3 is not set 1580# CONFIG_RPCSEC_GSS_SPKM3 is not set
1689CONFIG_SMB_FS=m 1581CONFIG_SMB_FS=m
@@ -1775,17 +1667,21 @@ CONFIG_ENABLE_WARN_DEPRECATED=y
1775CONFIG_FRAME_WARN=2048 1667CONFIG_FRAME_WARN=2048
1776# CONFIG_MAGIC_SYSRQ is not set 1668# CONFIG_MAGIC_SYSRQ is not set
1777# CONFIG_UNUSED_SYMBOLS is not set 1669# CONFIG_UNUSED_SYMBOLS is not set
1778# CONFIG_DEBUG_FS is not set 1670CONFIG_DEBUG_FS=y
1779# CONFIG_HEADERS_CHECK is not set 1671# CONFIG_HEADERS_CHECK is not set
1780# CONFIG_DEBUG_KERNEL is not set 1672# CONFIG_DEBUG_KERNEL is not set
1673CONFIG_STACKTRACE=y
1781# CONFIG_DEBUG_MEMORY_INIT is not set 1674# CONFIG_DEBUG_MEMORY_INIT is not set
1782# CONFIG_RCU_CPU_STALL_DETECTOR is not set 1675# CONFIG_RCU_CPU_STALL_DETECTOR is not set
1783CONFIG_SYSCTL_SYSCALL_CHECK=y 1676CONFIG_SYSCTL_SYSCALL_CHECK=y
1784 1677CONFIG_NOP_TRACER=y
1785# 1678CONFIG_RING_BUFFER=y
1786# Tracers 1679CONFIG_EVENT_TRACING=y
1787# 1680CONFIG_CONTEXT_SWITCH_TRACER=y
1788CONFIG_DYNAMIC_PRINTK_DEBUG=y 1681CONFIG_TRACING=y
1682CONFIG_TRACING_SUPPORT=y
1683# CONFIG_FTRACE is not set
1684# CONFIG_DYNAMIC_DEBUG is not set
1789# CONFIG_SAMPLES is not set 1685# CONFIG_SAMPLES is not set
1790CONFIG_HAVE_ARCH_KGDB=y 1686CONFIG_HAVE_ARCH_KGDB=y
1791CONFIG_CMDLINE="" 1687CONFIG_CMDLINE=""
@@ -1804,13 +1700,21 @@ CONFIG_CRYPTO=y
1804# 1700#
1805CONFIG_CRYPTO_FIPS=y 1701CONFIG_CRYPTO_FIPS=y
1806CONFIG_CRYPTO_ALGAPI=y 1702CONFIG_CRYPTO_ALGAPI=y
1807CONFIG_CRYPTO_AEAD=y 1703CONFIG_CRYPTO_ALGAPI2=y
1808CONFIG_CRYPTO_BLKCIPHER=y 1704CONFIG_CRYPTO_AEAD=m
1705CONFIG_CRYPTO_AEAD2=y
1706CONFIG_CRYPTO_BLKCIPHER=m
1707CONFIG_CRYPTO_BLKCIPHER2=y
1809CONFIG_CRYPTO_HASH=y 1708CONFIG_CRYPTO_HASH=y
1810CONFIG_CRYPTO_RNG=y 1709CONFIG_CRYPTO_HASH2=y
1710CONFIG_CRYPTO_RNG=m
1711CONFIG_CRYPTO_RNG2=y
1712CONFIG_CRYPTO_PCOMP=y
1811CONFIG_CRYPTO_MANAGER=y 1713CONFIG_CRYPTO_MANAGER=y
1714CONFIG_CRYPTO_MANAGER2=y
1812CONFIG_CRYPTO_GF128MUL=m 1715CONFIG_CRYPTO_GF128MUL=m
1813# CONFIG_CRYPTO_NULL is not set 1716# CONFIG_CRYPTO_NULL is not set
1717CONFIG_CRYPTO_WORKQUEUE=y
1814# CONFIG_CRYPTO_CRYPTD is not set 1718# CONFIG_CRYPTO_CRYPTD is not set
1815CONFIG_CRYPTO_AUTHENC=m 1719CONFIG_CRYPTO_AUTHENC=m
1816# CONFIG_CRYPTO_TEST is not set 1720# CONFIG_CRYPTO_TEST is not set
@@ -1879,6 +1783,7 @@ CONFIG_CRYPTO_SEED=m
1879# Compression 1783# Compression
1880# 1784#
1881CONFIG_CRYPTO_DEFLATE=m 1785CONFIG_CRYPTO_DEFLATE=m
1786# CONFIG_CRYPTO_ZLIB is not set
1882CONFIG_CRYPTO_LZO=m 1787CONFIG_CRYPTO_LZO=m
1883 1788
1884# 1789#
@@ -1886,11 +1791,13 @@ CONFIG_CRYPTO_LZO=m
1886# 1791#
1887CONFIG_CRYPTO_ANSI_CPRNG=m 1792CONFIG_CRYPTO_ANSI_CPRNG=m
1888# CONFIG_CRYPTO_HW is not set 1793# CONFIG_CRYPTO_HW is not set
1794CONFIG_BINARY_PRINTF=y
1889 1795
1890# 1796#
1891# Library routines 1797# Library routines
1892# 1798#
1893CONFIG_BITREVERSE=y 1799CONFIG_BITREVERSE=y
1800CONFIG_GENERIC_FIND_LAST_BIT=y
1894CONFIG_CRC_CCITT=y 1801CONFIG_CRC_CCITT=y
1895CONFIG_CRC16=m 1802CONFIG_CRC16=m
1896# CONFIG_CRC_T10DIF is not set 1803# CONFIG_CRC_T10DIF is not set
@@ -1906,7 +1813,7 @@ CONFIG_TEXTSEARCH=y
1906CONFIG_TEXTSEARCH_KMP=m 1813CONFIG_TEXTSEARCH_KMP=m
1907CONFIG_TEXTSEARCH_BM=m 1814CONFIG_TEXTSEARCH_BM=m
1908CONFIG_TEXTSEARCH_FSM=m 1815CONFIG_TEXTSEARCH_FSM=m
1909CONFIG_PLIST=y
1910CONFIG_HAS_IOMEM=y 1816CONFIG_HAS_IOMEM=y
1911CONFIG_HAS_IOPORT=y 1817CONFIG_HAS_IOPORT=y
1912CONFIG_HAS_DMA=y 1818CONFIG_HAS_DMA=y
1819CONFIG_NLATTR=y
diff --git a/arch/mips/configs/ip22_defconfig b/arch/mips/configs/ip22_defconfig
index 115822876417..f14d38ba6034 100644
--- a/arch/mips/configs/ip22_defconfig
+++ b/arch/mips/configs/ip22_defconfig
@@ -130,7 +130,6 @@ CONFIG_IP22_CPU_SCACHE=y
130CONFIG_MIPS_MT_DISABLED=y 130CONFIG_MIPS_MT_DISABLED=y
131# CONFIG_MIPS_MT_SMP is not set 131# CONFIG_MIPS_MT_SMP is not set
132# CONFIG_MIPS_MT_SMTC is not set 132# CONFIG_MIPS_MT_SMTC is not set
133CONFIG_CPU_HAS_LLSC=y
134CONFIG_CPU_HAS_SYNC=y 133CONFIG_CPU_HAS_SYNC=y
135CONFIG_GENERIC_HARDIRQS=y 134CONFIG_GENERIC_HARDIRQS=y
136CONFIG_GENERIC_IRQ_PROBE=y 135CONFIG_GENERIC_IRQ_PROBE=y
diff --git a/arch/mips/configs/ip27_defconfig b/arch/mips/configs/ip27_defconfig
index 0208723adf28..1fc73aa7b509 100644
--- a/arch/mips/configs/ip27_defconfig
+++ b/arch/mips/configs/ip27_defconfig
@@ -105,7 +105,6 @@ CONFIG_CPU_HAS_PREFETCH=y
105CONFIG_MIPS_MT_DISABLED=y 105CONFIG_MIPS_MT_DISABLED=y
106# CONFIG_MIPS_MT_SMP is not set 106# CONFIG_MIPS_MT_SMP is not set
107# CONFIG_MIPS_MT_SMTC is not set 107# CONFIG_MIPS_MT_SMTC is not set
108CONFIG_CPU_HAS_LLSC=y
109CONFIG_CPU_HAS_SYNC=y 108CONFIG_CPU_HAS_SYNC=y
110CONFIG_GENERIC_HARDIRQS=y 109CONFIG_GENERIC_HARDIRQS=y
111CONFIG_GENERIC_IRQ_PROBE=y 110CONFIG_GENERIC_IRQ_PROBE=y
diff --git a/arch/mips/configs/ip28_defconfig b/arch/mips/configs/ip28_defconfig
index 70a744e9a8c5..539dccb0345d 100644
--- a/arch/mips/configs/ip28_defconfig
+++ b/arch/mips/configs/ip28_defconfig
@@ -123,7 +123,6 @@ CONFIG_CPU_HAS_PREFETCH=y
123CONFIG_MIPS_MT_DISABLED=y 123CONFIG_MIPS_MT_DISABLED=y
124# CONFIG_MIPS_MT_SMP is not set 124# CONFIG_MIPS_MT_SMP is not set
125# CONFIG_MIPS_MT_SMTC is not set 125# CONFIG_MIPS_MT_SMTC is not set
126CONFIG_CPU_HAS_LLSC=y
127CONFIG_CPU_HAS_SYNC=y 126CONFIG_CPU_HAS_SYNC=y
128CONFIG_GENERIC_HARDIRQS=y 127CONFIG_GENERIC_HARDIRQS=y
129CONFIG_GENERIC_IRQ_PROBE=y 128CONFIG_GENERIC_IRQ_PROBE=y
diff --git a/arch/mips/configs/ip32_defconfig b/arch/mips/configs/ip32_defconfig
index de4c7a0a96dd..d934bdefb393 100644
--- a/arch/mips/configs/ip32_defconfig
+++ b/arch/mips/configs/ip32_defconfig
@@ -118,7 +118,6 @@ CONFIG_RM7000_CPU_SCACHE=y
118CONFIG_MIPS_MT_DISABLED=y 118CONFIG_MIPS_MT_DISABLED=y
119# CONFIG_MIPS_MT_SMP is not set 119# CONFIG_MIPS_MT_SMP is not set
120# CONFIG_MIPS_MT_SMTC is not set 120# CONFIG_MIPS_MT_SMTC is not set
121CONFIG_CPU_HAS_LLSC=y
122CONFIG_CPU_HAS_SYNC=y 121CONFIG_CPU_HAS_SYNC=y
123CONFIG_GENERIC_HARDIRQS=y 122CONFIG_GENERIC_HARDIRQS=y
124CONFIG_GENERIC_IRQ_PROBE=y 123CONFIG_GENERIC_IRQ_PROBE=y
diff --git a/arch/mips/configs/jazz_defconfig b/arch/mips/configs/jazz_defconfig
index bbacc35d804f..d22df61833a8 100644
--- a/arch/mips/configs/jazz_defconfig
+++ b/arch/mips/configs/jazz_defconfig
@@ -119,7 +119,6 @@ CONFIG_MIPS_MT_DISABLED=y
119# CONFIG_MIPS_MT_SMTC is not set 119# CONFIG_MIPS_MT_SMTC is not set
120# CONFIG_MIPS_VPE_LOADER is not set 120# CONFIG_MIPS_VPE_LOADER is not set
121# CONFIG_64BIT_PHYS_ADDR is not set 121# CONFIG_64BIT_PHYS_ADDR is not set
122CONFIG_CPU_HAS_LLSC=y
123CONFIG_CPU_HAS_SYNC=y 122CONFIG_CPU_HAS_SYNC=y
124CONFIG_GENERIC_HARDIRQS=y 123CONFIG_GENERIC_HARDIRQS=y
125CONFIG_GENERIC_IRQ_PROBE=y 124CONFIG_GENERIC_IRQ_PROBE=y
diff --git a/arch/mips/configs/lasat_defconfig b/arch/mips/configs/lasat_defconfig
index bc9159fda728..044074db7e55 100644
--- a/arch/mips/configs/lasat_defconfig
+++ b/arch/mips/configs/lasat_defconfig
@@ -108,7 +108,6 @@ CONFIG_R5000_CPU_SCACHE=y
108CONFIG_MIPS_MT_DISABLED=y 108CONFIG_MIPS_MT_DISABLED=y
109# CONFIG_MIPS_MT_SMP is not set 109# CONFIG_MIPS_MT_SMP is not set
110# CONFIG_MIPS_MT_SMTC is not set 110# CONFIG_MIPS_MT_SMTC is not set
111CONFIG_CPU_HAS_LLSC=y
112CONFIG_CPU_HAS_SYNC=y 111CONFIG_CPU_HAS_SYNC=y
113CONFIG_GENERIC_HARDIRQS=y 112CONFIG_GENERIC_HARDIRQS=y
114CONFIG_GENERIC_IRQ_PROBE=y 113CONFIG_GENERIC_IRQ_PROBE=y
diff --git a/arch/mips/configs/malta_defconfig b/arch/mips/configs/malta_defconfig
index 1ecdd3b65dc7..3f01870b4d65 100644
--- a/arch/mips/configs/malta_defconfig
+++ b/arch/mips/configs/malta_defconfig
@@ -139,7 +139,6 @@ CONFIG_SYS_SUPPORTS_SCHED_SMT=y
139CONFIG_SYS_SUPPORTS_MULTITHREADING=y 139CONFIG_SYS_SUPPORTS_MULTITHREADING=y
140CONFIG_MIPS_MT_FPAFF=y 140CONFIG_MIPS_MT_FPAFF=y
141# CONFIG_MIPS_VPE_LOADER is not set 141# CONFIG_MIPS_VPE_LOADER is not set
142CONFIG_CPU_HAS_LLSC=y
143# CONFIG_CPU_HAS_SMARTMIPS is not set 142# CONFIG_CPU_HAS_SMARTMIPS is not set
144CONFIG_CPU_MIPSR2_IRQ_VI=y 143CONFIG_CPU_MIPSR2_IRQ_VI=y
145CONFIG_CPU_MIPSR2_IRQ_EI=y 144CONFIG_CPU_MIPSR2_IRQ_EI=y
diff --git a/arch/mips/configs/markeins_defconfig b/arch/mips/configs/markeins_defconfig
index bad8901f8f3c..d001f7e87418 100644
--- a/arch/mips/configs/markeins_defconfig
+++ b/arch/mips/configs/markeins_defconfig
@@ -112,7 +112,6 @@ CONFIG_MIPS_MT_DISABLED=y
112# CONFIG_MIPS_MT_SMTC is not set 112# CONFIG_MIPS_MT_SMTC is not set
113# CONFIG_MIPS_VPE_LOADER is not set 113# CONFIG_MIPS_VPE_LOADER is not set
114# CONFIG_64BIT_PHYS_ADDR is not set 114# CONFIG_64BIT_PHYS_ADDR is not set
115CONFIG_CPU_HAS_LLSC=y
116CONFIG_CPU_HAS_SYNC=y 115CONFIG_CPU_HAS_SYNC=y
117CONFIG_GENERIC_HARDIRQS=y 116CONFIG_GENERIC_HARDIRQS=y
118CONFIG_GENERIC_IRQ_PROBE=y 117CONFIG_GENERIC_IRQ_PROBE=y
diff --git a/arch/mips/configs/mipssim_defconfig b/arch/mips/configs/mipssim_defconfig
index 2c0a6314e901..7358454deaa6 100644
--- a/arch/mips/configs/mipssim_defconfig
+++ b/arch/mips/configs/mipssim_defconfig
@@ -115,7 +115,6 @@ CONFIG_MIPS_MT_DISABLED=y
115# CONFIG_MIPS_MT_SMTC is not set 115# CONFIG_MIPS_MT_SMTC is not set
116CONFIG_SYS_SUPPORTS_MULTITHREADING=y 116CONFIG_SYS_SUPPORTS_MULTITHREADING=y
117# CONFIG_MIPS_VPE_LOADER is not set 117# CONFIG_MIPS_VPE_LOADER is not set
118CONFIG_CPU_HAS_LLSC=y
119CONFIG_CPU_HAS_SYNC=y 118CONFIG_CPU_HAS_SYNC=y
120CONFIG_GENERIC_HARDIRQS=y 119CONFIG_GENERIC_HARDIRQS=y
121CONFIG_GENERIC_IRQ_PROBE=y 120CONFIG_GENERIC_IRQ_PROBE=y
diff --git a/arch/mips/configs/msp71xx_defconfig b/arch/mips/configs/msp71xx_defconfig
index 84d6491b3d41..ecbc030b7b6c 100644
--- a/arch/mips/configs/msp71xx_defconfig
+++ b/arch/mips/configs/msp71xx_defconfig
@@ -129,7 +129,6 @@ CONFIG_MIPS_MT_DISABLED=y
129# CONFIG_MIPS_VPE_LOADER is not set 129# CONFIG_MIPS_VPE_LOADER is not set
130CONFIG_SYS_SUPPORTS_MULTITHREADING=y 130CONFIG_SYS_SUPPORTS_MULTITHREADING=y
131# CONFIG_64BIT_PHYS_ADDR is not set 131# CONFIG_64BIT_PHYS_ADDR is not set
132CONFIG_CPU_HAS_LLSC=y
133CONFIG_CPU_HAS_SYNC=y 132CONFIG_CPU_HAS_SYNC=y
134CONFIG_GENERIC_HARDIRQS=y 133CONFIG_GENERIC_HARDIRQS=y
135CONFIG_GENERIC_IRQ_PROBE=y 134CONFIG_GENERIC_IRQ_PROBE=y
diff --git a/arch/mips/configs/mtx1_defconfig b/arch/mips/configs/mtx1_defconfig
index fadb351d249b..9477f040796d 100644
--- a/arch/mips/configs/mtx1_defconfig
+++ b/arch/mips/configs/mtx1_defconfig
@@ -116,7 +116,6 @@ CONFIG_MIPS_MT_DISABLED=y
116# CONFIG_MIPS_MT_SMP is not set 116# CONFIG_MIPS_MT_SMP is not set
117# CONFIG_MIPS_MT_SMTC is not set 117# CONFIG_MIPS_MT_SMTC is not set
118CONFIG_64BIT_PHYS_ADDR=y 118CONFIG_64BIT_PHYS_ADDR=y
119CONFIG_CPU_HAS_LLSC=y
120CONFIG_CPU_HAS_SYNC=y 119CONFIG_CPU_HAS_SYNC=y
121CONFIG_GENERIC_HARDIRQS=y 120CONFIG_GENERIC_HARDIRQS=y
122CONFIG_GENERIC_IRQ_PROBE=y 121CONFIG_GENERIC_IRQ_PROBE=y
diff --git a/arch/mips/configs/pb1100_defconfig b/arch/mips/configs/pb1100_defconfig
index 9e21e333a2fc..be8091ef0a79 100644
--- a/arch/mips/configs/pb1100_defconfig
+++ b/arch/mips/configs/pb1100_defconfig
@@ -115,7 +115,6 @@ CONFIG_MIPS_MT_DISABLED=y
115# CONFIG_MIPS_MT_SMTC is not set 115# CONFIG_MIPS_MT_SMTC is not set
116# CONFIG_MIPS_VPE_LOADER is not set 116# CONFIG_MIPS_VPE_LOADER is not set
117CONFIG_64BIT_PHYS_ADDR=y 117CONFIG_64BIT_PHYS_ADDR=y
118CONFIG_CPU_HAS_LLSC=y
119CONFIG_CPU_HAS_SYNC=y 118CONFIG_CPU_HAS_SYNC=y
120CONFIG_GENERIC_HARDIRQS=y 119CONFIG_GENERIC_HARDIRQS=y
121CONFIG_GENERIC_IRQ_PROBE=y 120CONFIG_GENERIC_IRQ_PROBE=y
diff --git a/arch/mips/configs/pb1500_defconfig b/arch/mips/configs/pb1500_defconfig
index af67ed4f71ae..e74ba794c789 100644
--- a/arch/mips/configs/pb1500_defconfig
+++ b/arch/mips/configs/pb1500_defconfig
@@ -114,7 +114,6 @@ CONFIG_MIPS_MT_DISABLED=y
114# CONFIG_MIPS_MT_SMTC is not set 114# CONFIG_MIPS_MT_SMTC is not set
115# CONFIG_MIPS_VPE_LOADER is not set 115# CONFIG_MIPS_VPE_LOADER is not set
116CONFIG_64BIT_PHYS_ADDR=y 116CONFIG_64BIT_PHYS_ADDR=y
117CONFIG_CPU_HAS_LLSC=y
118CONFIG_CPU_HAS_SYNC=y 117CONFIG_CPU_HAS_SYNC=y
119CONFIG_GENERIC_HARDIRQS=y 118CONFIG_GENERIC_HARDIRQS=y
120CONFIG_GENERIC_IRQ_PROBE=y 119CONFIG_GENERIC_IRQ_PROBE=y
diff --git a/arch/mips/configs/pb1550_defconfig b/arch/mips/configs/pb1550_defconfig
index 7956f56cbf3e..1d896fd830da 100644
--- a/arch/mips/configs/pb1550_defconfig
+++ b/arch/mips/configs/pb1550_defconfig
@@ -115,7 +115,6 @@ CONFIG_MIPS_MT_DISABLED=y
115# CONFIG_MIPS_MT_SMTC is not set 115# CONFIG_MIPS_MT_SMTC is not set
116# CONFIG_MIPS_VPE_LOADER is not set 116# CONFIG_MIPS_VPE_LOADER is not set
117CONFIG_64BIT_PHYS_ADDR=y 117CONFIG_64BIT_PHYS_ADDR=y
118CONFIG_CPU_HAS_LLSC=y
119CONFIG_CPU_HAS_SYNC=y 118CONFIG_CPU_HAS_SYNC=y
120CONFIG_GENERIC_HARDIRQS=y 119CONFIG_GENERIC_HARDIRQS=y
121CONFIG_GENERIC_IRQ_PROBE=y 120CONFIG_GENERIC_IRQ_PROBE=y
diff --git a/arch/mips/configs/pnx8335-stb225_defconfig b/arch/mips/configs/pnx8335-stb225_defconfig
index 2728caa6c2fb..fef4d31c2055 100644
--- a/arch/mips/configs/pnx8335-stb225_defconfig
+++ b/arch/mips/configs/pnx8335-stb225_defconfig
@@ -112,7 +112,6 @@ CONFIG_CPU_HAS_PREFETCH=y
112CONFIG_MIPS_MT_DISABLED=y 112CONFIG_MIPS_MT_DISABLED=y
113# CONFIG_MIPS_MT_SMP is not set 113# CONFIG_MIPS_MT_SMP is not set
114# CONFIG_MIPS_MT_SMTC is not set 114# CONFIG_MIPS_MT_SMTC is not set
115CONFIG_CPU_HAS_LLSC=y
116CONFIG_CPU_MIPSR2_IRQ_VI=y 115CONFIG_CPU_MIPSR2_IRQ_VI=y
117CONFIG_CPU_HAS_SYNC=y 116CONFIG_CPU_HAS_SYNC=y
118CONFIG_GENERIC_HARDIRQS=y 117CONFIG_GENERIC_HARDIRQS=y
diff --git a/arch/mips/configs/pnx8550-jbs_defconfig b/arch/mips/configs/pnx8550-jbs_defconfig
index 723bd5176a35..e10c7116c3c2 100644
--- a/arch/mips/configs/pnx8550-jbs_defconfig
+++ b/arch/mips/configs/pnx8550-jbs_defconfig
@@ -112,7 +112,6 @@ CONFIG_MIPS_MT_DISABLED=y
112# CONFIG_MIPS_MT_SMTC is not set 112# CONFIG_MIPS_MT_SMTC is not set
113# CONFIG_MIPS_VPE_LOADER is not set 113# CONFIG_MIPS_VPE_LOADER is not set
114# CONFIG_64BIT_PHYS_ADDR is not set 114# CONFIG_64BIT_PHYS_ADDR is not set
115CONFIG_CPU_HAS_LLSC=y
116CONFIG_CPU_HAS_SYNC=y 115CONFIG_CPU_HAS_SYNC=y
117CONFIG_GENERIC_HARDIRQS=y 116CONFIG_GENERIC_HARDIRQS=y
118CONFIG_GENERIC_IRQ_PROBE=y 117CONFIG_GENERIC_IRQ_PROBE=y
diff --git a/arch/mips/configs/pnx8550-stb810_defconfig b/arch/mips/configs/pnx8550-stb810_defconfig
index b5052fb42e9e..5ed3c8dfa0a1 100644
--- a/arch/mips/configs/pnx8550-stb810_defconfig
+++ b/arch/mips/configs/pnx8550-stb810_defconfig
@@ -112,7 +112,6 @@ CONFIG_MIPS_MT_DISABLED=y
112# CONFIG_MIPS_MT_SMTC is not set 112# CONFIG_MIPS_MT_SMTC is not set
113# CONFIG_MIPS_VPE_LOADER is not set 113# CONFIG_MIPS_VPE_LOADER is not set
114# CONFIG_64BIT_PHYS_ADDR is not set 114# CONFIG_64BIT_PHYS_ADDR is not set
115CONFIG_CPU_HAS_LLSC=y
116CONFIG_CPU_HAS_SYNC=y 115CONFIG_CPU_HAS_SYNC=y
117CONFIG_GENERIC_HARDIRQS=y 116CONFIG_GENERIC_HARDIRQS=y
118CONFIG_GENERIC_IRQ_PROBE=y 117CONFIG_GENERIC_IRQ_PROBE=y
diff --git a/arch/mips/configs/rb532_defconfig b/arch/mips/configs/rb532_defconfig
index f28dc32974e5..f40c3a04739d 100644
--- a/arch/mips/configs/rb532_defconfig
+++ b/arch/mips/configs/rb532_defconfig
@@ -113,7 +113,6 @@ CONFIG_CPU_HAS_PREFETCH=y
113CONFIG_MIPS_MT_DISABLED=y 113CONFIG_MIPS_MT_DISABLED=y
114# CONFIG_MIPS_MT_SMP is not set 114# CONFIG_MIPS_MT_SMP is not set
115# CONFIG_MIPS_MT_SMTC is not set 115# CONFIG_MIPS_MT_SMTC is not set
116CONFIG_CPU_HAS_LLSC=y
117CONFIG_CPU_HAS_SYNC=y 116CONFIG_CPU_HAS_SYNC=y
118CONFIG_GENERIC_HARDIRQS=y 117CONFIG_GENERIC_HARDIRQS=y
119CONFIG_GENERIC_IRQ_PROBE=y 118CONFIG_GENERIC_IRQ_PROBE=y
diff --git a/arch/mips/configs/rbtx49xx_defconfig b/arch/mips/configs/rbtx49xx_defconfig
index 1efe977497dd..c69813b8488c 100644
--- a/arch/mips/configs/rbtx49xx_defconfig
+++ b/arch/mips/configs/rbtx49xx_defconfig
@@ -142,7 +142,6 @@ CONFIG_CPU_HAS_PREFETCH=y
142CONFIG_MIPS_MT_DISABLED=y 142CONFIG_MIPS_MT_DISABLED=y
143# CONFIG_MIPS_MT_SMP is not set 143# CONFIG_MIPS_MT_SMP is not set
144# CONFIG_MIPS_MT_SMTC is not set 144# CONFIG_MIPS_MT_SMTC is not set
145CONFIG_CPU_HAS_LLSC=y
146CONFIG_CPU_HAS_SYNC=y 145CONFIG_CPU_HAS_SYNC=y
147CONFIG_GENERIC_HARDIRQS=y 146CONFIG_GENERIC_HARDIRQS=y
148CONFIG_GENERIC_IRQ_PROBE=y 147CONFIG_GENERIC_IRQ_PROBE=y
diff --git a/arch/mips/configs/rm200_defconfig b/arch/mips/configs/rm200_defconfig
index 0f4da0325ea4..e53b8d096cfc 100644
--- a/arch/mips/configs/rm200_defconfig
+++ b/arch/mips/configs/rm200_defconfig
@@ -124,7 +124,6 @@ CONFIG_MIPS_MT_DISABLED=y
124# CONFIG_MIPS_MT_SMTC is not set 124# CONFIG_MIPS_MT_SMTC is not set
125# CONFIG_MIPS_VPE_LOADER is not set 125# CONFIG_MIPS_VPE_LOADER is not set
126# CONFIG_64BIT_PHYS_ADDR is not set 126# CONFIG_64BIT_PHYS_ADDR is not set
127CONFIG_CPU_HAS_LLSC=y
128CONFIG_CPU_HAS_SYNC=y 127CONFIG_CPU_HAS_SYNC=y
129CONFIG_GENERIC_HARDIRQS=y 128CONFIG_GENERIC_HARDIRQS=y
130CONFIG_GENERIC_IRQ_PROBE=y 129CONFIG_GENERIC_IRQ_PROBE=y
diff --git a/arch/mips/configs/sb1250-swarm_defconfig b/arch/mips/configs/sb1250-swarm_defconfig
index a9acaa2f9da3..7f38c0b956f3 100644
--- a/arch/mips/configs/sb1250-swarm_defconfig
+++ b/arch/mips/configs/sb1250-swarm_defconfig
@@ -133,7 +133,6 @@ CONFIG_MIPS_MT_DISABLED=y
133# CONFIG_MIPS_MT_SMP is not set 133# CONFIG_MIPS_MT_SMP is not set
134# CONFIG_MIPS_MT_SMTC is not set 134# CONFIG_MIPS_MT_SMTC is not set
135CONFIG_SB1_PASS_2_WORKAROUNDS=y 135CONFIG_SB1_PASS_2_WORKAROUNDS=y
136CONFIG_CPU_HAS_LLSC=y
137CONFIG_CPU_HAS_SYNC=y 136CONFIG_CPU_HAS_SYNC=y
138CONFIG_GENERIC_HARDIRQS=y 137CONFIG_GENERIC_HARDIRQS=y
139CONFIG_GENERIC_IRQ_PROBE=y 138CONFIG_GENERIC_IRQ_PROBE=y
diff --git a/arch/mips/configs/wrppmc_defconfig b/arch/mips/configs/wrppmc_defconfig
index fc2c56731b98..06acc7482e4c 100644
--- a/arch/mips/configs/wrppmc_defconfig
+++ b/arch/mips/configs/wrppmc_defconfig
@@ -120,7 +120,6 @@ CONFIG_MIPS_MT_DISABLED=y
120# CONFIG_MIPS_MT_SMTC is not set 120# CONFIG_MIPS_MT_SMTC is not set
121# CONFIG_MIPS_VPE_LOADER is not set 121# CONFIG_MIPS_VPE_LOADER is not set
122# CONFIG_64BIT_PHYS_ADDR is not set 122# CONFIG_64BIT_PHYS_ADDR is not set
123CONFIG_CPU_HAS_LLSC=y
124CONFIG_CPU_HAS_SYNC=y 123CONFIG_CPU_HAS_SYNC=y
125CONFIG_GENERIC_HARDIRQS=y 124CONFIG_GENERIC_HARDIRQS=y
126CONFIG_GENERIC_IRQ_PROBE=y 125CONFIG_GENERIC_IRQ_PROBE=y
diff --git a/arch/mips/configs/yosemite_defconfig b/arch/mips/configs/yosemite_defconfig
index ea8249c75b3f..69feaf88b510 100644
--- a/arch/mips/configs/yosemite_defconfig
+++ b/arch/mips/configs/yosemite_defconfig
@@ -115,7 +115,6 @@ CONFIG_MIPS_MT_DISABLED=y
115# CONFIG_MIPS_MT_SMTC is not set 115# CONFIG_MIPS_MT_SMTC is not set
116# CONFIG_MIPS_VPE_LOADER is not set 116# CONFIG_MIPS_VPE_LOADER is not set
117# CONFIG_64BIT_PHYS_ADDR is not set 117# CONFIG_64BIT_PHYS_ADDR is not set
118CONFIG_CPU_HAS_LLSC=y
119CONFIG_CPU_HAS_SYNC=y 118CONFIG_CPU_HAS_SYNC=y
120CONFIG_GENERIC_HARDIRQS=y 119CONFIG_GENERIC_HARDIRQS=y
121CONFIG_GENERIC_IRQ_PROBE=y 120CONFIG_GENERIC_IRQ_PROBE=y
diff --git a/arch/mips/dec/prom/memory.c b/arch/mips/dec/prom/memory.c
index 5a557e268f78..e95ff3054ff6 100644
--- a/arch/mips/dec/prom/memory.c
+++ b/arch/mips/dec/prom/memory.c
@@ -18,7 +18,7 @@
18#include <asm/sections.h> 18#include <asm/sections.h>
19 19
20 20
21volatile unsigned long mem_err = 0; /* So we know an error occurred */ 21volatile unsigned long mem_err; /* So we know an error occurred */
22 22
23/* 23/*
24 * Probe memory in 4MB chunks, waiting for an error to tell us we've fallen 24 * Probe memory in 4MB chunks, waiting for an error to tell us we've fallen
diff --git a/arch/mips/emma/markeins/setup.c b/arch/mips/emma/markeins/setup.c
index 335dc8c1a1bb..9b3f51e5f140 100644
--- a/arch/mips/emma/markeins/setup.c
+++ b/arch/mips/emma/markeins/setup.c
@@ -32,7 +32,7 @@
32 32
33extern void markeins_led(const char *); 33extern void markeins_led(const char *);
34 34
35static int bus_frequency = 0; 35static int bus_frequency;
36 36
37static void markeins_machine_restart(char *command) 37static void markeins_machine_restart(char *command)
38{ 38{
diff --git a/arch/mips/fw/arc/Makefile b/arch/mips/fw/arc/Makefile
index 4f349ec1ea2d..e0aaad482b0e 100644
--- a/arch/mips/fw/arc/Makefile
+++ b/arch/mips/fw/arc/Makefile
@@ -8,3 +8,5 @@ lib-y += cmdline.o env.o file.o identify.o init.o \
8lib-$(CONFIG_ARC_MEMORY) += memory.o 8lib-$(CONFIG_ARC_MEMORY) += memory.o
9lib-$(CONFIG_ARC_CONSOLE) += arc_con.o 9lib-$(CONFIG_ARC_CONSOLE) += arc_con.o
10lib-$(CONFIG_ARC_PROMLIB) += promlib.o 10lib-$(CONFIG_ARC_PROMLIB) += promlib.o
11
12EXTRA_CFLAGS += -Werror
diff --git a/arch/mips/fw/cfe/cfe_api.c b/arch/mips/fw/cfe/cfe_api.c
index 717db74f7c6e..d06dc5a6b8d3 100644
--- a/arch/mips/fw/cfe/cfe_api.c
+++ b/arch/mips/fw/cfe/cfe_api.c
@@ -45,8 +45,8 @@ int cfe_iocb_dispatch(struct cfe_xiocb *xiocb);
45 * passed in two registers each, and CFE expects one. 45 * passed in two registers each, and CFE expects one.
46 */ 46 */
47 47
48static int (*cfe_dispfunc) (intptr_t handle, intptr_t xiocb) = 0; 48static int (*cfe_dispfunc) (intptr_t handle, intptr_t xiocb);
49static u64 cfe_handle = 0; 49static u64 cfe_handle;
50 50
51int cfe_init(u64 handle, u64 ept) 51int cfe_init(u64 handle, u64 ept)
52{ 52{
diff --git a/arch/mips/include/asm/atomic.h b/arch/mips/include/asm/atomic.h
index eb7f01cfd1ac..dd75d673447e 100644
--- a/arch/mips/include/asm/atomic.h
+++ b/arch/mips/include/asm/atomic.h
@@ -49,7 +49,7 @@
49 */ 49 */
50static __inline__ void atomic_add(int i, atomic_t * v) 50static __inline__ void atomic_add(int i, atomic_t * v)
51{ 51{
52 if (cpu_has_llsc && R10000_LLSC_WAR) { 52 if (kernel_uses_llsc && R10000_LLSC_WAR) {
53 int temp; 53 int temp;
54 54
55 __asm__ __volatile__( 55 __asm__ __volatile__(
@@ -61,7 +61,7 @@ static __inline__ void atomic_add(int i, atomic_t * v)
61 " .set mips0 \n" 61 " .set mips0 \n"
62 : "=&r" (temp), "=m" (v->counter) 62 : "=&r" (temp), "=m" (v->counter)
63 : "Ir" (i), "m" (v->counter)); 63 : "Ir" (i), "m" (v->counter));
64 } else if (cpu_has_llsc) { 64 } else if (kernel_uses_llsc) {
65 int temp; 65 int temp;
66 66
67 __asm__ __volatile__( 67 __asm__ __volatile__(
@@ -94,7 +94,7 @@ static __inline__ void atomic_add(int i, atomic_t * v)
94 */ 94 */
95static __inline__ void atomic_sub(int i, atomic_t * v) 95static __inline__ void atomic_sub(int i, atomic_t * v)
96{ 96{
97 if (cpu_has_llsc && R10000_LLSC_WAR) { 97 if (kernel_uses_llsc && R10000_LLSC_WAR) {
98 int temp; 98 int temp;
99 99
100 __asm__ __volatile__( 100 __asm__ __volatile__(
@@ -106,7 +106,7 @@ static __inline__ void atomic_sub(int i, atomic_t * v)
106 " .set mips0 \n" 106 " .set mips0 \n"
107 : "=&r" (temp), "=m" (v->counter) 107 : "=&r" (temp), "=m" (v->counter)
108 : "Ir" (i), "m" (v->counter)); 108 : "Ir" (i), "m" (v->counter));
109 } else if (cpu_has_llsc) { 109 } else if (kernel_uses_llsc) {
110 int temp; 110 int temp;
111 111
112 __asm__ __volatile__( 112 __asm__ __volatile__(
@@ -139,7 +139,7 @@ static __inline__ int atomic_add_return(int i, atomic_t * v)
139 139
140 smp_llsc_mb(); 140 smp_llsc_mb();
141 141
142 if (cpu_has_llsc && R10000_LLSC_WAR) { 142 if (kernel_uses_llsc && R10000_LLSC_WAR) {
143 int temp; 143 int temp;
144 144
145 __asm__ __volatile__( 145 __asm__ __volatile__(
@@ -153,7 +153,7 @@ static __inline__ int atomic_add_return(int i, atomic_t * v)
153 : "=&r" (result), "=&r" (temp), "=m" (v->counter) 153 : "=&r" (result), "=&r" (temp), "=m" (v->counter)
154 : "Ir" (i), "m" (v->counter) 154 : "Ir" (i), "m" (v->counter)
155 : "memory"); 155 : "memory");
156 } else if (cpu_has_llsc) { 156 } else if (kernel_uses_llsc) {
157 int temp; 157 int temp;
158 158
159 __asm__ __volatile__( 159 __asm__ __volatile__(
@@ -191,7 +191,7 @@ static __inline__ int atomic_sub_return(int i, atomic_t * v)
191 191
192 smp_llsc_mb(); 192 smp_llsc_mb();
193 193
194 if (cpu_has_llsc && R10000_LLSC_WAR) { 194 if (kernel_uses_llsc && R10000_LLSC_WAR) {
195 int temp; 195 int temp;
196 196
197 __asm__ __volatile__( 197 __asm__ __volatile__(
@@ -205,7 +205,7 @@ static __inline__ int atomic_sub_return(int i, atomic_t * v)
205 : "=&r" (result), "=&r" (temp), "=m" (v->counter) 205 : "=&r" (result), "=&r" (temp), "=m" (v->counter)
206 : "Ir" (i), "m" (v->counter) 206 : "Ir" (i), "m" (v->counter)
207 : "memory"); 207 : "memory");
208 } else if (cpu_has_llsc) { 208 } else if (kernel_uses_llsc) {
209 int temp; 209 int temp;
210 210
211 __asm__ __volatile__( 211 __asm__ __volatile__(
@@ -251,7 +251,7 @@ static __inline__ int atomic_sub_if_positive(int i, atomic_t * v)
251 251
252 smp_llsc_mb(); 252 smp_llsc_mb();
253 253
254 if (cpu_has_llsc && R10000_LLSC_WAR) { 254 if (kernel_uses_llsc && R10000_LLSC_WAR) {
255 int temp; 255 int temp;
256 256
257 __asm__ __volatile__( 257 __asm__ __volatile__(
@@ -269,7 +269,7 @@ static __inline__ int atomic_sub_if_positive(int i, atomic_t * v)
269 : "=&r" (result), "=&r" (temp), "=m" (v->counter) 269 : "=&r" (result), "=&r" (temp), "=m" (v->counter)
270 : "Ir" (i), "m" (v->counter) 270 : "Ir" (i), "m" (v->counter)
271 : "memory"); 271 : "memory");
272 } else if (cpu_has_llsc) { 272 } else if (kernel_uses_llsc) {
273 int temp; 273 int temp;
274 274
275 __asm__ __volatile__( 275 __asm__ __volatile__(
@@ -428,7 +428,7 @@ static __inline__ int atomic_add_unless(atomic_t *v, int a, int u)
428 */ 428 */
429static __inline__ void atomic64_add(long i, atomic64_t * v) 429static __inline__ void atomic64_add(long i, atomic64_t * v)
430{ 430{
431 if (cpu_has_llsc && R10000_LLSC_WAR) { 431 if (kernel_uses_llsc && R10000_LLSC_WAR) {
432 long temp; 432 long temp;
433 433
434 __asm__ __volatile__( 434 __asm__ __volatile__(
@@ -440,7 +440,7 @@ static __inline__ void atomic64_add(long i, atomic64_t * v)
440 " .set mips0 \n" 440 " .set mips0 \n"
441 : "=&r" (temp), "=m" (v->counter) 441 : "=&r" (temp), "=m" (v->counter)
442 : "Ir" (i), "m" (v->counter)); 442 : "Ir" (i), "m" (v->counter));
443 } else if (cpu_has_llsc) { 443 } else if (kernel_uses_llsc) {
444 long temp; 444 long temp;
445 445
446 __asm__ __volatile__( 446 __asm__ __volatile__(
@@ -473,7 +473,7 @@ static __inline__ void atomic64_add(long i, atomic64_t * v)
473 */ 473 */
474static __inline__ void atomic64_sub(long i, atomic64_t * v) 474static __inline__ void atomic64_sub(long i, atomic64_t * v)
475{ 475{
476 if (cpu_has_llsc && R10000_LLSC_WAR) { 476 if (kernel_uses_llsc && R10000_LLSC_WAR) {
477 long temp; 477 long temp;
478 478
479 __asm__ __volatile__( 479 __asm__ __volatile__(
@@ -485,7 +485,7 @@ static __inline__ void atomic64_sub(long i, atomic64_t * v)
485 " .set mips0 \n" 485 " .set mips0 \n"
486 : "=&r" (temp), "=m" (v->counter) 486 : "=&r" (temp), "=m" (v->counter)
487 : "Ir" (i), "m" (v->counter)); 487 : "Ir" (i), "m" (v->counter));
488 } else if (cpu_has_llsc) { 488 } else if (kernel_uses_llsc) {
489 long temp; 489 long temp;
490 490
491 __asm__ __volatile__( 491 __asm__ __volatile__(
@@ -518,7 +518,7 @@ static __inline__ long atomic64_add_return(long i, atomic64_t * v)
518 518
519 smp_llsc_mb(); 519 smp_llsc_mb();
520 520
521 if (cpu_has_llsc && R10000_LLSC_WAR) { 521 if (kernel_uses_llsc && R10000_LLSC_WAR) {
522 long temp; 522 long temp;
523 523
524 __asm__ __volatile__( 524 __asm__ __volatile__(
@@ -532,7 +532,7 @@ static __inline__ long atomic64_add_return(long i, atomic64_t * v)
532 : "=&r" (result), "=&r" (temp), "=m" (v->counter) 532 : "=&r" (result), "=&r" (temp), "=m" (v->counter)
533 : "Ir" (i), "m" (v->counter) 533 : "Ir" (i), "m" (v->counter)
534 : "memory"); 534 : "memory");
535 } else if (cpu_has_llsc) { 535 } else if (kernel_uses_llsc) {
536 long temp; 536 long temp;
537 537
538 __asm__ __volatile__( 538 __asm__ __volatile__(
@@ -570,7 +570,7 @@ static __inline__ long atomic64_sub_return(long i, atomic64_t * v)
570 570
571 smp_llsc_mb(); 571 smp_llsc_mb();
572 572
573 if (cpu_has_llsc && R10000_LLSC_WAR) { 573 if (kernel_uses_llsc && R10000_LLSC_WAR) {
574 long temp; 574 long temp;
575 575
576 __asm__ __volatile__( 576 __asm__ __volatile__(
@@ -584,7 +584,7 @@ static __inline__ long atomic64_sub_return(long i, atomic64_t * v)
584 : "=&r" (result), "=&r" (temp), "=m" (v->counter) 584 : "=&r" (result), "=&r" (temp), "=m" (v->counter)
585 : "Ir" (i), "m" (v->counter) 585 : "Ir" (i), "m" (v->counter)
586 : "memory"); 586 : "memory");
587 } else if (cpu_has_llsc) { 587 } else if (kernel_uses_llsc) {
588 long temp; 588 long temp;
589 589
590 __asm__ __volatile__( 590 __asm__ __volatile__(
@@ -630,7 +630,7 @@ static __inline__ long atomic64_sub_if_positive(long i, atomic64_t * v)
630 630
631 smp_llsc_mb(); 631 smp_llsc_mb();
632 632
633 if (cpu_has_llsc && R10000_LLSC_WAR) { 633 if (kernel_uses_llsc && R10000_LLSC_WAR) {
634 long temp; 634 long temp;
635 635
636 __asm__ __volatile__( 636 __asm__ __volatile__(
@@ -648,7 +648,7 @@ static __inline__ long atomic64_sub_if_positive(long i, atomic64_t * v)
648 : "=&r" (result), "=&r" (temp), "=m" (v->counter) 648 : "=&r" (result), "=&r" (temp), "=m" (v->counter)
649 : "Ir" (i), "m" (v->counter) 649 : "Ir" (i), "m" (v->counter)
650 : "memory"); 650 : "memory");
651 } else if (cpu_has_llsc) { 651 } else if (kernel_uses_llsc) {
652 long temp; 652 long temp;
653 653
654 __asm__ __volatile__( 654 __asm__ __volatile__(
diff --git a/arch/mips/include/asm/bitops.h b/arch/mips/include/asm/bitops.h
index b1e9e97a9c78..84a383806b2c 100644
--- a/arch/mips/include/asm/bitops.h
+++ b/arch/mips/include/asm/bitops.h
@@ -61,7 +61,7 @@ static inline void set_bit(unsigned long nr, volatile unsigned long *addr)
61 unsigned short bit = nr & SZLONG_MASK; 61 unsigned short bit = nr & SZLONG_MASK;
62 unsigned long temp; 62 unsigned long temp;
63 63
64 if (cpu_has_llsc && R10000_LLSC_WAR) { 64 if (kernel_uses_llsc && R10000_LLSC_WAR) {
65 __asm__ __volatile__( 65 __asm__ __volatile__(
66 " .set mips3 \n" 66 " .set mips3 \n"
67 "1: " __LL "%0, %1 # set_bit \n" 67 "1: " __LL "%0, %1 # set_bit \n"
@@ -72,7 +72,7 @@ static inline void set_bit(unsigned long nr, volatile unsigned long *addr)
72 : "=&r" (temp), "=m" (*m) 72 : "=&r" (temp), "=m" (*m)
73 : "ir" (1UL << bit), "m" (*m)); 73 : "ir" (1UL << bit), "m" (*m));
74#ifdef CONFIG_CPU_MIPSR2 74#ifdef CONFIG_CPU_MIPSR2
75 } else if (__builtin_constant_p(bit)) { 75 } else if (kernel_uses_llsc && __builtin_constant_p(bit)) {
76 __asm__ __volatile__( 76 __asm__ __volatile__(
77 "1: " __LL "%0, %1 # set_bit \n" 77 "1: " __LL "%0, %1 # set_bit \n"
78 " " __INS "%0, %4, %2, 1 \n" 78 " " __INS "%0, %4, %2, 1 \n"
@@ -84,7 +84,7 @@ static inline void set_bit(unsigned long nr, volatile unsigned long *addr)
84 : "=&r" (temp), "=m" (*m) 84 : "=&r" (temp), "=m" (*m)
85 : "ir" (bit), "m" (*m), "r" (~0)); 85 : "ir" (bit), "m" (*m), "r" (~0));
86#endif /* CONFIG_CPU_MIPSR2 */ 86#endif /* CONFIG_CPU_MIPSR2 */
87 } else if (cpu_has_llsc) { 87 } else if (kernel_uses_llsc) {
88 __asm__ __volatile__( 88 __asm__ __volatile__(
89 " .set mips3 \n" 89 " .set mips3 \n"
90 "1: " __LL "%0, %1 # set_bit \n" 90 "1: " __LL "%0, %1 # set_bit \n"
@@ -126,7 +126,7 @@ static inline void clear_bit(unsigned long nr, volatile unsigned long *addr)
126 unsigned short bit = nr & SZLONG_MASK; 126 unsigned short bit = nr & SZLONG_MASK;
127 unsigned long temp; 127 unsigned long temp;
128 128
129 if (cpu_has_llsc && R10000_LLSC_WAR) { 129 if (kernel_uses_llsc && R10000_LLSC_WAR) {
130 __asm__ __volatile__( 130 __asm__ __volatile__(
131 " .set mips3 \n" 131 " .set mips3 \n"
132 "1: " __LL "%0, %1 # clear_bit \n" 132 "1: " __LL "%0, %1 # clear_bit \n"
@@ -137,7 +137,7 @@ static inline void clear_bit(unsigned long nr, volatile unsigned long *addr)
137 : "=&r" (temp), "=m" (*m) 137 : "=&r" (temp), "=m" (*m)
138 : "ir" (~(1UL << bit)), "m" (*m)); 138 : "ir" (~(1UL << bit)), "m" (*m));
139#ifdef CONFIG_CPU_MIPSR2 139#ifdef CONFIG_CPU_MIPSR2
140 } else if (__builtin_constant_p(bit)) { 140 } else if (kernel_uses_llsc && __builtin_constant_p(bit)) {
141 __asm__ __volatile__( 141 __asm__ __volatile__(
142 "1: " __LL "%0, %1 # clear_bit \n" 142 "1: " __LL "%0, %1 # clear_bit \n"
143 " " __INS "%0, $0, %2, 1 \n" 143 " " __INS "%0, $0, %2, 1 \n"
@@ -149,7 +149,7 @@ static inline void clear_bit(unsigned long nr, volatile unsigned long *addr)
149 : "=&r" (temp), "=m" (*m) 149 : "=&r" (temp), "=m" (*m)
150 : "ir" (bit), "m" (*m)); 150 : "ir" (bit), "m" (*m));
151#endif /* CONFIG_CPU_MIPSR2 */ 151#endif /* CONFIG_CPU_MIPSR2 */
152 } else if (cpu_has_llsc) { 152 } else if (kernel_uses_llsc) {
153 __asm__ __volatile__( 153 __asm__ __volatile__(
154 " .set mips3 \n" 154 " .set mips3 \n"
155 "1: " __LL "%0, %1 # clear_bit \n" 155 "1: " __LL "%0, %1 # clear_bit \n"
@@ -202,7 +202,7 @@ static inline void change_bit(unsigned long nr, volatile unsigned long *addr)
202{ 202{
203 unsigned short bit = nr & SZLONG_MASK; 203 unsigned short bit = nr & SZLONG_MASK;
204 204
205 if (cpu_has_llsc && R10000_LLSC_WAR) { 205 if (kernel_uses_llsc && R10000_LLSC_WAR) {
206 unsigned long *m = ((unsigned long *) addr) + (nr >> SZLONG_LOG); 206 unsigned long *m = ((unsigned long *) addr) + (nr >> SZLONG_LOG);
207 unsigned long temp; 207 unsigned long temp;
208 208
@@ -215,7 +215,7 @@ static inline void change_bit(unsigned long nr, volatile unsigned long *addr)
215 " .set mips0 \n" 215 " .set mips0 \n"
216 : "=&r" (temp), "=m" (*m) 216 : "=&r" (temp), "=m" (*m)
217 : "ir" (1UL << bit), "m" (*m)); 217 : "ir" (1UL << bit), "m" (*m));
218 } else if (cpu_has_llsc) { 218 } else if (kernel_uses_llsc) {
219 unsigned long *m = ((unsigned long *) addr) + (nr >> SZLONG_LOG); 219 unsigned long *m = ((unsigned long *) addr) + (nr >> SZLONG_LOG);
220 unsigned long temp; 220 unsigned long temp;
221 221
@@ -260,7 +260,7 @@ static inline int test_and_set_bit(unsigned long nr,
260 260
261 smp_llsc_mb(); 261 smp_llsc_mb();
262 262
263 if (cpu_has_llsc && R10000_LLSC_WAR) { 263 if (kernel_uses_llsc && R10000_LLSC_WAR) {
264 unsigned long *m = ((unsigned long *) addr) + (nr >> SZLONG_LOG); 264 unsigned long *m = ((unsigned long *) addr) + (nr >> SZLONG_LOG);
265 unsigned long temp; 265 unsigned long temp;
266 266
@@ -275,7 +275,7 @@ static inline int test_and_set_bit(unsigned long nr,
275 : "=&r" (temp), "=m" (*m), "=&r" (res) 275 : "=&r" (temp), "=m" (*m), "=&r" (res)
276 : "r" (1UL << bit), "m" (*m) 276 : "r" (1UL << bit), "m" (*m)
277 : "memory"); 277 : "memory");
278 } else if (cpu_has_llsc) { 278 } else if (kernel_uses_llsc) {
279 unsigned long *m = ((unsigned long *) addr) + (nr >> SZLONG_LOG); 279 unsigned long *m = ((unsigned long *) addr) + (nr >> SZLONG_LOG);
280 unsigned long temp; 280 unsigned long temp;
281 281
@@ -328,7 +328,7 @@ static inline int test_and_set_bit_lock(unsigned long nr,
328 unsigned short bit = nr & SZLONG_MASK; 328 unsigned short bit = nr & SZLONG_MASK;
329 unsigned long res; 329 unsigned long res;
330 330
331 if (cpu_has_llsc && R10000_LLSC_WAR) { 331 if (kernel_uses_llsc && R10000_LLSC_WAR) {
332 unsigned long *m = ((unsigned long *) addr) + (nr >> SZLONG_LOG); 332 unsigned long *m = ((unsigned long *) addr) + (nr >> SZLONG_LOG);
333 unsigned long temp; 333 unsigned long temp;
334 334
@@ -343,7 +343,7 @@ static inline int test_and_set_bit_lock(unsigned long nr,
343 : "=&r" (temp), "=m" (*m), "=&r" (res) 343 : "=&r" (temp), "=m" (*m), "=&r" (res)
344 : "r" (1UL << bit), "m" (*m) 344 : "r" (1UL << bit), "m" (*m)
345 : "memory"); 345 : "memory");
346 } else if (cpu_has_llsc) { 346 } else if (kernel_uses_llsc) {
347 unsigned long *m = ((unsigned long *) addr) + (nr >> SZLONG_LOG); 347 unsigned long *m = ((unsigned long *) addr) + (nr >> SZLONG_LOG);
348 unsigned long temp; 348 unsigned long temp;
349 349
@@ -397,7 +397,7 @@ static inline int test_and_clear_bit(unsigned long nr,
397 397
398 smp_llsc_mb(); 398 smp_llsc_mb();
399 399
400 if (cpu_has_llsc && R10000_LLSC_WAR) { 400 if (kernel_uses_llsc && R10000_LLSC_WAR) {
401 unsigned long *m = ((unsigned long *) addr) + (nr >> SZLONG_LOG); 401 unsigned long *m = ((unsigned long *) addr) + (nr >> SZLONG_LOG);
402 unsigned long temp; 402 unsigned long temp;
403 403
@@ -414,7 +414,7 @@ static inline int test_and_clear_bit(unsigned long nr,
414 : "r" (1UL << bit), "m" (*m) 414 : "r" (1UL << bit), "m" (*m)
415 : "memory"); 415 : "memory");
416#ifdef CONFIG_CPU_MIPSR2 416#ifdef CONFIG_CPU_MIPSR2
417 } else if (__builtin_constant_p(nr)) { 417 } else if (kernel_uses_llsc && __builtin_constant_p(nr)) {
418 unsigned long *m = ((unsigned long *) addr) + (nr >> SZLONG_LOG); 418 unsigned long *m = ((unsigned long *) addr) + (nr >> SZLONG_LOG);
419 unsigned long temp; 419 unsigned long temp;
420 420
@@ -431,7 +431,7 @@ static inline int test_and_clear_bit(unsigned long nr,
431 : "ir" (bit), "m" (*m) 431 : "ir" (bit), "m" (*m)
432 : "memory"); 432 : "memory");
433#endif 433#endif
434 } else if (cpu_has_llsc) { 434 } else if (kernel_uses_llsc) {
435 unsigned long *m = ((unsigned long *) addr) + (nr >> SZLONG_LOG); 435 unsigned long *m = ((unsigned long *) addr) + (nr >> SZLONG_LOG);
436 unsigned long temp; 436 unsigned long temp;
437 437
@@ -487,7 +487,7 @@ static inline int test_and_change_bit(unsigned long nr,
487 487
488 smp_llsc_mb(); 488 smp_llsc_mb();
489 489
490 if (cpu_has_llsc && R10000_LLSC_WAR) { 490 if (kernel_uses_llsc && R10000_LLSC_WAR) {
491 unsigned long *m = ((unsigned long *) addr) + (nr >> SZLONG_LOG); 491 unsigned long *m = ((unsigned long *) addr) + (nr >> SZLONG_LOG);
492 unsigned long temp; 492 unsigned long temp;
493 493
@@ -502,7 +502,7 @@ static inline int test_and_change_bit(unsigned long nr,
502 : "=&r" (temp), "=m" (*m), "=&r" (res) 502 : "=&r" (temp), "=m" (*m), "=&r" (res)
503 : "r" (1UL << bit), "m" (*m) 503 : "r" (1UL << bit), "m" (*m)
504 : "memory"); 504 : "memory");
505 } else if (cpu_has_llsc) { 505 } else if (kernel_uses_llsc) {
506 unsigned long *m = ((unsigned long *) addr) + (nr >> SZLONG_LOG); 506 unsigned long *m = ((unsigned long *) addr) + (nr >> SZLONG_LOG);
507 unsigned long temp; 507 unsigned long temp;
508 508
diff --git a/arch/mips/include/asm/bootinfo.h b/arch/mips/include/asm/bootinfo.h
index 610fe3af7a03..f5dfaf6a1606 100644
--- a/arch/mips/include/asm/bootinfo.h
+++ b/arch/mips/include/asm/bootinfo.h
@@ -7,6 +7,7 @@
7 * Copyright (C) 1995, 1996 Andreas Busse 7 * Copyright (C) 1995, 1996 Andreas Busse
8 * Copyright (C) 1995, 1996 Stoned Elipot 8 * Copyright (C) 1995, 1996 Stoned Elipot
9 * Copyright (C) 1995, 1996 Paul M. Antoine. 9 * Copyright (C) 1995, 1996 Paul M. Antoine.
10 * Copyright (C) 2009 Zhang Le
10 */ 11 */
11#ifndef _ASM_BOOTINFO_H 12#ifndef _ASM_BOOTINFO_H
12#define _ASM_BOOTINFO_H 13#define _ASM_BOOTINFO_H
@@ -57,6 +58,17 @@
57#define MACH_MIKROTIK_RB532 0 /* Mikrotik RouterBoard 532 */ 58#define MACH_MIKROTIK_RB532 0 /* Mikrotik RouterBoard 532 */
58#define MACH_MIKROTIK_RB532A 1 /* Mikrotik RouterBoard 532A */ 59#define MACH_MIKROTIK_RB532A 1 /* Mikrotik RouterBoard 532A */
59 60
61/*
62 * Valid machtype for Loongson family
63 */
64#define MACH_LOONGSON_UNKNOWN 0
65#define MACH_LEMOTE_FL2E 1
66#define MACH_LEMOTE_FL2F 2
67#define MACH_LEMOTE_ML2F7 3
68#define MACH_LEMOTE_YL2F89 4
69#define MACH_DEXXON_GDIUM2F10 5
70#define MACH_LOONGSON_END 6
71
60#define CL_SIZE COMMAND_LINE_SIZE 72#define CL_SIZE COMMAND_LINE_SIZE
61 73
62extern char *system_type; 74extern char *system_type;
diff --git a/arch/mips/include/asm/cmpxchg.h b/arch/mips/include/asm/cmpxchg.h
index 4a812c3ceb90..815a438a268d 100644
--- a/arch/mips/include/asm/cmpxchg.h
+++ b/arch/mips/include/asm/cmpxchg.h
@@ -16,7 +16,7 @@
16({ \ 16({ \
17 __typeof(*(m)) __ret; \ 17 __typeof(*(m)) __ret; \
18 \ 18 \
19 if (cpu_has_llsc && R10000_LLSC_WAR) { \ 19 if (kernel_uses_llsc && R10000_LLSC_WAR) { \
20 __asm__ __volatile__( \ 20 __asm__ __volatile__( \
21 " .set push \n" \ 21 " .set push \n" \
22 " .set noat \n" \ 22 " .set noat \n" \
@@ -33,7 +33,7 @@
33 : "=&r" (__ret), "=R" (*m) \ 33 : "=&r" (__ret), "=R" (*m) \
34 : "R" (*m), "Jr" (old), "Jr" (new) \ 34 : "R" (*m), "Jr" (old), "Jr" (new) \
35 : "memory"); \ 35 : "memory"); \
36 } else if (cpu_has_llsc) { \ 36 } else if (kernel_uses_llsc) { \
37 __asm__ __volatile__( \ 37 __asm__ __volatile__( \
38 " .set push \n" \ 38 " .set push \n" \
39 " .set noat \n" \ 39 " .set noat \n" \
diff --git a/arch/mips/include/asm/cpu-features.h b/arch/mips/include/asm/cpu-features.h
index 8ab1d12ba7f4..1f4df647c384 100644
--- a/arch/mips/include/asm/cpu-features.h
+++ b/arch/mips/include/asm/cpu-features.h
@@ -80,6 +80,9 @@
80#ifndef cpu_has_llsc 80#ifndef cpu_has_llsc
81#define cpu_has_llsc (cpu_data[0].options & MIPS_CPU_LLSC) 81#define cpu_has_llsc (cpu_data[0].options & MIPS_CPU_LLSC)
82#endif 82#endif
83#ifndef kernel_uses_llsc
84#define kernel_uses_llsc cpu_has_llsc
85#endif
83#ifndef cpu_has_mips16 86#ifndef cpu_has_mips16
84#define cpu_has_mips16 (cpu_data[0].ases & MIPS_ASE_MIPS16) 87#define cpu_has_mips16 (cpu_data[0].ases & MIPS_ASE_MIPS16)
85#endif 88#endif
diff --git a/arch/mips/include/asm/cpu.h b/arch/mips/include/asm/cpu.h
index 3bdc0e3d89cc..4b96d1a36056 100644
--- a/arch/mips/include/asm/cpu.h
+++ b/arch/mips/include/asm/cpu.h
@@ -113,6 +113,12 @@
113 113
114#define PRID_IMP_BCM4710 0x4000 114#define PRID_IMP_BCM4710 0x4000
115#define PRID_IMP_BCM3302 0x9000 115#define PRID_IMP_BCM3302 0x9000
116#define PRID_IMP_BCM6338 0x9000
117#define PRID_IMP_BCM6345 0x8000
118#define PRID_IMP_BCM6348 0x9100
119#define PRID_IMP_BCM4350 0xA000
120#define PRID_REV_BCM6358 0x0010
121#define PRID_REV_BCM6368 0x0030
116 122
117/* 123/*
118 * These are the PRID's for when 23:16 == PRID_COMP_CAVIUM 124 * These are the PRID's for when 23:16 == PRID_COMP_CAVIUM
@@ -210,6 +216,7 @@ enum cpu_type_enum {
210 */ 216 */
211 CPU_4KC, CPU_4KEC, CPU_4KSC, CPU_24K, CPU_34K, CPU_1004K, CPU_74K, 217 CPU_4KC, CPU_4KEC, CPU_4KSC, CPU_24K, CPU_34K, CPU_1004K, CPU_74K,
212 CPU_ALCHEMY, CPU_PR4450, CPU_BCM3302, CPU_BCM4710, 218 CPU_ALCHEMY, CPU_PR4450, CPU_BCM3302, CPU_BCM4710,
219 CPU_BCM6338, CPU_BCM6345, CPU_BCM6348, CPU_BCM6358,
213 220
214 /* 221 /*
215 * MIPS64 class processors 222 * MIPS64 class processors
diff --git a/arch/mips/include/asm/delay.h b/arch/mips/include/asm/delay.h
index d2d8949be6b7..e7cd78277c23 100644
--- a/arch/mips/include/asm/delay.h
+++ b/arch/mips/include/asm/delay.h
@@ -11,6 +11,8 @@
11#ifndef _ASM_DELAY_H 11#ifndef _ASM_DELAY_H
12#define _ASM_DELAY_H 12#define _ASM_DELAY_H
13 13
14#include <linux/param.h>
15
14extern void __delay(unsigned int loops); 16extern void __delay(unsigned int loops);
15extern void __ndelay(unsigned int ns); 17extern void __ndelay(unsigned int ns);
16extern void __udelay(unsigned int us); 18extern void __udelay(unsigned int us);
diff --git a/arch/mips/include/asm/fixmap.h b/arch/mips/include/asm/fixmap.h
index 0f5caa1307f1..efeddc8db8b1 100644
--- a/arch/mips/include/asm/fixmap.h
+++ b/arch/mips/include/asm/fixmap.h
@@ -67,11 +67,15 @@ enum fixed_addresses {
67 * the start of the fixmap, and leave one page empty 67 * the start of the fixmap, and leave one page empty
68 * at the top of mem.. 68 * at the top of mem..
69 */ 69 */
70#ifdef CONFIG_BCM63XX
71#define FIXADDR_TOP ((unsigned long)(long)(int)0xff000000)
72#else
70#if defined(CONFIG_CPU_TX39XX) || defined(CONFIG_CPU_TX49XX) 73#if defined(CONFIG_CPU_TX39XX) || defined(CONFIG_CPU_TX49XX)
71#define FIXADDR_TOP ((unsigned long)(long)(int)(0xff000000 - 0x20000)) 74#define FIXADDR_TOP ((unsigned long)(long)(int)(0xff000000 - 0x20000))
72#else 75#else
73#define FIXADDR_TOP ((unsigned long)(long)(int)0xfffe0000) 76#define FIXADDR_TOP ((unsigned long)(long)(int)0xfffe0000)
74#endif 77#endif
78#endif
75#define FIXADDR_SIZE (__end_of_fixed_addresses << PAGE_SHIFT) 79#define FIXADDR_SIZE (__end_of_fixed_addresses << PAGE_SHIFT)
76#define FIXADDR_START (FIXADDR_TOP - FIXADDR_SIZE) 80#define FIXADDR_START (FIXADDR_TOP - FIXADDR_SIZE)
77 81
diff --git a/arch/mips/include/asm/hardirq.h b/arch/mips/include/asm/hardirq.h
index 90bf399e6dd9..c977a86c2c65 100644
--- a/arch/mips/include/asm/hardirq.h
+++ b/arch/mips/include/asm/hardirq.h
@@ -10,15 +10,9 @@
10#ifndef _ASM_HARDIRQ_H 10#ifndef _ASM_HARDIRQ_H
11#define _ASM_HARDIRQ_H 11#define _ASM_HARDIRQ_H
12 12
13#include <linux/threads.h>
14#include <linux/irq.h>
15
16typedef struct {
17 unsigned int __softirq_pending;
18} ____cacheline_aligned irq_cpustat_t;
19
20#include <linux/irq_cpustat.h> /* Standard mappings for irq_cpustat_t above */
21
22extern void ack_bad_irq(unsigned int irq); 13extern void ack_bad_irq(unsigned int irq);
14#define ack_bad_irq ack_bad_irq
15
16#include <asm-generic/hardirq.h>
23 17
24#endif /* _ASM_HARDIRQ_H */ 18#endif /* _ASM_HARDIRQ_H */
diff --git a/arch/mips/include/asm/lasat/lasat.h b/arch/mips/include/asm/lasat/lasat.h
index caeba1e302a2..a1ada1c27c16 100644
--- a/arch/mips/include/asm/lasat/lasat.h
+++ b/arch/mips/include/asm/lasat/lasat.h
@@ -227,6 +227,7 @@ extern void lasat_write_eeprom_info(void);
227 * It is used for the bit-banging rtc and eeprom drivers */ 227 * It is used for the bit-banging rtc and eeprom drivers */
228 228
229#include <linux/delay.h> 229#include <linux/delay.h>
230#include <linux/smp.h>
230 231
231/* calculating with the slowest board with 100 MHz clock */ 232/* calculating with the slowest board with 100 MHz clock */
232#define LASAT_100_DIVIDER 20 233#define LASAT_100_DIVIDER 20
diff --git a/arch/mips/include/asm/local.h b/arch/mips/include/asm/local.h
index f96fd59e0845..361f4f16c30c 100644
--- a/arch/mips/include/asm/local.h
+++ b/arch/mips/include/asm/local.h
@@ -29,7 +29,7 @@ static __inline__ long local_add_return(long i, local_t * l)
29{ 29{
30 unsigned long result; 30 unsigned long result;
31 31
32 if (cpu_has_llsc && R10000_LLSC_WAR) { 32 if (kernel_uses_llsc && R10000_LLSC_WAR) {
33 unsigned long temp; 33 unsigned long temp;
34 34
35 __asm__ __volatile__( 35 __asm__ __volatile__(
@@ -43,7 +43,7 @@ static __inline__ long local_add_return(long i, local_t * l)
43 : "=&r" (result), "=&r" (temp), "=m" (l->a.counter) 43 : "=&r" (result), "=&r" (temp), "=m" (l->a.counter)
44 : "Ir" (i), "m" (l->a.counter) 44 : "Ir" (i), "m" (l->a.counter)
45 : "memory"); 45 : "memory");
46 } else if (cpu_has_llsc) { 46 } else if (kernel_uses_llsc) {
47 unsigned long temp; 47 unsigned long temp;
48 48
49 __asm__ __volatile__( 49 __asm__ __volatile__(
@@ -74,7 +74,7 @@ static __inline__ long local_sub_return(long i, local_t * l)
74{ 74{
75 unsigned long result; 75 unsigned long result;
76 76
77 if (cpu_has_llsc && R10000_LLSC_WAR) { 77 if (kernel_uses_llsc && R10000_LLSC_WAR) {
78 unsigned long temp; 78 unsigned long temp;
79 79
80 __asm__ __volatile__( 80 __asm__ __volatile__(
@@ -88,7 +88,7 @@ static __inline__ long local_sub_return(long i, local_t * l)
88 : "=&r" (result), "=&r" (temp), "=m" (l->a.counter) 88 : "=&r" (result), "=&r" (temp), "=m" (l->a.counter)
89 : "Ir" (i), "m" (l->a.counter) 89 : "Ir" (i), "m" (l->a.counter)
90 : "memory"); 90 : "memory");
91 } else if (cpu_has_llsc) { 91 } else if (kernel_uses_llsc) {
92 unsigned long temp; 92 unsigned long temp;
93 93
94 __asm__ __volatile__( 94 __asm__ __volatile__(
diff --git a/arch/mips/include/asm/mach-au1x00/gpio-au1000.h b/arch/mips/include/asm/mach-au1x00/gpio-au1000.h
index 127d4ed9f073..feea00148b5d 100644
--- a/arch/mips/include/asm/mach-au1x00/gpio-au1000.h
+++ b/arch/mips/include/asm/mach-au1x00/gpio-au1000.h
@@ -578,6 +578,15 @@ static inline int irq_to_gpio(int irq)
578 return alchemy_irq_to_gpio(irq); 578 return alchemy_irq_to_gpio(irq);
579} 579}
580 580
581static inline int gpio_request(unsigned gpio, const char *label)
582{
583 return 0;
584}
585
586static inline void gpio_free(unsigned gpio)
587{
588}
589
581#endif /* !CONFIG_ALCHEMY_GPIO_INDIRECT */ 590#endif /* !CONFIG_ALCHEMY_GPIO_INDIRECT */
582 591
583 592
diff --git a/arch/mips/include/asm/mach-bcm63xx/bcm63xx_board.h b/arch/mips/include/asm/mach-bcm63xx/bcm63xx_board.h
new file mode 100644
index 000000000000..fa3e7e617b09
--- /dev/null
+++ b/arch/mips/include/asm/mach-bcm63xx/bcm63xx_board.h
@@ -0,0 +1,12 @@
1#ifndef BCM63XX_BOARD_H_
2#define BCM63XX_BOARD_H_
3
4const char *board_get_name(void);
5
6void board_prom_init(void);
7
8void board_setup(void);
9
10int board_register_devices(void);
11
12#endif /* ! BCM63XX_BOARD_H_ */
diff --git a/arch/mips/include/asm/mach-bcm63xx/bcm63xx_clk.h b/arch/mips/include/asm/mach-bcm63xx/bcm63xx_clk.h
new file mode 100644
index 000000000000..8fcf8df4418a
--- /dev/null
+++ b/arch/mips/include/asm/mach-bcm63xx/bcm63xx_clk.h
@@ -0,0 +1,11 @@
1#ifndef BCM63XX_CLK_H_
2#define BCM63XX_CLK_H_
3
4struct clk {
5 void (*set)(struct clk *, int);
6 unsigned int rate;
7 unsigned int usage;
8 int id;
9};
10
11#endif /* ! BCM63XX_CLK_H_ */
diff --git a/arch/mips/include/asm/mach-bcm63xx/bcm63xx_cpu.h b/arch/mips/include/asm/mach-bcm63xx/bcm63xx_cpu.h
new file mode 100644
index 000000000000..b12c4aca2cc9
--- /dev/null
+++ b/arch/mips/include/asm/mach-bcm63xx/bcm63xx_cpu.h
@@ -0,0 +1,538 @@
1#ifndef BCM63XX_CPU_H_
2#define BCM63XX_CPU_H_
3
4#include <linux/types.h>
5#include <linux/init.h>
6
7/*
8 * Macro to fetch bcm63xx cpu id and revision, should be optimized at
9 * compile time if only one CPU support is enabled (idea stolen from
10 * arm mach-types)
11 */
12#define BCM6338_CPU_ID 0x6338
13#define BCM6345_CPU_ID 0x6345
14#define BCM6348_CPU_ID 0x6348
15#define BCM6358_CPU_ID 0x6358
16
17void __init bcm63xx_cpu_init(void);
18u16 __bcm63xx_get_cpu_id(void);
19u16 bcm63xx_get_cpu_rev(void);
20unsigned int bcm63xx_get_cpu_freq(void);
21
22#ifdef CONFIG_BCM63XX_CPU_6338
23# ifdef bcm63xx_get_cpu_id
24# undef bcm63xx_get_cpu_id
25# define bcm63xx_get_cpu_id() __bcm63xx_get_cpu_id()
26# define BCMCPU_RUNTIME_DETECT
27# else
28# define bcm63xx_get_cpu_id() BCM6338_CPU_ID
29# endif
30# define BCMCPU_IS_6338() (bcm63xx_get_cpu_id() == BCM6338_CPU_ID)
31#else
32# define BCMCPU_IS_6338() (0)
33#endif
34
35#ifdef CONFIG_BCM63XX_CPU_6345
36# ifdef bcm63xx_get_cpu_id
37# undef bcm63xx_get_cpu_id
38# define bcm63xx_get_cpu_id() __bcm63xx_get_cpu_id()
39# define BCMCPU_RUNTIME_DETECT
40# else
41# define bcm63xx_get_cpu_id() BCM6345_CPU_ID
42# endif
43# define BCMCPU_IS_6345() (bcm63xx_get_cpu_id() == BCM6345_CPU_ID)
44#else
45# define BCMCPU_IS_6345() (0)
46#endif
47
48#ifdef CONFIG_BCM63XX_CPU_6348
49# ifdef bcm63xx_get_cpu_id
50# undef bcm63xx_get_cpu_id
51# define bcm63xx_get_cpu_id() __bcm63xx_get_cpu_id()
52# define BCMCPU_RUNTIME_DETECT
53# else
54# define bcm63xx_get_cpu_id() BCM6348_CPU_ID
55# endif
56# define BCMCPU_IS_6348() (bcm63xx_get_cpu_id() == BCM6348_CPU_ID)
57#else
58# define BCMCPU_IS_6348() (0)
59#endif
60
61#ifdef CONFIG_BCM63XX_CPU_6358
62# ifdef bcm63xx_get_cpu_id
63# undef bcm63xx_get_cpu_id
64# define bcm63xx_get_cpu_id() __bcm63xx_get_cpu_id()
65# define BCMCPU_RUNTIME_DETECT
66# else
67# define bcm63xx_get_cpu_id() BCM6358_CPU_ID
68# endif
69# define BCMCPU_IS_6358() (bcm63xx_get_cpu_id() == BCM6358_CPU_ID)
70#else
71# define BCMCPU_IS_6358() (0)
72#endif
73
74#ifndef bcm63xx_get_cpu_id
75#error "No CPU support configured"
76#endif
77
78/*
79 * While registers sets are (mostly) the same across 63xx CPU, base
80 * address of these sets do change.
81 */
82enum bcm63xx_regs_set {
83 RSET_DSL_LMEM = 0,
84 RSET_PERF,
85 RSET_TIMER,
86 RSET_WDT,
87 RSET_UART0,
88 RSET_GPIO,
89 RSET_SPI,
90 RSET_UDC0,
91 RSET_OHCI0,
92 RSET_OHCI_PRIV,
93 RSET_USBH_PRIV,
94 RSET_MPI,
95 RSET_PCMCIA,
96 RSET_DSL,
97 RSET_ENET0,
98 RSET_ENET1,
99 RSET_ENETDMA,
100 RSET_EHCI0,
101 RSET_SDRAM,
102 RSET_MEMC,
103 RSET_DDR,
104};
105
106#define RSET_DSL_LMEM_SIZE (64 * 1024 * 4)
107#define RSET_DSL_SIZE 4096
108#define RSET_WDT_SIZE 12
109#define RSET_ENET_SIZE 2048
110#define RSET_ENETDMA_SIZE 2048
111#define RSET_UART_SIZE 24
112#define RSET_UDC_SIZE 256
113#define RSET_OHCI_SIZE 256
114#define RSET_EHCI_SIZE 256
115#define RSET_PCMCIA_SIZE 12
116
117/*
118 * 6338 register sets base address
119 */
120#define BCM_6338_DSL_LMEM_BASE (0xfff00000)
121#define BCM_6338_PERF_BASE (0xfffe0000)
122#define BCM_6338_BB_BASE (0xfffe0100)
123#define BCM_6338_TIMER_BASE (0xfffe0200)
124#define BCM_6338_WDT_BASE (0xfffe021c)
125#define BCM_6338_UART0_BASE (0xfffe0300)
126#define BCM_6338_GPIO_BASE (0xfffe0400)
127#define BCM_6338_SPI_BASE (0xfffe0c00)
128#define BCM_6338_UDC0_BASE (0xdeadbeef)
129#define BCM_6338_USBDMA_BASE (0xfffe2400)
130#define BCM_6338_OHCI0_BASE (0xdeadbeef)
131#define BCM_6338_OHCI_PRIV_BASE (0xfffe3000)
132#define BCM_6338_USBH_PRIV_BASE (0xdeadbeef)
133#define BCM_6338_MPI_BASE (0xfffe3160)
134#define BCM_6338_PCMCIA_BASE (0xdeadbeef)
135#define BCM_6338_SDRAM_REGS_BASE (0xfffe3100)
136#define BCM_6338_DSL_BASE (0xfffe1000)
137#define BCM_6338_SAR_BASE (0xfffe2000)
138#define BCM_6338_UBUS_BASE (0xdeadbeef)
139#define BCM_6338_ENET0_BASE (0xfffe2800)
140#define BCM_6338_ENET1_BASE (0xdeadbeef)
141#define BCM_6338_ENETDMA_BASE (0xfffe2400)
142#define BCM_6338_EHCI0_BASE (0xdeadbeef)
143#define BCM_6338_SDRAM_BASE (0xfffe3100)
144#define BCM_6338_MEMC_BASE (0xdeadbeef)
145#define BCM_6338_DDR_BASE (0xdeadbeef)
146
147/*
148 * 6345 register sets base address
149 */
150#define BCM_6345_DSL_LMEM_BASE (0xfff00000)
151#define BCM_6345_PERF_BASE (0xfffe0000)
152#define BCM_6345_BB_BASE (0xfffe0100)
153#define BCM_6345_TIMER_BASE (0xfffe0200)
154#define BCM_6345_WDT_BASE (0xfffe021c)
155#define BCM_6345_UART0_BASE (0xfffe0300)
156#define BCM_6345_GPIO_BASE (0xfffe0400)
157#define BCM_6345_SPI_BASE (0xdeadbeef)
158#define BCM_6345_UDC0_BASE (0xdeadbeef)
159#define BCM_6345_USBDMA_BASE (0xfffe2800)
160#define BCM_6345_ENET0_BASE (0xfffe1800)
161#define BCM_6345_ENETDMA_BASE (0xfffe2800)
162#define BCM_6345_PCMCIA_BASE (0xfffe2028)
163#define BCM_6345_MPI_BASE (0xdeadbeef)
164#define BCM_6345_OHCI0_BASE (0xfffe2100)
165#define BCM_6345_OHCI_PRIV_BASE (0xfffe2200)
166#define BCM_6345_USBH_PRIV_BASE (0xdeadbeef)
167#define BCM_6345_SDRAM_REGS_BASE (0xfffe2300)
168#define BCM_6345_DSL_BASE (0xdeadbeef)
169#define BCM_6345_SAR_BASE (0xdeadbeef)
170#define BCM_6345_UBUS_BASE (0xdeadbeef)
171#define BCM_6345_ENET1_BASE (0xdeadbeef)
172#define BCM_6345_EHCI0_BASE (0xdeadbeef)
173#define BCM_6345_SDRAM_BASE (0xfffe2300)
174#define BCM_6345_MEMC_BASE (0xdeadbeef)
175#define BCM_6345_DDR_BASE (0xdeadbeef)
176
177/*
178 * 6348 register sets base address
179 */
180#define BCM_6348_DSL_LMEM_BASE (0xfff00000)
181#define BCM_6348_PERF_BASE (0xfffe0000)
182#define BCM_6348_TIMER_BASE (0xfffe0200)
183#define BCM_6348_WDT_BASE (0xfffe021c)
184#define BCM_6348_UART0_BASE (0xfffe0300)
185#define BCM_6348_GPIO_BASE (0xfffe0400)
186#define BCM_6348_SPI_BASE (0xfffe0c00)
187#define BCM_6348_UDC0_BASE (0xfffe1000)
188#define BCM_6348_OHCI0_BASE (0xfffe1b00)
189#define BCM_6348_OHCI_PRIV_BASE (0xfffe1c00)
190#define BCM_6348_USBH_PRIV_BASE (0xdeadbeef)
191#define BCM_6348_MPI_BASE (0xfffe2000)
192#define BCM_6348_PCMCIA_BASE (0xfffe2054)
193#define BCM_6348_SDRAM_REGS_BASE (0xfffe2300)
194#define BCM_6348_DSL_BASE (0xfffe3000)
195#define BCM_6348_ENET0_BASE (0xfffe6000)
196#define BCM_6348_ENET1_BASE (0xfffe6800)
197#define BCM_6348_ENETDMA_BASE (0xfffe7000)
198#define BCM_6348_EHCI0_BASE (0xdeadbeef)
199#define BCM_6348_SDRAM_BASE (0xfffe2300)
200#define BCM_6348_MEMC_BASE (0xdeadbeef)
201#define BCM_6348_DDR_BASE (0xdeadbeef)
202
203/*
204 * 6358 register sets base address
205 */
206#define BCM_6358_DSL_LMEM_BASE (0xfff00000)
207#define BCM_6358_PERF_BASE (0xfffe0000)
208#define BCM_6358_TIMER_BASE (0xfffe0040)
209#define BCM_6358_WDT_BASE (0xfffe005c)
210#define BCM_6358_UART0_BASE (0xfffe0100)
211#define BCM_6358_GPIO_BASE (0xfffe0080)
212#define BCM_6358_SPI_BASE (0xdeadbeef)
213#define BCM_6358_UDC0_BASE (0xfffe0800)
214#define BCM_6358_OHCI0_BASE (0xfffe1400)
215#define BCM_6358_OHCI_PRIV_BASE (0xdeadbeef)
216#define BCM_6358_USBH_PRIV_BASE (0xfffe1500)
217#define BCM_6358_MPI_BASE (0xfffe1000)
218#define BCM_6358_PCMCIA_BASE (0xfffe1054)
219#define BCM_6358_SDRAM_REGS_BASE (0xfffe2300)
220#define BCM_6358_DSL_BASE (0xfffe3000)
221#define BCM_6358_ENET0_BASE (0xfffe4000)
222#define BCM_6358_ENET1_BASE (0xfffe4800)
223#define BCM_6358_ENETDMA_BASE (0xfffe5000)
224#define BCM_6358_EHCI0_BASE (0xfffe1300)
225#define BCM_6358_SDRAM_BASE (0xdeadbeef)
226#define BCM_6358_MEMC_BASE (0xfffe1200)
227#define BCM_6358_DDR_BASE (0xfffe12a0)
228
229
230extern const unsigned long *bcm63xx_regs_base;
231
232static inline unsigned long bcm63xx_regset_address(enum bcm63xx_regs_set set)
233{
234#ifdef BCMCPU_RUNTIME_DETECT
235 return bcm63xx_regs_base[set];
236#else
237#ifdef CONFIG_BCM63XX_CPU_6338
238 switch (set) {
239 case RSET_DSL_LMEM:
240 return BCM_6338_DSL_LMEM_BASE;
241 case RSET_PERF:
242 return BCM_6338_PERF_BASE;
243 case RSET_TIMER:
244 return BCM_6338_TIMER_BASE;
245 case RSET_WDT:
246 return BCM_6338_WDT_BASE;
247 case RSET_UART0:
248 return BCM_6338_UART0_BASE;
249 case RSET_GPIO:
250 return BCM_6338_GPIO_BASE;
251 case RSET_SPI:
252 return BCM_6338_SPI_BASE;
253 case RSET_UDC0:
254 return BCM_6338_UDC0_BASE;
255 case RSET_OHCI0:
256 return BCM_6338_OHCI0_BASE;
257 case RSET_OHCI_PRIV:
258 return BCM_6338_OHCI_PRIV_BASE;
259 case RSET_USBH_PRIV:
260 return BCM_6338_USBH_PRIV_BASE;
261 case RSET_MPI:
262 return BCM_6338_MPI_BASE;
263 case RSET_PCMCIA:
264 return BCM_6338_PCMCIA_BASE;
265 case RSET_DSL:
266 return BCM_6338_DSL_BASE;
267 case RSET_ENET0:
268 return BCM_6338_ENET0_BASE;
269 case RSET_ENET1:
270 return BCM_6338_ENET1_BASE;
271 case RSET_ENETDMA:
272 return BCM_6338_ENETDMA_BASE;
273 case RSET_EHCI0:
274 return BCM_6338_EHCI0_BASE;
275 case RSET_SDRAM:
276 return BCM_6338_SDRAM_BASE;
277 case RSET_MEMC:
278 return BCM_6338_MEMC_BASE;
279 case RSET_DDR:
280 return BCM_6338_DDR_BASE;
281 }
282#endif
283#ifdef CONFIG_BCM63XX_CPU_6345
284 switch (set) {
285 case RSET_DSL_LMEM:
286 return BCM_6345_DSL_LMEM_BASE;
287 case RSET_PERF:
288 return BCM_6345_PERF_BASE;
289 case RSET_TIMER:
290 return BCM_6345_TIMER_BASE;
291 case RSET_WDT:
292 return BCM_6345_WDT_BASE;
293 case RSET_UART0:
294 return BCM_6345_UART0_BASE;
295 case RSET_GPIO:
296 return BCM_6345_GPIO_BASE;
297 case RSET_SPI:
298 return BCM_6345_SPI_BASE;
299 case RSET_UDC0:
300 return BCM_6345_UDC0_BASE;
301 case RSET_OHCI0:
302 return BCM_6345_OHCI0_BASE;
303 case RSET_OHCI_PRIV:
304 return BCM_6345_OHCI_PRIV_BASE;
305 case RSET_USBH_PRIV:
306 return BCM_6345_USBH_PRIV_BASE;
307 case RSET_MPI:
308 return BCM_6345_MPI_BASE;
309 case RSET_PCMCIA:
310 return BCM_6345_PCMCIA_BASE;
311 case RSET_DSL:
312 return BCM_6345_DSL_BASE;
313 case RSET_ENET0:
314 return BCM_6345_ENET0_BASE;
315 case RSET_ENET1:
316 return BCM_6345_ENET1_BASE;
317 case RSET_ENETDMA:
318 return BCM_6345_ENETDMA_BASE;
319 case RSET_EHCI0:
320 return BCM_6345_EHCI0_BASE;
321 case RSET_SDRAM:
322 return BCM_6345_SDRAM_BASE;
323 case RSET_MEMC:
324 return BCM_6345_MEMC_BASE;
325 case RSET_DDR:
326 return BCM_6345_DDR_BASE;
327 }
328#endif
329#ifdef CONFIG_BCM63XX_CPU_6348
330 switch (set) {
331 case RSET_DSL_LMEM:
332 return BCM_6348_DSL_LMEM_BASE;
333 case RSET_PERF:
334 return BCM_6348_PERF_BASE;
335 case RSET_TIMER:
336 return BCM_6348_TIMER_BASE;
337 case RSET_WDT:
338 return BCM_6348_WDT_BASE;
339 case RSET_UART0:
340 return BCM_6348_UART0_BASE;
341 case RSET_GPIO:
342 return BCM_6348_GPIO_BASE;
343 case RSET_SPI:
344 return BCM_6348_SPI_BASE;
345 case RSET_UDC0:
346 return BCM_6348_UDC0_BASE;
347 case RSET_OHCI0:
348 return BCM_6348_OHCI0_BASE;
349 case RSET_OHCI_PRIV:
350 return BCM_6348_OHCI_PRIV_BASE;
351 case RSET_USBH_PRIV:
352 return BCM_6348_USBH_PRIV_BASE;
353 case RSET_MPI:
354 return BCM_6348_MPI_BASE;
355 case RSET_PCMCIA:
356 return BCM_6348_PCMCIA_BASE;
357 case RSET_DSL:
358 return BCM_6348_DSL_BASE;
359 case RSET_ENET0:
360 return BCM_6348_ENET0_BASE;
361 case RSET_ENET1:
362 return BCM_6348_ENET1_BASE;
363 case RSET_ENETDMA:
364 return BCM_6348_ENETDMA_BASE;
365 case RSET_EHCI0:
366 return BCM_6348_EHCI0_BASE;
367 case RSET_SDRAM:
368 return BCM_6348_SDRAM_BASE;
369 case RSET_MEMC:
370 return BCM_6348_MEMC_BASE;
371 case RSET_DDR:
372 return BCM_6348_DDR_BASE;
373 }
374#endif
375#ifdef CONFIG_BCM63XX_CPU_6358
376 switch (set) {
377 case RSET_DSL_LMEM:
378 return BCM_6358_DSL_LMEM_BASE;
379 case RSET_PERF:
380 return BCM_6358_PERF_BASE;
381 case RSET_TIMER:
382 return BCM_6358_TIMER_BASE;
383 case RSET_WDT:
384 return BCM_6358_WDT_BASE;
385 case RSET_UART0:
386 return BCM_6358_UART0_BASE;
387 case RSET_GPIO:
388 return BCM_6358_GPIO_BASE;
389 case RSET_SPI:
390 return BCM_6358_SPI_BASE;
391 case RSET_UDC0:
392 return BCM_6358_UDC0_BASE;
393 case RSET_OHCI0:
394 return BCM_6358_OHCI0_BASE;
395 case RSET_OHCI_PRIV:
396 return BCM_6358_OHCI_PRIV_BASE;
397 case RSET_USBH_PRIV:
398 return BCM_6358_USBH_PRIV_BASE;
399 case RSET_MPI:
400 return BCM_6358_MPI_BASE;
401 case RSET_PCMCIA:
402 return BCM_6358_PCMCIA_BASE;
403 case RSET_ENET0:
404 return BCM_6358_ENET0_BASE;
405 case RSET_ENET1:
406 return BCM_6358_ENET1_BASE;
407 case RSET_ENETDMA:
408 return BCM_6358_ENETDMA_BASE;
409 case RSET_DSL:
410 return BCM_6358_DSL_BASE;
411 case RSET_EHCI0:
412 return BCM_6358_EHCI0_BASE;
413 case RSET_SDRAM:
414 return BCM_6358_SDRAM_BASE;
415 case RSET_MEMC:
416 return BCM_6358_MEMC_BASE;
417 case RSET_DDR:
418 return BCM_6358_DDR_BASE;
419 }
420#endif
421#endif
422 /* unreached */
423 return 0;
424}
425
426/*
427 * IRQ number changes across CPU too
428 */
429enum bcm63xx_irq {
430 IRQ_TIMER = 0,
431 IRQ_UART0,
432 IRQ_DSL,
433 IRQ_ENET0,
434 IRQ_ENET1,
435 IRQ_ENET_PHY,
436 IRQ_OHCI0,
437 IRQ_EHCI0,
438 IRQ_PCMCIA0,
439 IRQ_ENET0_RXDMA,
440 IRQ_ENET0_TXDMA,
441 IRQ_ENET1_RXDMA,
442 IRQ_ENET1_TXDMA,
443 IRQ_PCI,
444 IRQ_PCMCIA,
445};
446
447/*
448 * 6338 irqs
449 */
450#define BCM_6338_TIMER_IRQ (IRQ_INTERNAL_BASE + 0)
451#define BCM_6338_SPI_IRQ (IRQ_INTERNAL_BASE + 1)
452#define BCM_6338_UART0_IRQ (IRQ_INTERNAL_BASE + 2)
453#define BCM_6338_DG_IRQ (IRQ_INTERNAL_BASE + 4)
454#define BCM_6338_DSL_IRQ (IRQ_INTERNAL_BASE + 5)
455#define BCM_6338_ATM_IRQ (IRQ_INTERNAL_BASE + 6)
456#define BCM_6338_UDC0_IRQ (IRQ_INTERNAL_BASE + 7)
457#define BCM_6338_ENET0_IRQ (IRQ_INTERNAL_BASE + 8)
458#define BCM_6338_ENET_PHY_IRQ (IRQ_INTERNAL_BASE + 9)
459#define BCM_6338_SDRAM_IRQ (IRQ_INTERNAL_BASE + 10)
460#define BCM_6338_USB_CNTL_RX_DMA_IRQ (IRQ_INTERNAL_BASE + 11)
461#define BCM_6338_USB_CNTL_TX_DMA_IRQ (IRQ_INTERNAL_BASE + 12)
462#define BCM_6338_USB_BULK_RX_DMA_IRQ (IRQ_INTERNAL_BASE + 13)
463#define BCM_6338_USB_BULK_TX_DMA_IRQ (IRQ_INTERNAL_BASE + 14)
464#define BCM_6338_ENET0_RXDMA_IRQ (IRQ_INTERNAL_BASE + 15)
465#define BCM_6338_ENET0_TXDMA_IRQ (IRQ_INTERNAL_BASE + 16)
466#define BCM_6338_SDIO_IRQ (IRQ_INTERNAL_BASE + 17)
467
468/*
469 * 6345 irqs
470 */
471#define BCM_6345_TIMER_IRQ (IRQ_INTERNAL_BASE + 0)
472#define BCM_6345_UART0_IRQ (IRQ_INTERNAL_BASE + 2)
473#define BCM_6345_DSL_IRQ (IRQ_INTERNAL_BASE + 3)
474#define BCM_6345_ATM_IRQ (IRQ_INTERNAL_BASE + 4)
475#define BCM_6345_USB_IRQ (IRQ_INTERNAL_BASE + 5)
476#define BCM_6345_ENET0_IRQ (IRQ_INTERNAL_BASE + 8)
477#define BCM_6345_ENET_PHY_IRQ (IRQ_INTERNAL_BASE + 12)
478#define BCM_6345_ENET0_RXDMA_IRQ (IRQ_INTERNAL_BASE + 13 + 1)
479#define BCM_6345_ENET0_TXDMA_IRQ (IRQ_INTERNAL_BASE + 13 + 2)
480#define BCM_6345_EBI_RX_IRQ (IRQ_INTERNAL_BASE + 13 + 5)
481#define BCM_6345_EBI_TX_IRQ (IRQ_INTERNAL_BASE + 13 + 6)
482#define BCM_6345_RESERVED_RX_IRQ (IRQ_INTERNAL_BASE + 13 + 9)
483#define BCM_6345_RESERVED_TX_IRQ (IRQ_INTERNAL_BASE + 13 + 10)
484#define BCM_6345_USB_BULK_RX_DMA_IRQ (IRQ_INTERNAL_BASE + 13 + 13)
485#define BCM_6345_USB_BULK_TX_DMA_IRQ (IRQ_INTERNAL_BASE + 13 + 14)
486#define BCM_6345_USB_CNTL_RX_DMA_IRQ (IRQ_INTERNAL_BASE + 13 + 15)
487#define BCM_6345_USB_CNTL_TX_DMA_IRQ (IRQ_INTERNAL_BASE + 13 + 16)
488#define BCM_6345_USB_ISO_RX_DMA_IRQ (IRQ_INTERNAL_BASE + 13 + 17)
489#define BCM_6345_USB_ISO_TX_DMA_IRQ (IRQ_INTERNAL_BASE + 13 + 18)
490
491/*
492 * 6348 irqs
493 */
494#define BCM_6348_TIMER_IRQ (IRQ_INTERNAL_BASE + 0)
495#define BCM_6348_UART0_IRQ (IRQ_INTERNAL_BASE + 2)
496#define BCM_6348_DSL_IRQ (IRQ_INTERNAL_BASE + 4)
497#define BCM_6348_ENET1_IRQ (IRQ_INTERNAL_BASE + 7)
498#define BCM_6348_ENET0_IRQ (IRQ_INTERNAL_BASE + 8)
499#define BCM_6348_ENET_PHY_IRQ (IRQ_INTERNAL_BASE + 9)
500#define BCM_6348_OHCI0_IRQ (IRQ_INTERNAL_BASE + 12)
501#define BCM_6348_ENET0_RXDMA_IRQ (IRQ_INTERNAL_BASE + 20)
502#define BCM_6348_ENET0_TXDMA_IRQ (IRQ_INTERNAL_BASE + 21)
503#define BCM_6348_ENET1_RXDMA_IRQ (IRQ_INTERNAL_BASE + 22)
504#define BCM_6348_ENET1_TXDMA_IRQ (IRQ_INTERNAL_BASE + 23)
505#define BCM_6348_PCMCIA_IRQ (IRQ_INTERNAL_BASE + 24)
506#define BCM_6348_PCI_IRQ (IRQ_INTERNAL_BASE + 24)
507
508/*
509 * 6358 irqs
510 */
511#define BCM_6358_TIMER_IRQ (IRQ_INTERNAL_BASE + 0)
512#define BCM_6358_UART0_IRQ (IRQ_INTERNAL_BASE + 2)
513#define BCM_6358_OHCI0_IRQ (IRQ_INTERNAL_BASE + 5)
514#define BCM_6358_ENET1_IRQ (IRQ_INTERNAL_BASE + 6)
515#define BCM_6358_ENET0_IRQ (IRQ_INTERNAL_BASE + 8)
516#define BCM_6358_ENET_PHY_IRQ (IRQ_INTERNAL_BASE + 9)
517#define BCM_6358_EHCI0_IRQ (IRQ_INTERNAL_BASE + 10)
518#define BCM_6358_ENET0_RXDMA_IRQ (IRQ_INTERNAL_BASE + 15)
519#define BCM_6358_ENET0_TXDMA_IRQ (IRQ_INTERNAL_BASE + 16)
520#define BCM_6358_ENET1_RXDMA_IRQ (IRQ_INTERNAL_BASE + 17)
521#define BCM_6358_ENET1_TXDMA_IRQ (IRQ_INTERNAL_BASE + 18)
522#define BCM_6358_DSL_IRQ (IRQ_INTERNAL_BASE + 29)
523#define BCM_6358_PCI_IRQ (IRQ_INTERNAL_BASE + 31)
524#define BCM_6358_PCMCIA_IRQ (IRQ_INTERNAL_BASE + 24)
525
526extern const int *bcm63xx_irqs;
527
528static inline int bcm63xx_get_irq_number(enum bcm63xx_irq irq)
529{
530 return bcm63xx_irqs[irq];
531}
532
533/*
534 * return installed memory size
535 */
536unsigned int bcm63xx_get_memory_size(void);
537
538#endif /* !BCM63XX_CPU_H_ */
diff --git a/arch/mips/include/asm/mach-bcm63xx/bcm63xx_cs.h b/arch/mips/include/asm/mach-bcm63xx/bcm63xx_cs.h
new file mode 100644
index 000000000000..b1821c866e53
--- /dev/null
+++ b/arch/mips/include/asm/mach-bcm63xx/bcm63xx_cs.h
@@ -0,0 +1,10 @@
1#ifndef BCM63XX_CS_H
2#define BCM63XX_CS_H
3
4int bcm63xx_set_cs_base(unsigned int cs, u32 base, unsigned int size);
5int bcm63xx_set_cs_timing(unsigned int cs, unsigned int wait,
6 unsigned int setup, unsigned int hold);
7int bcm63xx_set_cs_param(unsigned int cs, u32 flags);
8int bcm63xx_set_cs_status(unsigned int cs, int enable);
9
10#endif /* !BCM63XX_CS_H */
diff --git a/arch/mips/include/asm/mach-bcm63xx/bcm63xx_dev_dsp.h b/arch/mips/include/asm/mach-bcm63xx/bcm63xx_dev_dsp.h
new file mode 100644
index 000000000000..b587d45c3045
--- /dev/null
+++ b/arch/mips/include/asm/mach-bcm63xx/bcm63xx_dev_dsp.h
@@ -0,0 +1,13 @@
1#ifndef __BCM63XX_DSP_H
2#define __BCM63XX_DSP_H
3
4struct bcm63xx_dsp_platform_data {
5 unsigned gpio_rst;
6 unsigned gpio_int;
7 unsigned cs;
8 unsigned ext_irq;
9};
10
11int __init bcm63xx_dsp_register(const struct bcm63xx_dsp_platform_data *pd);
12
13#endif /* __BCM63XX_DSP_H */
diff --git a/arch/mips/include/asm/mach-bcm63xx/bcm63xx_dev_enet.h b/arch/mips/include/asm/mach-bcm63xx/bcm63xx_dev_enet.h
new file mode 100644
index 000000000000..d53f611184b9
--- /dev/null
+++ b/arch/mips/include/asm/mach-bcm63xx/bcm63xx_dev_enet.h
@@ -0,0 +1,45 @@
1#ifndef BCM63XX_DEV_ENET_H_
2#define BCM63XX_DEV_ENET_H_
3
4#include <linux/if_ether.h>
5#include <linux/init.h>
6
7/*
8 * on board ethernet platform data
9 */
10struct bcm63xx_enet_platform_data {
11 char mac_addr[ETH_ALEN];
12
13 int has_phy;
14
15 /* if has_phy, then set use_internal_phy */
16 int use_internal_phy;
17
18 /* or fill phy info to use an external one */
19 int phy_id;
20 int has_phy_interrupt;
21 int phy_interrupt;
22
23 /* if has_phy, use autonegociated pause parameters or force
24 * them */
25 int pause_auto;
26 int pause_rx;
27 int pause_tx;
28
29 /* if !has_phy, set desired forced speed/duplex */
30 int force_speed_100;
31 int force_duplex_full;
32
33 /* if !has_phy, set callback to perform mii device
34 * init/remove */
35 int (*mii_config)(struct net_device *dev, int probe,
36 int (*mii_read)(struct net_device *dev,
37 int phy_id, int reg),
38 void (*mii_write)(struct net_device *dev,
39 int phy_id, int reg, int val));
40};
41
42int __init bcm63xx_enet_register(int unit,
43 const struct bcm63xx_enet_platform_data *pd);
44
45#endif /* ! BCM63XX_DEV_ENET_H_ */
diff --git a/arch/mips/include/asm/mach-bcm63xx/bcm63xx_dev_pci.h b/arch/mips/include/asm/mach-bcm63xx/bcm63xx_dev_pci.h
new file mode 100644
index 000000000000..c549344b70ad
--- /dev/null
+++ b/arch/mips/include/asm/mach-bcm63xx/bcm63xx_dev_pci.h
@@ -0,0 +1,6 @@
1#ifndef BCM63XX_DEV_PCI_H_
2#define BCM63XX_DEV_PCI_H_
3
4extern int bcm63xx_pci_enabled;
5
6#endif /* BCM63XX_DEV_PCI_H_ */
diff --git a/arch/mips/include/asm/mach-bcm63xx/bcm63xx_gpio.h b/arch/mips/include/asm/mach-bcm63xx/bcm63xx_gpio.h
new file mode 100644
index 000000000000..76a0b7216af5
--- /dev/null
+++ b/arch/mips/include/asm/mach-bcm63xx/bcm63xx_gpio.h
@@ -0,0 +1,22 @@
1#ifndef BCM63XX_GPIO_H
2#define BCM63XX_GPIO_H
3
4#include <linux/init.h>
5
6int __init bcm63xx_gpio_init(void);
7
8static inline unsigned long bcm63xx_gpio_count(void)
9{
10 switch (bcm63xx_get_cpu_id()) {
11 case BCM6358_CPU_ID:
12 return 40;
13 case BCM6348_CPU_ID:
14 default:
15 return 37;
16 }
17}
18
19#define GPIO_DIR_OUT 0x0
20#define GPIO_DIR_IN 0x1
21
22#endif /* !BCM63XX_GPIO_H */
diff --git a/arch/mips/include/asm/mach-bcm63xx/bcm63xx_io.h b/arch/mips/include/asm/mach-bcm63xx/bcm63xx_io.h
new file mode 100644
index 000000000000..91180fac6ed9
--- /dev/null
+++ b/arch/mips/include/asm/mach-bcm63xx/bcm63xx_io.h
@@ -0,0 +1,93 @@
1#ifndef BCM63XX_IO_H_
2#define BCM63XX_IO_H_
3
4#include "bcm63xx_cpu.h"
5
6/*
7 * Physical memory map, RAM is mapped at 0x0.
8 *
9 * Note that size MUST be a power of two.
10 */
11#define BCM_PCMCIA_COMMON_BASE_PA (0x20000000)
12#define BCM_PCMCIA_COMMON_SIZE (16 * 1024 * 1024)
13#define BCM_PCMCIA_COMMON_END_PA (BCM_PCMCIA_COMMON_BASE_PA + \
14 BCM_PCMCIA_COMMON_SIZE - 1)
15
16#define BCM_PCMCIA_ATTR_BASE_PA (0x21000000)
17#define BCM_PCMCIA_ATTR_SIZE (16 * 1024 * 1024)
18#define BCM_PCMCIA_ATTR_END_PA (BCM_PCMCIA_ATTR_BASE_PA + \
19 BCM_PCMCIA_ATTR_SIZE - 1)
20
21#define BCM_PCMCIA_IO_BASE_PA (0x22000000)
22#define BCM_PCMCIA_IO_SIZE (64 * 1024)
23#define BCM_PCMCIA_IO_END_PA (BCM_PCMCIA_IO_BASE_PA + \
24 BCM_PCMCIA_IO_SIZE - 1)
25
26#define BCM_PCI_MEM_BASE_PA (0x30000000)
27#define BCM_PCI_MEM_SIZE (128 * 1024 * 1024)
28#define BCM_PCI_MEM_END_PA (BCM_PCI_MEM_BASE_PA + \
29 BCM_PCI_MEM_SIZE - 1)
30
31#define BCM_PCI_IO_BASE_PA (0x08000000)
32#define BCM_PCI_IO_SIZE (64 * 1024)
33#define BCM_PCI_IO_END_PA (BCM_PCI_IO_BASE_PA + \
34 BCM_PCI_IO_SIZE - 1)
35#define BCM_PCI_IO_HALF_PA (BCM_PCI_IO_BASE_PA + \
36 (BCM_PCI_IO_SIZE / 2) - 1)
37
38#define BCM_CB_MEM_BASE_PA (0x38000000)
39#define BCM_CB_MEM_SIZE (128 * 1024 * 1024)
40#define BCM_CB_MEM_END_PA (BCM_CB_MEM_BASE_PA + \
41 BCM_CB_MEM_SIZE - 1)
42
43
44/*
45 * Internal registers are accessed through KSEG3
46 */
47#define BCM_REGS_VA(x) ((void __iomem *)(x))
48
49#define bcm_readb(a) (*(volatile unsigned char *) BCM_REGS_VA(a))
50#define bcm_readw(a) (*(volatile unsigned short *) BCM_REGS_VA(a))
51#define bcm_readl(a) (*(volatile unsigned int *) BCM_REGS_VA(a))
52#define bcm_writeb(v, a) (*(volatile unsigned char *) BCM_REGS_VA((a)) = (v))
53#define bcm_writew(v, a) (*(volatile unsigned short *) BCM_REGS_VA((a)) = (v))
54#define bcm_writel(v, a) (*(volatile unsigned int *) BCM_REGS_VA((a)) = (v))
55
56/*
57 * IO helpers to access register set for current CPU
58 */
59#define bcm_rset_readb(s, o) bcm_readb(bcm63xx_regset_address(s) + (o))
60#define bcm_rset_readw(s, o) bcm_readw(bcm63xx_regset_address(s) + (o))
61#define bcm_rset_readl(s, o) bcm_readl(bcm63xx_regset_address(s) + (o))
62#define bcm_rset_writeb(s, v, o) bcm_writeb((v), \
63 bcm63xx_regset_address(s) + (o))
64#define bcm_rset_writew(s, v, o) bcm_writew((v), \
65 bcm63xx_regset_address(s) + (o))
66#define bcm_rset_writel(s, v, o) bcm_writel((v), \
67 bcm63xx_regset_address(s) + (o))
68
69/*
70 * helpers for frequently used register sets
71 */
72#define bcm_perf_readl(o) bcm_rset_readl(RSET_PERF, (o))
73#define bcm_perf_writel(v, o) bcm_rset_writel(RSET_PERF, (v), (o))
74#define bcm_timer_readl(o) bcm_rset_readl(RSET_TIMER, (o))
75#define bcm_timer_writel(v, o) bcm_rset_writel(RSET_TIMER, (v), (o))
76#define bcm_wdt_readl(o) bcm_rset_readl(RSET_WDT, (o))
77#define bcm_wdt_writel(v, o) bcm_rset_writel(RSET_WDT, (v), (o))
78#define bcm_gpio_readl(o) bcm_rset_readl(RSET_GPIO, (o))
79#define bcm_gpio_writel(v, o) bcm_rset_writel(RSET_GPIO, (v), (o))
80#define bcm_uart0_readl(o) bcm_rset_readl(RSET_UART0, (o))
81#define bcm_uart0_writel(v, o) bcm_rset_writel(RSET_UART0, (v), (o))
82#define bcm_mpi_readl(o) bcm_rset_readl(RSET_MPI, (o))
83#define bcm_mpi_writel(v, o) bcm_rset_writel(RSET_MPI, (v), (o))
84#define bcm_pcmcia_readl(o) bcm_rset_readl(RSET_PCMCIA, (o))
85#define bcm_pcmcia_writel(v, o) bcm_rset_writel(RSET_PCMCIA, (v), (o))
86#define bcm_sdram_readl(o) bcm_rset_readl(RSET_SDRAM, (o))
87#define bcm_sdram_writel(v, o) bcm_rset_writel(RSET_SDRAM, (v), (o))
88#define bcm_memc_readl(o) bcm_rset_readl(RSET_MEMC, (o))
89#define bcm_memc_writel(v, o) bcm_rset_writel(RSET_MEMC, (v), (o))
90#define bcm_ddr_readl(o) bcm_rset_readl(RSET_DDR, (o))
91#define bcm_ddr_writel(v, o) bcm_rset_writel(RSET_DDR, (v), (o))
92
93#endif /* ! BCM63XX_IO_H_ */
diff --git a/arch/mips/include/asm/mach-bcm63xx/bcm63xx_irq.h b/arch/mips/include/asm/mach-bcm63xx/bcm63xx_irq.h
new file mode 100644
index 000000000000..5f95577c8213
--- /dev/null
+++ b/arch/mips/include/asm/mach-bcm63xx/bcm63xx_irq.h
@@ -0,0 +1,15 @@
1#ifndef BCM63XX_IRQ_H_
2#define BCM63XX_IRQ_H_
3
4#include <bcm63xx_cpu.h>
5
6#define IRQ_MIPS_BASE 0
7#define IRQ_INTERNAL_BASE 8
8
9#define IRQ_EXT_BASE (IRQ_MIPS_BASE + 3)
10#define IRQ_EXT_0 (IRQ_EXT_BASE + 0)
11#define IRQ_EXT_1 (IRQ_EXT_BASE + 1)
12#define IRQ_EXT_2 (IRQ_EXT_BASE + 2)
13#define IRQ_EXT_3 (IRQ_EXT_BASE + 3)
14
15#endif /* ! BCM63XX_IRQ_H_ */
diff --git a/arch/mips/include/asm/mach-bcm63xx/bcm63xx_regs.h b/arch/mips/include/asm/mach-bcm63xx/bcm63xx_regs.h
new file mode 100644
index 000000000000..ed4ccec87dd4
--- /dev/null
+++ b/arch/mips/include/asm/mach-bcm63xx/bcm63xx_regs.h
@@ -0,0 +1,773 @@
1#ifndef BCM63XX_REGS_H_
2#define BCM63XX_REGS_H_
3
4/*************************************************************************
5 * _REG relative to RSET_PERF
6 *************************************************************************/
7
8/* Chip Identifier / Revision register */
9#define PERF_REV_REG 0x0
10#define REV_CHIPID_SHIFT 16
11#define REV_CHIPID_MASK (0xffff << REV_CHIPID_SHIFT)
12#define REV_REVID_SHIFT 0
13#define REV_REVID_MASK (0xffff << REV_REVID_SHIFT)
14
15/* Clock Control register */
16#define PERF_CKCTL_REG 0x4
17
18#define CKCTL_6338_ADSLPHY_EN (1 << 0)
19#define CKCTL_6338_MPI_EN (1 << 1)
20#define CKCTL_6338_DRAM_EN (1 << 2)
21#define CKCTL_6338_ENET_EN (1 << 4)
22#define CKCTL_6338_USBS_EN (1 << 4)
23#define CKCTL_6338_SAR_EN (1 << 5)
24#define CKCTL_6338_SPI_EN (1 << 9)
25
26#define CKCTL_6338_ALL_SAFE_EN (CKCTL_6338_ADSLPHY_EN | \
27 CKCTL_6338_MPI_EN | \
28 CKCTL_6338_ENET_EN | \
29 CKCTL_6338_SAR_EN | \
30 CKCTL_6338_SPI_EN)
31
32#define CKCTL_6345_CPU_EN (1 << 0)
33#define CKCTL_6345_BUS_EN (1 << 1)
34#define CKCTL_6345_EBI_EN (1 << 2)
35#define CKCTL_6345_UART_EN (1 << 3)
36#define CKCTL_6345_ADSLPHY_EN (1 << 4)
37#define CKCTL_6345_ENET_EN (1 << 7)
38#define CKCTL_6345_USBH_EN (1 << 8)
39
40#define CKCTL_6345_ALL_SAFE_EN (CKCTL_6345_ENET_EN | \
41 CKCTL_6345_USBH_EN | \
42 CKCTL_6345_ADSLPHY_EN)
43
44#define CKCTL_6348_ADSLPHY_EN (1 << 0)
45#define CKCTL_6348_MPI_EN (1 << 1)
46#define CKCTL_6348_SDRAM_EN (1 << 2)
47#define CKCTL_6348_M2M_EN (1 << 3)
48#define CKCTL_6348_ENET_EN (1 << 4)
49#define CKCTL_6348_SAR_EN (1 << 5)
50#define CKCTL_6348_USBS_EN (1 << 6)
51#define CKCTL_6348_USBH_EN (1 << 8)
52#define CKCTL_6348_SPI_EN (1 << 9)
53
54#define CKCTL_6348_ALL_SAFE_EN (CKCTL_6348_ADSLPHY_EN | \
55 CKCTL_6348_M2M_EN | \
56 CKCTL_6348_ENET_EN | \
57 CKCTL_6348_SAR_EN | \
58 CKCTL_6348_USBS_EN | \
59 CKCTL_6348_USBH_EN | \
60 CKCTL_6348_SPI_EN)
61
62#define CKCTL_6358_ENET_EN (1 << 4)
63#define CKCTL_6358_ADSLPHY_EN (1 << 5)
64#define CKCTL_6358_PCM_EN (1 << 8)
65#define CKCTL_6358_SPI_EN (1 << 9)
66#define CKCTL_6358_USBS_EN (1 << 10)
67#define CKCTL_6358_SAR_EN (1 << 11)
68#define CKCTL_6358_EMUSB_EN (1 << 17)
69#define CKCTL_6358_ENET0_EN (1 << 18)
70#define CKCTL_6358_ENET1_EN (1 << 19)
71#define CKCTL_6358_USBSU_EN (1 << 20)
72#define CKCTL_6358_EPHY_EN (1 << 21)
73
74#define CKCTL_6358_ALL_SAFE_EN (CKCTL_6358_ENET_EN | \
75 CKCTL_6358_ADSLPHY_EN | \
76 CKCTL_6358_PCM_EN | \
77 CKCTL_6358_SPI_EN | \
78 CKCTL_6358_USBS_EN | \
79 CKCTL_6358_SAR_EN | \
80 CKCTL_6358_EMUSB_EN | \
81 CKCTL_6358_ENET0_EN | \
82 CKCTL_6358_ENET1_EN | \
83 CKCTL_6358_USBSU_EN | \
84 CKCTL_6358_EPHY_EN)
85
86/* System PLL Control register */
87#define PERF_SYS_PLL_CTL_REG 0x8
88#define SYS_PLL_SOFT_RESET 0x1
89
90/* Interrupt Mask register */
91#define PERF_IRQMASK_REG 0xc
92#define PERF_IRQSTAT_REG 0x10
93
94/* Interrupt Status register */
95#define PERF_IRQSTAT_REG 0x10
96
97/* External Interrupt Configuration register */
98#define PERF_EXTIRQ_CFG_REG 0x14
99#define EXTIRQ_CFG_SENSE(x) (1 << (x))
100#define EXTIRQ_CFG_STAT(x) (1 << (x + 5))
101#define EXTIRQ_CFG_CLEAR(x) (1 << (x + 10))
102#define EXTIRQ_CFG_MASK(x) (1 << (x + 15))
103#define EXTIRQ_CFG_BOTHEDGE(x) (1 << (x + 20))
104#define EXTIRQ_CFG_LEVELSENSE(x) (1 << (x + 25))
105
106#define EXTIRQ_CFG_CLEAR_ALL (0xf << 10)
107#define EXTIRQ_CFG_MASK_ALL (0xf << 15)
108
109/* Soft Reset register */
110#define PERF_SOFTRESET_REG 0x28
111
112#define SOFTRESET_6338_SPI_MASK (1 << 0)
113#define SOFTRESET_6338_ENET_MASK (1 << 2)
114#define SOFTRESET_6338_USBH_MASK (1 << 3)
115#define SOFTRESET_6338_USBS_MASK (1 << 4)
116#define SOFTRESET_6338_ADSL_MASK (1 << 5)
117#define SOFTRESET_6338_DMAMEM_MASK (1 << 6)
118#define SOFTRESET_6338_SAR_MASK (1 << 7)
119#define SOFTRESET_6338_ACLC_MASK (1 << 8)
120#define SOFTRESET_6338_ADSLMIPSPLL_MASK (1 << 10)
121#define SOFTRESET_6338_ALL (SOFTRESET_6338_SPI_MASK | \
122 SOFTRESET_6338_ENET_MASK | \
123 SOFTRESET_6338_USBH_MASK | \
124 SOFTRESET_6338_USBS_MASK | \
125 SOFTRESET_6338_ADSL_MASK | \
126 SOFTRESET_6338_DMAMEM_MASK | \
127 SOFTRESET_6338_SAR_MASK | \
128 SOFTRESET_6338_ACLC_MASK | \
129 SOFTRESET_6338_ADSLMIPSPLL_MASK)
130
131#define SOFTRESET_6348_SPI_MASK (1 << 0)
132#define SOFTRESET_6348_ENET_MASK (1 << 2)
133#define SOFTRESET_6348_USBH_MASK (1 << 3)
134#define SOFTRESET_6348_USBS_MASK (1 << 4)
135#define SOFTRESET_6348_ADSL_MASK (1 << 5)
136#define SOFTRESET_6348_DMAMEM_MASK (1 << 6)
137#define SOFTRESET_6348_SAR_MASK (1 << 7)
138#define SOFTRESET_6348_ACLC_MASK (1 << 8)
139#define SOFTRESET_6348_ADSLMIPSPLL_MASK (1 << 10)
140
141#define SOFTRESET_6348_ALL (SOFTRESET_6348_SPI_MASK | \
142 SOFTRESET_6348_ENET_MASK | \
143 SOFTRESET_6348_USBH_MASK | \
144 SOFTRESET_6348_USBS_MASK | \
145 SOFTRESET_6348_ADSL_MASK | \
146 SOFTRESET_6348_DMAMEM_MASK | \
147 SOFTRESET_6348_SAR_MASK | \
148 SOFTRESET_6348_ACLC_MASK | \
149 SOFTRESET_6348_ADSLMIPSPLL_MASK)
150
151/* MIPS PLL control register */
152#define PERF_MIPSPLLCTL_REG 0x34
153#define MIPSPLLCTL_N1_SHIFT 20
154#define MIPSPLLCTL_N1_MASK (0x7 << MIPSPLLCTL_N1_SHIFT)
155#define MIPSPLLCTL_N2_SHIFT 15
156#define MIPSPLLCTL_N2_MASK (0x1f << MIPSPLLCTL_N2_SHIFT)
157#define MIPSPLLCTL_M1REF_SHIFT 12
158#define MIPSPLLCTL_M1REF_MASK (0x7 << MIPSPLLCTL_M1REF_SHIFT)
159#define MIPSPLLCTL_M2REF_SHIFT 9
160#define MIPSPLLCTL_M2REF_MASK (0x7 << MIPSPLLCTL_M2REF_SHIFT)
161#define MIPSPLLCTL_M1CPU_SHIFT 6
162#define MIPSPLLCTL_M1CPU_MASK (0x7 << MIPSPLLCTL_M1CPU_SHIFT)
163#define MIPSPLLCTL_M1BUS_SHIFT 3
164#define MIPSPLLCTL_M1BUS_MASK (0x7 << MIPSPLLCTL_M1BUS_SHIFT)
165#define MIPSPLLCTL_M2BUS_SHIFT 0
166#define MIPSPLLCTL_M2BUS_MASK (0x7 << MIPSPLLCTL_M2BUS_SHIFT)
167
168/* ADSL PHY PLL Control register */
169#define PERF_ADSLPLLCTL_REG 0x38
170#define ADSLPLLCTL_N1_SHIFT 20
171#define ADSLPLLCTL_N1_MASK (0x7 << ADSLPLLCTL_N1_SHIFT)
172#define ADSLPLLCTL_N2_SHIFT 15
173#define ADSLPLLCTL_N2_MASK (0x1f << ADSLPLLCTL_N2_SHIFT)
174#define ADSLPLLCTL_M1REF_SHIFT 12
175#define ADSLPLLCTL_M1REF_MASK (0x7 << ADSLPLLCTL_M1REF_SHIFT)
176#define ADSLPLLCTL_M2REF_SHIFT 9
177#define ADSLPLLCTL_M2REF_MASK (0x7 << ADSLPLLCTL_M2REF_SHIFT)
178#define ADSLPLLCTL_M1CPU_SHIFT 6
179#define ADSLPLLCTL_M1CPU_MASK (0x7 << ADSLPLLCTL_M1CPU_SHIFT)
180#define ADSLPLLCTL_M1BUS_SHIFT 3
181#define ADSLPLLCTL_M1BUS_MASK (0x7 << ADSLPLLCTL_M1BUS_SHIFT)
182#define ADSLPLLCTL_M2BUS_SHIFT 0
183#define ADSLPLLCTL_M2BUS_MASK (0x7 << ADSLPLLCTL_M2BUS_SHIFT)
184
185#define ADSLPLLCTL_VAL(n1, n2, m1ref, m2ref, m1cpu, m1bus, m2bus) \
186 (((n1) << ADSLPLLCTL_N1_SHIFT) | \
187 ((n2) << ADSLPLLCTL_N2_SHIFT) | \
188 ((m1ref) << ADSLPLLCTL_M1REF_SHIFT) | \
189 ((m2ref) << ADSLPLLCTL_M2REF_SHIFT) | \
190 ((m1cpu) << ADSLPLLCTL_M1CPU_SHIFT) | \
191 ((m1bus) << ADSLPLLCTL_M1BUS_SHIFT) | \
192 ((m2bus) << ADSLPLLCTL_M2BUS_SHIFT))
193
194
195/*************************************************************************
196 * _REG relative to RSET_TIMER
197 *************************************************************************/
198
199#define BCM63XX_TIMER_COUNT 4
200#define TIMER_T0_ID 0
201#define TIMER_T1_ID 1
202#define TIMER_T2_ID 2
203#define TIMER_WDT_ID 3
204
205/* Timer irqstat register */
206#define TIMER_IRQSTAT_REG 0
207#define TIMER_IRQSTAT_TIMER_CAUSE(x) (1 << (x))
208#define TIMER_IRQSTAT_TIMER0_CAUSE (1 << 0)
209#define TIMER_IRQSTAT_TIMER1_CAUSE (1 << 1)
210#define TIMER_IRQSTAT_TIMER2_CAUSE (1 << 2)
211#define TIMER_IRQSTAT_WDT_CAUSE (1 << 3)
212#define TIMER_IRQSTAT_TIMER_IR_EN(x) (1 << ((x) + 8))
213#define TIMER_IRQSTAT_TIMER0_IR_EN (1 << 8)
214#define TIMER_IRQSTAT_TIMER1_IR_EN (1 << 9)
215#define TIMER_IRQSTAT_TIMER2_IR_EN (1 << 10)
216
217/* Timer control register */
218#define TIMER_CTLx_REG(x) (0x4 + (x * 4))
219#define TIMER_CTL0_REG 0x4
220#define TIMER_CTL1_REG 0x8
221#define TIMER_CTL2_REG 0xC
222#define TIMER_CTL_COUNTDOWN_MASK (0x3fffffff)
223#define TIMER_CTL_MONOTONIC_MASK (1 << 30)
224#define TIMER_CTL_ENABLE_MASK (1 << 31)
225
226
227/*************************************************************************
228 * _REG relative to RSET_WDT
229 *************************************************************************/
230
231/* Watchdog default count register */
232#define WDT_DEFVAL_REG 0x0
233
234/* Watchdog control register */
235#define WDT_CTL_REG 0x4
236
237/* Watchdog control register constants */
238#define WDT_START_1 (0xff00)
239#define WDT_START_2 (0x00ff)
240#define WDT_STOP_1 (0xee00)
241#define WDT_STOP_2 (0x00ee)
242
243/* Watchdog reset length register */
244#define WDT_RSTLEN_REG 0x8
245
246
247/*************************************************************************
248 * _REG relative to RSET_UARTx
249 *************************************************************************/
250
251/* UART Control Register */
252#define UART_CTL_REG 0x0
253#define UART_CTL_RXTMOUTCNT_SHIFT 0
254#define UART_CTL_RXTMOUTCNT_MASK (0x1f << UART_CTL_RXTMOUTCNT_SHIFT)
255#define UART_CTL_RSTTXDN_SHIFT 5
256#define UART_CTL_RSTTXDN_MASK (1 << UART_CTL_RSTTXDN_SHIFT)
257#define UART_CTL_RSTRXFIFO_SHIFT 6
258#define UART_CTL_RSTRXFIFO_MASK (1 << UART_CTL_RSTRXFIFO_SHIFT)
259#define UART_CTL_RSTTXFIFO_SHIFT 7
260#define UART_CTL_RSTTXFIFO_MASK (1 << UART_CTL_RSTTXFIFO_SHIFT)
261#define UART_CTL_STOPBITS_SHIFT 8
262#define UART_CTL_STOPBITS_MASK (0xf << UART_CTL_STOPBITS_SHIFT)
263#define UART_CTL_STOPBITS_1 (0x7 << UART_CTL_STOPBITS_SHIFT)
264#define UART_CTL_STOPBITS_2 (0xf << UART_CTL_STOPBITS_SHIFT)
265#define UART_CTL_BITSPERSYM_SHIFT 12
266#define UART_CTL_BITSPERSYM_MASK (0x3 << UART_CTL_BITSPERSYM_SHIFT)
267#define UART_CTL_XMITBRK_SHIFT 14
268#define UART_CTL_XMITBRK_MASK (1 << UART_CTL_XMITBRK_SHIFT)
269#define UART_CTL_RSVD_SHIFT 15
270#define UART_CTL_RSVD_MASK (1 << UART_CTL_RSVD_SHIFT)
271#define UART_CTL_RXPAREVEN_SHIFT 16
272#define UART_CTL_RXPAREVEN_MASK (1 << UART_CTL_RXPAREVEN_SHIFT)
273#define UART_CTL_RXPAREN_SHIFT 17
274#define UART_CTL_RXPAREN_MASK (1 << UART_CTL_RXPAREN_SHIFT)
275#define UART_CTL_TXPAREVEN_SHIFT 18
276#define UART_CTL_TXPAREVEN_MASK (1 << UART_CTL_TXPAREVEN_SHIFT)
277#define UART_CTL_TXPAREN_SHIFT 18
278#define UART_CTL_TXPAREN_MASK (1 << UART_CTL_TXPAREN_SHIFT)
279#define UART_CTL_LOOPBACK_SHIFT 20
280#define UART_CTL_LOOPBACK_MASK (1 << UART_CTL_LOOPBACK_SHIFT)
281#define UART_CTL_RXEN_SHIFT 21
282#define UART_CTL_RXEN_MASK (1 << UART_CTL_RXEN_SHIFT)
283#define UART_CTL_TXEN_SHIFT 22
284#define UART_CTL_TXEN_MASK (1 << UART_CTL_TXEN_SHIFT)
285#define UART_CTL_BRGEN_SHIFT 23
286#define UART_CTL_BRGEN_MASK (1 << UART_CTL_BRGEN_SHIFT)
287
288/* UART Baudword register */
289#define UART_BAUD_REG 0x4
290
291/* UART Misc Control register */
292#define UART_MCTL_REG 0x8
293#define UART_MCTL_DTR_SHIFT 0
294#define UART_MCTL_DTR_MASK (1 << UART_MCTL_DTR_SHIFT)
295#define UART_MCTL_RTS_SHIFT 1
296#define UART_MCTL_RTS_MASK (1 << UART_MCTL_RTS_SHIFT)
297#define UART_MCTL_RXFIFOTHRESH_SHIFT 8
298#define UART_MCTL_RXFIFOTHRESH_MASK (0xf << UART_MCTL_RXFIFOTHRESH_SHIFT)
299#define UART_MCTL_TXFIFOTHRESH_SHIFT 12
300#define UART_MCTL_TXFIFOTHRESH_MASK (0xf << UART_MCTL_TXFIFOTHRESH_SHIFT)
301#define UART_MCTL_RXFIFOFILL_SHIFT 16
302#define UART_MCTL_RXFIFOFILL_MASK (0x1f << UART_MCTL_RXFIFOFILL_SHIFT)
303#define UART_MCTL_TXFIFOFILL_SHIFT 24
304#define UART_MCTL_TXFIFOFILL_MASK (0x1f << UART_MCTL_TXFIFOFILL_SHIFT)
305
306/* UART External Input Configuration register */
307#define UART_EXTINP_REG 0xc
308#define UART_EXTINP_RI_SHIFT 0
309#define UART_EXTINP_RI_MASK (1 << UART_EXTINP_RI_SHIFT)
310#define UART_EXTINP_CTS_SHIFT 1
311#define UART_EXTINP_CTS_MASK (1 << UART_EXTINP_CTS_SHIFT)
312#define UART_EXTINP_DCD_SHIFT 2
313#define UART_EXTINP_DCD_MASK (1 << UART_EXTINP_DCD_SHIFT)
314#define UART_EXTINP_DSR_SHIFT 3
315#define UART_EXTINP_DSR_MASK (1 << UART_EXTINP_DSR_SHIFT)
316#define UART_EXTINP_IRSTAT(x) (1 << (x + 4))
317#define UART_EXTINP_IRMASK(x) (1 << (x + 8))
318#define UART_EXTINP_IR_RI 0
319#define UART_EXTINP_IR_CTS 1
320#define UART_EXTINP_IR_DCD 2
321#define UART_EXTINP_IR_DSR 3
322#define UART_EXTINP_RI_NOSENSE_SHIFT 16
323#define UART_EXTINP_RI_NOSENSE_MASK (1 << UART_EXTINP_RI_NOSENSE_SHIFT)
324#define UART_EXTINP_CTS_NOSENSE_SHIFT 17
325#define UART_EXTINP_CTS_NOSENSE_MASK (1 << UART_EXTINP_CTS_NOSENSE_SHIFT)
326#define UART_EXTINP_DCD_NOSENSE_SHIFT 18
327#define UART_EXTINP_DCD_NOSENSE_MASK (1 << UART_EXTINP_DCD_NOSENSE_SHIFT)
328#define UART_EXTINP_DSR_NOSENSE_SHIFT 19
329#define UART_EXTINP_DSR_NOSENSE_MASK (1 << UART_EXTINP_DSR_NOSENSE_SHIFT)
330
331/* UART Interrupt register */
332#define UART_IR_REG 0x10
333#define UART_IR_MASK(x) (1 << (x + 16))
334#define UART_IR_STAT(x) (1 << (x))
335#define UART_IR_EXTIP 0
336#define UART_IR_TXUNDER 1
337#define UART_IR_TXOVER 2
338#define UART_IR_TXTRESH 3
339#define UART_IR_TXRDLATCH 4
340#define UART_IR_TXEMPTY 5
341#define UART_IR_RXUNDER 6
342#define UART_IR_RXOVER 7
343#define UART_IR_RXTIMEOUT 8
344#define UART_IR_RXFULL 9
345#define UART_IR_RXTHRESH 10
346#define UART_IR_RXNOTEMPTY 11
347#define UART_IR_RXFRAMEERR 12
348#define UART_IR_RXPARERR 13
349#define UART_IR_RXBRK 14
350#define UART_IR_TXDONE 15
351
352/* UART Fifo register */
353#define UART_FIFO_REG 0x14
354#define UART_FIFO_VALID_SHIFT 0
355#define UART_FIFO_VALID_MASK 0xff
356#define UART_FIFO_FRAMEERR_SHIFT 8
357#define UART_FIFO_FRAMEERR_MASK (1 << UART_FIFO_FRAMEERR_SHIFT)
358#define UART_FIFO_PARERR_SHIFT 9
359#define UART_FIFO_PARERR_MASK (1 << UART_FIFO_PARERR_SHIFT)
360#define UART_FIFO_BRKDET_SHIFT 10
361#define UART_FIFO_BRKDET_MASK (1 << UART_FIFO_BRKDET_SHIFT)
362#define UART_FIFO_ANYERR_MASK (UART_FIFO_FRAMEERR_MASK | \
363 UART_FIFO_PARERR_MASK | \
364 UART_FIFO_BRKDET_MASK)
365
366
367/*************************************************************************
368 * _REG relative to RSET_GPIO
369 *************************************************************************/
370
371/* GPIO registers */
372#define GPIO_CTL_HI_REG 0x0
373#define GPIO_CTL_LO_REG 0x4
374#define GPIO_DATA_HI_REG 0x8
375#define GPIO_DATA_LO_REG 0xC
376
377/* GPIO mux registers and constants */
378#define GPIO_MODE_REG 0x18
379
380#define GPIO_MODE_6348_G4_DIAG 0x00090000
381#define GPIO_MODE_6348_G4_UTOPIA 0x00080000
382#define GPIO_MODE_6348_G4_LEGACY_LED 0x00030000
383#define GPIO_MODE_6348_G4_MII_SNOOP 0x00020000
384#define GPIO_MODE_6348_G4_EXT_EPHY 0x00010000
385#define GPIO_MODE_6348_G3_DIAG 0x00009000
386#define GPIO_MODE_6348_G3_UTOPIA 0x00008000
387#define GPIO_MODE_6348_G3_EXT_MII 0x00007000
388#define GPIO_MODE_6348_G2_DIAG 0x00000900
389#define GPIO_MODE_6348_G2_PCI 0x00000500
390#define GPIO_MODE_6348_G1_DIAG 0x00000090
391#define GPIO_MODE_6348_G1_UTOPIA 0x00000080
392#define GPIO_MODE_6348_G1_SPI_UART 0x00000060
393#define GPIO_MODE_6348_G1_SPI_MASTER 0x00000060
394#define GPIO_MODE_6348_G1_MII_PCCARD 0x00000040
395#define GPIO_MODE_6348_G1_MII_SNOOP 0x00000020
396#define GPIO_MODE_6348_G1_EXT_EPHY 0x00000010
397#define GPIO_MODE_6348_G0_DIAG 0x00000009
398#define GPIO_MODE_6348_G0_EXT_MII 0x00000007
399
400#define GPIO_MODE_6358_EXTRACS (1 << 5)
401#define GPIO_MODE_6358_UART1 (1 << 6)
402#define GPIO_MODE_6358_EXTRA_SPI_SS (1 << 7)
403#define GPIO_MODE_6358_SERIAL_LED (1 << 10)
404#define GPIO_MODE_6358_UTOPIA (1 << 12)
405
406
407/*************************************************************************
408 * _REG relative to RSET_ENET
409 *************************************************************************/
410
411/* Receiver Configuration register */
412#define ENET_RXCFG_REG 0x0
413#define ENET_RXCFG_ALLMCAST_SHIFT 1
414#define ENET_RXCFG_ALLMCAST_MASK (1 << ENET_RXCFG_ALLMCAST_SHIFT)
415#define ENET_RXCFG_PROMISC_SHIFT 3
416#define ENET_RXCFG_PROMISC_MASK (1 << ENET_RXCFG_PROMISC_SHIFT)
417#define ENET_RXCFG_LOOPBACK_SHIFT 4
418#define ENET_RXCFG_LOOPBACK_MASK (1 << ENET_RXCFG_LOOPBACK_SHIFT)
419#define ENET_RXCFG_ENFLOW_SHIFT 5
420#define ENET_RXCFG_ENFLOW_MASK (1 << ENET_RXCFG_ENFLOW_SHIFT)
421
422/* Receive Maximum Length register */
423#define ENET_RXMAXLEN_REG 0x4
424#define ENET_RXMAXLEN_SHIFT 0
425#define ENET_RXMAXLEN_MASK (0x7ff << ENET_RXMAXLEN_SHIFT)
426
427/* Transmit Maximum Length register */
428#define ENET_TXMAXLEN_REG 0x8
429#define ENET_TXMAXLEN_SHIFT 0
430#define ENET_TXMAXLEN_MASK (0x7ff << ENET_TXMAXLEN_SHIFT)
431
432/* MII Status/Control register */
433#define ENET_MIISC_REG 0x10
434#define ENET_MIISC_MDCFREQDIV_SHIFT 0
435#define ENET_MIISC_MDCFREQDIV_MASK (0x7f << ENET_MIISC_MDCFREQDIV_SHIFT)
436#define ENET_MIISC_PREAMBLEEN_SHIFT 7
437#define ENET_MIISC_PREAMBLEEN_MASK (1 << ENET_MIISC_PREAMBLEEN_SHIFT)
438
439/* MII Data register */
440#define ENET_MIIDATA_REG 0x14
441#define ENET_MIIDATA_DATA_SHIFT 0
442#define ENET_MIIDATA_DATA_MASK (0xffff << ENET_MIIDATA_DATA_SHIFT)
443#define ENET_MIIDATA_TA_SHIFT 16
444#define ENET_MIIDATA_TA_MASK (0x3 << ENET_MIIDATA_TA_SHIFT)
445#define ENET_MIIDATA_REG_SHIFT 18
446#define ENET_MIIDATA_REG_MASK (0x1f << ENET_MIIDATA_REG_SHIFT)
447#define ENET_MIIDATA_PHYID_SHIFT 23
448#define ENET_MIIDATA_PHYID_MASK (0x1f << ENET_MIIDATA_PHYID_SHIFT)
449#define ENET_MIIDATA_OP_READ_MASK (0x6 << 28)
450#define ENET_MIIDATA_OP_WRITE_MASK (0x5 << 28)
451
452/* Ethernet Interrupt Mask register */
453#define ENET_IRMASK_REG 0x18
454
455/* Ethernet Interrupt register */
456#define ENET_IR_REG 0x1c
457#define ENET_IR_MII (1 << 0)
458#define ENET_IR_MIB (1 << 1)
459#define ENET_IR_FLOWC (1 << 2)
460
461/* Ethernet Control register */
462#define ENET_CTL_REG 0x2c
463#define ENET_CTL_ENABLE_SHIFT 0
464#define ENET_CTL_ENABLE_MASK (1 << ENET_CTL_ENABLE_SHIFT)
465#define ENET_CTL_DISABLE_SHIFT 1
466#define ENET_CTL_DISABLE_MASK (1 << ENET_CTL_DISABLE_SHIFT)
467#define ENET_CTL_SRESET_SHIFT 2
468#define ENET_CTL_SRESET_MASK (1 << ENET_CTL_SRESET_SHIFT)
469#define ENET_CTL_EPHYSEL_SHIFT 3
470#define ENET_CTL_EPHYSEL_MASK (1 << ENET_CTL_EPHYSEL_SHIFT)
471
472/* Transmit Control register */
473#define ENET_TXCTL_REG 0x30
474#define ENET_TXCTL_FD_SHIFT 0
475#define ENET_TXCTL_FD_MASK (1 << ENET_TXCTL_FD_SHIFT)
476
477/* Transmit Watermask register */
478#define ENET_TXWMARK_REG 0x34
479#define ENET_TXWMARK_WM_SHIFT 0
480#define ENET_TXWMARK_WM_MASK (0x3f << ENET_TXWMARK_WM_SHIFT)
481
482/* MIB Control register */
483#define ENET_MIBCTL_REG 0x38
484#define ENET_MIBCTL_RDCLEAR_SHIFT 0
485#define ENET_MIBCTL_RDCLEAR_MASK (1 << ENET_MIBCTL_RDCLEAR_SHIFT)
486
487/* Perfect Match Data Low register */
488#define ENET_PML_REG(x) (0x58 + (x) * 8)
489#define ENET_PMH_REG(x) (0x5c + (x) * 8)
490#define ENET_PMH_DATAVALID_SHIFT 16
491#define ENET_PMH_DATAVALID_MASK (1 << ENET_PMH_DATAVALID_SHIFT)
492
493/* MIB register */
494#define ENET_MIB_REG(x) (0x200 + (x) * 4)
495#define ENET_MIB_REG_COUNT 55
496
497
498/*************************************************************************
499 * _REG relative to RSET_ENETDMA
500 *************************************************************************/
501
502/* Controller Configuration Register */
503#define ENETDMA_CFG_REG (0x0)
504#define ENETDMA_CFG_EN_SHIFT 0
505#define ENETDMA_CFG_EN_MASK (1 << ENETDMA_CFG_EN_SHIFT)
506#define ENETDMA_CFG_FLOWCH_MASK(x) (1 << ((x >> 1) + 1))
507
508/* Flow Control Descriptor Low Threshold register */
509#define ENETDMA_FLOWCL_REG(x) (0x4 + (x) * 6)
510
511/* Flow Control Descriptor High Threshold register */
512#define ENETDMA_FLOWCH_REG(x) (0x8 + (x) * 6)
513
514/* Flow Control Descriptor Buffer Alloca Threshold register */
515#define ENETDMA_BUFALLOC_REG(x) (0xc + (x) * 6)
516#define ENETDMA_BUFALLOC_FORCE_SHIFT 31
517#define ENETDMA_BUFALLOC_FORCE_MASK (1 << ENETDMA_BUFALLOC_FORCE_SHIFT)
518
519/* Channel Configuration register */
520#define ENETDMA_CHANCFG_REG(x) (0x100 + (x) * 0x10)
521#define ENETDMA_CHANCFG_EN_SHIFT 0
522#define ENETDMA_CHANCFG_EN_MASK (1 << ENETDMA_CHANCFG_EN_SHIFT)
523#define ENETDMA_CHANCFG_PKTHALT_SHIFT 1
524#define ENETDMA_CHANCFG_PKTHALT_MASK (1 << ENETDMA_CHANCFG_PKTHALT_SHIFT)
525
526/* Interrupt Control/Status register */
527#define ENETDMA_IR_REG(x) (0x104 + (x) * 0x10)
528#define ENETDMA_IR_BUFDONE_MASK (1 << 0)
529#define ENETDMA_IR_PKTDONE_MASK (1 << 1)
530#define ENETDMA_IR_NOTOWNER_MASK (1 << 2)
531
532/* Interrupt Mask register */
533#define ENETDMA_IRMASK_REG(x) (0x108 + (x) * 0x10)
534
535/* Maximum Burst Length */
536#define ENETDMA_MAXBURST_REG(x) (0x10C + (x) * 0x10)
537
538/* Ring Start Address register */
539#define ENETDMA_RSTART_REG(x) (0x200 + (x) * 0x10)
540
541/* State Ram Word 2 */
542#define ENETDMA_SRAM2_REG(x) (0x204 + (x) * 0x10)
543
544/* State Ram Word 3 */
545#define ENETDMA_SRAM3_REG(x) (0x208 + (x) * 0x10)
546
547/* State Ram Word 4 */
548#define ENETDMA_SRAM4_REG(x) (0x20c + (x) * 0x10)
549
550
551/*************************************************************************
552 * _REG relative to RSET_OHCI_PRIV
553 *************************************************************************/
554
555#define OHCI_PRIV_REG 0x0
556#define OHCI_PRIV_PORT1_HOST_SHIFT 0
557#define OHCI_PRIV_PORT1_HOST_MASK (1 << OHCI_PRIV_PORT1_HOST_SHIFT)
558#define OHCI_PRIV_REG_SWAP_SHIFT 3
559#define OHCI_PRIV_REG_SWAP_MASK (1 << OHCI_PRIV_REG_SWAP_SHIFT)
560
561
562/*************************************************************************
563 * _REG relative to RSET_USBH_PRIV
564 *************************************************************************/
565
566#define USBH_PRIV_SWAP_REG 0x0
567#define USBH_PRIV_SWAP_EHCI_ENDN_SHIFT 4
568#define USBH_PRIV_SWAP_EHCI_ENDN_MASK (1 << USBH_PRIV_SWAP_EHCI_ENDN_SHIFT)
569#define USBH_PRIV_SWAP_EHCI_DATA_SHIFT 3
570#define USBH_PRIV_SWAP_EHCI_DATA_MASK (1 << USBH_PRIV_SWAP_EHCI_DATA_SHIFT)
571#define USBH_PRIV_SWAP_OHCI_ENDN_SHIFT 1
572#define USBH_PRIV_SWAP_OHCI_ENDN_MASK (1 << USBH_PRIV_SWAP_OHCI_ENDN_SHIFT)
573#define USBH_PRIV_SWAP_OHCI_DATA_SHIFT 0
574#define USBH_PRIV_SWAP_OHCI_DATA_MASK (1 << USBH_PRIV_SWAP_OHCI_DATA_SHIFT)
575
576#define USBH_PRIV_TEST_REG 0x24
577
578
579/*************************************************************************
580 * _REG relative to RSET_MPI
581 *************************************************************************/
582
583/* well known (hard wired) chip select */
584#define MPI_CS_PCMCIA_COMMON 4
585#define MPI_CS_PCMCIA_ATTR 5
586#define MPI_CS_PCMCIA_IO 6
587
588/* Chip select base register */
589#define MPI_CSBASE_REG(x) (0x0 + (x) * 8)
590#define MPI_CSBASE_BASE_SHIFT 13
591#define MPI_CSBASE_BASE_MASK (0x1ffff << MPI_CSBASE_BASE_SHIFT)
592#define MPI_CSBASE_SIZE_SHIFT 0
593#define MPI_CSBASE_SIZE_MASK (0xf << MPI_CSBASE_SIZE_SHIFT)
594
595#define MPI_CSBASE_SIZE_8K 0
596#define MPI_CSBASE_SIZE_16K 1
597#define MPI_CSBASE_SIZE_32K 2
598#define MPI_CSBASE_SIZE_64K 3
599#define MPI_CSBASE_SIZE_128K 4
600#define MPI_CSBASE_SIZE_256K 5
601#define MPI_CSBASE_SIZE_512K 6
602#define MPI_CSBASE_SIZE_1M 7
603#define MPI_CSBASE_SIZE_2M 8
604#define MPI_CSBASE_SIZE_4M 9
605#define MPI_CSBASE_SIZE_8M 10
606#define MPI_CSBASE_SIZE_16M 11
607#define MPI_CSBASE_SIZE_32M 12
608#define MPI_CSBASE_SIZE_64M 13
609#define MPI_CSBASE_SIZE_128M 14
610#define MPI_CSBASE_SIZE_256M 15
611
612/* Chip select control register */
613#define MPI_CSCTL_REG(x) (0x4 + (x) * 8)
614#define MPI_CSCTL_ENABLE_MASK (1 << 0)
615#define MPI_CSCTL_WAIT_SHIFT 1
616#define MPI_CSCTL_WAIT_MASK (0x7 << MPI_CSCTL_WAIT_SHIFT)
617#define MPI_CSCTL_DATA16_MASK (1 << 4)
618#define MPI_CSCTL_SYNCMODE_MASK (1 << 7)
619#define MPI_CSCTL_TSIZE_MASK (1 << 8)
620#define MPI_CSCTL_ENDIANSWAP_MASK (1 << 10)
621#define MPI_CSCTL_SETUP_SHIFT 16
622#define MPI_CSCTL_SETUP_MASK (0xf << MPI_CSCTL_SETUP_SHIFT)
623#define MPI_CSCTL_HOLD_SHIFT 20
624#define MPI_CSCTL_HOLD_MASK (0xf << MPI_CSCTL_HOLD_SHIFT)
625
626/* PCI registers */
627#define MPI_SP0_RANGE_REG 0x100
628#define MPI_SP0_REMAP_REG 0x104
629#define MPI_SP0_REMAP_ENABLE_MASK (1 << 0)
630#define MPI_SP1_RANGE_REG 0x10C
631#define MPI_SP1_REMAP_REG 0x110
632#define MPI_SP1_REMAP_ENABLE_MASK (1 << 0)
633
634#define MPI_L2PCFG_REG 0x11C
635#define MPI_L2PCFG_CFG_TYPE_SHIFT 0
636#define MPI_L2PCFG_CFG_TYPE_MASK (0x3 << MPI_L2PCFG_CFG_TYPE_SHIFT)
637#define MPI_L2PCFG_REG_SHIFT 2
638#define MPI_L2PCFG_REG_MASK (0x3f << MPI_L2PCFG_REG_SHIFT)
639#define MPI_L2PCFG_FUNC_SHIFT 8
640#define MPI_L2PCFG_FUNC_MASK (0x7 << MPI_L2PCFG_FUNC_SHIFT)
641#define MPI_L2PCFG_DEVNUM_SHIFT 11
642#define MPI_L2PCFG_DEVNUM_MASK (0x1f << MPI_L2PCFG_DEVNUM_SHIFT)
643#define MPI_L2PCFG_CFG_USEREG_MASK (1 << 30)
644#define MPI_L2PCFG_CFG_SEL_MASK (1 << 31)
645
646#define MPI_L2PMEMRANGE1_REG 0x120
647#define MPI_L2PMEMBASE1_REG 0x124
648#define MPI_L2PMEMREMAP1_REG 0x128
649#define MPI_L2PMEMRANGE2_REG 0x12C
650#define MPI_L2PMEMBASE2_REG 0x130
651#define MPI_L2PMEMREMAP2_REG 0x134
652#define MPI_L2PIORANGE_REG 0x138
653#define MPI_L2PIOBASE_REG 0x13C
654#define MPI_L2PIOREMAP_REG 0x140
655#define MPI_L2P_BASE_MASK (0xffff8000)
656#define MPI_L2PREMAP_ENABLED_MASK (1 << 0)
657#define MPI_L2PREMAP_IS_CARDBUS_MASK (1 << 2)
658
659#define MPI_PCIMODESEL_REG 0x144
660#define MPI_PCIMODESEL_BAR1_NOSWAP_MASK (1 << 0)
661#define MPI_PCIMODESEL_BAR2_NOSWAP_MASK (1 << 1)
662#define MPI_PCIMODESEL_EXT_ARB_MASK (1 << 2)
663#define MPI_PCIMODESEL_PREFETCH_SHIFT 4
664#define MPI_PCIMODESEL_PREFETCH_MASK (0xf << MPI_PCIMODESEL_PREFETCH_SHIFT)
665
666#define MPI_LOCBUSCTL_REG 0x14C
667#define MPI_LOCBUSCTL_EN_PCI_GPIO_MASK (1 << 0)
668#define MPI_LOCBUSCTL_U2P_NOSWAP_MASK (1 << 1)
669
670#define MPI_LOCINT_REG 0x150
671#define MPI_LOCINT_MASK(x) (1 << (x + 16))
672#define MPI_LOCINT_STAT(x) (1 << (x))
673#define MPI_LOCINT_DIR_FAILED 6
674#define MPI_LOCINT_EXT_PCI_INT 7
675#define MPI_LOCINT_SERR 8
676#define MPI_LOCINT_CSERR 9
677
678#define MPI_PCICFGCTL_REG 0x178
679#define MPI_PCICFGCTL_CFGADDR_SHIFT 2
680#define MPI_PCICFGCTL_CFGADDR_MASK (0x1f << MPI_PCICFGCTL_CFGADDR_SHIFT)
681#define MPI_PCICFGCTL_WRITEEN_MASK (1 << 7)
682
683#define MPI_PCICFGDATA_REG 0x17C
684
685/* PCI host bridge custom register */
686#define BCMPCI_REG_TIMERS 0x40
687#define REG_TIMER_TRDY_SHIFT 0
688#define REG_TIMER_TRDY_MASK (0xff << REG_TIMER_TRDY_SHIFT)
689#define REG_TIMER_RETRY_SHIFT 8
690#define REG_TIMER_RETRY_MASK (0xff << REG_TIMER_RETRY_SHIFT)
691
692
693/*************************************************************************
694 * _REG relative to RSET_PCMCIA
695 *************************************************************************/
696
697#define PCMCIA_C1_REG 0x0
698#define PCMCIA_C1_CD1_MASK (1 << 0)
699#define PCMCIA_C1_CD2_MASK (1 << 1)
700#define PCMCIA_C1_VS1_MASK (1 << 2)
701#define PCMCIA_C1_VS2_MASK (1 << 3)
702#define PCMCIA_C1_VS1OE_MASK (1 << 6)
703#define PCMCIA_C1_VS2OE_MASK (1 << 7)
704#define PCMCIA_C1_CBIDSEL_SHIFT (8)
705#define PCMCIA_C1_CBIDSEL_MASK (0x1f << PCMCIA_C1_CBIDSEL_SHIFT)
706#define PCMCIA_C1_EN_PCMCIA_GPIO_MASK (1 << 13)
707#define PCMCIA_C1_EN_PCMCIA_MASK (1 << 14)
708#define PCMCIA_C1_EN_CARDBUS_MASK (1 << 15)
709#define PCMCIA_C1_RESET_MASK (1 << 18)
710
711#define PCMCIA_C2_REG 0x8
712#define PCMCIA_C2_DATA16_MASK (1 << 0)
713#define PCMCIA_C2_BYTESWAP_MASK (1 << 1)
714#define PCMCIA_C2_RWCOUNT_SHIFT 2
715#define PCMCIA_C2_RWCOUNT_MASK (0x3f << PCMCIA_C2_RWCOUNT_SHIFT)
716#define PCMCIA_C2_INACTIVE_SHIFT 8
717#define PCMCIA_C2_INACTIVE_MASK (0x3f << PCMCIA_C2_INACTIVE_SHIFT)
718#define PCMCIA_C2_SETUP_SHIFT 16
719#define PCMCIA_C2_SETUP_MASK (0x3f << PCMCIA_C2_SETUP_SHIFT)
720#define PCMCIA_C2_HOLD_SHIFT 24
721#define PCMCIA_C2_HOLD_MASK (0x3f << PCMCIA_C2_HOLD_SHIFT)
722
723
724/*************************************************************************
725 * _REG relative to RSET_SDRAM
726 *************************************************************************/
727
728#define SDRAM_CFG_REG 0x0
729#define SDRAM_CFG_ROW_SHIFT 4
730#define SDRAM_CFG_ROW_MASK (0x3 << SDRAM_CFG_ROW_SHIFT)
731#define SDRAM_CFG_COL_SHIFT 6
732#define SDRAM_CFG_COL_MASK (0x3 << SDRAM_CFG_COL_SHIFT)
733#define SDRAM_CFG_32B_SHIFT 10
734#define SDRAM_CFG_32B_MASK (1 << SDRAM_CFG_32B_SHIFT)
735#define SDRAM_CFG_BANK_SHIFT 13
736#define SDRAM_CFG_BANK_MASK (1 << SDRAM_CFG_BANK_SHIFT)
737
738#define SDRAM_PRIO_REG 0x2C
739#define SDRAM_PRIO_MIPS_SHIFT 29
740#define SDRAM_PRIO_MIPS_MASK (1 << SDRAM_PRIO_MIPS_SHIFT)
741#define SDRAM_PRIO_ADSL_SHIFT 30
742#define SDRAM_PRIO_ADSL_MASK (1 << SDRAM_PRIO_ADSL_SHIFT)
743#define SDRAM_PRIO_EN_SHIFT 31
744#define SDRAM_PRIO_EN_MASK (1 << SDRAM_PRIO_EN_SHIFT)
745
746
747/*************************************************************************
748 * _REG relative to RSET_MEMC
749 *************************************************************************/
750
751#define MEMC_CFG_REG 0x4
752#define MEMC_CFG_32B_SHIFT 1
753#define MEMC_CFG_32B_MASK (1 << MEMC_CFG_32B_SHIFT)
754#define MEMC_CFG_COL_SHIFT 3
755#define MEMC_CFG_COL_MASK (0x3 << MEMC_CFG_COL_SHIFT)
756#define MEMC_CFG_ROW_SHIFT 6
757#define MEMC_CFG_ROW_MASK (0x3 << MEMC_CFG_ROW_SHIFT)
758
759
760/*************************************************************************
761 * _REG relative to RSET_DDR
762 *************************************************************************/
763
764#define DDR_DMIPSPLLCFG_REG 0x18
765#define DMIPSPLLCFG_M1_SHIFT 0
766#define DMIPSPLLCFG_M1_MASK (0xff << DMIPSPLLCFG_M1_SHIFT)
767#define DMIPSPLLCFG_N1_SHIFT 23
768#define DMIPSPLLCFG_N1_MASK (0x3f << DMIPSPLLCFG_N1_SHIFT)
769#define DMIPSPLLCFG_N2_SHIFT 29
770#define DMIPSPLLCFG_N2_MASK (0x7 << DMIPSPLLCFG_N2_SHIFT)
771
772#endif /* BCM63XX_REGS_H_ */
773
diff --git a/arch/mips/include/asm/mach-bcm63xx/bcm63xx_timer.h b/arch/mips/include/asm/mach-bcm63xx/bcm63xx_timer.h
new file mode 100644
index 000000000000..c0fce833c9ed
--- /dev/null
+++ b/arch/mips/include/asm/mach-bcm63xx/bcm63xx_timer.h
@@ -0,0 +1,11 @@
1#ifndef BCM63XX_TIMER_H_
2#define BCM63XX_TIMER_H_
3
4int bcm63xx_timer_register(int id, void (*callback)(void *data), void *data);
5void bcm63xx_timer_unregister(int id);
6int bcm63xx_timer_set(int id, int monotonic, unsigned int countdown_us);
7int bcm63xx_timer_enable(int id);
8int bcm63xx_timer_disable(int id);
9unsigned int bcm63xx_timer_countdown(unsigned int countdown_us);
10
11#endif /* !BCM63XX_TIMER_H_ */
diff --git a/arch/mips/include/asm/mach-bcm63xx/board_bcm963xx.h b/arch/mips/include/asm/mach-bcm63xx/board_bcm963xx.h
new file mode 100644
index 000000000000..6479090a4106
--- /dev/null
+++ b/arch/mips/include/asm/mach-bcm63xx/board_bcm963xx.h
@@ -0,0 +1,60 @@
1#ifndef BOARD_BCM963XX_H_
2#define BOARD_BCM963XX_H_
3
4#include <linux/types.h>
5#include <linux/gpio.h>
6#include <linux/leds.h>
7#include <bcm63xx_dev_enet.h>
8#include <bcm63xx_dev_dsp.h>
9
10/*
11 * flash mapping
12 */
13#define BCM963XX_CFE_VERSION_OFFSET 0x570
14#define BCM963XX_NVRAM_OFFSET 0x580
15
16/*
17 * nvram structure
18 */
19struct bcm963xx_nvram {
20 u32 version;
21 u8 reserved1[256];
22 u8 name[16];
23 u32 main_tp_number;
24 u32 psi_size;
25 u32 mac_addr_count;
26 u8 mac_addr_base[6];
27 u8 reserved2[2];
28 u32 checksum_old;
29 u8 reserved3[720];
30 u32 checksum_high;
31};
32
33/*
34 * board definition
35 */
36struct board_info {
37 u8 name[16];
38 unsigned int expected_cpu_id;
39
40 /* enabled feature/device */
41 unsigned int has_enet0:1;
42 unsigned int has_enet1:1;
43 unsigned int has_pci:1;
44 unsigned int has_pccard:1;
45 unsigned int has_ohci0:1;
46 unsigned int has_ehci0:1;
47 unsigned int has_dsp:1;
48
49 /* ethernet config */
50 struct bcm63xx_enet_platform_data enet0;
51 struct bcm63xx_enet_platform_data enet1;
52
53 /* DSP config */
54 struct bcm63xx_dsp_platform_data dsp;
55
56 /* GPIO LEDs */
57 struct gpio_led leds[5];
58};
59
60#endif /* ! BOARD_BCM963XX_H_ */
diff --git a/arch/mips/include/asm/mach-bcm63xx/cpu-feature-overrides.h b/arch/mips/include/asm/mach-bcm63xx/cpu-feature-overrides.h
new file mode 100644
index 000000000000..71742bac940d
--- /dev/null
+++ b/arch/mips/include/asm/mach-bcm63xx/cpu-feature-overrides.h
@@ -0,0 +1,51 @@
1#ifndef __ASM_MACH_BCM963XX_CPU_FEATURE_OVERRIDES_H
2#define __ASM_MACH_BCM963XX_CPU_FEATURE_OVERRIDES_H
3
4#include <bcm63xx_cpu.h>
5
6#define cpu_has_tlb 1
7#define cpu_has_4kex 1
8#define cpu_has_4k_cache 1
9#define cpu_has_fpu 0
10#define cpu_has_32fpr 0
11#define cpu_has_counter 1
12#define cpu_has_watch 0
13#define cpu_has_divec 1
14#define cpu_has_vce 0
15#define cpu_has_cache_cdex_p 0
16#define cpu_has_cache_cdex_s 0
17#define cpu_has_prefetch 1
18#define cpu_has_mcheck 1
19#define cpu_has_ejtag 1
20#define cpu_has_llsc 1
21#define cpu_has_mips16 0
22#define cpu_has_mdmx 0
23#define cpu_has_mips3d 0
24#define cpu_has_smartmips 0
25#define cpu_has_vtag_icache 0
26
27#if !defined(BCMCPU_RUNTIME_DETECT) && (defined(CONFIG_BCMCPU_IS_6348) || defined(CONFIG_CPU_IS_6338) || defined(CONFIG_CPU_IS_BCM6345))
28#define cpu_has_dc_aliases 0
29#endif
30
31#define cpu_has_ic_fills_f_dc 0
32#define cpu_has_pindexed_dcache 0
33
34#define cpu_has_mips32r1 1
35#define cpu_has_mips32r2 0
36#define cpu_has_mips64r1 0
37#define cpu_has_mips64r2 0
38
39#define cpu_has_dsp 0
40#define cpu_has_mipsmt 0
41#define cpu_has_userlocal 0
42
43#define cpu_has_nofpuex 0
44#define cpu_has_64bits 0
45#define cpu_has_64bit_zero_reg 0
46
47#define cpu_dcache_line_size() 16
48#define cpu_icache_line_size() 16
49#define cpu_scache_line_size() 0
50
51#endif /* __ASM_MACH_BCM963XX_CPU_FEATURE_OVERRIDES_H */
diff --git a/arch/mips/include/asm/mach-bcm63xx/gpio.h b/arch/mips/include/asm/mach-bcm63xx/gpio.h
new file mode 100644
index 000000000000..7cda8c0a3979
--- /dev/null
+++ b/arch/mips/include/asm/mach-bcm63xx/gpio.h
@@ -0,0 +1,15 @@
1#ifndef __ASM_MIPS_MACH_BCM63XX_GPIO_H
2#define __ASM_MIPS_MACH_BCM63XX_GPIO_H
3
4#include <bcm63xx_gpio.h>
5
6#define gpio_to_irq(gpio) NULL
7
8#define gpio_get_value __gpio_get_value
9#define gpio_set_value __gpio_set_value
10
11#define gpio_cansleep __gpio_cansleep
12
13#include <asm-generic/gpio.h>
14
15#endif /* __ASM_MIPS_MACH_BCM63XX_GPIO_H */
diff --git a/arch/mips/include/asm/mach-bcm63xx/war.h b/arch/mips/include/asm/mach-bcm63xx/war.h
new file mode 100644
index 000000000000..8e3f3fdf3209
--- /dev/null
+++ b/arch/mips/include/asm/mach-bcm63xx/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_BCM63XX_WAR_H
9#define __ASM_MIPS_MACH_BCM63XX_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_BCM63XX_WAR_H */
diff --git a/arch/mips/include/asm/mach-cavium-octeon/cpu-feature-overrides.h b/arch/mips/include/asm/mach-cavium-octeon/cpu-feature-overrides.h
index 3d830756b13a..425e708d4fb9 100644
--- a/arch/mips/include/asm/mach-cavium-octeon/cpu-feature-overrides.h
+++ b/arch/mips/include/asm/mach-cavium-octeon/cpu-feature-overrides.h
@@ -31,12 +31,16 @@
31#define cpu_has_cache_cdex_s 0 31#define cpu_has_cache_cdex_s 0
32#define cpu_has_prefetch 1 32#define cpu_has_prefetch 1
33 33
34#define cpu_has_llsc 1
34/* 35/*
35 * We should disable LL/SC on non SMP systems as it is faster to 36 * We Disable LL/SC on non SMP systems as it is faster to disable
36 * disable interrupts for atomic access than a LL/SC. Unfortunatly we 37 * interrupts for atomic access than a LL/SC.
37 * cannot as this breaks asm/futex.h
38 */ 38 */
39#define cpu_has_llsc 1 39#ifdef CONFIG_SMP
40# define kernel_uses_llsc 1
41#else
42# define kernel_uses_llsc 0
43#endif
40#define cpu_has_vtag_icache 1 44#define cpu_has_vtag_icache 1
41#define cpu_has_dc_aliases 0 45#define cpu_has_dc_aliases 0
42#define cpu_has_ic_fills_f_dc 0 46#define cpu_has_ic_fills_f_dc 0
diff --git a/arch/mips/include/asm/mach-ip27/topology.h b/arch/mips/include/asm/mach-ip27/topology.h
index 07547231e078..230591707005 100644
--- a/arch/mips/include/asm/mach-ip27/topology.h
+++ b/arch/mips/include/asm/mach-ip27/topology.h
@@ -48,7 +48,6 @@ extern unsigned char __node_distances[MAX_COMPACT_NODES][MAX_COMPACT_NODES];
48 .cache_nice_tries = 1, \ 48 .cache_nice_tries = 1, \
49 .flags = SD_LOAD_BALANCE \ 49 .flags = SD_LOAD_BALANCE \
50 | SD_BALANCE_EXEC \ 50 | SD_BALANCE_EXEC \
51 | SD_WAKE_BALANCE, \
52 .last_balance = jiffies, \ 51 .last_balance = jiffies, \
53 .balance_interval = 1, \ 52 .balance_interval = 1, \
54 .nr_balance_failed = 0, \ 53 .nr_balance_failed = 0, \
diff --git a/arch/mips/include/asm/mach-lemote/cpu-feature-overrides.h b/arch/mips/include/asm/mach-loongson/cpu-feature-overrides.h
index 550a10dc9dba..ce5b6e270e3f 100644
--- a/arch/mips/include/asm/mach-lemote/cpu-feature-overrides.h
+++ b/arch/mips/include/asm/mach-loongson/cpu-feature-overrides.h
@@ -13,8 +13,8 @@
13 * loongson2f user manual. 13 * loongson2f user manual.
14 */ 14 */
15 15
16#ifndef __ASM_MACH_LEMOTE_CPU_FEATURE_OVERRIDES_H 16#ifndef __ASM_MACH_LOONGSON_CPU_FEATURE_OVERRIDES_H
17#define __ASM_MACH_LEMOTE_CPU_FEATURE_OVERRIDES_H 17#define __ASM_MACH_LOONGSON_CPU_FEATURE_OVERRIDES_H
18 18
19#define cpu_dcache_line_size() 32 19#define cpu_dcache_line_size() 32
20#define cpu_icache_line_size() 32 20#define cpu_icache_line_size() 32
@@ -56,4 +56,4 @@
56#define cpu_has_watch 1 56#define cpu_has_watch 1
57#define cpu_icache_snoops_remote_store 1 57#define cpu_icache_snoops_remote_store 1
58 58
59#endif /* __ASM_MACH_LEMOTE_CPU_FEATURE_OVERRIDES_H */ 59#endif /* __ASM_MACH_LOONGSON_CPU_FEATURE_OVERRIDES_H */
diff --git a/arch/mips/include/asm/mach-lemote/dma-coherence.h b/arch/mips/include/asm/mach-loongson/dma-coherence.h
index c8de5e750777..71a6851ba833 100644
--- a/arch/mips/include/asm/mach-lemote/dma-coherence.h
+++ b/arch/mips/include/asm/mach-loongson/dma-coherence.h
@@ -8,8 +8,8 @@
8 * Author: Fuxin Zhang, zhangfx@lemote.com 8 * Author: Fuxin Zhang, zhangfx@lemote.com
9 * 9 *
10 */ 10 */
11#ifndef __ASM_MACH_LEMOTE_DMA_COHERENCE_H 11#ifndef __ASM_MACH_LOONGSON_DMA_COHERENCE_H
12#define __ASM_MACH_LEMOTE_DMA_COHERENCE_H 12#define __ASM_MACH_LOONGSON_DMA_COHERENCE_H
13 13
14struct device; 14struct device;
15 15
@@ -65,4 +65,4 @@ static inline int plat_device_is_coherent(struct device *dev)
65 return 0; 65 return 0;
66} 66}
67 67
68#endif /* __ASM_MACH_LEMOTE_DMA_COHERENCE_H */ 68#endif /* __ASM_MACH_LOONGSON_DMA_COHERENCE_H */
diff --git a/arch/mips/include/asm/mach-loongson/loongson.h b/arch/mips/include/asm/mach-loongson/loongson.h
new file mode 100644
index 000000000000..da70bcf2304e
--- /dev/null
+++ b/arch/mips/include/asm/mach-loongson/loongson.h
@@ -0,0 +1,64 @@
1/*
2 * Copyright (C) 2009 Lemote, Inc. & Institute of Computing Technology
3 * Author: Wu Zhangjin <wuzj@lemote.com>
4 *
5 * This program is free software; you can redistribute it and/or modify it
6 * under the terms of the GNU General Public License as published by the
7 * Free Software Foundation; either version 2 of the License, or (at your
8 * option) any later version.
9 *
10 */
11
12#ifndef __ASM_MACH_LOONGSON_LOONGSON_H
13#define __ASM_MACH_LOONGSON_LOONGSON_H
14
15#include <linux/io.h>
16#include <linux/init.h>
17
18/* there is an internal bonito64-compatiable northbridge in loongson2e/2f */
19#include <asm/mips-boards/bonito64.h>
20
21/* loongson internal northbridge initialization */
22extern void bonito_irq_init(void);
23
24/* machine-specific reboot/halt operation */
25extern void mach_prepare_reboot(void);
26extern void mach_prepare_shutdown(void);
27
28/* environment arguments from bootloader */
29extern unsigned long bus_clock, cpu_clock_freq;
30extern unsigned long memsize, highmemsize;
31
32/* loongson-specific command line, env and memory initialization */
33extern void __init prom_init_memory(void);
34extern void __init prom_init_cmdline(void);
35extern void __init prom_init_env(void);
36
37/* irq operation functions */
38extern void bonito_irqdispatch(void);
39extern void __init bonito_irq_init(void);
40extern void __init set_irq_trigger_mode(void);
41extern void __init mach_init_irq(void);
42extern void mach_irq_dispatch(unsigned int pending);
43
44/* PCI Configuration Registers */
45#define LOONGSON_PCI_ISR4C BONITO_PCI_REG(0x4c)
46
47/* PCI_Hit*_Sel_* */
48
49#define LOONGSON_PCI_HIT0_SEL_L BONITO(BONITO_REGBASE + 0x50)
50#define LOONGSON_PCI_HIT0_SEL_H BONITO(BONITO_REGBASE + 0x54)
51#define LOONGSON_PCI_HIT1_SEL_L BONITO(BONITO_REGBASE + 0x58)
52#define LOONGSON_PCI_HIT1_SEL_H BONITO(BONITO_REGBASE + 0x5c)
53#define LOONGSON_PCI_HIT2_SEL_L BONITO(BONITO_REGBASE + 0x60)
54#define LOONGSON_PCI_HIT2_SEL_H BONITO(BONITO_REGBASE + 0x64)
55
56/* PXArb Config & Status */
57
58#define LOONGSON_PXARB_CFG BONITO(BONITO_REGBASE + 0x68)
59#define LOONGSON_PXARB_STATUS BONITO(BONITO_REGBASE + 0x6c)
60
61/* loongson2-specific perf counter IRQ */
62#define LOONGSON2_PERFCNT_IRQ (MIPS_CPU_IRQ_BASE + 6)
63
64#endif /* __ASM_MACH_LOONGSON_LOONGSON_H */
diff --git a/arch/mips/include/asm/mach-loongson/machine.h b/arch/mips/include/asm/mach-loongson/machine.h
new file mode 100644
index 000000000000..206ea2067916
--- /dev/null
+++ b/arch/mips/include/asm/mach-loongson/machine.h
@@ -0,0 +1,22 @@
1/*
2 * Copyright (C) 2009 Lemote, Inc. & Institute of Computing Technology
3 * Author: Wu Zhangjin <wuzj@lemote.com>
4 *
5 * This program is free software; you can redistribute it and/or modify it
6 * under the terms of the GNU General Public License as published by the
7 * Free Software Foundation; either version 2 of the License, or (at your
8 * option) any later version.
9 */
10
11#ifndef __ASM_MACH_LOONGSON_MACHINE_H
12#define __ASM_MACH_LOONGSON_MACHINE_H
13
14#ifdef CONFIG_LEMOTE_FULOONG2E
15
16#define LOONGSON_UART_BASE (BONITO_PCIIO_BASE + 0x3f8)
17
18#define LOONGSON_MACHTYPE MACH_LEMOTE_FL2E
19
20#endif
21
22#endif /* __ASM_MACH_LOONGSON_MACHINE_H */
diff --git a/arch/mips/include/asm/mach-lemote/mc146818rtc.h b/arch/mips/include/asm/mach-loongson/mc146818rtc.h
index ed5147e11085..ed7fe978335a 100644
--- a/arch/mips/include/asm/mach-lemote/mc146818rtc.h
+++ b/arch/mips/include/asm/mach-loongson/mc146818rtc.h
@@ -7,8 +7,8 @@
7 * 7 *
8 * RTC routines for PC style attached Dallas chip. 8 * RTC routines for PC style attached Dallas chip.
9 */ 9 */
10#ifndef __ASM_MACH_LEMOTE_MC146818RTC_H 10#ifndef __ASM_MACH_LOONGSON_MC146818RTC_H
11#define __ASM_MACH_LEMOTE_MC146818RTC_H 11#define __ASM_MACH_LOONGSON_MC146818RTC_H
12 12
13#include <linux/io.h> 13#include <linux/io.h>
14 14
@@ -33,4 +33,4 @@ static inline void CMOS_WRITE(unsigned char data, unsigned long addr)
33#define mc146818_decode_year(year) ((year) < 70 ? (year) + 2000 : (year) + 1970) 33#define mc146818_decode_year(year) ((year) < 70 ? (year) + 2000 : (year) + 1970)
34#endif 34#endif
35 35
36#endif /* __ASM_MACH_LEMOTE_MC146818RTC_H */ 36#endif /* __ASM_MACH_LOONGSON_MC146818RTC_H */
diff --git a/arch/mips/include/asm/mach-loongson/mem.h b/arch/mips/include/asm/mach-loongson/mem.h
new file mode 100644
index 000000000000..bd7b3cba7e35
--- /dev/null
+++ b/arch/mips/include/asm/mach-loongson/mem.h
@@ -0,0 +1,30 @@
1/*
2 * Copyright (C) 2009 Lemote, Inc. & Institute of Computing Technology
3 * Author: Wu Zhangjin <wuzj@lemote.com>
4 *
5 * This program is free software; you can redistribute it and/or modify it
6 * under the terms of the GNU General Public License as published by the
7 * Free Software Foundation; either version 2 of the License, or (at your
8 * option) any later version.
9 */
10
11#ifndef __ASM_MACH_LOONGSON_MEM_H
12#define __ASM_MACH_LOONGSON_MEM_H
13
14/*
15 * On Lemote Loongson 2e
16 *
17 * the high memory space starts from 512M.
18 * the peripheral registers reside between 0x1000:0000 and 0x2000:0000.
19 */
20
21#ifdef CONFIG_LEMOTE_FULOONG2E
22
23#define LOONGSON_HIGHMEM_START 0x20000000
24
25#define LOONGSON_MMIO_MEM_START 0x10000000
26#define LOONGSON_MMIO_MEM_END 0x20000000
27
28#endif
29
30#endif /* __ASM_MACH_LOONGSON_MEM_H */
diff --git a/arch/mips/include/asm/mach-lemote/pci.h b/arch/mips/include/asm/mach-loongson/pci.h
index ea6aa143b78e..f1663ca81da0 100644
--- a/arch/mips/include/asm/mach-lemote/pci.h
+++ b/arch/mips/include/asm/mach-loongson/pci.h
@@ -19,12 +19,19 @@
19 * 02139, USA. 19 * 02139, USA.
20 */ 20 */
21 21
22#ifndef _LEMOTE_PCI_H_ 22#ifndef __ASM_MACH_LOONGSON_PCI_H_
23#define _LEMOTE_PCI_H_ 23#define __ASM_MACH_LOONGSON_PCI_H_
24 24
25#define LOONGSON2E_PCI_MEM_START 0x14000000UL 25extern struct pci_ops bonito64_pci_ops;
26#define LOONGSON2E_PCI_MEM_END 0x1fffffffUL
27#define LOONGSON2E_PCI_IO_START 0x00004000UL
28#define LOONGSON2E_IO_PORT_BASE 0x1fd00000UL
29 26
30#endif /* !_LEMOTE_PCI_H_ */ 27#ifdef CONFIG_LEMOTE_FULOONG2E
28
29/* this pci memory space is mapped by pcimap in pci.c */
30#define LOONGSON_PCI_MEM_START BONITO_PCILO1_BASE
31#define LOONGSON_PCI_MEM_END (BONITO_PCILO1_BASE + 0x04000000 * 2)
32/* this is an offset from mips_io_port_base */
33#define LOONGSON_PCI_IO_START 0x00004000UL
34
35#endif
36
37#endif /* !__ASM_MACH_LOONGSON_PCI_H_ */
diff --git a/arch/mips/include/asm/mach-lemote/war.h b/arch/mips/include/asm/mach-loongson/war.h
index 05f89e0f2a11..4b971c3ffd8d 100644
--- a/arch/mips/include/asm/mach-lemote/war.h
+++ b/arch/mips/include/asm/mach-loongson/war.h
@@ -5,8 +5,8 @@
5 * 5 *
6 * Copyright (C) 2002, 2004, 2007 by Ralf Baechle <ralf@linux-mips.org> 6 * Copyright (C) 2002, 2004, 2007 by Ralf Baechle <ralf@linux-mips.org>
7 */ 7 */
8#ifndef __ASM_MIPS_MACH_LEMOTE_WAR_H 8#ifndef __ASM_MACH_LOONGSON_WAR_H
9#define __ASM_MIPS_MACH_LEMOTE_WAR_H 9#define __ASM_MACH_LOONGSON_WAR_H
10 10
11#define R4600_V1_INDEX_ICACHEOP_WAR 0 11#define R4600_V1_INDEX_ICACHEOP_WAR 0
12#define R4600_V1_HIT_CACHEOP_WAR 0 12#define R4600_V1_HIT_CACHEOP_WAR 0
@@ -22,4 +22,4 @@
22#define R10000_LLSC_WAR 0 22#define R10000_LLSC_WAR 0
23#define MIPS34K_MISSED_ITLB_WAR 0 23#define MIPS34K_MISSED_ITLB_WAR 0
24 24
25#endif /* __ASM_MIPS_MACH_LEMOTE_WAR_H */ 25#endif /* __ASM_MACH_LEMOTE_WAR_H */
diff --git a/arch/mips/include/asm/mach-malta/cpu-feature-overrides.h b/arch/mips/include/asm/mach-malta/cpu-feature-overrides.h
index 7f3e3f9bd23a..2848cea42bce 100644
--- a/arch/mips/include/asm/mach-malta/cpu-feature-overrides.h
+++ b/arch/mips/include/asm/mach-malta/cpu-feature-overrides.h
@@ -28,11 +28,7 @@
28/* #define cpu_has_prefetch ? */ 28/* #define cpu_has_prefetch ? */
29#define cpu_has_mcheck 1 29#define cpu_has_mcheck 1
30/* #define cpu_has_ejtag ? */ 30/* #define cpu_has_ejtag ? */
31#ifdef CONFIG_CPU_HAS_LLSC
32#define cpu_has_llsc 1 31#define cpu_has_llsc 1
33#else
34#define cpu_has_llsc 0
35#endif
36/* #define cpu_has_vtag_icache ? */ 32/* #define cpu_has_vtag_icache ? */
37/* #define cpu_has_dc_aliases ? */ 33/* #define cpu_has_dc_aliases ? */
38/* #define cpu_has_ic_fills_f_dc ? */ 34/* #define cpu_has_ic_fills_f_dc ? */
diff --git a/arch/mips/include/asm/mips-boards/bonito64.h b/arch/mips/include/asm/mips-boards/bonito64.h
index a0f04bb99c99..a576ce044c3c 100644
--- a/arch/mips/include/asm/mips-boards/bonito64.h
+++ b/arch/mips/include/asm/mips-boards/bonito64.h
@@ -26,7 +26,7 @@
26/* offsets from base register */ 26/* offsets from base register */
27#define BONITO(x) (x) 27#define BONITO(x) (x)
28 28
29#elif defined(CONFIG_LEMOTE_FULONG) 29#elif defined(CONFIG_LEMOTE_FULOONG2E)
30 30
31#define BONITO(x) (*(volatile u32 *)((char *)CKSEG1ADDR(BONITO_REG_BASE) + (x))) 31#define BONITO(x) (*(volatile u32 *)((char *)CKSEG1ADDR(BONITO_REG_BASE) + (x)))
32#define BONITO_IRQ_BASE 32 32#define BONITO_IRQ_BASE 32
diff --git a/arch/mips/include/asm/mips-boards/generic.h b/arch/mips/include/asm/mips-boards/generic.h
index c0da1a881e3d..46c08563e532 100644
--- a/arch/mips/include/asm/mips-boards/generic.h
+++ b/arch/mips/include/asm/mips-boards/generic.h
@@ -87,8 +87,6 @@
87 87
88extern int mips_revision_sconid; 88extern int mips_revision_sconid;
89 89
90extern void mips_reboot_setup(void);
91
92#ifdef CONFIG_PCI 90#ifdef CONFIG_PCI
93extern void mips_pcibios_init(void); 91extern void mips_pcibios_init(void);
94#else 92#else
diff --git a/arch/mips/include/asm/octeon/cvmx-rnm-defs.h b/arch/mips/include/asm/octeon/cvmx-rnm-defs.h
new file mode 100644
index 000000000000..4586958c97be
--- /dev/null
+++ b/arch/mips/include/asm/octeon/cvmx-rnm-defs.h
@@ -0,0 +1,88 @@
1/***********************license start***************
2 * Author: Cavium Networks
3 *
4 * Contact: support@caviumnetworks.com
5 * This file is part of the OCTEON SDK
6 *
7 * Copyright (c) 2003-2008 Cavium Networks
8 *
9 * This file is free software; you can redistribute it and/or modify
10 * it under the terms of the GNU General Public License, Version 2, as
11 * published by the Free Software Foundation.
12 *
13 * This file is distributed in the hope that it will be useful, but
14 * AS-IS and WITHOUT ANY WARRANTY; without even the implied warranty
15 * of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE, TITLE, or
16 * NONINFRINGEMENT. See the GNU General Public License for more
17 * details.
18 *
19 * You should have received a copy of the GNU General Public License
20 * along with this file; if not, write to the Free Software
21 * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
22 * or visit http://www.gnu.org/licenses/.
23 *
24 * This file may also be available under a different license from Cavium.
25 * Contact Cavium Networks for more information
26 ***********************license end**************************************/
27
28#ifndef __CVMX_RNM_DEFS_H__
29#define __CVMX_RNM_DEFS_H__
30
31#include <linux/types.h>
32
33#define CVMX_RNM_BIST_STATUS \
34 CVMX_ADD_IO_SEG(0x0001180040000008ull)
35#define CVMX_RNM_CTL_STATUS \
36 CVMX_ADD_IO_SEG(0x0001180040000000ull)
37
38union cvmx_rnm_bist_status {
39 uint64_t u64;
40 struct cvmx_rnm_bist_status_s {
41 uint64_t reserved_2_63:62;
42 uint64_t rrc:1;
43 uint64_t mem:1;
44 } s;
45 struct cvmx_rnm_bist_status_s cn30xx;
46 struct cvmx_rnm_bist_status_s cn31xx;
47 struct cvmx_rnm_bist_status_s cn38xx;
48 struct cvmx_rnm_bist_status_s cn38xxp2;
49 struct cvmx_rnm_bist_status_s cn50xx;
50 struct cvmx_rnm_bist_status_s cn52xx;
51 struct cvmx_rnm_bist_status_s cn52xxp1;
52 struct cvmx_rnm_bist_status_s cn56xx;
53 struct cvmx_rnm_bist_status_s cn56xxp1;
54 struct cvmx_rnm_bist_status_s cn58xx;
55 struct cvmx_rnm_bist_status_s cn58xxp1;
56};
57
58union cvmx_rnm_ctl_status {
59 uint64_t u64;
60 struct cvmx_rnm_ctl_status_s {
61 uint64_t reserved_9_63:55;
62 uint64_t ent_sel:4;
63 uint64_t exp_ent:1;
64 uint64_t rng_rst:1;
65 uint64_t rnm_rst:1;
66 uint64_t rng_en:1;
67 uint64_t ent_en:1;
68 } s;
69 struct cvmx_rnm_ctl_status_cn30xx {
70 uint64_t reserved_4_63:60;
71 uint64_t rng_rst:1;
72 uint64_t rnm_rst:1;
73 uint64_t rng_en:1;
74 uint64_t ent_en:1;
75 } cn30xx;
76 struct cvmx_rnm_ctl_status_cn30xx cn31xx;
77 struct cvmx_rnm_ctl_status_cn30xx cn38xx;
78 struct cvmx_rnm_ctl_status_cn30xx cn38xxp2;
79 struct cvmx_rnm_ctl_status_s cn50xx;
80 struct cvmx_rnm_ctl_status_s cn52xx;
81 struct cvmx_rnm_ctl_status_s cn52xxp1;
82 struct cvmx_rnm_ctl_status_s cn56xx;
83 struct cvmx_rnm_ctl_status_s cn56xxp1;
84 struct cvmx_rnm_ctl_status_s cn58xx;
85 struct cvmx_rnm_ctl_status_s cn58xxp1;
86};
87
88#endif
diff --git a/arch/mips/include/asm/octeon/cvmx.h b/arch/mips/include/asm/octeon/cvmx.h
index e31e3fe14f8a..9d9381e2e3d8 100644
--- a/arch/mips/include/asm/octeon/cvmx.h
+++ b/arch/mips/include/asm/octeon/cvmx.h
@@ -271,7 +271,7 @@ static inline void cvmx_write_csr(uint64_t csr_addr, uint64_t val)
271 * what RSL read we do, so we choose CVMX_MIO_BOOT_BIST_STAT 271 * what RSL read we do, so we choose CVMX_MIO_BOOT_BIST_STAT
272 * because it is fast and harmless. 272 * because it is fast and harmless.
273 */ 273 */
274 if ((csr_addr >> 40) == (0x800118)) 274 if (((csr_addr >> 40) & 0x7ffff) == (0x118))
275 cvmx_read64(CVMX_MIO_BOOT_BIST_STAT); 275 cvmx_read64(CVMX_MIO_BOOT_BIST_STAT);
276} 276}
277 277
diff --git a/arch/mips/include/asm/page.h b/arch/mips/include/asm/page.h
index 4320239cf4ef..f266295cce51 100644
--- a/arch/mips/include/asm/page.h
+++ b/arch/mips/include/asm/page.h
@@ -10,6 +10,7 @@
10#define _ASM_PAGE_H 10#define _ASM_PAGE_H
11 11
12#include <spaces.h> 12#include <spaces.h>
13#include <linux/const.h>
13 14
14/* 15/*
15 * PAGE_SHIFT determines the page size 16 * PAGE_SHIFT determines the page size
@@ -29,12 +30,12 @@
29#ifdef CONFIG_PAGE_SIZE_64KB 30#ifdef CONFIG_PAGE_SIZE_64KB
30#define PAGE_SHIFT 16 31#define PAGE_SHIFT 16
31#endif 32#endif
32#define PAGE_SIZE (1UL << PAGE_SHIFT) 33#define PAGE_SIZE (_AC(1,UL) << PAGE_SHIFT)
33#define PAGE_MASK (~((1 << PAGE_SHIFT) - 1)) 34#define PAGE_MASK (~((1 << PAGE_SHIFT) - 1))
34 35
35#ifdef CONFIG_HUGETLB_PAGE 36#ifdef CONFIG_HUGETLB_PAGE
36#define HPAGE_SHIFT (PAGE_SHIFT + PAGE_SHIFT - 3) 37#define HPAGE_SHIFT (PAGE_SHIFT + PAGE_SHIFT - 3)
37#define HPAGE_SIZE ((1UL) << HPAGE_SHIFT) 38#define HPAGE_SIZE (_AC(1,UL) << HPAGE_SHIFT)
38#define HPAGE_MASK (~(HPAGE_SIZE - 1)) 39#define HPAGE_MASK (~(HPAGE_SIZE - 1))
39#define HUGETLB_PAGE_ORDER (HPAGE_SHIFT - PAGE_SHIFT) 40#define HUGETLB_PAGE_ORDER (HPAGE_SHIFT - PAGE_SHIFT)
40#endif /* CONFIG_HUGETLB_PAGE */ 41#endif /* CONFIG_HUGETLB_PAGE */
diff --git a/arch/mips/include/asm/pci.h b/arch/mips/include/asm/pci.h
index a68d111e55e9..5ebf82572ec0 100644
--- a/arch/mips/include/asm/pci.h
+++ b/arch/mips/include/asm/pci.h
@@ -65,8 +65,6 @@ extern int pcibios_map_irq(const struct pci_dev *dev, u8 slot, u8 pin);
65 65
66extern unsigned int pcibios_assign_all_busses(void); 66extern unsigned int pcibios_assign_all_busses(void);
67 67
68#define pcibios_scan_all_fns(a, b) 0
69
70extern unsigned long PCIBIOS_MIN_IO; 68extern unsigned long PCIBIOS_MIN_IO;
71extern unsigned long PCIBIOS_MIN_MEM; 69extern unsigned long PCIBIOS_MIN_MEM;
72 70
diff --git a/arch/mips/include/asm/pgtable-64.h b/arch/mips/include/asm/pgtable-64.h
index 4ed9d1bba2ba..9cd508993956 100644
--- a/arch/mips/include/asm/pgtable-64.h
+++ b/arch/mips/include/asm/pgtable-64.h
@@ -109,13 +109,13 @@
109 109
110#define VMALLOC_START MAP_BASE 110#define VMALLOC_START MAP_BASE
111#define VMALLOC_END \ 111#define VMALLOC_END \
112 (VMALLOC_START + PTRS_PER_PGD * PTRS_PER_PMD * PTRS_PER_PTE * PAGE_SIZE) 112 (VMALLOC_START + \
113 PTRS_PER_PGD * PTRS_PER_PMD * PTRS_PER_PTE * PAGE_SIZE - (1UL << 32))
113#if defined(CONFIG_MODULES) && defined(KBUILD_64BIT_SYM32) && \ 114#if defined(CONFIG_MODULES) && defined(KBUILD_64BIT_SYM32) && \
114 VMALLOC_START != CKSSEG 115 VMALLOC_START != CKSSEG
115/* Load modules into 32bit-compatible segment. */ 116/* Load modules into 32bit-compatible segment. */
116#define MODULE_START CKSSEG 117#define MODULE_START CKSSEG
117#define MODULE_END (FIXADDR_START-2*PAGE_SIZE) 118#define MODULE_END (FIXADDR_START-2*PAGE_SIZE)
118extern pgd_t module_pg_dir[PTRS_PER_PGD];
119#endif 119#endif
120 120
121#define pte_ERROR(e) \ 121#define pte_ERROR(e) \
@@ -188,12 +188,7 @@ static inline void pud_clear(pud_t *pudp)
188#define __pmd_offset(address) pmd_index(address) 188#define __pmd_offset(address) pmd_index(address)
189 189
190/* to find an entry in a kernel page-table-directory */ 190/* to find an entry in a kernel page-table-directory */
191#ifdef MODULE_START 191#define pgd_offset_k(address) pgd_offset(&init_mm, address)
192#define pgd_offset_k(address) \
193 ((address) >= MODULE_START ? module_pg_dir : pgd_offset(&init_mm, 0UL))
194#else
195#define pgd_offset_k(address) pgd_offset(&init_mm, 0UL)
196#endif
197 192
198#define pgd_index(address) (((address) >> PGDIR_SHIFT) & (PTRS_PER_PGD-1)) 193#define pgd_index(address) (((address) >> PGDIR_SHIFT) & (PTRS_PER_PGD-1))
199#define pmd_index(address) (((address) >> PMD_SHIFT) & (PTRS_PER_PMD-1)) 194#define pmd_index(address) (((address) >> PMD_SHIFT) & (PTRS_PER_PMD-1))
diff --git a/arch/mips/include/asm/system.h b/arch/mips/include/asm/system.h
index cd30f83235bb..fcf5f98d90cc 100644
--- a/arch/mips/include/asm/system.h
+++ b/arch/mips/include/asm/system.h
@@ -32,6 +32,9 @@ extern asmlinkage void *resume(void *last, void *next, void *next_ti);
32 32
33struct task_struct; 33struct task_struct;
34 34
35extern unsigned int ll_bit;
36extern struct task_struct *ll_task;
37
35#ifdef CONFIG_MIPS_MT_FPAFF 38#ifdef CONFIG_MIPS_MT_FPAFF
36 39
37/* 40/*
@@ -63,11 +66,18 @@ do { \
63#define __mips_mt_fpaff_switch_to(prev) do { (void) (prev); } while (0) 66#define __mips_mt_fpaff_switch_to(prev) do { (void) (prev); } while (0)
64#endif 67#endif
65 68
69#define __clear_software_ll_bit() \
70do { \
71 if (!__builtin_constant_p(cpu_has_llsc) || !cpu_has_llsc) \
72 ll_bit = 0; \
73} while (0)
74
66#define switch_to(prev, next, last) \ 75#define switch_to(prev, next, last) \
67do { \ 76do { \
68 __mips_mt_fpaff_switch_to(prev); \ 77 __mips_mt_fpaff_switch_to(prev); \
69 if (cpu_has_dsp) \ 78 if (cpu_has_dsp) \
70 __save_dsp(prev); \ 79 __save_dsp(prev); \
80 __clear_software_ll_bit(); \
71 (last) = resume(prev, next, task_thread_info(next)); \ 81 (last) = resume(prev, next, task_thread_info(next)); \
72} while (0) 82} while (0)
73 83
@@ -84,7 +94,7 @@ static inline unsigned long __xchg_u32(volatile int * m, unsigned int val)
84{ 94{
85 __u32 retval; 95 __u32 retval;
86 96
87 if (cpu_has_llsc && R10000_LLSC_WAR) { 97 if (kernel_uses_llsc && R10000_LLSC_WAR) {
88 unsigned long dummy; 98 unsigned long dummy;
89 99
90 __asm__ __volatile__( 100 __asm__ __volatile__(
@@ -99,7 +109,7 @@ static inline unsigned long __xchg_u32(volatile int * m, unsigned int val)
99 : "=&r" (retval), "=m" (*m), "=&r" (dummy) 109 : "=&r" (retval), "=m" (*m), "=&r" (dummy)
100 : "R" (*m), "Jr" (val) 110 : "R" (*m), "Jr" (val)
101 : "memory"); 111 : "memory");
102 } else if (cpu_has_llsc) { 112 } else if (kernel_uses_llsc) {
103 unsigned long dummy; 113 unsigned long dummy;
104 114
105 __asm__ __volatile__( 115 __asm__ __volatile__(
@@ -136,7 +146,7 @@ static inline __u64 __xchg_u64(volatile __u64 * m, __u64 val)
136{ 146{
137 __u64 retval; 147 __u64 retval;
138 148
139 if (cpu_has_llsc && R10000_LLSC_WAR) { 149 if (kernel_uses_llsc && R10000_LLSC_WAR) {
140 unsigned long dummy; 150 unsigned long dummy;
141 151
142 __asm__ __volatile__( 152 __asm__ __volatile__(
@@ -149,7 +159,7 @@ static inline __u64 __xchg_u64(volatile __u64 * m, __u64 val)
149 : "=&r" (retval), "=m" (*m), "=&r" (dummy) 159 : "=&r" (retval), "=m" (*m), "=&r" (dummy)
150 : "R" (*m), "Jr" (val) 160 : "R" (*m), "Jr" (val)
151 : "memory"); 161 : "memory");
152 } else if (cpu_has_llsc) { 162 } else if (kernel_uses_llsc) {
153 unsigned long dummy; 163 unsigned long dummy;
154 164
155 __asm__ __volatile__( 165 __asm__ __volatile__(
diff --git a/arch/mips/kernel/asm-offsets.c b/arch/mips/kernel/asm-offsets.c
index 8d006ec65677..2c1e1d02338b 100644
--- a/arch/mips/kernel/asm-offsets.c
+++ b/arch/mips/kernel/asm-offsets.c
@@ -183,9 +183,6 @@ void output_mm_defines(void)
183 OFFSET(MM_PGD, mm_struct, pgd); 183 OFFSET(MM_PGD, mm_struct, pgd);
184 OFFSET(MM_CONTEXT, mm_struct, context); 184 OFFSET(MM_CONTEXT, mm_struct, context);
185 BLANK(); 185 BLANK();
186 DEFINE(_PAGE_SIZE, PAGE_SIZE);
187 DEFINE(_PAGE_SHIFT, PAGE_SHIFT);
188 BLANK();
189 DEFINE(_PGD_T_SIZE, sizeof(pgd_t)); 186 DEFINE(_PGD_T_SIZE, sizeof(pgd_t));
190 DEFINE(_PMD_T_SIZE, sizeof(pmd_t)); 187 DEFINE(_PMD_T_SIZE, sizeof(pmd_t));
191 DEFINE(_PTE_T_SIZE, sizeof(pte_t)); 188 DEFINE(_PTE_T_SIZE, sizeof(pte_t));
diff --git a/arch/mips/kernel/cpu-bugs64.c b/arch/mips/kernel/cpu-bugs64.c
index 02b7713cf71c..408d0a07b3a3 100644
--- a/arch/mips/kernel/cpu-bugs64.c
+++ b/arch/mips/kernel/cpu-bugs64.c
@@ -167,7 +167,7 @@ static inline void check_mult_sh(void)
167 panic(bug64hit, !R4000_WAR ? r4kwar : nowar); 167 panic(bug64hit, !R4000_WAR ? r4kwar : nowar);
168} 168}
169 169
170static volatile int daddi_ov __cpuinitdata = 0; 170static volatile int daddi_ov __cpuinitdata;
171 171
172asmlinkage void __init do_daddi_ov(struct pt_regs *regs) 172asmlinkage void __init do_daddi_ov(struct pt_regs *regs)
173{ 173{
diff --git a/arch/mips/kernel/cpu-probe.c b/arch/mips/kernel/cpu-probe.c
index 1abe9905c9c1..f709657e4dcd 100644
--- a/arch/mips/kernel/cpu-probe.c
+++ b/arch/mips/kernel/cpu-probe.c
@@ -31,7 +31,7 @@
31 * The wait instruction stops the pipeline and reduces the power consumption of 31 * The wait instruction stops the pipeline and reduces the power consumption of
32 * the CPU very much. 32 * the CPU very much.
33 */ 33 */
34void (*cpu_wait)(void) = NULL; 34void (*cpu_wait)(void);
35 35
36static void r3081_wait(void) 36static void r3081_wait(void)
37{ 37{
@@ -91,16 +91,13 @@ static void rm7k_wait_irqoff(void)
91 local_irq_enable(); 91 local_irq_enable();
92} 92}
93 93
94/* The Au1xxx wait is available only if using 32khz counter or 94/*
95 * external timer source, but specifically not CP0 Counter. */ 95 * The Au1xxx wait is available only if using 32khz counter or
96int allow_au1k_wait; 96 * external timer source, but specifically not CP0 Counter.
97 97 * alchemy/common/time.c may override cpu_wait!
98 */
98static void au1k_wait(void) 99static void au1k_wait(void)
99{ 100{
100 if (!allow_au1k_wait)
101 return;
102
103 /* using the wait instruction makes CP0 counter unusable */
104 __asm__(" .set mips3 \n" 101 __asm__(" .set mips3 \n"
105 " cache 0x14, 0(%0) \n" 102 " cache 0x14, 0(%0) \n"
106 " cache 0x14, 32(%0) \n" 103 " cache 0x14, 32(%0) \n"
@@ -115,7 +112,7 @@ static void au1k_wait(void)
115 : : "r" (au1k_wait)); 112 : : "r" (au1k_wait));
116} 113}
117 114
118static int __initdata nowait = 0; 115static int __initdata nowait;
119 116
120static int __init wait_disable(char *s) 117static int __init wait_disable(char *s)
121{ 118{
@@ -159,6 +156,9 @@ void __init check_wait(void)
159 case CPU_25KF: 156 case CPU_25KF:
160 case CPU_PR4450: 157 case CPU_PR4450:
161 case CPU_BCM3302: 158 case CPU_BCM3302:
159 case CPU_BCM6338:
160 case CPU_BCM6348:
161 case CPU_BCM6358:
162 case CPU_CAVIUM_OCTEON: 162 case CPU_CAVIUM_OCTEON:
163 cpu_wait = r4k_wait; 163 cpu_wait = r4k_wait;
164 break; 164 break;
@@ -857,6 +857,7 @@ static inline void cpu_probe_broadcom(struct cpuinfo_mips *c, unsigned int cpu)
857 decode_configs(c); 857 decode_configs(c);
858 switch (c->processor_id & 0xff00) { 858 switch (c->processor_id & 0xff00) {
859 case PRID_IMP_BCM3302: 859 case PRID_IMP_BCM3302:
860 /* same as PRID_IMP_BCM6338 */
860 c->cputype = CPU_BCM3302; 861 c->cputype = CPU_BCM3302;
861 __cpu_name[cpu] = "Broadcom BCM3302"; 862 __cpu_name[cpu] = "Broadcom BCM3302";
862 break; 863 break;
@@ -864,6 +865,25 @@ static inline void cpu_probe_broadcom(struct cpuinfo_mips *c, unsigned int cpu)
864 c->cputype = CPU_BCM4710; 865 c->cputype = CPU_BCM4710;
865 __cpu_name[cpu] = "Broadcom BCM4710"; 866 __cpu_name[cpu] = "Broadcom BCM4710";
866 break; 867 break;
868 case PRID_IMP_BCM6345:
869 c->cputype = CPU_BCM6345;
870 __cpu_name[cpu] = "Broadcom BCM6345";
871 break;
872 case PRID_IMP_BCM6348:
873 c->cputype = CPU_BCM6348;
874 __cpu_name[cpu] = "Broadcom BCM6348";
875 break;
876 case PRID_IMP_BCM4350:
877 switch (c->processor_id & 0xf0) {
878 case PRID_REV_BCM6358:
879 c->cputype = CPU_BCM6358;
880 __cpu_name[cpu] = "Broadcom BCM6358";
881 break;
882 default:
883 c->cputype = CPU_UNKNOWN;
884 break;
885 }
886 break;
867 } 887 }
868} 888}
869 889
diff --git a/arch/mips/kernel/kspd.c b/arch/mips/kernel/kspd.c
index fd6e51224034..f2397f00db43 100644
--- a/arch/mips/kernel/kspd.c
+++ b/arch/mips/kernel/kspd.c
@@ -31,7 +31,7 @@
31#include <asm/rtlx.h> 31#include <asm/rtlx.h>
32#include <asm/kspd.h> 32#include <asm/kspd.h>
33 33
34static struct workqueue_struct *workqueue = NULL; 34static struct workqueue_struct *workqueue;
35static struct work_struct work; 35static struct work_struct work;
36 36
37extern unsigned long cpu_khz; 37extern unsigned long cpu_khz;
@@ -58,7 +58,7 @@ struct mtsp_syscall_generic {
58}; 58};
59 59
60static struct list_head kspd_notifylist; 60static struct list_head kspd_notifylist;
61static int sp_stopping = 0; 61static int sp_stopping;
62 62
63/* these should match with those in the SDE kit */ 63/* these should match with those in the SDE kit */
64#define MTSP_SYSCALL_BASE 0 64#define MTSP_SYSCALL_BASE 0
@@ -328,7 +328,7 @@ static void sp_cleanup(void)
328 sys_chdir("/"); 328 sys_chdir("/");
329} 329}
330 330
331static int channel_open = 0; 331static int channel_open;
332 332
333/* the work handler */ 333/* the work handler */
334static void sp_work(struct work_struct *unused) 334static void sp_work(struct work_struct *unused)
diff --git a/arch/mips/kernel/mips-mt-fpaff.c b/arch/mips/kernel/mips-mt-fpaff.c
index 42461310b185..cbc6182b0065 100644
--- a/arch/mips/kernel/mips-mt-fpaff.c
+++ b/arch/mips/kernel/mips-mt-fpaff.c
@@ -18,7 +18,7 @@
18cpumask_t mt_fpu_cpumask; 18cpumask_t mt_fpu_cpumask;
19 19
20static int fpaff_threshold = -1; 20static int fpaff_threshold = -1;
21unsigned long mt_fpemul_threshold = 0; 21unsigned long mt_fpemul_threshold;
22 22
23/* 23/*
24 * Replacement functions for the sys_sched_setaffinity() and 24 * Replacement functions for the sys_sched_setaffinity() and
diff --git a/arch/mips/kernel/mips-mt.c b/arch/mips/kernel/mips-mt.c
index d01665a453f5..b2259e7cd829 100644
--- a/arch/mips/kernel/mips-mt.c
+++ b/arch/mips/kernel/mips-mt.c
@@ -125,10 +125,10 @@ void mips_mt_regdump(unsigned long mvpctl)
125 local_irq_restore(flags); 125 local_irq_restore(flags);
126} 126}
127 127
128static int mt_opt_norps = 0; 128static int mt_opt_norps;
129static int mt_opt_rpsctl = -1; 129static int mt_opt_rpsctl = -1;
130static int mt_opt_nblsu = -1; 130static int mt_opt_nblsu = -1;
131static int mt_opt_forceconfig7 = 0; 131static int mt_opt_forceconfig7;
132static int mt_opt_config7 = -1; 132static int mt_opt_config7 = -1;
133 133
134static int __init rps_disable(char *s) 134static int __init rps_disable(char *s)
@@ -161,8 +161,8 @@ static int __init config7_set(char *str)
161__setup("config7=", config7_set); 161__setup("config7=", config7_set);
162 162
163/* Experimental cache flush control parameters that should go away some day */ 163/* Experimental cache flush control parameters that should go away some day */
164int mt_protiflush = 0; 164int mt_protiflush;
165int mt_protdflush = 0; 165int mt_protdflush;
166int mt_n_iflushes = 1; 166int mt_n_iflushes = 1;
167int mt_n_dflushes = 1; 167int mt_n_dflushes = 1;
168 168
@@ -194,7 +194,7 @@ static int __init ndflush(char *s)
194} 194}
195__setup("ndflush=", ndflush); 195__setup("ndflush=", ndflush);
196 196
197static unsigned int itc_base = 0; 197static unsigned int itc_base;
198 198
199static int __init set_itc_base(char *str) 199static int __init set_itc_base(char *str)
200{ 200{
diff --git a/arch/mips/kernel/octeon_switch.S b/arch/mips/kernel/octeon_switch.S
index d52389672b06..3952b8323efa 100644
--- a/arch/mips/kernel/octeon_switch.S
+++ b/arch/mips/kernel/octeon_switch.S
@@ -36,9 +36,6 @@
36 .align 7 36 .align 7
37 LEAF(resume) 37 LEAF(resume)
38 .set arch=octeon 38 .set arch=octeon
39#ifndef CONFIG_CPU_HAS_LLSC
40 sw zero, ll_bit
41#endif
42 mfc0 t1, CP0_STATUS 39 mfc0 t1, CP0_STATUS
43 LONG_S t1, THREAD_STATUS(a0) 40 LONG_S t1, THREAD_STATUS(a0)
44 cpu_save_nonscratch a0 41 cpu_save_nonscratch a0
diff --git a/arch/mips/kernel/r2300_switch.S b/arch/mips/kernel/r2300_switch.S
index 656bde2e11b1..698414b7a253 100644
--- a/arch/mips/kernel/r2300_switch.S
+++ b/arch/mips/kernel/r2300_switch.S
@@ -46,9 +46,6 @@
46 * struct thread_info *next_ti) ) 46 * struct thread_info *next_ti) )
47 */ 47 */
48LEAF(resume) 48LEAF(resume)
49#ifndef CONFIG_CPU_HAS_LLSC
50 sw zero, ll_bit
51#endif
52 mfc0 t1, CP0_STATUS 49 mfc0 t1, CP0_STATUS
53 sw t1, THREAD_STATUS(a0) 50 sw t1, THREAD_STATUS(a0)
54 cpu_save_nonscratch a0 51 cpu_save_nonscratch a0
diff --git a/arch/mips/kernel/r4k_switch.S b/arch/mips/kernel/r4k_switch.S
index d9bfae53c43f..8893ee1a2368 100644
--- a/arch/mips/kernel/r4k_switch.S
+++ b/arch/mips/kernel/r4k_switch.S
@@ -45,9 +45,6 @@
45 */ 45 */
46 .align 5 46 .align 5
47 LEAF(resume) 47 LEAF(resume)
48#ifndef CONFIG_CPU_HAS_LLSC
49 sw zero, ll_bit
50#endif
51 mfc0 t1, CP0_STATUS 48 mfc0 t1, CP0_STATUS
52 LONG_S t1, THREAD_STATUS(a0) 49 LONG_S t1, THREAD_STATUS(a0)
53 cpu_save_nonscratch a0 50 cpu_save_nonscratch a0
diff --git a/arch/mips/kernel/rtlx.c b/arch/mips/kernel/rtlx.c
index 4ce93aa7b372..a10ebfdc28ae 100644
--- a/arch/mips/kernel/rtlx.c
+++ b/arch/mips/kernel/rtlx.c
@@ -57,7 +57,7 @@ static struct chan_waitqueues {
57} channel_wqs[RTLX_CHANNELS]; 57} channel_wqs[RTLX_CHANNELS];
58 58
59static struct vpe_notifications notify; 59static struct vpe_notifications notify;
60static int sp_stopping = 0; 60static int sp_stopping;
61 61
62extern void *vpe_get_shared(int index); 62extern void *vpe_get_shared(int index);
63 63
diff --git a/arch/mips/kernel/scall32-o32.S b/arch/mips/kernel/scall32-o32.S
index b57082123536..7c2de4f091c4 100644
--- a/arch/mips/kernel/scall32-o32.S
+++ b/arch/mips/kernel/scall32-o32.S
@@ -187,78 +187,6 @@ illegal_syscall:
187 j o32_syscall_exit 187 j o32_syscall_exit
188 END(handle_sys) 188 END(handle_sys)
189 189
190 LEAF(mips_atomic_set)
191 andi v0, a1, 3 # must be word aligned
192 bnez v0, bad_alignment
193
194 lw v1, TI_ADDR_LIMIT($28) # in legal address range?
195 addiu a0, a1, 4
196 or a0, a0, a1
197 and a0, a0, v1
198 bltz a0, bad_address
199
200#ifdef CONFIG_CPU_HAS_LLSC
201 /* Ok, this is the ll/sc case. World is sane :-) */
2021: ll v0, (a1)
203 move a0, a2
2042: sc a0, (a1)
205#if R10000_LLSC_WAR
206 beqzl a0, 1b
207#else
208 beqz a0, 1b
209#endif
210
211 .section __ex_table,"a"
212 PTR 1b, bad_stack
213 PTR 2b, bad_stack
214 .previous
215#else
216 sw a1, 16(sp)
217 sw a2, 20(sp)
218
219 move a0, sp
220 move a2, a1
221 li a1, 1
222 jal do_page_fault
223
224 lw a1, 16(sp)
225 lw a2, 20(sp)
226
227 /*
228 * At this point the page should be readable and writable unless
229 * there was no more memory available.
230 */
2311: lw v0, (a1)
2322: sw a2, (a1)
233
234 .section __ex_table,"a"
235 PTR 1b, no_mem
236 PTR 2b, no_mem
237 .previous
238#endif
239
240 sw zero, PT_R7(sp) # success
241 sw v0, PT_R2(sp) # result
242
243 j o32_syscall_exit # continue like a normal syscall
244
245no_mem: li v0, -ENOMEM
246 jr ra
247
248bad_address:
249 li v0, -EFAULT
250 jr ra
251
252bad_alignment:
253 li v0, -EINVAL
254 jr ra
255 END(mips_atomic_set)
256
257 LEAF(sys_sysmips)
258 beq a0, MIPS_ATOMIC_SET, mips_atomic_set
259 j _sys_sysmips
260 END(sys_sysmips)
261
262 LEAF(sys_syscall) 190 LEAF(sys_syscall)
263 subu t0, a0, __NR_O32_Linux # check syscall number 191 subu t0, a0, __NR_O32_Linux # check syscall number
264 sltiu v0, t0, __NR_O32_Linux_syscalls + 1 192 sltiu v0, t0, __NR_O32_Linux_syscalls + 1
diff --git a/arch/mips/kernel/scall64-64.S b/arch/mips/kernel/scall64-64.S
index 3d866f24e064..b97b993846d6 100644
--- a/arch/mips/kernel/scall64-64.S
+++ b/arch/mips/kernel/scall64-64.S
@@ -124,78 +124,6 @@ illegal_syscall:
124 j n64_syscall_exit 124 j n64_syscall_exit
125 END(handle_sys64) 125 END(handle_sys64)
126 126
127 LEAF(mips_atomic_set)
128 andi v0, a1, 3 # must be word aligned
129 bnez v0, bad_alignment
130
131 LONG_L v1, TI_ADDR_LIMIT($28) # in legal address range?
132 LONG_ADDIU a0, a1, 4
133 or a0, a0, a1
134 and a0, a0, v1
135 bltz a0, bad_address
136
137#ifdef CONFIG_CPU_HAS_LLSC
138 /* Ok, this is the ll/sc case. World is sane :-) */
1391: ll v0, (a1)
140 move a0, a2
1412: sc a0, (a1)
142#if R10000_LLSC_WAR
143 beqzl a0, 1b
144#else
145 beqz a0, 1b
146#endif
147
148 .section __ex_table,"a"
149 PTR 1b, bad_stack
150 PTR 2b, bad_stack
151 .previous
152#else
153 sw a1, 16(sp)
154 sw a2, 20(sp)
155
156 move a0, sp
157 move a2, a1
158 li a1, 1
159 jal do_page_fault
160
161 lw a1, 16(sp)
162 lw a2, 20(sp)
163
164 /*
165 * At this point the page should be readable and writable unless
166 * there was no more memory available.
167 */
1681: lw v0, (a1)
1692: sw a2, (a1)
170
171 .section __ex_table,"a"
172 PTR 1b, no_mem
173 PTR 2b, no_mem
174 .previous
175#endif
176
177 sd zero, PT_R7(sp) # success
178 sd v0, PT_R2(sp) # result
179
180 j n64_syscall_exit # continue like a normal syscall
181
182no_mem: li v0, -ENOMEM
183 jr ra
184
185bad_address:
186 li v0, -EFAULT
187 jr ra
188
189bad_alignment:
190 li v0, -EINVAL
191 jr ra
192 END(mips_atomic_set)
193
194 LEAF(sys_sysmips)
195 beq a0, MIPS_ATOMIC_SET, mips_atomic_set
196 j _sys_sysmips
197 END(sys_sysmips)
198
199 .align 3 127 .align 3
200sys_call_table: 128sys_call_table:
201 PTR sys_read /* 5000 */ 129 PTR sys_read /* 5000 */
diff --git a/arch/mips/kernel/setup.c b/arch/mips/kernel/setup.c
index 2950b97253b7..2b290d70083e 100644
--- a/arch/mips/kernel/setup.c
+++ b/arch/mips/kernel/setup.c
@@ -441,7 +441,7 @@ static void __init bootmem_init(void)
441 * initialization hook for anything else was introduced. 441 * initialization hook for anything else was introduced.
442 */ 442 */
443 443
444static int usermem __initdata = 0; 444static int usermem __initdata;
445 445
446static int __init early_parse_mem(char *p) 446static int __init early_parse_mem(char *p)
447{ 447{
diff --git a/arch/mips/kernel/smp.c b/arch/mips/kernel/smp.c
index bc7d9b05e2f4..64668a93248b 100644
--- a/arch/mips/kernel/smp.c
+++ b/arch/mips/kernel/smp.c
@@ -32,6 +32,7 @@
32#include <linux/cpumask.h> 32#include <linux/cpumask.h>
33#include <linux/cpu.h> 33#include <linux/cpu.h>
34#include <linux/err.h> 34#include <linux/err.h>
35#include <linux/smp.h>
35 36
36#include <asm/atomic.h> 37#include <asm/atomic.h>
37#include <asm/cpu.h> 38#include <asm/cpu.h>
@@ -49,8 +50,6 @@ volatile cpumask_t cpu_callin_map; /* Bitmask of started secondaries */
49int __cpu_number_map[NR_CPUS]; /* Map physical to logical */ 50int __cpu_number_map[NR_CPUS]; /* Map physical to logical */
50int __cpu_logical_map[NR_CPUS]; /* Map logical to physical */ 51int __cpu_logical_map[NR_CPUS]; /* Map logical to physical */
51 52
52extern void cpu_idle(void);
53
54/* Number of TCs (or siblings in Intel speak) per CPU core */ 53/* Number of TCs (or siblings in Intel speak) per CPU core */
55int smp_num_siblings = 1; 54int smp_num_siblings = 1;
56EXPORT_SYMBOL(smp_num_siblings); 55EXPORT_SYMBOL(smp_num_siblings);
diff --git a/arch/mips/kernel/smtc.c b/arch/mips/kernel/smtc.c
index c16bb6d6c25c..1a466baf0edf 100644
--- a/arch/mips/kernel/smtc.c
+++ b/arch/mips/kernel/smtc.c
@@ -95,14 +95,14 @@ void init_smtc_stats(void);
95 95
96/* Global SMTC Status */ 96/* Global SMTC Status */
97 97
98unsigned int smtc_status = 0; 98unsigned int smtc_status;
99 99
100/* Boot command line configuration overrides */ 100/* Boot command line configuration overrides */
101 101
102static int vpe0limit; 102static int vpe0limit;
103static int ipibuffers = 0; 103static int ipibuffers;
104static int nostlb = 0; 104static int nostlb;
105static int asidmask = 0; 105static int asidmask;
106unsigned long smtc_asid_mask = 0xff; 106unsigned long smtc_asid_mask = 0xff;
107 107
108static int __init vpe0tcs(char *str) 108static int __init vpe0tcs(char *str)
@@ -151,7 +151,7 @@ __setup("asidmask=", asidmask_set);
151 151
152#ifdef CONFIG_SMTC_IDLE_HOOK_DEBUG 152#ifdef CONFIG_SMTC_IDLE_HOOK_DEBUG
153 153
154static int hang_trig = 0; 154static int hang_trig;
155 155
156static int __init hangtrig_enable(char *s) 156static int __init hangtrig_enable(char *s)
157{ 157{
diff --git a/arch/mips/kernel/syscall.c b/arch/mips/kernel/syscall.c
index 8cf384644040..3fe1fcfa2e73 100644
--- a/arch/mips/kernel/syscall.c
+++ b/arch/mips/kernel/syscall.c
@@ -28,7 +28,9 @@
28#include <linux/compiler.h> 28#include <linux/compiler.h>
29#include <linux/module.h> 29#include <linux/module.h>
30#include <linux/ipc.h> 30#include <linux/ipc.h>
31#include <linux/uaccess.h>
31 32
33#include <asm/asm.h>
32#include <asm/branch.h> 34#include <asm/branch.h>
33#include <asm/cachectl.h> 35#include <asm/cachectl.h>
34#include <asm/cacheflush.h> 36#include <asm/cacheflush.h>
@@ -290,12 +292,116 @@ SYSCALL_DEFINE1(set_thread_area, unsigned long, addr)
290 return 0; 292 return 0;
291} 293}
292 294
293asmlinkage int _sys_sysmips(long cmd, long arg1, long arg2, long arg3) 295static inline int mips_atomic_set(struct pt_regs *regs,
296 unsigned long addr, unsigned long new)
294{ 297{
298 unsigned long old, tmp;
299 unsigned int err;
300
301 if (unlikely(addr & 3))
302 return -EINVAL;
303
304 if (unlikely(!access_ok(VERIFY_WRITE, addr, 4)))
305 return -EINVAL;
306
307 if (cpu_has_llsc && R10000_LLSC_WAR) {
308 __asm__ __volatile__ (
309 " li %[err], 0 \n"
310 "1: ll %[old], (%[addr]) \n"
311 " move %[tmp], %[new] \n"
312 "2: sc %[tmp], (%[addr]) \n"
313 " beqzl %[tmp], 1b \n"
314 "3: \n"
315 " .section .fixup,\"ax\" \n"
316 "4: li %[err], %[efault] \n"
317 " j 3b \n"
318 " .previous \n"
319 " .section __ex_table,\"a\" \n"
320 " "STR(PTR)" 1b, 4b \n"
321 " "STR(PTR)" 2b, 4b \n"
322 " .previous \n"
323 : [old] "=&r" (old),
324 [err] "=&r" (err),
325 [tmp] "=&r" (tmp)
326 : [addr] "r" (addr),
327 [new] "r" (new),
328 [efault] "i" (-EFAULT)
329 : "memory");
330 } else if (cpu_has_llsc) {
331 __asm__ __volatile__ (
332 " li %[err], 0 \n"
333 "1: ll %[old], (%[addr]) \n"
334 " move %[tmp], %[new] \n"
335 "2: sc %[tmp], (%[addr]) \n"
336 " bnez %[tmp], 4f \n"
337 "3: \n"
338 " .subsection 2 \n"
339 "4: b 1b \n"
340 " .previous \n"
341 " \n"
342 " .section .fixup,\"ax\" \n"
343 "5: li %[err], %[efault] \n"
344 " j 3b \n"
345 " .previous \n"
346 " .section __ex_table,\"a\" \n"
347 " "STR(PTR)" 1b, 5b \n"
348 " "STR(PTR)" 2b, 5b \n"
349 " .previous \n"
350 : [old] "=&r" (old),
351 [err] "=&r" (err),
352 [tmp] "=&r" (tmp)
353 : [addr] "r" (addr),
354 [new] "r" (new),
355 [efault] "i" (-EFAULT)
356 : "memory");
357 } else {
358 do {
359 preempt_disable();
360 ll_bit = 1;
361 ll_task = current;
362 preempt_enable();
363
364 err = __get_user(old, (unsigned int *) addr);
365 err |= __put_user(new, (unsigned int *) addr);
366 if (err)
367 break;
368 rmb();
369 } while (!ll_bit);
370 }
371
372 if (unlikely(err))
373 return err;
374
375 regs->regs[2] = old;
376 regs->regs[7] = 0; /* No error */
377
378 /*
379 * Don't let your children do this ...
380 */
381 __asm__ __volatile__(
382 " move $29, %0 \n"
383 " j syscall_exit \n"
384 : /* no outputs */
385 : "r" (regs));
386
387 /* unreached. Honestly. */
388 while (1);
389}
390
391save_static_function(sys_sysmips);
392static int __used noinline
393_sys_sysmips(nabi_no_regargs struct pt_regs regs)
394{
395 long cmd, arg1, arg2, arg3;
396
397 cmd = regs.regs[4];
398 arg1 = regs.regs[5];
399 arg2 = regs.regs[6];
400 arg3 = regs.regs[7];
401
295 switch (cmd) { 402 switch (cmd) {
296 case MIPS_ATOMIC_SET: 403 case MIPS_ATOMIC_SET:
297 printk(KERN_CRIT "How did I get here?\n"); 404 return mips_atomic_set(&regs, arg1, arg2);
298 return -EINVAL;
299 405
300 case MIPS_FIXADE: 406 case MIPS_FIXADE:
301 if (arg1 & ~3) 407 if (arg1 & ~3)
diff --git a/arch/mips/kernel/traps.c b/arch/mips/kernel/traps.c
index 08f1edf355e8..0a18b4c62afb 100644
--- a/arch/mips/kernel/traps.c
+++ b/arch/mips/kernel/traps.c
@@ -466,9 +466,8 @@ asmlinkage void do_be(struct pt_regs *regs)
466 * The ll_bit is cleared by r*_switch.S 466 * The ll_bit is cleared by r*_switch.S
467 */ 467 */
468 468
469unsigned long ll_bit; 469unsigned int ll_bit;
470 470struct task_struct *ll_task;
471static struct task_struct *ll_task = NULL;
472 471
473static inline int simulate_ll(struct pt_regs *regs, unsigned int opcode) 472static inline int simulate_ll(struct pt_regs *regs, unsigned int opcode)
474{ 473{
diff --git a/arch/mips/kernel/vmlinux.lds.S b/arch/mips/kernel/vmlinux.lds.S
index 58738c8d754f..2769bed3d2af 100644
--- a/arch/mips/kernel/vmlinux.lds.S
+++ b/arch/mips/kernel/vmlinux.lds.S
@@ -1,4 +1,5 @@
1#include <asm/asm-offsets.h> 1#include <asm/asm-offsets.h>
2#include <asm/page.h>
2#include <asm-generic/vmlinux.lds.h> 3#include <asm-generic/vmlinux.lds.h>
3 4
4#undef mips 5#undef mips
@@ -42,13 +43,7 @@ SECTIONS
42 } :text = 0 43 } :text = 0
43 _etext = .; /* End of text section */ 44 _etext = .; /* End of text section */
44 45
45 /* Exception table */ 46 EXCEPTION_TABLE(16)
46 . = ALIGN(16);
47 __ex_table : {
48 __start___ex_table = .;
49 *(__ex_table)
50 __stop___ex_table = .;
51 }
52 47
53 /* Exception table for data bus errors */ 48 /* Exception table for data bus errors */
54 __dbe_table : { 49 __dbe_table : {
@@ -65,20 +60,10 @@ SECTIONS
65 /* writeable */ 60 /* writeable */
66 .data : { /* Data */ 61 .data : { /* Data */
67 . = . + DATAOFFSET; /* for CONFIG_MAPPED_KERNEL */ 62 . = . + DATAOFFSET; /* for CONFIG_MAPPED_KERNEL */
68 /*
69 * This ALIGN is needed as a workaround for a bug a
70 * gcc bug upto 4.1 which limits the maximum alignment
71 * to at most 32kB and results in the following
72 * warning:
73 *
74 * CC arch/mips/kernel/init_task.o
75 * arch/mips/kernel/init_task.c:30: warning: alignment
76 * of ‘init_thread_union’ is greater than maximum
77 * object file alignment. Using 32768
78 */
79 . = ALIGN(_PAGE_SIZE);
80 *(.data.init_task)
81 63
64 INIT_TASK_DATA(PAGE_SIZE)
65 NOSAVE_DATA
66 CACHELINE_ALIGNED_DATA(1 << CONFIG_MIPS_L1_CACHE_SHIFT)
82 DATA_DATA 67 DATA_DATA
83 CONSTRUCTORS 68 CONSTRUCTORS
84 } 69 }
@@ -95,51 +80,13 @@ SECTIONS
95 .sdata : { 80 .sdata : {
96 *(.sdata) 81 *(.sdata)
97 } 82 }
98
99 . = ALIGN(_PAGE_SIZE);
100 .data_nosave : {
101 __nosave_begin = .;
102 *(.data.nosave)
103 }
104 . = ALIGN(_PAGE_SIZE);
105 __nosave_end = .;
106
107 . = ALIGN(1 << CONFIG_MIPS_L1_CACHE_SHIFT);
108 .data.cacheline_aligned : {
109 *(.data.cacheline_aligned)
110 }
111 _edata = .; /* End of data section */ 83 _edata = .; /* End of data section */
112 84
113 /* will be freed after init */ 85 /* will be freed after init */
114 . = ALIGN(_PAGE_SIZE); /* Init code and data */ 86 . = ALIGN(PAGE_SIZE); /* Init code and data */
115 __init_begin = .; 87 __init_begin = .;
116 .init.text : { 88 INIT_TEXT_SECTION(PAGE_SIZE)
117 _sinittext = .; 89 INIT_DATA_SECTION(16)
118 INIT_TEXT
119 _einittext = .;
120 }
121 .init.data : {
122 INIT_DATA
123 }
124 . = ALIGN(16);
125 .init.setup : {
126 __setup_start = .;
127 *(.init.setup)
128 __setup_end = .;
129 }
130
131 .initcall.init : {
132 __initcall_start = .;
133 INITCALLS
134 __initcall_end = .;
135 }
136
137 .con_initcall.init : {
138 __con_initcall_start = .;
139 *(.con_initcall.init)
140 __con_initcall_end = .;
141 }
142 SECURITY_INIT
143 90
144 /* .exit.text is discarded at runtime, not link time, to deal with 91 /* .exit.text is discarded at runtime, not link time, to deal with
145 * references from .rodata 92 * references from .rodata
@@ -150,43 +97,16 @@ SECTIONS
150 .exit.data : { 97 .exit.data : {
151 EXIT_DATA 98 EXIT_DATA
152 } 99 }
153#if defined(CONFIG_BLK_DEV_INITRD) 100
154 . = ALIGN(_PAGE_SIZE); 101 PERCPU(PAGE_SIZE)
155 .init.ramfs : { 102 . = ALIGN(PAGE_SIZE);
156 __initramfs_start = .;
157 *(.init.ramfs)
158 __initramfs_end = .;
159 }
160#endif
161 PERCPU(_PAGE_SIZE)
162 . = ALIGN(_PAGE_SIZE);
163 __init_end = .; 103 __init_end = .;
164 /* freed after init ends here */ 104 /* freed after init ends here */
165 105
166 __bss_start = .; /* BSS */ 106 BSS_SECTION(0, 0, 0)
167 .sbss : {
168 *(.sbss)
169 *(.scommon)
170 }
171 .bss : {
172 *(.bss)
173 *(COMMON)
174 }
175 __bss_stop = .;
176 107
177 _end = . ; 108 _end = . ;
178 109
179 /* Sections to be discarded */
180 /DISCARD/ : {
181 *(.exitcall.exit)
182
183 /* ABI crap starts here */
184 *(.MIPS.options)
185 *(.options)
186 *(.pdr)
187 *(.reginfo)
188 }
189
190 /* These mark the ABI of the kernel for debuggers. */ 110 /* These mark the ABI of the kernel for debuggers. */
191 .mdebug.abi32 : { 111 .mdebug.abi32 : {
192 KEEP(*(.mdebug.abi32)) 112 KEEP(*(.mdebug.abi32))
@@ -212,4 +132,14 @@ SECTIONS
212 *(.gptab.bss) 132 *(.gptab.bss)
213 *(.gptab.sbss) 133 *(.gptab.sbss)
214 } 134 }
135
136 /* Sections to be discarded */
137 DISCARDS
138 /DISCARD/ : {
139 /* ABI crap starts here */
140 *(.MIPS.options)
141 *(.options)
142 *(.pdr)
143 *(.reginfo)
144 }
215} 145}
diff --git a/arch/mips/kernel/vpe.c b/arch/mips/kernel/vpe.c
index 9a1ab7e87fd4..eb6c4c5b7fbe 100644
--- a/arch/mips/kernel/vpe.c
+++ b/arch/mips/kernel/vpe.c
@@ -74,7 +74,7 @@ static const int minor = 1; /* fixed for now */
74 74
75#ifdef CONFIG_MIPS_APSP_KSPD 75#ifdef CONFIG_MIPS_APSP_KSPD
76static struct kspd_notifications kspd_events; 76static struct kspd_notifications kspd_events;
77static int kspd_events_reqd = 0; 77static int kspd_events_reqd;
78#endif 78#endif
79 79
80/* grab the likely amount of memory we will need. */ 80/* grab the likely amount of memory we will need. */
diff --git a/arch/mips/lemote/lm2e/Makefile b/arch/mips/lemote/lm2e/Makefile
deleted file mode 100644
index d34671d1b899..000000000000
--- a/arch/mips/lemote/lm2e/Makefile
+++ /dev/null
@@ -1,7 +0,0 @@
1#
2# Makefile for Lemote Fulong mini-PC board.
3#
4
5obj-y += setup.o prom.o reset.o irq.o pci.o bonito-irq.o dbg_io.o mem.o
6
7EXTRA_CFLAGS += -Werror
diff --git a/arch/mips/lemote/lm2e/dbg_io.c b/arch/mips/lemote/lm2e/dbg_io.c
deleted file mode 100644
index 6c95da3ca76f..000000000000
--- a/arch/mips/lemote/lm2e/dbg_io.c
+++ /dev/null
@@ -1,146 +0,0 @@
1/*
2 * Copyright 2001 MontaVista Software Inc.
3 * Author: Jun Sun, jsun@mvista.com or jsun@junsun.net
4 * Copyright (C) 2000, 2001 Ralf Baechle (ralf@gnu.org)
5 *
6 * Copyright (C) 2007 Lemote Inc. & Insititute of Computing Technology
7 * Author: Fuxin Zhang, zhangfx@lemote.com
8 *
9 * This program is free software; you can redistribute it and/or modify it
10 * under the terms of the GNU General Public License as published by the
11 * Free Software Foundation; either version 2 of the License, or (at your
12 * option) any later version.
13 *
14 * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESS OR IMPLIED
15 * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
16 * MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN
17 * NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT,
18 * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
19 * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF
20 * USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON
21 * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
22 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
23 * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
24 *
25 * You should have received a copy of the GNU General Public License along
26 * with this program; if not, write to the Free Software Foundation, Inc.,
27 * 675 Mass Ave, Cambridge, MA 02139, USA.
28 *
29 */
30
31#include <linux/io.h>
32#include <linux/init.h>
33#include <linux/types.h>
34
35#include <asm/serial.h>
36
37#define UART16550_BAUD_2400 2400
38#define UART16550_BAUD_4800 4800
39#define UART16550_BAUD_9600 9600
40#define UART16550_BAUD_19200 19200
41#define UART16550_BAUD_38400 38400
42#define UART16550_BAUD_57600 57600
43#define UART16550_BAUD_115200 115200
44
45#define UART16550_PARITY_NONE 0
46#define UART16550_PARITY_ODD 0x08
47#define UART16550_PARITY_EVEN 0x18
48#define UART16550_PARITY_MARK 0x28
49#define UART16550_PARITY_SPACE 0x38
50
51#define UART16550_DATA_5BIT 0x0
52#define UART16550_DATA_6BIT 0x1
53#define UART16550_DATA_7BIT 0x2
54#define UART16550_DATA_8BIT 0x3
55
56#define UART16550_STOP_1BIT 0x0
57#define UART16550_STOP_2BIT 0x4
58
59/* ----------------------------------------------------- */
60
61/* === CONFIG === */
62#ifdef CONFIG_64BIT
63#define BASE (0xffffffffbfd003f8)
64#else
65#define BASE (0xbfd003f8)
66#endif
67
68#define MAX_BAUD BASE_BAUD
69/* === END OF CONFIG === */
70
71#define REG_OFFSET 1
72
73/* register offset */
74#define OFS_RCV_BUFFER 0
75#define OFS_TRANS_HOLD 0
76#define OFS_SEND_BUFFER 0
77#define OFS_INTR_ENABLE (1*REG_OFFSET)
78#define OFS_INTR_ID (2*REG_OFFSET)
79#define OFS_DATA_FORMAT (3*REG_OFFSET)
80#define OFS_LINE_CONTROL (3*REG_OFFSET)
81#define OFS_MODEM_CONTROL (4*REG_OFFSET)
82#define OFS_RS232_OUTPUT (4*REG_OFFSET)
83#define OFS_LINE_STATUS (5*REG_OFFSET)
84#define OFS_MODEM_STATUS (6*REG_OFFSET)
85#define OFS_RS232_INPUT (6*REG_OFFSET)
86#define OFS_SCRATCH_PAD (7*REG_OFFSET)
87
88#define OFS_DIVISOR_LSB (0*REG_OFFSET)
89#define OFS_DIVISOR_MSB (1*REG_OFFSET)
90
91/* memory-mapped read/write of the port */
92#define UART16550_READ(y) readb((char *)BASE + (y))
93#define UART16550_WRITE(y, z) writeb(z, (char *)BASE + (y))
94
95void debugInit(u32 baud, u8 data, u8 parity, u8 stop)
96{
97 u32 divisor;
98
99 /* disable interrupts */
100 UART16550_WRITE(OFS_INTR_ENABLE, 0);
101
102 /* set up buad rate */
103 /* set DIAB bit */
104 UART16550_WRITE(OFS_LINE_CONTROL, 0x80);
105
106 /* set divisor */
107 divisor = MAX_BAUD / baud;
108 UART16550_WRITE(OFS_DIVISOR_LSB, divisor & 0xff);
109 UART16550_WRITE(OFS_DIVISOR_MSB, (divisor & 0xff00) >> 8);
110
111 /* clear DIAB bit */
112 UART16550_WRITE(OFS_LINE_CONTROL, 0x0);
113
114 /* set data format */
115 UART16550_WRITE(OFS_DATA_FORMAT, data | parity | stop);
116}
117
118static int remoteDebugInitialized;
119
120u8 getDebugChar(void)
121{
122 if (!remoteDebugInitialized) {
123 remoteDebugInitialized = 1;
124 debugInit(UART16550_BAUD_115200,
125 UART16550_DATA_8BIT,
126 UART16550_PARITY_NONE, UART16550_STOP_1BIT);
127 }
128
129 while ((UART16550_READ(OFS_LINE_STATUS) & 0x1) == 0) ;
130 return UART16550_READ(OFS_RCV_BUFFER);
131}
132
133int putDebugChar(u8 byte)
134{
135 if (!remoteDebugInitialized) {
136 remoteDebugInitialized = 1;
137 /*
138 debugInit(UART16550_BAUD_115200,
139 UART16550_DATA_8BIT,
140 UART16550_PARITY_NONE, UART16550_STOP_1BIT); */
141 }
142
143 while ((UART16550_READ(OFS_LINE_STATUS) & 0x20) == 0) ;
144 UART16550_WRITE(OFS_SEND_BUFFER, byte);
145 return 1;
146}
diff --git a/arch/mips/lemote/lm2e/irq.c b/arch/mips/lemote/lm2e/irq.c
deleted file mode 100644
index 1d0a09f3b832..000000000000
--- a/arch/mips/lemote/lm2e/irq.c
+++ /dev/null
@@ -1,143 +0,0 @@
1/*
2 * Copyright (C) 2007 Lemote Inc. & Insititute of Computing Technology
3 * Author: Fuxin Zhang, zhangfx@lemote.com
4 *
5 * This program is free software; you can redistribute it and/or modify it
6 * under the terms of the GNU General Public License as published by the
7 * Free Software Foundation; either version 2 of the License, or (at your
8 * option) any later version.
9 *
10 * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESS OR IMPLIED
11 * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
12 * MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN
13 * NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT,
14 * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
15 * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF
16 * USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON
17 * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
18 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
19 * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
20 *
21 * You should have received a copy of the GNU General Public License along
22 * with this program; if not, write to the Free Software Foundation, Inc.,
23 * 675 Mass Ave, Cambridge, MA 02139, USA.
24 *
25 */
26#include <linux/delay.h>
27#include <linux/io.h>
28#include <linux/init.h>
29#include <linux/interrupt.h>
30#include <linux/irq.h>
31
32#include <asm/irq_cpu.h>
33#include <asm/i8259.h>
34#include <asm/mipsregs.h>
35#include <asm/mips-boards/bonito64.h>
36
37
38/*
39 * the first level int-handler will jump here if it is a bonito irq
40 */
41static void bonito_irqdispatch(void)
42{
43 u32 int_status;
44 int i;
45
46 /* workaround the IO dma problem: let cpu looping to allow DMA finish */
47 int_status = BONITO_INTISR;
48 if (int_status & (1 << 10)) {
49 while (int_status & (1 << 10)) {
50 udelay(1);
51 int_status = BONITO_INTISR;
52 }
53 }
54
55 /* Get pending sources, masked by current enables */
56 int_status = BONITO_INTISR & BONITO_INTEN;
57
58 if (int_status != 0) {
59 i = __ffs(int_status);
60 int_status &= ~(1 << i);
61 do_IRQ(BONITO_IRQ_BASE + i);
62 }
63}
64
65static void i8259_irqdispatch(void)
66{
67 int irq;
68
69 irq = i8259_irq();
70 if (irq >= 0) {
71 do_IRQ(irq);
72 } else {
73 spurious_interrupt();
74 }
75
76}
77
78asmlinkage void plat_irq_dispatch(void)
79{
80 unsigned int pending = read_c0_cause() & read_c0_status() & ST0_IM;
81
82 if (pending & CAUSEF_IP7) {
83 do_IRQ(MIPS_CPU_IRQ_BASE + 7);
84 } else if (pending & CAUSEF_IP5) {
85 i8259_irqdispatch();
86 } else if (pending & CAUSEF_IP2) {
87 bonito_irqdispatch();
88 } else {
89 spurious_interrupt();
90 }
91}
92
93static struct irqaction cascade_irqaction = {
94 .handler = no_action,
95 .name = "cascade",
96};
97
98void __init arch_init_irq(void)
99{
100 extern void bonito_irq_init(void);
101
102 /*
103 * Clear all of the interrupts while we change the able around a bit.
104 * int-handler is not on bootstrap
105 */
106 clear_c0_status(ST0_IM | ST0_BEV);
107 local_irq_disable();
108
109 /* most bonito irq should be level triggered */
110 BONITO_INTEDGE = BONITO_ICU_SYSTEMERR | BONITO_ICU_MASTERERR |
111 BONITO_ICU_RETRYERR | BONITO_ICU_MBOXES;
112 BONITO_INTSTEER = 0;
113
114 /*
115 * Mask out all interrupt by writing "1" to all bit position in
116 * the interrupt reset reg.
117 */
118 BONITO_INTENCLR = ~0;
119
120 /* init all controller
121 * 0-15 ------> i8259 interrupt
122 * 16-23 ------> mips cpu interrupt
123 * 32-63 ------> bonito irq
124 */
125
126 /* Sets the first-level interrupt dispatcher. */
127 mips_cpu_irq_init();
128 init_i8259_irqs();
129 bonito_irq_init();
130
131 /*
132 printk("GPIODATA=%x, GPIOIE=%x\n", BONITO_GPIODATA, BONITO_GPIOIE);
133 printk("INTEN=%x, INTSET=%x, INTCLR=%x, INTISR=%x\n",
134 BONITO_INTEN, BONITO_INTENSET,
135 BONITO_INTENCLR, BONITO_INTISR);
136 */
137
138 /* bonito irq at IP2 */
139 setup_irq(MIPS_CPU_IRQ_BASE + 2, &cascade_irqaction);
140 /* 8259 irq at IP5 */
141 setup_irq(MIPS_CPU_IRQ_BASE + 5, &cascade_irqaction);
142
143}
diff --git a/arch/mips/lemote/lm2e/pci.c b/arch/mips/lemote/lm2e/pci.c
deleted file mode 100644
index 8be03a8e1ad4..000000000000
--- a/arch/mips/lemote/lm2e/pci.c
+++ /dev/null
@@ -1,97 +0,0 @@
1/*
2 * pci.c
3 *
4 * Copyright (C) 2007 Lemote, Inc. & Institute of Computing Technology
5 * Author: Fuxin Zhang, zhangfx@lemote.com
6 *
7 * This program is free software; you can redistribute it and/or modify it
8 * under the terms of the GNU General Public License as published by the
9 * Free Software Foundation; either version 2 of the License, or (at your
10 * option) any later version.
11 *
12 * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESS OR IMPLIED
13 * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
14 * MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN
15 * NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT,
16 * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
17 * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF
18 * USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON
19 * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
20 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
21 * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
22 *
23 * You should have received a copy of the GNU General Public License along
24 * with this program; if not, write to the Free Software Foundation, Inc.,
25 * 675 Mass Ave, Cambridge, MA 02139, USA.
26 *
27 */
28#include <linux/types.h>
29#include <linux/pci.h>
30#include <linux/kernel.h>
31#include <linux/init.h>
32#include <asm/mips-boards/bonito64.h>
33#include <asm/mach-lemote/pci.h>
34
35extern struct pci_ops bonito64_pci_ops;
36
37static struct resource loongson2e_pci_mem_resource = {
38 .name = "LOONGSON2E PCI MEM",
39 .start = LOONGSON2E_PCI_MEM_START,
40 .end = LOONGSON2E_PCI_MEM_END,
41 .flags = IORESOURCE_MEM,
42};
43
44static struct resource loongson2e_pci_io_resource = {
45 .name = "LOONGSON2E PCI IO MEM",
46 .start = LOONGSON2E_PCI_IO_START,
47 .end = IO_SPACE_LIMIT,
48 .flags = IORESOURCE_IO,
49};
50
51static struct pci_controller loongson2e_pci_controller = {
52 .pci_ops = &bonito64_pci_ops,
53 .io_resource = &loongson2e_pci_io_resource,
54 .mem_resource = &loongson2e_pci_mem_resource,
55 .mem_offset = 0x00000000UL,
56 .io_offset = 0x00000000UL,
57};
58
59static void __init ict_pcimap(void)
60{
61 /*
62 * local to PCI mapping: [256M,512M] -> [256M,512M]; differ from PMON
63 *
64 * CPU address space [256M,448M] is window for accessing pci space
65 * we set pcimap_lo[0,1,2] to map it to pci space [256M,448M]
66 * pcimap: bit18,pcimap_2; bit[17-12],lo2;bit[11-6],lo1;bit[5-0],lo0
67 */
68 /* 1,00 0110 ,0001 01,00 0000 */
69 BONITO_PCIMAP = 0x46140;
70
71 /* 1, 00 0010, 0000,01, 00 0000 */
72 /* BONITO_PCIMAP = 0x42040; */
73
74 /*
75 * PCI to local mapping: [2G,2G+256M] -> [0,256M]
76 */
77 BONITO_PCIBASE0 = 0x80000000;
78 BONITO_PCIBASE1 = 0x00800000;
79 BONITO_PCIBASE2 = 0x90000000;
80
81}
82
83static int __init pcibios_init(void)
84{
85 ict_pcimap();
86
87 loongson2e_pci_controller.io_map_base =
88 (unsigned long) ioremap(LOONGSON2E_IO_PORT_BASE,
89 loongson2e_pci_io_resource.end -
90 loongson2e_pci_io_resource.start + 1);
91
92 register_pci_controller(&loongson2e_pci_controller);
93
94 return 0;
95}
96
97arch_initcall(pcibios_init);
diff --git a/arch/mips/lemote/lm2e/prom.c b/arch/mips/lemote/lm2e/prom.c
deleted file mode 100644
index 7edc15dfed6c..000000000000
--- a/arch/mips/lemote/lm2e/prom.c
+++ /dev/null
@@ -1,97 +0,0 @@
1/*
2 * Based on Ocelot Linux port, which is
3 * Copyright 2001 MontaVista Software Inc.
4 * Author: jsun@mvista.com or jsun@junsun.net
5 *
6 * Copyright 2003 ICT CAS
7 * Author: Michael Guo <guoyi@ict.ac.cn>
8 *
9 * Copyright (C) 2007 Lemote Inc. & Insititute of Computing Technology
10 * Author: Fuxin Zhang, zhangfx@lemote.com
11 *
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
14 * Free Software Foundation; either version 2 of the License, or (at your
15 * option) any later version.
16 */
17#include <linux/init.h>
18#include <linux/bootmem.h>
19#include <asm/bootinfo.h>
20
21extern unsigned long bus_clock;
22extern unsigned long cpu_clock_freq;
23extern unsigned int memsize, highmemsize;
24extern int putDebugChar(unsigned char byte);
25
26static int argc;
27/* pmon passes arguments in 32bit pointers */
28static int *arg;
29static int *env;
30
31const char *get_system_type(void)
32{
33 return "lemote-fulong";
34}
35
36void __init prom_init_cmdline(void)
37{
38 int i;
39 long l;
40
41 /* arg[0] is "g", the rest is boot parameters */
42 arcs_cmdline[0] = '\0';
43 for (i = 1; i < argc; i++) {
44 l = (long)arg[i];
45 if (strlen(arcs_cmdline) + strlen(((char *)l) + 1)
46 >= sizeof(arcs_cmdline))
47 break;
48 strcat(arcs_cmdline, ((char *)l));
49 strcat(arcs_cmdline, " ");
50 }
51}
52
53void __init prom_init(void)
54{
55 long l;
56 argc = fw_arg0;
57 arg = (int *)fw_arg1;
58 env = (int *)fw_arg2;
59
60 prom_init_cmdline();
61
62 if ((strstr(arcs_cmdline, "console=")) == NULL)
63 strcat(arcs_cmdline, " console=ttyS0,115200");
64 if ((strstr(arcs_cmdline, "root=")) == NULL)
65 strcat(arcs_cmdline, " root=/dev/hda1");
66
67#define parse_even_earlier(res, option, p) \
68do { \
69 if (strncmp(option, (char *)p, strlen(option)) == 0) \
70 res = simple_strtol((char *)p + strlen(option"="), \
71 NULL, 10); \
72} while (0)
73
74 l = (long)*env;
75 while (l != 0) {
76 parse_even_earlier(bus_clock, "busclock", l);
77 parse_even_earlier(cpu_clock_freq, "cpuclock", l);
78 parse_even_earlier(memsize, "memsize", l);
79 parse_even_earlier(highmemsize, "highmemsize", l);
80 env++;
81 l = (long)*env;
82 }
83 if (memsize == 0)
84 memsize = 256;
85
86 pr_info("busclock=%ld, cpuclock=%ld,memsize=%d,highmemsize=%d\n",
87 bus_clock, cpu_clock_freq, memsize, highmemsize);
88}
89
90void __init prom_free_prom_memory(void)
91{
92}
93
94void prom_putchar(char c)
95{
96 putDebugChar(c);
97}
diff --git a/arch/mips/lemote/lm2e/reset.c b/arch/mips/lemote/lm2e/reset.c
deleted file mode 100644
index 099387a3827a..000000000000
--- a/arch/mips/lemote/lm2e/reset.c
+++ /dev/null
@@ -1,41 +0,0 @@
1/*
2 * This program is free software; you can redistribute it and/or modify it
3 * under the terms of the GNU General Public License as published by the
4 * Free Software Foundation; either version 2 of the License, or (at your
5 * option) any later version.
6 *
7 * Copyright (C) 2007 Lemote, Inc. & Institute of Computing Technology
8 * Author: Fuxin Zhang, zhangfx@lemote.com
9 */
10#include <linux/pm.h>
11
12#include <asm/reboot.h>
13
14static void loongson2e_restart(char *command)
15{
16#ifdef CONFIG_32BIT
17 *(unsigned long *)0xbfe00104 &= ~(1 << 2);
18 *(unsigned long *)0xbfe00104 |= (1 << 2);
19#else
20 *(unsigned long *)0xffffffffbfe00104 &= ~(1 << 2);
21 *(unsigned long *)0xffffffffbfe00104 |= (1 << 2);
22#endif
23 __asm__ __volatile__("jr\t%0"::"r"(0xbfc00000));
24}
25
26static void loongson2e_halt(void)
27{
28 while (1) ;
29}
30
31static void loongson2e_power_off(void)
32{
33 loongson2e_halt();
34}
35
36void mips_reboot_setup(void)
37{
38 _machine_restart = loongson2e_restart;
39 _machine_halt = loongson2e_halt;
40 pm_power_off = loongson2e_power_off;
41}
diff --git a/arch/mips/lemote/lm2e/setup.c b/arch/mips/lemote/lm2e/setup.c
deleted file mode 100644
index ebd6ceaef2fd..000000000000
--- a/arch/mips/lemote/lm2e/setup.c
+++ /dev/null
@@ -1,111 +0,0 @@
1/*
2 * BRIEF MODULE DESCRIPTION
3 * setup.c - board dependent boot routines
4 *
5 * Copyright (C) 2007 Lemote Inc. & Insititute of Computing Technology
6 * Author: Fuxin Zhang, zhangfx@lemote.com
7 *
8 * This program is free software; you can redistribute it and/or modify it
9 * under the terms of the GNU General Public License as published by the
10 * Free Software Foundation; either version 2 of the License, or (at your
11 * option) any later version.
12 *
13 * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESS OR IMPLIED
14 * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
15 * MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN
16 * NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT,
17 * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
18 * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF
19 * USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON
20 * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
21 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
22 * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
23 *
24 * You should have received a copy of the GNU General Public License along
25 * with this program; if not, write to the Free Software Foundation, Inc.,
26 * 675 Mass Ave, Cambridge, MA 02139, USA.
27 *
28 */
29#include <linux/bootmem.h>
30#include <linux/init.h>
31#include <linux/irq.h>
32
33#include <asm/bootinfo.h>
34#include <asm/mc146818-time.h>
35#include <asm/time.h>
36#include <asm/wbflush.h>
37#include <asm/mach-lemote/pci.h>
38
39#ifdef CONFIG_VT
40#include <linux/console.h>
41#include <linux/screen_info.h>
42#endif
43
44extern void mips_reboot_setup(void);
45
46unsigned long cpu_clock_freq;
47unsigned long bus_clock;
48unsigned int memsize;
49unsigned int highmemsize = 0;
50
51void __init plat_time_init(void)
52{
53 /* setup mips r4k timer */
54 mips_hpt_frequency = cpu_clock_freq / 2;
55}
56
57unsigned long read_persistent_clock(void)
58{
59 return mc146818_get_cmos_time();
60}
61
62void (*__wbflush)(void);
63EXPORT_SYMBOL(__wbflush);
64
65static void wbflush_loongson2e(void)
66{
67 asm(".set\tpush\n\t"
68 ".set\tnoreorder\n\t"
69 ".set mips3\n\t"
70 "sync\n\t"
71 "nop\n\t"
72 ".set\tpop\n\t"
73 ".set mips0\n\t");
74}
75
76void __init plat_mem_setup(void)
77{
78 set_io_port_base((unsigned long)ioremap(LOONGSON2E_IO_PORT_BASE,
79 IO_SPACE_LIMIT - LOONGSON2E_PCI_IO_START + 1));
80 mips_reboot_setup();
81
82 __wbflush = wbflush_loongson2e;
83
84 add_memory_region(0x0, (memsize << 20), BOOT_MEM_RAM);
85#ifdef CONFIG_64BIT
86 if (highmemsize > 0) {
87 add_memory_region(0x20000000, highmemsize << 20, BOOT_MEM_RAM);
88 }
89#endif
90
91#ifdef CONFIG_VT
92#if defined(CONFIG_VGA_CONSOLE)
93 conswitchp = &vga_con;
94
95 screen_info = (struct screen_info) {
96 0, 25, /* orig-x, orig-y */
97 0, /* unused */
98 0, /* orig-video-page */
99 0, /* orig-video-mode */
100 80, /* orig-video-cols */
101 0, 0, 0, /* ega_ax, ega_bx, ega_cx */
102 25, /* orig-video-lines */
103 VIDEO_TYPE_VGAC, /* orig-video-isVGA */
104 16 /* orig-video-points */
105 };
106#elif defined(CONFIG_DUMMY_CONSOLE)
107 conswitchp = &dummy_con;
108#endif
109#endif
110
111}
diff --git a/arch/mips/loongson/Kconfig b/arch/mips/loongson/Kconfig
new file mode 100644
index 000000000000..d45092505fa1
--- /dev/null
+++ b/arch/mips/loongson/Kconfig
@@ -0,0 +1,31 @@
1choice
2 prompt "Machine Type"
3 depends on MACH_LOONGSON
4
5config LEMOTE_FULOONG2E
6 bool "Lemote Fuloong(2e) mini-PC"
7 select ARCH_SPARSEMEM_ENABLE
8 select CEVT_R4K
9 select CSRC_R4K
10 select SYS_HAS_CPU_LOONGSON2E
11 select DMA_NONCOHERENT
12 select BOOT_ELF32
13 select BOARD_SCACHE
14 select HW_HAS_PCI
15 select I8259
16 select ISA
17 select IRQ_CPU
18 select SYS_SUPPORTS_32BIT_KERNEL
19 select SYS_SUPPORTS_64BIT_KERNEL
20 select SYS_SUPPORTS_LITTLE_ENDIAN
21 select SYS_SUPPORTS_HIGHMEM
22 select SYS_HAS_EARLY_PRINTK
23 select GENERIC_HARDIRQS_NO__DO_IRQ
24 select GENERIC_ISA_DMA_SUPPORT_BROKEN
25 select CPU_HAS_WB
26 help
27 Lemote Fuloong(2e) mini-PC board based on the Chinese Loongson-2E CPU and
28 an FPGA northbridge
29
30 Lemote Fuloong(2e) mini PC have a VIA686B south bridge.
31endchoice
diff --git a/arch/mips/loongson/Makefile b/arch/mips/loongson/Makefile
new file mode 100644
index 000000000000..39048c455d7d
--- /dev/null
+++ b/arch/mips/loongson/Makefile
@@ -0,0 +1,11 @@
1#
2# Common code for all Loongson based systems
3#
4
5obj-$(CONFIG_MACH_LOONGSON) += common/
6
7#
8# Lemote Fuloong mini-PC (Loongson 2E-based)
9#
10
11obj-$(CONFIG_LEMOTE_FULOONG2E) += fuloong-2e/
diff --git a/arch/mips/loongson/common/Makefile b/arch/mips/loongson/common/Makefile
new file mode 100644
index 000000000000..656b3cc0a2a6
--- /dev/null
+++ b/arch/mips/loongson/common/Makefile
@@ -0,0 +1,11 @@
1#
2# Makefile for loongson based machines.
3#
4
5obj-y += setup.o init.o cmdline.o env.o time.o reset.o irq.o \
6 pci.o bonito-irq.o mem.o machtype.o
7
8#
9# Early printk support
10#
11obj-$(CONFIG_EARLY_PRINTK) += early_printk.o
diff --git a/arch/mips/lemote/lm2e/bonito-irq.c b/arch/mips/loongson/common/bonito-irq.c
index 8fc3bce7075b..3e31e7ad713e 100644
--- a/arch/mips/lemote/lm2e/bonito-irq.c
+++ b/arch/mips/loongson/common/bonito-irq.c
@@ -10,32 +10,10 @@
10 * under the terms of the GNU General Public License as published by the 10 * under the terms of the GNU General Public License as published by the
11 * Free Software Foundation; either version 2 of the License, or (at your 11 * Free Software Foundation; either version 2 of the License, or (at your
12 * option) any later version. 12 * option) any later version.
13 *
14 * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESS OR IMPLIED
15 * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
16 * MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN
17 * NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT,
18 * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
19 * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF
20 * USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON
21 * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
22 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
23 * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
24 *
25 * You should have received a copy of the GNU General Public License along
26 * with this program; if not, write to the Free Software Foundation, Inc.,
27 * 675 Mass Ave, Cambridge, MA 02139, USA.
28 *
29 */ 13 */
30#include <linux/errno.h>
31#include <linux/init.h>
32#include <linux/io.h>
33#include <linux/types.h>
34#include <linux/interrupt.h> 14#include <linux/interrupt.h>
35#include <linux/irq.h>
36
37#include <asm/mips-boards/bonito64.h>
38 15
16#include <loongson.h>
39 17
40static inline void bonito_irq_enable(unsigned int irq) 18static inline void bonito_irq_enable(unsigned int irq)
41{ 19{
@@ -66,9 +44,8 @@ void bonito_irq_init(void)
66{ 44{
67 u32 i; 45 u32 i;
68 46
69 for (i = BONITO_IRQ_BASE; i < BONITO_IRQ_BASE + 32; i++) { 47 for (i = BONITO_IRQ_BASE; i < BONITO_IRQ_BASE + 32; i++)
70 set_irq_chip_and_handler(i, &bonito_irq_type, handle_level_irq); 48 set_irq_chip_and_handler(i, &bonito_irq_type, handle_level_irq);
71 }
72 49
73 setup_irq(BONITO_IRQ_BASE + 10, &dma_timeout_irqaction); 50 setup_irq(BONITO_IRQ_BASE + 10, &dma_timeout_irqaction);
74} 51}
diff --git a/arch/mips/loongson/common/cmdline.c b/arch/mips/loongson/common/cmdline.c
new file mode 100644
index 000000000000..75f1b243ee4e
--- /dev/null
+++ b/arch/mips/loongson/common/cmdline.c
@@ -0,0 +1,52 @@
1/*
2 * Based on Ocelot Linux port, which is
3 * Copyright 2001 MontaVista Software Inc.
4 * Author: jsun@mvista.com or jsun@junsun.net
5 *
6 * Copyright 2003 ICT CAS
7 * Author: Michael Guo <guoyi@ict.ac.cn>
8 *
9 * Copyright (C) 2007 Lemote Inc. & Insititute of Computing Technology
10 * Author: Fuxin Zhang, zhangfx@lemote.com
11 *
12 * Copyright (C) 2009 Lemote Inc. & Insititute of Computing Technology
13 * Author: Wu Zhangjin, wuzj@lemote.com
14 *
15 * This program is free software; you can redistribute it and/or modify it
16 * under the terms of the GNU General Public License as published by the
17 * Free Software Foundation; either version 2 of the License, or (at your
18 * option) any later version.
19 */
20#include <asm/bootinfo.h>
21
22#include <loongson.h>
23
24int prom_argc;
25/* pmon passes arguments in 32bit pointers */
26int *_prom_argv;
27
28void __init prom_init_cmdline(void)
29{
30 int i;
31 long l;
32
33 /* firmware arguments are initialized in head.S */
34 prom_argc = fw_arg0;
35 _prom_argv = (int *)fw_arg1;
36
37 /* arg[0] is "g", the rest is boot parameters */
38 arcs_cmdline[0] = '\0';
39 for (i = 1; i < prom_argc; i++) {
40 l = (long)_prom_argv[i];
41 if (strlen(arcs_cmdline) + strlen(((char *)l) + 1)
42 >= sizeof(arcs_cmdline))
43 break;
44 strcat(arcs_cmdline, ((char *)l));
45 strcat(arcs_cmdline, " ");
46 }
47
48 if ((strstr(arcs_cmdline, "console=")) == NULL)
49 strcat(arcs_cmdline, " console=ttyS0,115200");
50 if ((strstr(arcs_cmdline, "root=")) == NULL)
51 strcat(arcs_cmdline, " root=/dev/hda1");
52}
diff --git a/arch/mips/loongson/common/early_printk.c b/arch/mips/loongson/common/early_printk.c
new file mode 100644
index 000000000000..bc73edc0cfd8
--- /dev/null
+++ b/arch/mips/loongson/common/early_printk.c
@@ -0,0 +1,38 @@
1/* early printk support
2 *
3 * Copyright (c) 2009 Philippe Vachon <philippe@cowpig.ca>
4 * Copyright (C) 2009 Lemote Inc. & Insititute of Computing Technology
5 * Author: Wu Zhangjin, wuzj@lemote.com
6 *
7 * This program is free software; you can redistribute it and/or modify it
8 * under the terms of the GNU General Public License as published by the
9 * Free Software Foundation; either version 2 of the License, or (at your
10 * option) any later version.
11 */
12#include <linux/serial_reg.h>
13
14#include <loongson.h>
15#include <machine.h>
16
17#define PORT(base, offset) (u8 *)(base + offset)
18
19static inline unsigned int serial_in(phys_addr_t base, int offset)
20{
21 return readb(PORT(base, offset));
22}
23
24static inline void serial_out(phys_addr_t base, int offset, int value)
25{
26 writeb(value, PORT(base, offset));
27}
28
29void prom_putchar(char c)
30{
31 phys_addr_t uart_base =
32 (phys_addr_t) ioremap_nocache(LOONGSON_UART_BASE, 8);
33
34 while ((serial_in(uart_base, UART_LSR) & UART_LSR_THRE) == 0)
35 ;
36
37 serial_out(uart_base, UART_TX, c);
38}
diff --git a/arch/mips/loongson/common/env.c b/arch/mips/loongson/common/env.c
new file mode 100644
index 000000000000..b9ef50385541
--- /dev/null
+++ b/arch/mips/loongson/common/env.c
@@ -0,0 +1,58 @@
1/*
2 * Based on Ocelot Linux port, which is
3 * Copyright 2001 MontaVista Software Inc.
4 * Author: jsun@mvista.com or jsun@junsun.net
5 *
6 * Copyright 2003 ICT CAS
7 * Author: Michael Guo <guoyi@ict.ac.cn>
8 *
9 * Copyright (C) 2007 Lemote Inc. & Insititute of Computing Technology
10 * Author: Fuxin Zhang, zhangfx@lemote.com
11 *
12 * Copyright (C) 2009 Lemote Inc. & Insititute of Computing Technology
13 * Author: Wu Zhangjin, wuzj@lemote.com
14 *
15 * This program is free software; you can redistribute it and/or modify it
16 * under the terms of the GNU General Public License as published by the
17 * Free Software Foundation; either version 2 of the License, or (at your
18 * option) any later version.
19 */
20#include <asm/bootinfo.h>
21
22#include <loongson.h>
23
24unsigned long bus_clock, cpu_clock_freq;
25unsigned long memsize, highmemsize;
26
27/* pmon passes arguments in 32bit pointers */
28int *_prom_envp;
29
30#define parse_even_earlier(res, option, p) \
31do { \
32 if (strncmp(option, (char *)p, strlen(option)) == 0) \
33 strict_strtol((char *)p + strlen(option"="), \
34 10, &res); \
35} while (0)
36
37void __init prom_init_env(void)
38{
39 long l;
40
41 /* firmware arguments are initialized in head.S */
42 _prom_envp = (int *)fw_arg2;
43
44 l = (long)*_prom_envp;
45 while (l != 0) {
46 parse_even_earlier(bus_clock, "busclock", l);
47 parse_even_earlier(cpu_clock_freq, "cpuclock", l);
48 parse_even_earlier(memsize, "memsize", l);
49 parse_even_earlier(highmemsize, "highmemsize", l);
50 _prom_envp++;
51 l = (long)*_prom_envp;
52 }
53 if (memsize == 0)
54 memsize = 256;
55
56 pr_info("busclock=%ld, cpuclock=%ld, memsize=%ld, highmemsize=%ld\n",
57 bus_clock, cpu_clock_freq, memsize, highmemsize);
58}
diff --git a/arch/mips/loongson/common/init.c b/arch/mips/loongson/common/init.c
new file mode 100644
index 000000000000..3abe927422a3
--- /dev/null
+++ b/arch/mips/loongson/common/init.c
@@ -0,0 +1,30 @@
1/*
2 * Copyright (C) 2009 Lemote Inc. & Insititute of Computing Technology
3 * Author: Wu Zhangjin, wuzj@lemote.com
4 *
5 * This program is free software; you can redistribute it and/or modify it
6 * under the terms of the GNU General Public License as published by the
7 * Free Software Foundation; either version 2 of the License, or (at your
8 * option) any later version.
9 */
10
11#include <linux/bootmem.h>
12
13#include <asm/bootinfo.h>
14
15#include <loongson.h>
16
17void __init prom_init(void)
18{
19 /* init base address of io space */
20 set_io_port_base((unsigned long)
21 ioremap(BONITO_PCIIO_BASE, BONITO_PCIIO_SIZE));
22
23 prom_init_cmdline();
24 prom_init_env();
25 prom_init_memory();
26}
27
28void __init prom_free_prom_memory(void)
29{
30}
diff --git a/arch/mips/loongson/common/irq.c b/arch/mips/loongson/common/irq.c
new file mode 100644
index 000000000000..f368c735cbd3
--- /dev/null
+++ b/arch/mips/loongson/common/irq.c
@@ -0,0 +1,74 @@
1/*
2 * Copyright (C) 2007 Lemote Inc. & Insititute of Computing Technology
3 * Author: Fuxin Zhang, zhangfx@lemote.com
4 *
5 * This program is free software; you can redistribute it and/or modify it
6 * under the terms of the GNU General Public License as published by the
7 * Free Software Foundation; either version 2 of the License, or (at your
8 * option) any later version.
9 */
10#include <linux/delay.h>
11#include <linux/interrupt.h>
12
13#include <loongson.h>
14/*
15 * the first level int-handler will jump here if it is a bonito irq
16 */
17void bonito_irqdispatch(void)
18{
19 u32 int_status;
20 int i;
21
22 /* workaround the IO dma problem: let cpu looping to allow DMA finish */
23 int_status = BONITO_INTISR;
24 if (int_status & (1 << 10)) {
25 while (int_status & (1 << 10)) {
26 udelay(1);
27 int_status = BONITO_INTISR;
28 }
29 }
30
31 /* Get pending sources, masked by current enables */
32 int_status = BONITO_INTISR & BONITO_INTEN;
33
34 if (int_status != 0) {
35 i = __ffs(int_status);
36 int_status &= ~(1 << i);
37 do_IRQ(BONITO_IRQ_BASE + i);
38 }
39}
40
41asmlinkage void plat_irq_dispatch(void)
42{
43 unsigned int pending;
44
45 pending = read_c0_cause() & read_c0_status() & ST0_IM;
46
47 /* machine-specific plat_irq_dispatch */
48 mach_irq_dispatch(pending);
49}
50
51void __init arch_init_irq(void)
52{
53 /*
54 * Clear all of the interrupts while we change the able around a bit.
55 * int-handler is not on bootstrap
56 */
57 clear_c0_status(ST0_IM | ST0_BEV);
58 local_irq_disable();
59
60 /* setting irq trigger mode */
61 set_irq_trigger_mode();
62
63 /* no steer */
64 BONITO_INTSTEER = 0;
65
66 /*
67 * Mask out all interrupt by writing "1" to all bit position in
68 * the interrupt reset reg.
69 */
70 BONITO_INTENCLR = ~0;
71
72 /* machine specific irq init */
73 mach_init_irq();
74}
diff --git a/arch/mips/loongson/common/machtype.c b/arch/mips/loongson/common/machtype.c
new file mode 100644
index 000000000000..7b348248de7d
--- /dev/null
+++ b/arch/mips/loongson/common/machtype.c
@@ -0,0 +1,50 @@
1/*
2 * Copyright (C) 2009 Lemote Inc. & Insititute of Computing Technology
3 * Author: Wu Zhangjin, wuzj@lemote.com
4 *
5 * Copyright (c) 2009 Zhang Le <r0bertz@gentoo.org>
6 *
7 * This program is free software; you can redistribute it and/or modify it
8 * under the terms of the GNU General Public License as published by the
9 * Free Software Foundation; either version 2 of the License, or (at your
10 * option) any later version.
11 */
12#include <linux/errno.h>
13#include <asm/bootinfo.h>
14
15#include <loongson.h>
16#include <machine.h>
17
18static const char *system_types[] = {
19 [MACH_LOONGSON_UNKNOWN] "unknown loongson machine",
20 [MACH_LEMOTE_FL2E] "lemote-fuloong-2e-box",
21 [MACH_LEMOTE_FL2F] "lemote-fuloong-2f-box",
22 [MACH_LEMOTE_ML2F7] "lemote-mengloong-2f-7inches",
23 [MACH_LEMOTE_YL2F89] "lemote-yeeloong-2f-8.9inches",
24 [MACH_DEXXON_GDIUM2F10] "dexxon-gidum-2f-10inches",
25 [MACH_LOONGSON_END] NULL,
26};
27
28const char *get_system_type(void)
29{
30 if (mips_machtype == MACH_UNKNOWN)
31 mips_machtype = LOONGSON_MACHTYPE;
32
33 return system_types[mips_machtype];
34}
35
36static __init int machtype_setup(char *str)
37{
38 int machtype = MACH_LEMOTE_FL2E;
39
40 if (!str)
41 return -EINVAL;
42
43 for (; system_types[machtype]; machtype++)
44 if (strstr(system_types[machtype], str)) {
45 mips_machtype = machtype;
46 break;
47 }
48 return 0;
49}
50__setup("machtype=", machtype_setup);
diff --git a/arch/mips/lemote/lm2e/mem.c b/arch/mips/loongson/common/mem.c
index 16cd21587d34..7c92f79b6480 100644
--- a/arch/mips/lemote/lm2e/mem.c
+++ b/arch/mips/loongson/common/mem.c
@@ -8,16 +8,28 @@
8#include <linux/fcntl.h> 8#include <linux/fcntl.h>
9#include <linux/mm.h> 9#include <linux/mm.h>
10 10
11#include <asm/bootinfo.h>
12
13#include <loongson.h>
14#include <mem.h>
15
16void __init prom_init_memory(void)
17{
18 add_memory_region(0x0, (memsize << 20), BOOT_MEM_RAM);
19#ifdef CONFIG_64BIT
20 if (highmemsize > 0)
21 add_memory_region(LOONGSON_HIGHMEM_START,
22 highmemsize << 20, BOOT_MEM_RAM);
23#endif /* CONFIG_64BIT */
24}
25
11/* override of arch/mips/mm/cache.c: __uncached_access */ 26/* override of arch/mips/mm/cache.c: __uncached_access */
12int __uncached_access(struct file *file, unsigned long addr) 27int __uncached_access(struct file *file, unsigned long addr)
13{ 28{
14 if (file->f_flags & O_SYNC) 29 if (file->f_flags & O_SYNC)
15 return 1; 30 return 1;
16 31
17 /*
18 * On the Lemote Loongson 2e system, the peripheral registers
19 * reside between 0x1000:0000 and 0x2000:0000.
20 */
21 return addr >= __pa(high_memory) || 32 return addr >= __pa(high_memory) ||
22 ((addr >= 0x10000000) && (addr < 0x20000000)); 33 ((addr >= LOONGSON_MMIO_MEM_START) &&
34 (addr < LOONGSON_MMIO_MEM_END));
23} 35}
diff --git a/arch/mips/loongson/common/pci.c b/arch/mips/loongson/common/pci.c
new file mode 100644
index 000000000000..a3a4abfb6c9a
--- /dev/null
+++ b/arch/mips/loongson/common/pci.c
@@ -0,0 +1,83 @@
1/*
2 * Copyright (C) 2007 Lemote, Inc. & Institute of Computing Technology
3 * Author: Fuxin Zhang, zhangfx@lemote.com
4 *
5 * This program is free software; you can redistribute it and/or modify it
6 * under the terms of the GNU General Public License as published by the
7 * Free Software Foundation; either version 2 of the License, or (at your
8 * option) any later version.
9 */
10#include <linux/pci.h>
11
12#include <pci.h>
13#include <loongson.h>
14
15static struct resource loongson_pci_mem_resource = {
16 .name = "pci memory space",
17 .start = LOONGSON_PCI_MEM_START,
18 .end = LOONGSON_PCI_MEM_END,
19 .flags = IORESOURCE_MEM,
20};
21
22static struct resource loongson_pci_io_resource = {
23 .name = "pci io space",
24 .start = LOONGSON_PCI_IO_START,
25 .end = IO_SPACE_LIMIT,
26 .flags = IORESOURCE_IO,
27};
28
29static struct pci_controller loongson_pci_controller = {
30 .pci_ops = &bonito64_pci_ops,
31 .io_resource = &loongson_pci_io_resource,
32 .mem_resource = &loongson_pci_mem_resource,
33 .mem_offset = 0x00000000UL,
34 .io_offset = 0x00000000UL,
35};
36
37static void __init setup_pcimap(void)
38{
39 /*
40 * local to PCI mapping for CPU accessing PCI space
41 * CPU address space [256M,448M] is window for accessing pci space
42 * we set pcimap_lo[0,1,2] to map it to pci space[0M,64M], [320M,448M]
43 *
44 * pcimap: PCI_MAP2 PCI_Mem_Lo2 PCI_Mem_Lo1 PCI_Mem_Lo0
45 * [<2G] [384M,448M] [320M,384M] [0M,64M]
46 */
47 BONITO_PCIMAP = BONITO_PCIMAP_PCIMAP_2 |
48 BONITO_PCIMAP_WIN(2, BONITO_PCILO2_BASE) |
49 BONITO_PCIMAP_WIN(1, BONITO_PCILO1_BASE) |
50 BONITO_PCIMAP_WIN(0, 0);
51
52 /*
53 * PCI-DMA to local mapping: [2G,2G+256M] -> [0M,256M]
54 */
55 BONITO_PCIBASE0 = 0x80000000ul; /* base: 2G -> mmap: 0M */
56 /* size: 256M, burst transmission, pre-fetch enable, 64bit */
57 LOONGSON_PCI_HIT0_SEL_L = 0xc000000cul;
58 LOONGSON_PCI_HIT0_SEL_H = 0xfffffffful;
59 LOONGSON_PCI_HIT1_SEL_L = 0x00000006ul; /* set this BAR as invalid */
60 LOONGSON_PCI_HIT1_SEL_H = 0x00000000ul;
61 LOONGSON_PCI_HIT2_SEL_L = 0x00000006ul; /* set this BAR as invalid */
62 LOONGSON_PCI_HIT2_SEL_H = 0x00000000ul;
63
64 /* avoid deadlock of PCI reading/writing lock operation */
65 LOONGSON_PCI_ISR4C = 0xd2000001ul;
66
67 /* can not change gnt to break pci transfer when device's gnt not
68 deassert for some broken device */
69 LOONGSON_PXARB_CFG = 0x00fe0105ul;
70}
71
72static int __init pcibios_init(void)
73{
74 setup_pcimap();
75
76 loongson_pci_controller.io_map_base = mips_io_port_base;
77
78 register_pci_controller(&loongson_pci_controller);
79
80 return 0;
81}
82
83arch_initcall(pcibios_init);
diff --git a/arch/mips/loongson/common/reset.c b/arch/mips/loongson/common/reset.c
new file mode 100644
index 000000000000..97e918251edd
--- /dev/null
+++ b/arch/mips/loongson/common/reset.c
@@ -0,0 +1,44 @@
1/*
2 * This program is free software; you can redistribute it and/or modify it
3 * under the terms of the GNU General Public License as published by the
4 * Free Software Foundation; either version 2 of the License, or (at your
5 * option) any later version.
6 *
7 * Copyright (C) 2007 Lemote, Inc. & Institute of Computing Technology
8 * Author: Fuxin Zhang, zhangfx@lemote.com
9 * Copyright (C) 2009 Lemote, Inc. & Institute of Computing Technology
10 * Author: Zhangjin Wu, wuzj@lemote.com
11 */
12#include <linux/init.h>
13#include <linux/pm.h>
14
15#include <asm/reboot.h>
16
17#include <loongson.h>
18
19static void loongson_restart(char *command)
20{
21 /* do preparation for reboot */
22 mach_prepare_reboot();
23
24 /* reboot via jumping to boot base address */
25 ((void (*)(void))ioremap_nocache(BONITO_BOOT_BASE, 4)) ();
26}
27
28static void loongson_halt(void)
29{
30 mach_prepare_shutdown();
31 while (1)
32 ;
33}
34
35static int __init mips_reboot_setup(void)
36{
37 _machine_restart = loongson_restart;
38 _machine_halt = loongson_halt;
39 pm_power_off = loongson_halt;
40
41 return 0;
42}
43
44arch_initcall(mips_reboot_setup);
diff --git a/arch/mips/loongson/common/setup.c b/arch/mips/loongson/common/setup.c
new file mode 100644
index 000000000000..4cd2aa9a342c
--- /dev/null
+++ b/arch/mips/loongson/common/setup.c
@@ -0,0 +1,58 @@
1/*
2 * Copyright (C) 2007 Lemote Inc. & Insititute of Computing Technology
3 * Author: Fuxin Zhang, zhangfx@lemote.com
4 *
5 * This program is free software; you can redistribute it and/or modify it
6 * under the terms of the GNU General Public License as published by the
7 * Free Software Foundation; either version 2 of the License, or (at your
8 * option) any later version.
9 */
10#include <linux/module.h>
11
12#include <asm/wbflush.h>
13
14#include <loongson.h>
15
16#ifdef CONFIG_VT
17#include <linux/console.h>
18#include <linux/screen_info.h>
19#endif
20
21void (*__wbflush)(void);
22EXPORT_SYMBOL(__wbflush);
23
24static void wbflush_loongson(void)
25{
26 asm(".set\tpush\n\t"
27 ".set\tnoreorder\n\t"
28 ".set mips3\n\t"
29 "sync\n\t"
30 "nop\n\t"
31 ".set\tpop\n\t"
32 ".set mips0\n\t");
33}
34
35void __init plat_mem_setup(void)
36{
37 __wbflush = wbflush_loongson;
38
39#ifdef CONFIG_VT
40#if defined(CONFIG_VGA_CONSOLE)
41 conswitchp = &vga_con;
42
43 screen_info = (struct screen_info) {
44 0, 25, /* orig-x, orig-y */
45 0, /* unused */
46 0, /* orig-video-page */
47 0, /* orig-video-mode */
48 80, /* orig-video-cols */
49 0, 0, 0, /* ega_ax, ega_bx, ega_cx */
50 25, /* orig-video-lines */
51 VIDEO_TYPE_VGAC, /* orig-video-isVGA */
52 16 /* orig-video-points */
53 };
54#elif defined(CONFIG_DUMMY_CONSOLE)
55 conswitchp = &dummy_con;
56#endif
57#endif
58}
diff --git a/arch/mips/loongson/common/time.c b/arch/mips/loongson/common/time.c
new file mode 100644
index 000000000000..b13d17174654
--- /dev/null
+++ b/arch/mips/loongson/common/time.c
@@ -0,0 +1,27 @@
1/*
2 * Copyright (C) 2007 Lemote, Inc. & Institute of Computing Technology
3 * Author: Fuxin Zhang, zhangfx@lemote.com
4 *
5 * Copyright (C) 2009 Lemote Inc. & Insititute of Computing Technology
6 * Author: Wu Zhangjin, wuzj@lemote.com
7 *
8 * This program is free software; you can redistribute it and/or modify it
9 * under the terms of the GNU General Public License as published by the
10 * Free Software Foundation; either version 2 of the License, or (at your
11 * option) any later version.
12 */
13#include <asm/mc146818-time.h>
14#include <asm/time.h>
15
16#include <loongson.h>
17
18void __init plat_time_init(void)
19{
20 /* setup mips r4k timer */
21 mips_hpt_frequency = cpu_clock_freq / 2;
22}
23
24unsigned long read_persistent_clock(void)
25{
26 return mc146818_get_cmos_time();
27}
diff --git a/arch/mips/loongson/fuloong-2e/Makefile b/arch/mips/loongson/fuloong-2e/Makefile
new file mode 100644
index 000000000000..3aba5fcc09dc
--- /dev/null
+++ b/arch/mips/loongson/fuloong-2e/Makefile
@@ -0,0 +1,7 @@
1#
2# Makefile for Lemote Fuloong2e mini-PC board.
3#
4
5obj-y += irq.o reset.o
6
7EXTRA_CFLAGS += -Werror
diff --git a/arch/mips/loongson/fuloong-2e/irq.c b/arch/mips/loongson/fuloong-2e/irq.c
new file mode 100644
index 000000000000..7888cf69424a
--- /dev/null
+++ b/arch/mips/loongson/fuloong-2e/irq.c
@@ -0,0 +1,71 @@
1/*
2 * Copyright (C) 2007 Lemote Inc. & Insititute of Computing Technology
3 * Author: Fuxin Zhang, zhangfx@lemote.com
4 *
5 * This program is free software; you can redistribute it and/or modify it
6 * under the terms of the GNU General Public License as published by the
7 * Free Software Foundation; either version 2 of the License, or (at your
8 * option) any later version.
9 */
10#include <linux/interrupt.h>
11
12#include <asm/irq_cpu.h>
13#include <asm/i8259.h>
14
15#include <loongson.h>
16
17static void i8259_irqdispatch(void)
18{
19 int irq;
20
21 irq = i8259_irq();
22 if (irq >= 0)
23 do_IRQ(irq);
24 else
25 spurious_interrupt();
26}
27
28asmlinkage void mach_irq_dispatch(unsigned int pending)
29{
30 if (pending & CAUSEF_IP7)
31 do_IRQ(MIPS_CPU_IRQ_BASE + 7);
32 else if (pending & CAUSEF_IP6) /* perf counter loverflow */
33 do_IRQ(LOONGSON2_PERFCNT_IRQ);
34 else if (pending & CAUSEF_IP5)
35 i8259_irqdispatch();
36 else if (pending & CAUSEF_IP2)
37 bonito_irqdispatch();
38 else
39 spurious_interrupt();
40}
41
42static struct irqaction cascade_irqaction = {
43 .handler = no_action,
44 .name = "cascade",
45};
46
47void __init set_irq_trigger_mode(void)
48{
49 /* most bonito irq should be level triggered */
50 BONITO_INTEDGE = BONITO_ICU_SYSTEMERR | BONITO_ICU_MASTERERR |
51 BONITO_ICU_RETRYERR | BONITO_ICU_MBOXES;
52}
53
54void __init mach_init_irq(void)
55{
56 /* init all controller
57 * 0-15 ------> i8259 interrupt
58 * 16-23 ------> mips cpu interrupt
59 * 32-63 ------> bonito irq
60 */
61
62 /* Sets the first-level interrupt dispatcher. */
63 mips_cpu_irq_init();
64 init_i8259_irqs();
65 bonito_irq_init();
66
67 /* bonito irq at IP2 */
68 setup_irq(MIPS_CPU_IRQ_BASE + 2, &cascade_irqaction);
69 /* 8259 irq at IP5 */
70 setup_irq(MIPS_CPU_IRQ_BASE + 5, &cascade_irqaction);
71}
diff --git a/arch/mips/loongson/fuloong-2e/reset.c b/arch/mips/loongson/fuloong-2e/reset.c
new file mode 100644
index 000000000000..677fe186db95
--- /dev/null
+++ b/arch/mips/loongson/fuloong-2e/reset.c
@@ -0,0 +1,23 @@
1/* Board-specific reboot/shutdown routines
2 * Copyright (c) 2009 Philippe Vachon <philippe@cowpig.ca>
3 *
4 * Copyright (C) 2009 Lemote Inc. & Insititute of Computing Technology
5 * Author: Wu Zhangjin, wuzj@lemote.com
6 *
7 * This program is free software; you can redistribute it and/or modify it
8 * under the terms of the GNU General Public License as published by the
9 * Free Software Foundation; either version 2 of the License, or (at your
10 * option) any later version.
11 */
12
13#include <loongson.h>
14
15void mach_prepare_reboot(void)
16{
17 BONITO_BONGENCFG &= ~(1 << 2);
18 BONITO_BONGENCFG |= (1 << 2);
19}
20
21void mach_prepare_shutdown(void)
22{
23}
diff --git a/arch/mips/mipssim/sim_setup.c b/arch/mips/mipssim/sim_setup.c
index 7c7148ef2646..2877675c5f0d 100644
--- a/arch/mips/mipssim/sim_setup.c
+++ b/arch/mips/mipssim/sim_setup.c
@@ -37,7 +37,7 @@
37 37
38 38
39static void __init serial_init(void); 39static void __init serial_init(void);
40unsigned int _isbonito = 0; 40unsigned int _isbonito;
41 41
42const char *get_system_type(void) 42const char *get_system_type(void)
43{ 43{
diff --git a/arch/mips/mm/fault.c b/arch/mips/mm/fault.c
index f956ecbb8136..e97a7a2fb2c0 100644
--- a/arch/mips/mm/fault.c
+++ b/arch/mips/mm/fault.c
@@ -58,11 +58,17 @@ asmlinkage void do_page_fault(struct pt_regs *regs, unsigned long write,
58 * only copy the information from the master page table, 58 * only copy the information from the master page table,
59 * nothing more. 59 * nothing more.
60 */ 60 */
61#ifdef CONFIG_64BIT
62# define VMALLOC_FAULT_TARGET no_context
63#else
64# define VMALLOC_FAULT_TARGET vmalloc_fault
65#endif
66
61 if (unlikely(address >= VMALLOC_START && address <= VMALLOC_END)) 67 if (unlikely(address >= VMALLOC_START && address <= VMALLOC_END))
62 goto vmalloc_fault; 68 goto VMALLOC_FAULT_TARGET;
63#ifdef MODULE_START 69#ifdef MODULE_START
64 if (unlikely(address >= MODULE_START && address < MODULE_END)) 70 if (unlikely(address >= MODULE_START && address < MODULE_END))
65 goto vmalloc_fault; 71 goto VMALLOC_FAULT_TARGET;
66#endif 72#endif
67 73
68 /* 74 /*
@@ -203,6 +209,7 @@ do_sigbus:
203 force_sig_info(SIGBUS, &info, tsk); 209 force_sig_info(SIGBUS, &info, tsk);
204 210
205 return; 211 return;
212#ifndef CONFIG_64BIT
206vmalloc_fault: 213vmalloc_fault:
207 { 214 {
208 /* 215 /*
@@ -241,4 +248,5 @@ vmalloc_fault:
241 goto no_context; 248 goto no_context;
242 return; 249 return;
243 } 250 }
251#endif
244} 252}
diff --git a/arch/mips/mm/init.c b/arch/mips/mm/init.c
index 0e820508ff23..38c79c55b060 100644
--- a/arch/mips/mm/init.c
+++ b/arch/mips/mm/init.c
@@ -475,9 +475,6 @@ unsigned long pgd_current[NR_CPUS];
475 */ 475 */
476pgd_t swapper_pg_dir[_PTRS_PER_PGD] __page_aligned(_PGD_ORDER); 476pgd_t swapper_pg_dir[_PTRS_PER_PGD] __page_aligned(_PGD_ORDER);
477#ifdef CONFIG_64BIT 477#ifdef CONFIG_64BIT
478#ifdef MODULE_START
479pgd_t module_pg_dir[PTRS_PER_PGD] __page_aligned(PGD_ORDER);
480#endif
481pmd_t invalid_pmd_table[PTRS_PER_PMD] __page_aligned(PMD_ORDER); 478pmd_t invalid_pmd_table[PTRS_PER_PMD] __page_aligned(PMD_ORDER);
482#endif 479#endif
483pte_t invalid_pte_table[PTRS_PER_PTE] __page_aligned(PTE_ORDER); 480pte_t invalid_pte_table[PTRS_PER_PTE] __page_aligned(PTE_ORDER);
diff --git a/arch/mips/mm/pgtable-64.c b/arch/mips/mm/pgtable-64.c
index e4b565aeb008..1121019fa456 100644
--- a/arch/mips/mm/pgtable-64.c
+++ b/arch/mips/mm/pgtable-64.c
@@ -59,9 +59,6 @@ void __init pagetable_init(void)
59 59
60 /* Initialize the entire pgd. */ 60 /* Initialize the entire pgd. */
61 pgd_init((unsigned long)swapper_pg_dir); 61 pgd_init((unsigned long)swapper_pg_dir);
62#ifdef MODULE_START
63 pgd_init((unsigned long)module_pg_dir);
64#endif
65 pmd_init((unsigned long)invalid_pmd_table, (unsigned long)invalid_pte_table); 62 pmd_init((unsigned long)invalid_pmd_table, (unsigned long)invalid_pte_table);
66 63
67 pgd_base = swapper_pg_dir; 64 pgd_base = swapper_pg_dir;
diff --git a/arch/mips/mm/tlb-r4k.c b/arch/mips/mm/tlb-r4k.c
index cee502caf398..d73428b18b0a 100644
--- a/arch/mips/mm/tlb-r4k.c
+++ b/arch/mips/mm/tlb-r4k.c
@@ -475,7 +475,7 @@ static void __cpuinit probe_tlb(unsigned long config)
475 c->tlbsize = ((reg >> 25) & 0x3f) + 1; 475 c->tlbsize = ((reg >> 25) & 0x3f) + 1;
476} 476}
477 477
478static int __cpuinitdata ntlb = 0; 478static int __cpuinitdata ntlb;
479static int __init set_ntlb(char *str) 479static int __init set_ntlb(char *str)
480{ 480{
481 get_option(&str, &ntlb); 481 get_option(&str, &ntlb);
diff --git a/arch/mips/mm/tlbex.c b/arch/mips/mm/tlbex.c
index 9a17bf8395df..bb1719a55d22 100644
--- a/arch/mips/mm/tlbex.c
+++ b/arch/mips/mm/tlbex.c
@@ -321,6 +321,10 @@ static void __cpuinit build_tlb_write_entry(u32 **p, struct uasm_label **l,
321 case CPU_BCM3302: 321 case CPU_BCM3302:
322 case CPU_BCM4710: 322 case CPU_BCM4710:
323 case CPU_LOONGSON2: 323 case CPU_LOONGSON2:
324 case CPU_BCM6338:
325 case CPU_BCM6345:
326 case CPU_BCM6348:
327 case CPU_BCM6358:
324 case CPU_R5500: 328 case CPU_R5500:
325 if (m4kc_tlbp_war()) 329 if (m4kc_tlbp_war())
326 uasm_i_nop(p); 330 uasm_i_nop(p);
@@ -499,11 +503,7 @@ build_get_pmde64(u32 **p, struct uasm_label **l, struct uasm_reloc **r,
499 * The vmalloc handling is not in the hotpath. 503 * The vmalloc handling is not in the hotpath.
500 */ 504 */
501 uasm_i_dmfc0(p, tmp, C0_BADVADDR); 505 uasm_i_dmfc0(p, tmp, C0_BADVADDR);
502#ifdef MODULE_START
503 uasm_il_bltz(p, r, tmp, label_module_alloc);
504#else
505 uasm_il_bltz(p, r, tmp, label_vmalloc); 506 uasm_il_bltz(p, r, tmp, label_vmalloc);
506#endif
507 /* No uasm_i_nop needed here, since the next insn doesn't touch TMP. */ 507 /* No uasm_i_nop needed here, since the next insn doesn't touch TMP. */
508 508
509#ifdef CONFIG_SMP 509#ifdef CONFIG_SMP
@@ -556,52 +556,7 @@ build_get_pgd_vmalloc64(u32 **p, struct uasm_label **l, struct uasm_reloc **r,
556{ 556{
557 long swpd = (long)swapper_pg_dir; 557 long swpd = (long)swapper_pg_dir;
558 558
559#ifdef MODULE_START
560 long modd = (long)module_pg_dir;
561
562 uasm_l_module_alloc(l, *p);
563 /*
564 * Assumption:
565 * VMALLOC_START >= 0xc000000000000000UL
566 * MODULE_START >= 0xe000000000000000UL
567 */
568 UASM_i_SLL(p, ptr, bvaddr, 2);
569 uasm_il_bgez(p, r, ptr, label_vmalloc);
570
571 if (uasm_in_compat_space_p(MODULE_START) &&
572 !uasm_rel_lo(MODULE_START)) {
573 uasm_i_lui(p, ptr, uasm_rel_hi(MODULE_START)); /* delay slot */
574 } else {
575 /* unlikely configuration */
576 uasm_i_nop(p); /* delay slot */
577 UASM_i_LA(p, ptr, MODULE_START);
578 }
579 uasm_i_dsubu(p, bvaddr, bvaddr, ptr);
580
581 if (uasm_in_compat_space_p(modd) && !uasm_rel_lo(modd)) {
582 uasm_il_b(p, r, label_vmalloc_done);
583 uasm_i_lui(p, ptr, uasm_rel_hi(modd));
584 } else {
585 UASM_i_LA_mostly(p, ptr, modd);
586 uasm_il_b(p, r, label_vmalloc_done);
587 if (uasm_in_compat_space_p(modd))
588 uasm_i_addiu(p, ptr, ptr, uasm_rel_lo(modd));
589 else
590 uasm_i_daddiu(p, ptr, ptr, uasm_rel_lo(modd));
591 }
592
593 uasm_l_vmalloc(l, *p); 559 uasm_l_vmalloc(l, *p);
594 if (uasm_in_compat_space_p(MODULE_START) &&
595 !uasm_rel_lo(MODULE_START) &&
596 MODULE_START << 32 == VMALLOC_START)
597 uasm_i_dsll32(p, ptr, ptr, 0); /* typical case */
598 else
599 UASM_i_LA(p, ptr, VMALLOC_START);
600#else
601 uasm_l_vmalloc(l, *p);
602 UASM_i_LA(p, ptr, VMALLOC_START);
603#endif
604 uasm_i_dsubu(p, bvaddr, bvaddr, ptr);
605 560
606 if (uasm_in_compat_space_p(swpd) && !uasm_rel_lo(swpd)) { 561 if (uasm_in_compat_space_p(swpd) && !uasm_rel_lo(swpd)) {
607 uasm_il_b(p, r, label_vmalloc_done); 562 uasm_il_b(p, r, label_vmalloc_done);
diff --git a/arch/mips/mti-malta/malta-init.c b/arch/mips/mti-malta/malta-init.c
index 27c807b67fea..f1b14c8a4a1c 100644
--- a/arch/mips/mti-malta/malta-init.c
+++ b/arch/mips/mti-malta/malta-init.c
@@ -47,7 +47,7 @@ int *_prom_argv, *_prom_envp;
47 */ 47 */
48#define prom_envp(index) ((char *)(long)_prom_envp[(index)]) 48#define prom_envp(index) ((char *)(long)_prom_envp[(index)])
49 49
50int init_debug = 0; 50int init_debug;
51 51
52static int mips_revision_corid; 52static int mips_revision_corid;
53int mips_revision_sconid; 53int mips_revision_sconid;
diff --git a/arch/mips/mti-malta/malta-reset.c b/arch/mips/mti-malta/malta-reset.c
index f48d60e84290..329420536241 100644
--- a/arch/mips/mti-malta/malta-reset.c
+++ b/arch/mips/mti-malta/malta-reset.c
@@ -22,6 +22,7 @@
22 * Reset the MIPS boards. 22 * Reset the MIPS boards.
23 * 23 *
24 */ 24 */
25#include <linux/init.h>
25#include <linux/pm.h> 26#include <linux/pm.h>
26 27
27#include <asm/io.h> 28#include <asm/io.h>
@@ -45,9 +46,13 @@ static void mips_machine_halt(void)
45} 46}
46 47
47 48
48void mips_reboot_setup(void) 49static int __init mips_reboot_setup(void)
49{ 50{
50 _machine_restart = mips_machine_restart; 51 _machine_restart = mips_machine_restart;
51 _machine_halt = mips_machine_halt; 52 _machine_halt = mips_machine_halt;
52 pm_power_off = mips_machine_halt; 53 pm_power_off = mips_machine_halt;
54
55 return 0;
53} 56}
57
58arch_initcall(mips_reboot_setup);
diff --git a/arch/mips/mti-malta/malta-setup.c b/arch/mips/mti-malta/malta-setup.c
index dc78b8983eeb..b7f37d4982fa 100644
--- a/arch/mips/mti-malta/malta-setup.c
+++ b/arch/mips/mti-malta/malta-setup.c
@@ -218,7 +218,6 @@ void __init plat_mem_setup(void)
218#if defined(CONFIG_VT) && defined(CONFIG_VGA_CONSOLE) 218#if defined(CONFIG_VT) && defined(CONFIG_VGA_CONSOLE)
219 screen_info_setup(); 219 screen_info_setup();
220#endif 220#endif
221 mips_reboot_setup();
222 221
223 board_be_init = malta_be_init; 222 board_be_init = malta_be_init;
224 board_be_handler = malta_be_handler; 223 board_be_handler = malta_be_handler;
diff --git a/arch/mips/nxp/pnx833x/stb22x/board.c b/arch/mips/nxp/pnx833x/stb22x/board.c
index 90cc604bdadf..644eb7c3210f 100644
--- a/arch/mips/nxp/pnx833x/stb22x/board.c
+++ b/arch/mips/nxp/pnx833x/stb22x/board.c
@@ -39,7 +39,7 @@
39#define PNX8335_DEBUG7 0x441c 39#define PNX8335_DEBUG7 0x441c
40 40
41int prom_argc; 41int prom_argc;
42char **prom_argv = 0, **prom_envp = 0; 42char **prom_argv, **prom_envp;
43 43
44extern void prom_init_cmdline(void); 44extern void prom_init_cmdline(void);
45extern char *prom_getenv(char *envname); 45extern char *prom_getenv(char *envname);
diff --git a/arch/mips/nxp/pnx8550/common/proc.c b/arch/mips/nxp/pnx8550/common/proc.c
index acf1fa889444..af094cd1d85b 100644
--- a/arch/mips/nxp/pnx8550/common/proc.c
+++ b/arch/mips/nxp/pnx8550/common/proc.c
@@ -69,9 +69,9 @@ static int pnx8550_registers_read(char* page, char** start, off_t offset, int co
69 return len; 69 return len;
70} 70}
71 71
72static struct proc_dir_entry* pnx8550_dir = NULL; 72static struct proc_dir_entry* pnx8550_dir;
73static struct proc_dir_entry* pnx8550_timers = NULL; 73static struct proc_dir_entry* pnx8550_timers;
74static struct proc_dir_entry* pnx8550_registers = NULL; 74static struct proc_dir_entry* pnx8550_registers;
75 75
76static int pnx8550_proc_init( void ) 76static int pnx8550_proc_init( void )
77{ 77{
diff --git a/arch/mips/oprofile/Makefile b/arch/mips/oprofile/Makefile
index bf3be6fcf7ff..02cc65e52d11 100644
--- a/arch/mips/oprofile/Makefile
+++ b/arch/mips/oprofile/Makefile
@@ -15,3 +15,4 @@ oprofile-$(CONFIG_CPU_MIPS64) += op_model_mipsxx.o
15oprofile-$(CONFIG_CPU_R10000) += op_model_mipsxx.o 15oprofile-$(CONFIG_CPU_R10000) += op_model_mipsxx.o
16oprofile-$(CONFIG_CPU_SB1) += op_model_mipsxx.o 16oprofile-$(CONFIG_CPU_SB1) += op_model_mipsxx.o
17oprofile-$(CONFIG_CPU_RM9000) += op_model_rm9000.o 17oprofile-$(CONFIG_CPU_RM9000) += op_model_rm9000.o
18oprofile-$(CONFIG_CPU_LOONGSON2) += op_model_loongson2.o
diff --git a/arch/mips/oprofile/common.c b/arch/mips/oprofile/common.c
index 3bf3354547f6..7832ad257a14 100644
--- a/arch/mips/oprofile/common.c
+++ b/arch/mips/oprofile/common.c
@@ -16,6 +16,7 @@
16 16
17extern struct op_mips_model op_model_mipsxx_ops __attribute__((weak)); 17extern struct op_mips_model op_model_mipsxx_ops __attribute__((weak));
18extern struct op_mips_model op_model_rm9000_ops __attribute__((weak)); 18extern struct op_mips_model op_model_rm9000_ops __attribute__((weak));
19extern struct op_mips_model op_model_loongson2_ops __attribute__((weak));
19 20
20static struct op_mips_model *model; 21static struct op_mips_model *model;
21 22
@@ -93,6 +94,9 @@ int __init oprofile_arch_init(struct oprofile_operations *ops)
93 case CPU_RM9000: 94 case CPU_RM9000:
94 lmodel = &op_model_rm9000_ops; 95 lmodel = &op_model_rm9000_ops;
95 break; 96 break;
97 case CPU_LOONGSON2:
98 lmodel = &op_model_loongson2_ops;
99 break;
96 }; 100 };
97 101
98 if (!lmodel) 102 if (!lmodel)
diff --git a/arch/mips/oprofile/op_model_loongson2.c b/arch/mips/oprofile/op_model_loongson2.c
new file mode 100644
index 000000000000..655cb8dec340
--- /dev/null
+++ b/arch/mips/oprofile/op_model_loongson2.c
@@ -0,0 +1,177 @@
1/*
2 * Loongson2 performance counter driver for oprofile
3 *
4 * Copyright (C) 2009 Lemote Inc. & Insititute of Computing Technology
5 * Author: Yanhua <yanh@lemote.com>
6 * Author: Wu Zhangjin <wuzj@lemote.com>
7 *
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
10 * for more details.
11 *
12 */
13#include <linux/init.h>
14#include <linux/oprofile.h>
15#include <linux/interrupt.h>
16
17#include <loongson.h> /* LOONGSON2_PERFCNT_IRQ */
18#include "op_impl.h"
19
20/*
21 * a patch should be sent to oprofile with the loongson-specific support.
22 * otherwise, the oprofile tool will not recognize this and complain about
23 * "cpu_type 'unset' is not valid".
24 */
25#define LOONGSON2_CPU_TYPE "mips/godson2"
26
27#define LOONGSON2_COUNTER1_EVENT(event) ((event & 0x0f) << 5)
28#define LOONGSON2_COUNTER2_EVENT(event) ((event & 0x0f) << 9)
29
30#define LOONGSON2_PERFCNT_EXL (1UL << 0)
31#define LOONGSON2_PERFCNT_KERNEL (1UL << 1)
32#define LOONGSON2_PERFCNT_SUPERVISOR (1UL << 2)
33#define LOONGSON2_PERFCNT_USER (1UL << 3)
34#define LOONGSON2_PERFCNT_INT_EN (1UL << 4)
35#define LOONGSON2_PERFCNT_OVERFLOW (1ULL << 31)
36
37/* Loongson2 performance counter register */
38#define read_c0_perfctrl() __read_64bit_c0_register($24, 0)
39#define write_c0_perfctrl(val) __write_64bit_c0_register($24, 0, val)
40#define read_c0_perfcnt() __read_64bit_c0_register($25, 0)
41#define write_c0_perfcnt(val) __write_64bit_c0_register($25, 0, val)
42
43static struct loongson2_register_config {
44 unsigned int ctrl;
45 unsigned long long reset_counter1;
46 unsigned long long reset_counter2;
47 int cnt1_enalbed, cnt2_enalbed;
48} reg;
49
50DEFINE_SPINLOCK(sample_lock);
51
52static char *oprofid = "LoongsonPerf";
53static irqreturn_t loongson2_perfcount_handler(int irq, void *dev_id);
54/* Compute all of the registers in preparation for enabling profiling. */
55
56static void loongson2_reg_setup(struct op_counter_config *cfg)
57{
58 unsigned int ctrl = 0;
59
60 reg.reset_counter1 = 0;
61 reg.reset_counter2 = 0;
62 /* Compute the performance counter ctrl word. */
63 /* For now count kernel and user mode */
64 if (cfg[0].enabled) {
65 ctrl |= LOONGSON2_COUNTER1_EVENT(cfg[0].event);
66 reg.reset_counter1 = 0x80000000ULL - cfg[0].count;
67 }
68
69 if (cfg[1].enabled) {
70 ctrl |= LOONGSON2_COUNTER2_EVENT(cfg[1].event);
71 reg.reset_counter2 = (0x80000000ULL - cfg[1].count);
72 }
73
74 if (cfg[0].enabled || cfg[1].enabled) {
75 ctrl |= LOONGSON2_PERFCNT_EXL | LOONGSON2_PERFCNT_INT_EN;
76 if (cfg[0].kernel || cfg[1].kernel)
77 ctrl |= LOONGSON2_PERFCNT_KERNEL;
78 if (cfg[0].user || cfg[1].user)
79 ctrl |= LOONGSON2_PERFCNT_USER;
80 }
81
82 reg.ctrl = ctrl;
83
84 reg.cnt1_enalbed = cfg[0].enabled;
85 reg.cnt2_enalbed = cfg[1].enabled;
86
87}
88
89/* Program all of the registers in preparation for enabling profiling. */
90
91static void loongson2_cpu_setup(void *args)
92{
93 uint64_t perfcount;
94
95 perfcount = (reg.reset_counter2 << 32) | reg.reset_counter1;
96 write_c0_perfcnt(perfcount);
97}
98
99static void loongson2_cpu_start(void *args)
100{
101 /* Start all counters on current CPU */
102 if (reg.cnt1_enalbed || reg.cnt2_enalbed)
103 write_c0_perfctrl(reg.ctrl);
104}
105
106static void loongson2_cpu_stop(void *args)
107{
108 /* Stop all counters on current CPU */
109 write_c0_perfctrl(0);
110 memset(&reg, 0, sizeof(reg));
111}
112
113static irqreturn_t loongson2_perfcount_handler(int irq, void *dev_id)
114{
115 uint64_t counter, counter1, counter2;
116 struct pt_regs *regs = get_irq_regs();
117 int enabled;
118 unsigned long flags;
119
120 /*
121 * LOONGSON2 defines two 32-bit performance counters.
122 * To avoid a race updating the registers we need to stop the counters
123 * while we're messing with
124 * them ...
125 */
126
127 /* Check whether the irq belongs to me */
128 enabled = reg.cnt1_enalbed | reg.cnt2_enalbed;
129 if (!enabled)
130 return IRQ_NONE;
131
132 counter = read_c0_perfcnt();
133 counter1 = counter & 0xffffffff;
134 counter2 = counter >> 32;
135
136 spin_lock_irqsave(&sample_lock, flags);
137
138 if (counter1 & LOONGSON2_PERFCNT_OVERFLOW) {
139 if (reg.cnt1_enalbed)
140 oprofile_add_sample(regs, 0);
141 counter1 = reg.reset_counter1;
142 }
143 if (counter2 & LOONGSON2_PERFCNT_OVERFLOW) {
144 if (reg.cnt2_enalbed)
145 oprofile_add_sample(regs, 1);
146 counter2 = reg.reset_counter2;
147 }
148
149 spin_unlock_irqrestore(&sample_lock, flags);
150
151 write_c0_perfcnt((counter2 << 32) | counter1);
152
153 return IRQ_HANDLED;
154}
155
156static int __init loongson2_init(void)
157{
158 return request_irq(LOONGSON2_PERFCNT_IRQ, loongson2_perfcount_handler,
159 IRQF_SHARED, "Perfcounter", oprofid);
160}
161
162static void loongson2_exit(void)
163{
164 write_c0_perfctrl(0);
165 free_irq(LOONGSON2_PERFCNT_IRQ, oprofid);
166}
167
168struct op_mips_model op_model_loongson2_ops = {
169 .reg_setup = loongson2_reg_setup,
170 .cpu_setup = loongson2_cpu_setup,
171 .init = loongson2_init,
172 .exit = loongson2_exit,
173 .cpu_start = loongson2_cpu_start,
174 .cpu_stop = loongson2_cpu_stop,
175 .cpu_type = LOONGSON2_CPU_TYPE,
176 .num_counters = 2
177};
diff --git a/arch/mips/pci/Makefile b/arch/mips/pci/Makefile
index 63d8a297c58d..91bfe73a7f60 100644
--- a/arch/mips/pci/Makefile
+++ b/arch/mips/pci/Makefile
@@ -16,6 +16,8 @@ obj-$(CONFIG_PCI_VR41XX) += ops-vr41xx.o pci-vr41xx.o
16obj-$(CONFIG_NEC_MARKEINS) += ops-emma2rh.o pci-emma2rh.o fixup-emma2rh.o 16obj-$(CONFIG_NEC_MARKEINS) += ops-emma2rh.o pci-emma2rh.o fixup-emma2rh.o
17obj-$(CONFIG_PCI_TX4927) += ops-tx4927.o 17obj-$(CONFIG_PCI_TX4927) += ops-tx4927.o
18obj-$(CONFIG_BCM47XX) += pci-bcm47xx.o 18obj-$(CONFIG_BCM47XX) += pci-bcm47xx.o
19obj-$(CONFIG_BCM63XX) += pci-bcm63xx.o fixup-bcm63xx.o \
20 ops-bcm63xx.o
19 21
20# 22#
21# These are still pretty much in the old state, watch, go blind. 23# These are still pretty much in the old state, watch, go blind.
@@ -26,7 +28,7 @@ obj-$(CONFIG_MIPS_COBALT) += fixup-cobalt.o
26obj-$(CONFIG_SOC_AU1500) += fixup-au1000.o ops-au1000.o 28obj-$(CONFIG_SOC_AU1500) += fixup-au1000.o ops-au1000.o
27obj-$(CONFIG_SOC_AU1550) += fixup-au1000.o ops-au1000.o 29obj-$(CONFIG_SOC_AU1550) += fixup-au1000.o ops-au1000.o
28obj-$(CONFIG_SOC_PNX8550) += fixup-pnx8550.o ops-pnx8550.o 30obj-$(CONFIG_SOC_PNX8550) += fixup-pnx8550.o ops-pnx8550.o
29obj-$(CONFIG_LEMOTE_FULONG) += fixup-lm2e.o ops-bonito64.o 31obj-$(CONFIG_LEMOTE_FULOONG2E) += fixup-fuloong2e.o ops-bonito64.o
30obj-$(CONFIG_MIPS_MALTA) += fixup-malta.o 32obj-$(CONFIG_MIPS_MALTA) += fixup-malta.o
31obj-$(CONFIG_PMC_MSP7120_GW) += fixup-pmcmsp.o ops-pmcmsp.o 33obj-$(CONFIG_PMC_MSP7120_GW) += fixup-pmcmsp.o ops-pmcmsp.o
32obj-$(CONFIG_PMC_MSP7120_EVAL) += fixup-pmcmsp.o ops-pmcmsp.o 34obj-$(CONFIG_PMC_MSP7120_EVAL) += fixup-pmcmsp.o ops-pmcmsp.o
diff --git a/arch/mips/pci/fixup-bcm63xx.c b/arch/mips/pci/fixup-bcm63xx.c
new file mode 100644
index 000000000000..340863009da9
--- /dev/null
+++ b/arch/mips/pci/fixup-bcm63xx.c
@@ -0,0 +1,21 @@
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) 2008 Maxime Bizon <mbizon@freebox.fr>
7 */
8
9#include <linux/types.h>
10#include <linux/pci.h>
11#include <bcm63xx_cpu.h>
12
13int pcibios_map_irq(const struct pci_dev *dev, u8 slot, u8 pin)
14{
15 return bcm63xx_get_irq_number(IRQ_PCI);
16}
17
18int pcibios_plat_dev_init(struct pci_dev *dev)
19{
20 return 0;
21}
diff --git a/arch/mips/pci/fixup-lm2e.c b/arch/mips/pci/fixup-fuloong2e.c
index e18ae4f574c1..0c4c7a81213f 100644
--- a/arch/mips/pci/fixup-lm2e.c
+++ b/arch/mips/pci/fixup-fuloong2e.c
@@ -1,6 +1,4 @@
1/* 1/*
2 * fixup-lm2e.c
3 *
4 * Copyright (C) 2004 ICT CAS 2 * Copyright (C) 2004 ICT CAS
5 * Author: Li xiaoyu, ICT CAS 3 * Author: Li xiaoyu, ICT CAS
6 * lixy@ict.ac.cn 4 * lixy@ict.ac.cn
@@ -12,22 +10,6 @@
12 * under the terms of the GNU General Public License as published by the 10 * under the terms of the GNU General Public License as published by the
13 * Free Software Foundation; either version 2 of the License, or (at your 11 * Free Software Foundation; either version 2 of the License, or (at your
14 * option) any later version. 12 * option) any later version.
15 *
16 * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESS OR IMPLIED
17 * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
18 * MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN
19 * NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT,
20 * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
21 * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF
22 * USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON
23 * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
24 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
25 * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
26 *
27 * You should have received a copy of the GNU General Public License along
28 * with this program; if not, write to the Free Software Foundation, Inc.,
29 * 675 Mass Ave, Cambridge, MA 02139, USA.
30 *
31 */ 13 */
32#include <linux/init.h> 14#include <linux/init.h>
33#include <linux/pci.h> 15#include <linux/pci.h>
diff --git a/arch/mips/pci/ops-bcm63xx.c b/arch/mips/pci/ops-bcm63xx.c
new file mode 100644
index 000000000000..822ae179bc56
--- /dev/null
+++ b/arch/mips/pci/ops-bcm63xx.c
@@ -0,0 +1,467 @@
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) 2008 Maxime Bizon <mbizon@freebox.fr>
7 */
8
9#include <linux/types.h>
10#include <linux/pci.h>
11#include <linux/kernel.h>
12#include <linux/init.h>
13#include <linux/delay.h>
14#include <linux/io.h>
15
16#include "pci-bcm63xx.h"
17
18/*
19 * swizzle 32bits data to return only the needed part
20 */
21static int postprocess_read(u32 data, int where, unsigned int size)
22{
23 u32 ret;
24
25 ret = 0;
26 switch (size) {
27 case 1:
28 ret = (data >> ((where & 3) << 3)) & 0xff;
29 break;
30 case 2:
31 ret = (data >> ((where & 3) << 3)) & 0xffff;
32 break;
33 case 4:
34 ret = data;
35 break;
36 }
37 return ret;
38}
39
40static int preprocess_write(u32 orig_data, u32 val, int where,
41 unsigned int size)
42{
43 u32 ret;
44
45 ret = 0;
46 switch (size) {
47 case 1:
48 ret = (orig_data & ~(0xff << ((where & 3) << 3))) |
49 (val << ((where & 3) << 3));
50 break;
51 case 2:
52 ret = (orig_data & ~(0xffff << ((where & 3) << 3))) |
53 (val << ((where & 3) << 3));
54 break;
55 case 4:
56 ret = val;
57 break;
58 }
59 return ret;
60}
61
62/*
63 * setup hardware for a configuration cycle with given parameters
64 */
65static int bcm63xx_setup_cfg_access(int type, unsigned int busn,
66 unsigned int devfn, int where)
67{
68 unsigned int slot, func, reg;
69 u32 val;
70
71 slot = PCI_SLOT(devfn);
72 func = PCI_FUNC(devfn);
73 reg = where >> 2;
74
75 /* sanity check */
76 if (slot > (MPI_L2PCFG_DEVNUM_MASK >> MPI_L2PCFG_DEVNUM_SHIFT))
77 return 1;
78
79 if (func > (MPI_L2PCFG_FUNC_MASK >> MPI_L2PCFG_FUNC_SHIFT))
80 return 1;
81
82 if (reg > (MPI_L2PCFG_REG_MASK >> MPI_L2PCFG_REG_SHIFT))
83 return 1;
84
85 /* ok, setup config access */
86 val = (reg << MPI_L2PCFG_REG_SHIFT);
87 val |= (func << MPI_L2PCFG_FUNC_SHIFT);
88 val |= (slot << MPI_L2PCFG_DEVNUM_SHIFT);
89 val |= MPI_L2PCFG_CFG_USEREG_MASK;
90 val |= MPI_L2PCFG_CFG_SEL_MASK;
91 /* type 0 cycle for local bus, type 1 cycle for anything else */
92 if (type != 0) {
93 /* FIXME: how to specify bus ??? */
94 val |= (1 << MPI_L2PCFG_CFG_TYPE_SHIFT);
95 }
96 bcm_mpi_writel(val, MPI_L2PCFG_REG);
97
98 return 0;
99}
100
101static int bcm63xx_do_cfg_read(int type, unsigned int busn,
102 unsigned int devfn, int where, int size,
103 u32 *val)
104{
105 u32 data;
106
107 /* two phase cycle, first we write address, then read data at
108 * another location, caller already has a spinlock so no need
109 * to add one here */
110 if (bcm63xx_setup_cfg_access(type, busn, devfn, where))
111 return PCIBIOS_DEVICE_NOT_FOUND;
112 iob();
113 data = le32_to_cpu(__raw_readl(pci_iospace_start));
114 /* restore IO space normal behaviour */
115 bcm_mpi_writel(0, MPI_L2PCFG_REG);
116
117 *val = postprocess_read(data, where, size);
118
119 return PCIBIOS_SUCCESSFUL;
120}
121
122static int bcm63xx_do_cfg_write(int type, unsigned int busn,
123 unsigned int devfn, int where, int size,
124 u32 val)
125{
126 u32 data;
127
128 /* two phase cycle, first we write address, then write data to
129 * another location, caller already has a spinlock so no need
130 * to add one here */
131 if (bcm63xx_setup_cfg_access(type, busn, devfn, where))
132 return PCIBIOS_DEVICE_NOT_FOUND;
133 iob();
134
135 data = le32_to_cpu(__raw_readl(pci_iospace_start));
136 data = preprocess_write(data, val, where, size);
137
138 __raw_writel(cpu_to_le32(data), pci_iospace_start);
139 wmb();
140 /* no way to know the access is done, we have to wait */
141 udelay(500);
142 /* restore IO space normal behaviour */
143 bcm_mpi_writel(0, MPI_L2PCFG_REG);
144
145 return PCIBIOS_SUCCESSFUL;
146}
147
148static int bcm63xx_pci_read(struct pci_bus *bus, unsigned int devfn,
149 int where, int size, u32 *val)
150{
151 int type;
152
153 type = bus->parent ? 1 : 0;
154
155 if (type == 0 && PCI_SLOT(devfn) == CARDBUS_PCI_IDSEL)
156 return PCIBIOS_DEVICE_NOT_FOUND;
157
158 return bcm63xx_do_cfg_read(type, bus->number, devfn,
159 where, size, val);
160}
161
162static int bcm63xx_pci_write(struct pci_bus *bus, unsigned int devfn,
163 int where, int size, u32 val)
164{
165 int type;
166
167 type = bus->parent ? 1 : 0;
168
169 if (type == 0 && PCI_SLOT(devfn) == CARDBUS_PCI_IDSEL)
170 return PCIBIOS_DEVICE_NOT_FOUND;
171
172 return bcm63xx_do_cfg_write(type, bus->number, devfn,
173 where, size, val);
174}
175
176struct pci_ops bcm63xx_pci_ops = {
177 .read = bcm63xx_pci_read,
178 .write = bcm63xx_pci_write
179};
180
181#ifdef CONFIG_CARDBUS
182/*
183 * emulate configuration read access on a cardbus bridge
184 */
185#define FAKE_CB_BRIDGE_SLOT 0x1e
186
187static int fake_cb_bridge_bus_number = -1;
188
189static struct {
190 u16 pci_command;
191 u8 cb_latency;
192 u8 subordinate_busn;
193 u8 cardbus_busn;
194 u8 pci_busn;
195 int bus_assigned;
196 u16 bridge_control;
197
198 u32 mem_base0;
199 u32 mem_limit0;
200 u32 mem_base1;
201 u32 mem_limit1;
202
203 u32 io_base0;
204 u32 io_limit0;
205 u32 io_base1;
206 u32 io_limit1;
207} fake_cb_bridge_regs;
208
209static int fake_cb_bridge_read(int where, int size, u32 *val)
210{
211 unsigned int reg;
212 u32 data;
213
214 data = 0;
215 reg = where >> 2;
216 switch (reg) {
217 case (PCI_VENDOR_ID >> 2):
218 case (PCI_CB_SUBSYSTEM_VENDOR_ID >> 2):
219 /* create dummy vendor/device id from our cpu id */
220 data = (bcm63xx_get_cpu_id() << 16) | PCI_VENDOR_ID_BROADCOM;
221 break;
222
223 case (PCI_COMMAND >> 2):
224 data = (PCI_STATUS_DEVSEL_SLOW << 16);
225 data |= fake_cb_bridge_regs.pci_command;
226 break;
227
228 case (PCI_CLASS_REVISION >> 2):
229 data = (PCI_CLASS_BRIDGE_CARDBUS << 16);
230 break;
231
232 case (PCI_CACHE_LINE_SIZE >> 2):
233 data = (PCI_HEADER_TYPE_CARDBUS << 16);
234 break;
235
236 case (PCI_INTERRUPT_LINE >> 2):
237 /* bridge control */
238 data = (fake_cb_bridge_regs.bridge_control << 16);
239 /* pin:intA line:0xff */
240 data |= (0x1 << 8) | 0xff;
241 break;
242
243 case (PCI_CB_PRIMARY_BUS >> 2):
244 data = (fake_cb_bridge_regs.cb_latency << 24);
245 data |= (fake_cb_bridge_regs.subordinate_busn << 16);
246 data |= (fake_cb_bridge_regs.cardbus_busn << 8);
247 data |= fake_cb_bridge_regs.pci_busn;
248 break;
249
250 case (PCI_CB_MEMORY_BASE_0 >> 2):
251 data = fake_cb_bridge_regs.mem_base0;
252 break;
253
254 case (PCI_CB_MEMORY_LIMIT_0 >> 2):
255 data = fake_cb_bridge_regs.mem_limit0;
256 break;
257
258 case (PCI_CB_MEMORY_BASE_1 >> 2):
259 data = fake_cb_bridge_regs.mem_base1;
260 break;
261
262 case (PCI_CB_MEMORY_LIMIT_1 >> 2):
263 data = fake_cb_bridge_regs.mem_limit1;
264 break;
265
266 case (PCI_CB_IO_BASE_0 >> 2):
267 /* | 1 for 32bits io support */
268 data = fake_cb_bridge_regs.io_base0 | 0x1;
269 break;
270
271 case (PCI_CB_IO_LIMIT_0 >> 2):
272 data = fake_cb_bridge_regs.io_limit0;
273 break;
274
275 case (PCI_CB_IO_BASE_1 >> 2):
276 /* | 1 for 32bits io support */
277 data = fake_cb_bridge_regs.io_base1 | 0x1;
278 break;
279
280 case (PCI_CB_IO_LIMIT_1 >> 2):
281 data = fake_cb_bridge_regs.io_limit1;
282 break;
283 }
284
285 *val = postprocess_read(data, where, size);
286 return PCIBIOS_SUCCESSFUL;
287}
288
289/*
290 * emulate configuration write access on a cardbus bridge
291 */
292static int fake_cb_bridge_write(int where, int size, u32 val)
293{
294 unsigned int reg;
295 u32 data, tmp;
296 int ret;
297
298 ret = fake_cb_bridge_read((where & ~0x3), 4, &data);
299 if (ret != PCIBIOS_SUCCESSFUL)
300 return ret;
301
302 data = preprocess_write(data, val, where, size);
303
304 reg = where >> 2;
305 switch (reg) {
306 case (PCI_COMMAND >> 2):
307 fake_cb_bridge_regs.pci_command = (data & 0xffff);
308 break;
309
310 case (PCI_CB_PRIMARY_BUS >> 2):
311 fake_cb_bridge_regs.cb_latency = (data >> 24) & 0xff;
312 fake_cb_bridge_regs.subordinate_busn = (data >> 16) & 0xff;
313 fake_cb_bridge_regs.cardbus_busn = (data >> 8) & 0xff;
314 fake_cb_bridge_regs.pci_busn = data & 0xff;
315 if (fake_cb_bridge_regs.cardbus_busn)
316 fake_cb_bridge_regs.bus_assigned = 1;
317 break;
318
319 case (PCI_INTERRUPT_LINE >> 2):
320 tmp = (data >> 16) & 0xffff;
321 /* disable memory prefetch support */
322 tmp &= ~PCI_CB_BRIDGE_CTL_PREFETCH_MEM0;
323 tmp &= ~PCI_CB_BRIDGE_CTL_PREFETCH_MEM1;
324 fake_cb_bridge_regs.bridge_control = tmp;
325 break;
326
327 case (PCI_CB_MEMORY_BASE_0 >> 2):
328 fake_cb_bridge_regs.mem_base0 = data;
329 break;
330
331 case (PCI_CB_MEMORY_LIMIT_0 >> 2):
332 fake_cb_bridge_regs.mem_limit0 = data;
333 break;
334
335 case (PCI_CB_MEMORY_BASE_1 >> 2):
336 fake_cb_bridge_regs.mem_base1 = data;
337 break;
338
339 case (PCI_CB_MEMORY_LIMIT_1 >> 2):
340 fake_cb_bridge_regs.mem_limit1 = data;
341 break;
342
343 case (PCI_CB_IO_BASE_0 >> 2):
344 fake_cb_bridge_regs.io_base0 = data;
345 break;
346
347 case (PCI_CB_IO_LIMIT_0 >> 2):
348 fake_cb_bridge_regs.io_limit0 = data;
349 break;
350
351 case (PCI_CB_IO_BASE_1 >> 2):
352 fake_cb_bridge_regs.io_base1 = data;
353 break;
354
355 case (PCI_CB_IO_LIMIT_1 >> 2):
356 fake_cb_bridge_regs.io_limit1 = data;
357 break;
358 }
359
360 return PCIBIOS_SUCCESSFUL;
361}
362
363static int bcm63xx_cb_read(struct pci_bus *bus, unsigned int devfn,
364 int where, int size, u32 *val)
365{
366 /* snoop access to slot 0x1e on root bus, we fake a cardbus
367 * bridge at this location */
368 if (!bus->parent && PCI_SLOT(devfn) == FAKE_CB_BRIDGE_SLOT) {
369 fake_cb_bridge_bus_number = bus->number;
370 return fake_cb_bridge_read(where, size, val);
371 }
372
373 /* a configuration cycle for the device behind the cardbus
374 * bridge is actually done as a type 0 cycle on the primary
375 * bus. This means that only one device can be on the cardbus
376 * bus */
377 if (fake_cb_bridge_regs.bus_assigned &&
378 bus->number == fake_cb_bridge_regs.cardbus_busn &&
379 PCI_SLOT(devfn) == 0)
380 return bcm63xx_do_cfg_read(0, 0,
381 PCI_DEVFN(CARDBUS_PCI_IDSEL, 0),
382 where, size, val);
383
384 return PCIBIOS_DEVICE_NOT_FOUND;
385}
386
387static int bcm63xx_cb_write(struct pci_bus *bus, unsigned int devfn,
388 int where, int size, u32 val)
389{
390 if (!bus->parent && PCI_SLOT(devfn) == FAKE_CB_BRIDGE_SLOT) {
391 fake_cb_bridge_bus_number = bus->number;
392 return fake_cb_bridge_write(where, size, val);
393 }
394
395 if (fake_cb_bridge_regs.bus_assigned &&
396 bus->number == fake_cb_bridge_regs.cardbus_busn &&
397 PCI_SLOT(devfn) == 0)
398 return bcm63xx_do_cfg_write(0, 0,
399 PCI_DEVFN(CARDBUS_PCI_IDSEL, 0),
400 where, size, val);
401
402 return PCIBIOS_DEVICE_NOT_FOUND;
403}
404
405struct pci_ops bcm63xx_cb_ops = {
406 .read = bcm63xx_cb_read,
407 .write = bcm63xx_cb_write,
408};
409
410/*
411 * only one IO window, so it cannot be shared by PCI and cardbus, use
412 * fixup to choose and detect unhandled configuration
413 */
414static void bcm63xx_fixup(struct pci_dev *dev)
415{
416 static int io_window = -1;
417 int i, found, new_io_window;
418 u32 val;
419
420 /* look for any io resource */
421 found = 0;
422 for (i = 0; i < DEVICE_COUNT_RESOURCE; i++) {
423 if (pci_resource_flags(dev, i) & IORESOURCE_IO) {
424 found = 1;
425 break;
426 }
427 }
428
429 if (!found)
430 return;
431
432 /* skip our fake bus with only cardbus bridge on it */
433 if (dev->bus->number == fake_cb_bridge_bus_number)
434 return;
435
436 /* find on which bus the device is */
437 if (fake_cb_bridge_regs.bus_assigned &&
438 dev->bus->number == fake_cb_bridge_regs.cardbus_busn &&
439 PCI_SLOT(dev->devfn) == 0)
440 new_io_window = 1;
441 else
442 new_io_window = 0;
443
444 if (new_io_window == io_window)
445 return;
446
447 if (io_window != -1) {
448 printk(KERN_ERR "bcm63xx: both PCI and cardbus devices "
449 "need IO, which hardware cannot do\n");
450 return;
451 }
452
453 printk(KERN_INFO "bcm63xx: PCI IO window assigned to %s\n",
454 (new_io_window == 0) ? "PCI" : "cardbus");
455
456 val = bcm_mpi_readl(MPI_L2PIOREMAP_REG);
457 if (io_window)
458 val |= MPI_L2PREMAP_IS_CARDBUS_MASK;
459 else
460 val &= ~MPI_L2PREMAP_IS_CARDBUS_MASK;
461 bcm_mpi_writel(val, MPI_L2PIOREMAP_REG);
462
463 io_window = new_io_window;
464}
465
466DECLARE_PCI_FIXUP_ENABLE(PCI_ANY_ID, PCI_ANY_ID, bcm63xx_fixup);
467#endif
diff --git a/arch/mips/pci/ops-bonito64.c b/arch/mips/pci/ops-bonito64.c
index f742c51acf0d..54e55e7a2431 100644
--- a/arch/mips/pci/ops-bonito64.c
+++ b/arch/mips/pci/ops-bonito64.c
@@ -29,7 +29,7 @@
29#define PCI_ACCESS_READ 0 29#define PCI_ACCESS_READ 0
30#define PCI_ACCESS_WRITE 1 30#define PCI_ACCESS_WRITE 1
31 31
32#ifdef CONFIG_LEMOTE_FULONG 32#ifdef CONFIG_LEMOTE_FULOONG2E
33#define CFG_SPACE_REG(offset) (void *)CKSEG1ADDR(BONITO_PCICFG_BASE | (offset)) 33#define CFG_SPACE_REG(offset) (void *)CKSEG1ADDR(BONITO_PCICFG_BASE | (offset))
34#define ID_SEL_BEGIN 11 34#define ID_SEL_BEGIN 11
35#else 35#else
@@ -77,7 +77,7 @@ static int bonito64_pcibios_config_access(unsigned char access_type,
77 addrp = CFG_SPACE_REG(addr & 0xffff); 77 addrp = CFG_SPACE_REG(addr & 0xffff);
78 if (access_type == PCI_ACCESS_WRITE) { 78 if (access_type == PCI_ACCESS_WRITE) {
79 writel(cpu_to_le32(*data), addrp); 79 writel(cpu_to_le32(*data), addrp);
80#ifndef CONFIG_LEMOTE_FULONG 80#ifndef CONFIG_LEMOTE_FULOONG2E
81 /* Wait till done */ 81 /* Wait till done */
82 while (BONITO_PCIMSTAT & 0xF); 82 while (BONITO_PCIMSTAT & 0xF);
83#endif 83#endif
diff --git a/arch/mips/pci/pci-bcm1480.c b/arch/mips/pci/pci-bcm1480.c
index a9060c771840..6f5e24c6ae67 100644
--- a/arch/mips/pci/pci-bcm1480.c
+++ b/arch/mips/pci/pci-bcm1480.c
@@ -57,7 +57,7 @@ static void *cfg_space;
57#define PCI_BUS_ENABLED 1 57#define PCI_BUS_ENABLED 1
58#define PCI_DEVICE_MODE 2 58#define PCI_DEVICE_MODE 2
59 59
60static int bcm1480_bus_status = 0; 60static int bcm1480_bus_status;
61 61
62#define PCI_BRIDGE_DEVICE 0 62#define PCI_BRIDGE_DEVICE 0
63 63
diff --git a/arch/mips/pci/pci-bcm1480ht.c b/arch/mips/pci/pci-bcm1480ht.c
index f54f45412b0b..50cc6e9e8240 100644
--- a/arch/mips/pci/pci-bcm1480ht.c
+++ b/arch/mips/pci/pci-bcm1480ht.c
@@ -56,7 +56,7 @@ static void *ht_cfg_space;
56#define PCI_BUS_ENABLED 1 56#define PCI_BUS_ENABLED 1
57#define PCI_DEVICE_MODE 2 57#define PCI_DEVICE_MODE 2
58 58
59static int bcm1480ht_bus_status = 0; 59static int bcm1480ht_bus_status;
60 60
61#define PCI_BRIDGE_DEVICE 0 61#define PCI_BRIDGE_DEVICE 0
62#define HT_BRIDGE_DEVICE 1 62#define HT_BRIDGE_DEVICE 1
diff --git a/arch/mips/pci/pci-bcm63xx.c b/arch/mips/pci/pci-bcm63xx.c
new file mode 100644
index 000000000000..82e0fde1dba0
--- /dev/null
+++ b/arch/mips/pci/pci-bcm63xx.c
@@ -0,0 +1,224 @@
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) 2008 Maxime Bizon <mbizon@freebox.fr>
7 */
8
9#include <linux/types.h>
10#include <linux/pci.h>
11#include <linux/kernel.h>
12#include <linux/init.h>
13#include <asm/bootinfo.h>
14
15#include "pci-bcm63xx.h"
16
17/*
18 * Allow PCI to be disabled at runtime depending on board nvram
19 * configuration
20 */
21int bcm63xx_pci_enabled;
22
23static struct resource bcm_pci_mem_resource = {
24 .name = "bcm63xx PCI memory space",
25 .start = BCM_PCI_MEM_BASE_PA,
26 .end = BCM_PCI_MEM_END_PA,
27 .flags = IORESOURCE_MEM
28};
29
30static struct resource bcm_pci_io_resource = {
31 .name = "bcm63xx PCI IO space",
32 .start = BCM_PCI_IO_BASE_PA,
33#ifdef CONFIG_CARDBUS
34 .end = BCM_PCI_IO_HALF_PA,
35#else
36 .end = BCM_PCI_IO_END_PA,
37#endif
38 .flags = IORESOURCE_IO
39};
40
41struct pci_controller bcm63xx_controller = {
42 .pci_ops = &bcm63xx_pci_ops,
43 .io_resource = &bcm_pci_io_resource,
44 .mem_resource = &bcm_pci_mem_resource,
45};
46
47/*
48 * We handle cardbus via a fake Cardbus bridge, memory and io spaces
49 * have to be clearly separated from PCI one since we have different
50 * memory decoder.
51 */
52#ifdef CONFIG_CARDBUS
53static struct resource bcm_cb_mem_resource = {
54 .name = "bcm63xx Cardbus memory space",
55 .start = BCM_CB_MEM_BASE_PA,
56 .end = BCM_CB_MEM_END_PA,
57 .flags = IORESOURCE_MEM
58};
59
60static struct resource bcm_cb_io_resource = {
61 .name = "bcm63xx Cardbus IO space",
62 .start = BCM_PCI_IO_HALF_PA + 1,
63 .end = BCM_PCI_IO_END_PA,
64 .flags = IORESOURCE_IO
65};
66
67struct pci_controller bcm63xx_cb_controller = {
68 .pci_ops = &bcm63xx_cb_ops,
69 .io_resource = &bcm_cb_io_resource,
70 .mem_resource = &bcm_cb_mem_resource,
71};
72#endif
73
74static u32 bcm63xx_int_cfg_readl(u32 reg)
75{
76 u32 tmp;
77
78 tmp = reg & MPI_PCICFGCTL_CFGADDR_MASK;
79 tmp |= MPI_PCICFGCTL_WRITEEN_MASK;
80 bcm_mpi_writel(tmp, MPI_PCICFGCTL_REG);
81 iob();
82 return bcm_mpi_readl(MPI_PCICFGDATA_REG);
83}
84
85static void bcm63xx_int_cfg_writel(u32 val, u32 reg)
86{
87 u32 tmp;
88
89 tmp = reg & MPI_PCICFGCTL_CFGADDR_MASK;
90 tmp |= MPI_PCICFGCTL_WRITEEN_MASK;
91 bcm_mpi_writel(tmp, MPI_PCICFGCTL_REG);
92 bcm_mpi_writel(val, MPI_PCICFGDATA_REG);
93}
94
95void __iomem *pci_iospace_start;
96
97static int __init bcm63xx_pci_init(void)
98{
99 unsigned int mem_size;
100 u32 val;
101
102 if (!BCMCPU_IS_6348() && !BCMCPU_IS_6358())
103 return -ENODEV;
104
105 if (!bcm63xx_pci_enabled)
106 return -ENODEV;
107
108 /*
109 * configuration access are done through IO space, remap 4
110 * first bytes to access it from CPU.
111 *
112 * this means that no io access from CPU should happen while
113 * we do a configuration cycle, but there's no way we can add
114 * a spinlock for each io access, so this is currently kind of
115 * broken on SMP.
116 */
117 pci_iospace_start = ioremap_nocache(BCM_PCI_IO_BASE_PA, 4);
118 if (!pci_iospace_start)
119 return -ENOMEM;
120
121 /* setup local bus to PCI access (PCI memory) */
122 val = BCM_PCI_MEM_BASE_PA & MPI_L2P_BASE_MASK;
123 bcm_mpi_writel(val, MPI_L2PMEMBASE1_REG);
124 bcm_mpi_writel(~(BCM_PCI_MEM_SIZE - 1), MPI_L2PMEMRANGE1_REG);
125 bcm_mpi_writel(val | MPI_L2PREMAP_ENABLED_MASK, MPI_L2PMEMREMAP1_REG);
126
127 /* set Cardbus IDSEL (type 0 cfg access on primary bus for
128 * this IDSEL will be done on Cardbus instead) */
129 val = bcm_pcmcia_readl(PCMCIA_C1_REG);
130 val &= ~PCMCIA_C1_CBIDSEL_MASK;
131 val |= (CARDBUS_PCI_IDSEL << PCMCIA_C1_CBIDSEL_SHIFT);
132 bcm_pcmcia_writel(val, PCMCIA_C1_REG);
133
134#ifdef CONFIG_CARDBUS
135 /* setup local bus to PCI access (Cardbus memory) */
136 val = BCM_CB_MEM_BASE_PA & MPI_L2P_BASE_MASK;
137 bcm_mpi_writel(val, MPI_L2PMEMBASE2_REG);
138 bcm_mpi_writel(~(BCM_CB_MEM_SIZE - 1), MPI_L2PMEMRANGE2_REG);
139 val |= MPI_L2PREMAP_ENABLED_MASK | MPI_L2PREMAP_IS_CARDBUS_MASK;
140 bcm_mpi_writel(val, MPI_L2PMEMREMAP2_REG);
141#else
142 /* disable second access windows */
143 bcm_mpi_writel(0, MPI_L2PMEMREMAP2_REG);
144#endif
145
146 /* setup local bus to PCI access (IO memory), we have only 1
147 * IO window for both PCI and cardbus, but it cannot handle
148 * both at the same time, assume standard PCI for now, if
149 * cardbus card has IO zone, PCI fixup will change window to
150 * cardbus */
151 val = BCM_PCI_IO_BASE_PA & MPI_L2P_BASE_MASK;
152 bcm_mpi_writel(val, MPI_L2PIOBASE_REG);
153 bcm_mpi_writel(~(BCM_PCI_IO_SIZE - 1), MPI_L2PIORANGE_REG);
154 bcm_mpi_writel(val | MPI_L2PREMAP_ENABLED_MASK, MPI_L2PIOREMAP_REG);
155
156 /* enable PCI related GPIO pins */
157 bcm_mpi_writel(MPI_LOCBUSCTL_EN_PCI_GPIO_MASK, MPI_LOCBUSCTL_REG);
158
159 /* setup PCI to local bus access, used by PCI device to target
160 * local RAM while bus mastering */
161 bcm63xx_int_cfg_writel(0, PCI_BASE_ADDRESS_3);
162 if (BCMCPU_IS_6358())
163 val = MPI_SP0_REMAP_ENABLE_MASK;
164 else
165 val = 0;
166 bcm_mpi_writel(val, MPI_SP0_REMAP_REG);
167
168 bcm63xx_int_cfg_writel(0x0, PCI_BASE_ADDRESS_4);
169 bcm_mpi_writel(0, MPI_SP1_REMAP_REG);
170
171 mem_size = bcm63xx_get_memory_size();
172
173 /* 6348 before rev b0 exposes only 16 MB of RAM memory through
174 * PCI, throw a warning if we have more memory */
175 if (BCMCPU_IS_6348() && (bcm63xx_get_cpu_rev() & 0xf0) == 0xa0) {
176 if (mem_size > (16 * 1024 * 1024))
177 printk(KERN_WARNING "bcm63xx: this CPU "
178 "revision cannot handle more than 16MB "
179 "of RAM for PCI bus mastering\n");
180 } else {
181 /* setup sp0 range to local RAM size */
182 bcm_mpi_writel(~(mem_size - 1), MPI_SP0_RANGE_REG);
183 bcm_mpi_writel(0, MPI_SP1_RANGE_REG);
184 }
185
186 /* change host bridge retry counter to infinite number of
187 * retry, needed for some broadcom wifi cards with Silicon
188 * Backplane bus where access to srom seems very slow */
189 val = bcm63xx_int_cfg_readl(BCMPCI_REG_TIMERS);
190 val &= ~REG_TIMER_RETRY_MASK;
191 bcm63xx_int_cfg_writel(val, BCMPCI_REG_TIMERS);
192
193 /* enable memory decoder and bus mastering */
194 val = bcm63xx_int_cfg_readl(PCI_COMMAND);
195 val |= (PCI_COMMAND_MEMORY | PCI_COMMAND_MASTER);
196 bcm63xx_int_cfg_writel(val, PCI_COMMAND);
197
198 /* enable read prefetching & disable byte swapping for bus
199 * mastering transfers */
200 val = bcm_mpi_readl(MPI_PCIMODESEL_REG);
201 val &= ~MPI_PCIMODESEL_BAR1_NOSWAP_MASK;
202 val &= ~MPI_PCIMODESEL_BAR2_NOSWAP_MASK;
203 val &= ~MPI_PCIMODESEL_PREFETCH_MASK;
204 val |= (8 << MPI_PCIMODESEL_PREFETCH_SHIFT);
205 bcm_mpi_writel(val, MPI_PCIMODESEL_REG);
206
207 /* enable pci interrupt */
208 val = bcm_mpi_readl(MPI_LOCINT_REG);
209 val |= MPI_LOCINT_MASK(MPI_LOCINT_EXT_PCI_INT);
210 bcm_mpi_writel(val, MPI_LOCINT_REG);
211
212 register_pci_controller(&bcm63xx_controller);
213
214#ifdef CONFIG_CARDBUS
215 register_pci_controller(&bcm63xx_cb_controller);
216#endif
217
218 /* mark memory space used for IO mapping as reserved */
219 request_mem_region(BCM_PCI_IO_BASE_PA, BCM_PCI_IO_SIZE,
220 "bcm63xx PCI IO space");
221 return 0;
222}
223
224arch_initcall(bcm63xx_pci_init);
diff --git a/arch/mips/pci/pci-bcm63xx.h b/arch/mips/pci/pci-bcm63xx.h
new file mode 100644
index 000000000000..a6e594ef3d6a
--- /dev/null
+++ b/arch/mips/pci/pci-bcm63xx.h
@@ -0,0 +1,27 @@
1#ifndef PCI_BCM63XX_H_
2#define PCI_BCM63XX_H_
3
4#include <bcm63xx_cpu.h>
5#include <bcm63xx_io.h>
6#include <bcm63xx_regs.h>
7#include <bcm63xx_dev_pci.h>
8
9/*
10 * Cardbus shares the PCI bus, but has no IDSEL, so a special id is
11 * reserved for it. If you have a standard PCI device at this id, you
12 * need to change the following definition.
13 */
14#define CARDBUS_PCI_IDSEL 0x8
15
16/*
17 * defined in ops-bcm63xx.c
18 */
19extern struct pci_ops bcm63xx_pci_ops;
20extern struct pci_ops bcm63xx_cb_ops;
21
22/*
23 * defined in pci-bcm63xx.c
24 */
25extern void __iomem *pci_iospace_start;
26
27#endif /* ! PCI_BCM63XX_H_ */
diff --git a/arch/mips/pci/pci-sb1250.c b/arch/mips/pci/pci-sb1250.c
index bf639590b8b2..ada24e6f951f 100644
--- a/arch/mips/pci/pci-sb1250.c
+++ b/arch/mips/pci/pci-sb1250.c
@@ -58,7 +58,7 @@ static void *cfg_space;
58#define LDT_BUS_ENABLED 2 58#define LDT_BUS_ENABLED 2
59#define PCI_DEVICE_MODE 4 59#define PCI_DEVICE_MODE 4
60 60
61static int sb1250_bus_status = 0; 61static int sb1250_bus_status;
62 62
63#define PCI_BRIDGE_DEVICE 0 63#define PCI_BRIDGE_DEVICE 0
64#define LDT_BRIDGE_DEVICE 1 64#define LDT_BRIDGE_DEVICE 1
diff --git a/arch/mips/pci/pci.c b/arch/mips/pci/pci.c
index b0eb9e75c682..9a11c2226891 100644
--- a/arch/mips/pci/pci.c
+++ b/arch/mips/pci/pci.c
@@ -31,8 +31,8 @@ unsigned int pci_probe = PCI_ASSIGN_ALL_BUSSES;
31 31
32static struct pci_controller *hose_head, **hose_tail = &hose_head; 32static struct pci_controller *hose_head, **hose_tail = &hose_head;
33 33
34unsigned long PCIBIOS_MIN_IO = 0x0000; 34unsigned long PCIBIOS_MIN_IO;
35unsigned long PCIBIOS_MIN_MEM = 0; 35unsigned long PCIBIOS_MIN_MEM;
36 36
37static int pci_initialized; 37static int pci_initialized;
38 38
diff --git a/arch/mips/power/hibernate.S b/arch/mips/power/hibernate.S
index 4b8174b382d7..0cf86fb32ec3 100644
--- a/arch/mips/power/hibernate.S
+++ b/arch/mips/power/hibernate.S
@@ -8,6 +8,7 @@
8 * Wu Zhangjin <wuzj@lemote.com> 8 * Wu Zhangjin <wuzj@lemote.com>
9 */ 9 */
10#include <asm/asm-offsets.h> 10#include <asm/asm-offsets.h>
11#include <asm/page.h>
11#include <asm/regdef.h> 12#include <asm/regdef.h>
12#include <asm/asm.h> 13#include <asm/asm.h>
13 14
@@ -34,7 +35,7 @@ LEAF(swsusp_arch_resume)
340: 350:
35 PTR_L t1, PBE_ADDRESS(t0) /* source */ 36 PTR_L t1, PBE_ADDRESS(t0) /* source */
36 PTR_L t2, PBE_ORIG_ADDRESS(t0) /* destination */ 37 PTR_L t2, PBE_ORIG_ADDRESS(t0) /* destination */
37 PTR_ADDIU t3, t1, _PAGE_SIZE 38 PTR_ADDIU t3, t1, PAGE_SIZE
381: 391:
39 REG_L t8, (t1) 40 REG_L t8, (t1)
40 REG_S t8, (t2) 41 REG_S t8, (t2)
diff --git a/arch/mips/sgi-ip22/Makefile b/arch/mips/sgi-ip22/Makefile
index ef1564e40c8d..416b18f9fa72 100644
--- a/arch/mips/sgi-ip22/Makefile
+++ b/arch/mips/sgi-ip22/Makefile
@@ -10,4 +10,4 @@ obj-$(CONFIG_SGI_IP22) += ip22-berr.o
10obj-$(CONFIG_SGI_IP28) += ip28-berr.o 10obj-$(CONFIG_SGI_IP28) += ip28-berr.o
11obj-$(CONFIG_EISA) += ip22-eisa.o 11obj-$(CONFIG_EISA) += ip22-eisa.o
12 12
13# EXTRA_CFLAGS += -Werror 13EXTRA_CFLAGS += -Werror
diff --git a/arch/mips/txx9/generic/pci.c b/arch/mips/txx9/generic/pci.c
index 7b637a7c0e66..707cfa9c547d 100644
--- a/arch/mips/txx9/generic/pci.c
+++ b/arch/mips/txx9/generic/pci.c
@@ -341,6 +341,15 @@ static void quirk_slc90e66_ide(struct pci_dev *dev)
341} 341}
342#endif /* CONFIG_TOSHIBA_FPCIB0 */ 342#endif /* CONFIG_TOSHIBA_FPCIB0 */
343 343
344static void tc35815_fixup(struct pci_dev *dev)
345{
346 /* This device may have PM registers but not they are not suported. */
347 if (dev->pm_cap) {
348 dev_info(&dev->dev, "PM disabled\n");
349 dev->pm_cap = 0;
350 }
351}
352
344static void final_fixup(struct pci_dev *dev) 353static void final_fixup(struct pci_dev *dev)
345{ 354{
346 unsigned char bist; 355 unsigned char bist;
@@ -374,6 +383,10 @@ DECLARE_PCI_FIXUP_FINAL(PCI_VENDOR_ID_EFAR, PCI_DEVICE_ID_EFAR_SLC90E66_1,
374DECLARE_PCI_FIXUP_RESUME(PCI_VENDOR_ID_EFAR, PCI_DEVICE_ID_EFAR_SLC90E66_1, 383DECLARE_PCI_FIXUP_RESUME(PCI_VENDOR_ID_EFAR, PCI_DEVICE_ID_EFAR_SLC90E66_1,
375 quirk_slc90e66_ide); 384 quirk_slc90e66_ide);
376#endif 385#endif
386DECLARE_PCI_FIXUP_FINAL(PCI_VENDOR_ID_TOSHIBA_2,
387 PCI_DEVICE_ID_TOSHIBA_TC35815_NWU, tc35815_fixup);
388DECLARE_PCI_FIXUP_FINAL(PCI_VENDOR_ID_TOSHIBA_2,
389 PCI_DEVICE_ID_TOSHIBA_TC35815_TX4939, tc35815_fixup);
377DECLARE_PCI_FIXUP_FINAL(PCI_ANY_ID, PCI_ANY_ID, final_fixup); 390DECLARE_PCI_FIXUP_FINAL(PCI_ANY_ID, PCI_ANY_ID, final_fixup);
378DECLARE_PCI_FIXUP_RESUME(PCI_ANY_ID, PCI_ANY_ID, final_fixup); 391DECLARE_PCI_FIXUP_RESUME(PCI_ANY_ID, PCI_ANY_ID, final_fixup);
379 392
diff --git a/arch/mips/txx9/generic/setup.c b/arch/mips/txx9/generic/setup.c
index a205e2ba8e7b..c860810722c0 100644
--- a/arch/mips/txx9/generic/setup.c
+++ b/arch/mips/txx9/generic/setup.c
@@ -782,7 +782,7 @@ void __init txx9_iocled_init(unsigned long baseaddr,
782 return; 782 return;
783 iocled->mmioaddr = ioremap(baseaddr, 1); 783 iocled->mmioaddr = ioremap(baseaddr, 1);
784 if (!iocled->mmioaddr) 784 if (!iocled->mmioaddr)
785 return; 785 goto out_free;
786 iocled->chip.get = txx9_iocled_get; 786 iocled->chip.get = txx9_iocled_get;
787 iocled->chip.set = txx9_iocled_set; 787 iocled->chip.set = txx9_iocled_set;
788 iocled->chip.direction_input = txx9_iocled_dir_in; 788 iocled->chip.direction_input = txx9_iocled_dir_in;
@@ -791,13 +791,13 @@ void __init txx9_iocled_init(unsigned long baseaddr,
791 iocled->chip.base = basenum; 791 iocled->chip.base = basenum;
792 iocled->chip.ngpio = num; 792 iocled->chip.ngpio = num;
793 if (gpiochip_add(&iocled->chip)) 793 if (gpiochip_add(&iocled->chip))
794 return; 794 goto out_unmap;
795 if (basenum < 0) 795 if (basenum < 0)
796 basenum = iocled->chip.base; 796 basenum = iocled->chip.base;
797 797
798 pdev = platform_device_alloc("leds-gpio", basenum); 798 pdev = platform_device_alloc("leds-gpio", basenum);
799 if (!pdev) 799 if (!pdev)
800 return; 800 goto out_gpio;
801 iocled->pdata.num_leds = num; 801 iocled->pdata.num_leds = num;
802 iocled->pdata.leds = iocled->leds; 802 iocled->pdata.leds = iocled->leds;
803 for (i = 0; i < num; i++) { 803 for (i = 0; i < num; i++) {
@@ -812,7 +812,16 @@ void __init txx9_iocled_init(unsigned long baseaddr,
812 } 812 }
813 pdev->dev.platform_data = &iocled->pdata; 813 pdev->dev.platform_data = &iocled->pdata;
814 if (platform_device_add(pdev)) 814 if (platform_device_add(pdev))
815 platform_device_put(pdev); 815 goto out_pdev;
816 return;
817out_pdev:
818 platform_device_put(pdev);
819out_gpio:
820 gpio_remove(&iocled->chip);
821out_unmap:
822 iounmap(iocled->mmioaddr);
823out_free:
824 kfree(iocled);
816} 825}
817#else /* CONFIG_LEDS_GPIO */ 826#else /* CONFIG_LEDS_GPIO */
818void __init txx9_iocled_init(unsigned long baseaddr, 827void __init txx9_iocled_init(unsigned long baseaddr,
diff --git a/arch/mn10300/include/asm/pci.h b/arch/mn10300/include/asm/pci.h
index 19aecc90f7a4..6095a28561dd 100644
--- a/arch/mn10300/include/asm/pci.h
+++ b/arch/mn10300/include/asm/pci.h
@@ -101,7 +101,18 @@ extern void pcibios_bus_to_resource(struct pci_dev *dev,
101 struct resource *res, 101 struct resource *res,
102 struct pci_bus_region *region); 102 struct pci_bus_region *region);
103 103
104#define pcibios_scan_all_fns(a, b) 0 104static inline struct resource *
105pcibios_select_root(struct pci_dev *pdev, struct resource *res)
106{
107 struct resource *root = NULL;
108
109 if (res->flags & IORESOURCE_IO)
110 root = &ioport_resource;
111 if (res->flags & IORESOURCE_MEM)
112 root = &iomem_resource;
113
114 return root;
115}
105 116
106static inline int pci_get_legacy_ide_irq(struct pci_dev *dev, int channel) 117static inline int pci_get_legacy_ide_irq(struct pci_dev *dev, int channel)
107{ 118{
diff --git a/arch/mn10300/kernel/vmlinux.lds.S b/arch/mn10300/kernel/vmlinux.lds.S
index f4aa07934654..76f41bdb79c4 100644
--- a/arch/mn10300/kernel/vmlinux.lds.S
+++ b/arch/mn10300/kernel/vmlinux.lds.S
@@ -115,12 +115,10 @@ SECTIONS
115 . = ALIGN(PAGE_SIZE); 115 . = ALIGN(PAGE_SIZE);
116 pg0 = .; 116 pg0 = .;
117 117
118 /* Sections to be discarded */
119 /DISCARD/ : {
120 EXIT_CALL
121 }
122
123 STABS_DEBUG 118 STABS_DEBUG
124 119
125 DWARF_DEBUG 120 DWARF_DEBUG
121
122 /* Sections to be discarded */
123 DISCARDS
126} 124}
diff --git a/arch/parisc/include/asm/agp.h b/arch/parisc/include/asm/agp.h
index 9651660da639..d226ffa8fc12 100644
--- a/arch/parisc/include/asm/agp.h
+++ b/arch/parisc/include/asm/agp.h
@@ -11,10 +11,6 @@
11#define unmap_page_from_agp(page) /* nothing */ 11#define unmap_page_from_agp(page) /* nothing */
12#define flush_agp_cache() mb() 12#define flush_agp_cache() mb()
13 13
14/* Convert a physical address to an address suitable for the GART. */
15#define phys_to_gart(x) (x)
16#define gart_to_phys(x) (x)
17
18/* GATT allocation. Returns/accepts GATT kernel virtual address. */ 14/* GATT allocation. Returns/accepts GATT kernel virtual address. */
19#define alloc_gatt_pages(order) \ 15#define alloc_gatt_pages(order) \
20 ((char *)__get_free_pages(GFP_KERNEL, (order))) 16 ((char *)__get_free_pages(GFP_KERNEL, (order)))
diff --git a/arch/parisc/include/asm/pci.h b/arch/parisc/include/asm/pci.h
index 7d842d699df2..64c7aa590ae5 100644
--- a/arch/parisc/include/asm/pci.h
+++ b/arch/parisc/include/asm/pci.h
@@ -233,7 +233,6 @@ static inline void pcibios_register_hba(struct pci_hba_data *x)
233 * rp7420/8420 boxes and then revisit this issue. 233 * rp7420/8420 boxes and then revisit this issue.
234 */ 234 */
235#define pcibios_assign_all_busses() (1) 235#define pcibios_assign_all_busses() (1)
236#define pcibios_scan_all_fns(a, b) (0)
237 236
238#define PCIBIOS_MIN_IO 0x10 237#define PCIBIOS_MIN_IO 0x10
239#define PCIBIOS_MIN_MEM 0x1000 /* NBPG - but pci/setup-res.c dies */ 238#define PCIBIOS_MIN_MEM 0x1000 /* NBPG - but pci/setup-res.c dies */
diff --git a/arch/parisc/kernel/vmlinux.lds.S b/arch/parisc/kernel/vmlinux.lds.S
index fd2cc4fd2b65..aea1784edbd1 100644
--- a/arch/parisc/kernel/vmlinux.lds.S
+++ b/arch/parisc/kernel/vmlinux.lds.S
@@ -237,9 +237,12 @@ SECTIONS
237 /* freed after init ends here */ 237 /* freed after init ends here */
238 _end = . ; 238 _end = . ;
239 239
240 STABS_DEBUG
241 .note 0 : { *(.note) }
242
240 /* Sections to be discarded */ 243 /* Sections to be discarded */
244 DISCARDS
241 /DISCARD/ : { 245 /DISCARD/ : {
242 *(.exitcall.exit)
243#ifdef CONFIG_64BIT 246#ifdef CONFIG_64BIT
244 /* temporary hack until binutils is fixed to not emit these 247 /* temporary hack until binutils is fixed to not emit these
245 * for static binaries 248 * for static binaries
@@ -252,7 +255,4 @@ SECTIONS
252 *(.gnu.hash) 255 *(.gnu.hash)
253#endif 256#endif
254 } 257 }
255
256 STABS_DEBUG
257 .note 0 : { *(.note) }
258} 258}
diff --git a/arch/powerpc/Kconfig b/arch/powerpc/Kconfig
index d00131ca0835..8250902265c6 100644
--- a/arch/powerpc/Kconfig
+++ b/arch/powerpc/Kconfig
@@ -49,6 +49,9 @@ config GENERIC_HARDIRQS_NO__DO_IRQ
49config HAVE_SETUP_PER_CPU_AREA 49config HAVE_SETUP_PER_CPU_AREA
50 def_bool PPC64 50 def_bool PPC64
51 51
52config NEED_PER_CPU_EMBED_FIRST_CHUNK
53 def_bool PPC64
54
52config IRQ_PER_CPU 55config IRQ_PER_CPU
53 bool 56 bool
54 default y 57 default y
@@ -120,7 +123,8 @@ config PPC
120 select HAVE_KRETPROBES 123 select HAVE_KRETPROBES
121 select HAVE_ARCH_TRACEHOOK 124 select HAVE_ARCH_TRACEHOOK
122 select HAVE_LMB 125 select HAVE_LMB
123 select HAVE_DMA_ATTRS if PPC64 126 select HAVE_DMA_ATTRS
127 select HAVE_DMA_API_DEBUG
124 select USE_GENERIC_SMP_HELPERS if SMP 128 select USE_GENERIC_SMP_HELPERS if SMP
125 select HAVE_OPROFILE 129 select HAVE_OPROFILE
126 select HAVE_SYSCALL_WRAPPERS if PPC64 130 select HAVE_SYSCALL_WRAPPERS if PPC64
@@ -307,10 +311,6 @@ config SWIOTLB
307 platforms where the size of a physical address is larger 311 platforms where the size of a physical address is larger
308 than the bus address. Not all platforms support this. 312 than the bus address. Not all platforms support this.
309 313
310config PPC_NEED_DMA_SYNC_OPS
311 def_bool y
312 depends on (NOT_COHERENT_CACHE || SWIOTLB)
313
314config HOTPLUG_CPU 314config HOTPLUG_CPU
315 bool "Support for enabling/disabling CPUs" 315 bool "Support for enabling/disabling CPUs"
316 depends on SMP && HOTPLUG && EXPERIMENTAL && (PPC_PSERIES || PPC_PMAC) 316 depends on SMP && HOTPLUG && EXPERIMENTAL && (PPC_PSERIES || PPC_PMAC)
@@ -472,7 +472,7 @@ config PPC_16K_PAGES
472 bool "16k page size" if 44x 472 bool "16k page size" if 44x
473 473
474config PPC_64K_PAGES 474config PPC_64K_PAGES
475 bool "64k page size" if 44x || PPC_STD_MMU_64 475 bool "64k page size" if 44x || PPC_STD_MMU_64 || PPC_BOOK3E_64
476 select PPC_HAS_HASH_64K if PPC_STD_MMU_64 476 select PPC_HAS_HASH_64K if PPC_STD_MMU_64
477 477
478config PPC_256K_PAGES 478config PPC_256K_PAGES
@@ -492,16 +492,16 @@ endchoice
492 492
493config FORCE_MAX_ZONEORDER 493config FORCE_MAX_ZONEORDER
494 int "Maximum zone order" 494 int "Maximum zone order"
495 range 9 64 if PPC_STD_MMU_64 && PPC_64K_PAGES 495 range 9 64 if PPC64 && PPC_64K_PAGES
496 default "9" if PPC_STD_MMU_64 && PPC_64K_PAGES 496 default "9" if PPC64 && PPC_64K_PAGES
497 range 13 64 if PPC_STD_MMU_64 && !PPC_64K_PAGES 497 range 13 64 if PPC64 && !PPC_64K_PAGES
498 default "13" if PPC_STD_MMU_64 && !PPC_64K_PAGES 498 default "13" if PPC64 && !PPC_64K_PAGES
499 range 9 64 if PPC_STD_MMU_32 && PPC_16K_PAGES 499 range 9 64 if PPC32 && PPC_16K_PAGES
500 default "9" if PPC_STD_MMU_32 && PPC_16K_PAGES 500 default "9" if PPC32 && PPC_16K_PAGES
501 range 7 64 if PPC_STD_MMU_32 && PPC_64K_PAGES 501 range 7 64 if PPC32 && PPC_64K_PAGES
502 default "7" if PPC_STD_MMU_32 && PPC_64K_PAGES 502 default "7" if PPC32 && PPC_64K_PAGES
503 range 5 64 if PPC_STD_MMU_32 && PPC_256K_PAGES 503 range 5 64 if PPC32 && PPC_256K_PAGES
504 default "5" if PPC_STD_MMU_32 && PPC_256K_PAGES 504 default "5" if PPC32 && PPC_256K_PAGES
505 range 11 64 505 range 11 64
506 default "11" 506 default "11"
507 help 507 help
diff --git a/arch/powerpc/Makefile b/arch/powerpc/Makefile
index bc35f4e2b81c..952a3963e9e8 100644
--- a/arch/powerpc/Makefile
+++ b/arch/powerpc/Makefile
@@ -77,7 +77,7 @@ CPP = $(CC) -E $(KBUILD_CFLAGS)
77CHECKFLAGS += -m$(CONFIG_WORD_SIZE) -D__powerpc__ -D__powerpc$(CONFIG_WORD_SIZE)__ 77CHECKFLAGS += -m$(CONFIG_WORD_SIZE) -D__powerpc__ -D__powerpc$(CONFIG_WORD_SIZE)__
78 78
79ifeq ($(CONFIG_PPC64),y) 79ifeq ($(CONFIG_PPC64),y)
80GCC_BROKEN_VEC := $(shell if [ $(call cc-version) -lt 0400 ] ; then echo "y"; fi) 80GCC_BROKEN_VEC := $(call cc-ifversion, -lt, 0400, y)
81 81
82ifeq ($(CONFIG_POWER4_ONLY),y) 82ifeq ($(CONFIG_POWER4_ONLY),y)
83ifeq ($(CONFIG_ALTIVEC),y) 83ifeq ($(CONFIG_ALTIVEC),y)
diff --git a/arch/powerpc/boot/4xx.c b/arch/powerpc/boot/4xx.c
index 325b310573b9..27db8938827a 100644
--- a/arch/powerpc/boot/4xx.c
+++ b/arch/powerpc/boot/4xx.c
@@ -8,6 +8,10 @@
8 * Eugene Surovegin <eugene.surovegin@zultys.com> or <ebs@ebshome.net> 8 * Eugene Surovegin <eugene.surovegin@zultys.com> or <ebs@ebshome.net>
9 * Copyright (c) 2003, 2004 Zultys Technologies 9 * Copyright (c) 2003, 2004 Zultys Technologies
10 * 10 *
11 * Copyright (C) 2009 Wind River Systems, Inc.
12 * Updated for supporting PPC405EX on Kilauea.
13 * Tiejun Chen <tiejun.chen@windriver.com>
14 *
11 * This program is free software; you can redistribute it and/or 15 * This program is free software; you can redistribute it and/or
12 * modify it under the terms of the GNU General Public License 16 * modify it under the terms of the GNU General Public License
13 * as published by the Free Software Foundation; either version 17 * as published by the Free Software Foundation; either version
@@ -659,3 +663,141 @@ void ibm405ep_fixup_clocks(unsigned int sys_clk)
659 dt_fixup_clock("/plb/opb/serial@ef600300", uart0); 663 dt_fixup_clock("/plb/opb/serial@ef600300", uart0);
660 dt_fixup_clock("/plb/opb/serial@ef600400", uart1); 664 dt_fixup_clock("/plb/opb/serial@ef600400", uart1);
661} 665}
666
667static u8 ibm405ex_fwdv_multi_bits[] = {
668 /* values for: 1 - 16 */
669 0x01, 0x02, 0x0e, 0x09, 0x04, 0x0b, 0x10, 0x0d, 0x0c, 0x05,
670 0x06, 0x0f, 0x0a, 0x07, 0x08, 0x03
671};
672
673u32 ibm405ex_get_fwdva(unsigned long cpr_fwdv)
674{
675 u32 index;
676
677 for (index = 0; index < ARRAY_SIZE(ibm405ex_fwdv_multi_bits); index++)
678 if (cpr_fwdv == (u32)ibm405ex_fwdv_multi_bits[index])
679 return index + 1;
680
681 return 0;
682}
683
684static u8 ibm405ex_fbdv_multi_bits[] = {
685 /* values for: 1 - 100 */
686 0x00, 0xff, 0x7e, 0xfd, 0x7a, 0xf5, 0x6a, 0xd5, 0x2a, 0xd4,
687 0x29, 0xd3, 0x26, 0xcc, 0x19, 0xb3, 0x67, 0xce, 0x1d, 0xbb,
688 0x77, 0xee, 0x5d, 0xba, 0x74, 0xe9, 0x52, 0xa5, 0x4b, 0x96,
689 0x2c, 0xd8, 0x31, 0xe3, 0x46, 0x8d, 0x1b, 0xb7, 0x6f, 0xde,
690 0x3d, 0xfb, 0x76, 0xed, 0x5a, 0xb5, 0x6b, 0xd6, 0x2d, 0xdb,
691 0x36, 0xec, 0x59, 0xb2, 0x64, 0xc9, 0x12, 0xa4, 0x48, 0x91,
692 0x23, 0xc7, 0x0e, 0x9c, 0x38, 0xf0, 0x61, 0xc2, 0x05, 0x8b,
693 0x17, 0xaf, 0x5f, 0xbe, 0x7c, 0xf9, 0x72, 0xe5, 0x4a, 0x95,
694 0x2b, 0xd7, 0x2e, 0xdc, 0x39, 0xf3, 0x66, 0xcd, 0x1a, 0xb4,
695 0x68, 0xd1, 0x22, 0xc4, 0x09, 0x93, 0x27, 0xcf, 0x1e, 0xbc,
696 /* values for: 101 - 200 */
697 0x78, 0xf1, 0x62, 0xc5, 0x0a, 0x94, 0x28, 0xd0, 0x21, 0xc3,
698 0x06, 0x8c, 0x18, 0xb0, 0x60, 0xc1, 0x02, 0x84, 0x08, 0x90,
699 0x20, 0xc0, 0x01, 0x83, 0x07, 0x8f, 0x1f, 0xbf, 0x7f, 0xfe,
700 0x7d, 0xfa, 0x75, 0xea, 0x55, 0xaa, 0x54, 0xa9, 0x53, 0xa6,
701 0x4c, 0x99, 0x33, 0xe7, 0x4e, 0x9d, 0x3b, 0xf7, 0x6e, 0xdd,
702 0x3a, 0xf4, 0x69, 0xd2, 0x25, 0xcb, 0x16, 0xac, 0x58, 0xb1,
703 0x63, 0xc6, 0x0d, 0x9b, 0x37, 0xef, 0x5e, 0xbd, 0x7b, 0xf6,
704 0x6d, 0xda, 0x35, 0xeb, 0x56, 0xad, 0x5b, 0xb6, 0x6c, 0xd9,
705 0x32, 0xe4, 0x49, 0x92, 0x24, 0xc8, 0x11, 0xa3, 0x47, 0x8e,
706 0x1c, 0xb8, 0x70, 0xe1, 0x42, 0x85, 0x0b, 0x97, 0x2f, 0xdf,
707 /* values for: 201 - 255 */
708 0x3e, 0xfc, 0x79, 0xf2, 0x65, 0xca, 0x15, 0xab, 0x57, 0xae,
709 0x5c, 0xb9, 0x73, 0xe6, 0x4d, 0x9a, 0x34, 0xe8, 0x51, 0xa2,
710 0x44, 0x89, 0x13, 0xa7, 0x4f, 0x9e, 0x3c, 0xf8, 0x71, 0xe2,
711 0x45, 0x8a, 0x14, 0xa8, 0x50, 0xa1, 0x43, 0x86, 0x0c, 0x98,
712 0x30, 0xe0, 0x41, 0x82, 0x04, 0x88, 0x10, 0xa0, 0x40, 0x81,
713 0x03, 0x87, 0x0f, 0x9f, 0x3f /* END */
714};
715
716u32 ibm405ex_get_fbdv(unsigned long cpr_fbdv)
717{
718 u32 index;
719
720 for (index = 0; index < ARRAY_SIZE(ibm405ex_fbdv_multi_bits); index++)
721 if (cpr_fbdv == (u32)ibm405ex_fbdv_multi_bits[index])
722 return index + 1;
723
724 return 0;
725}
726
727void ibm405ex_fixup_clocks(unsigned int sys_clk, unsigned int uart_clk)
728{
729 /* PLL config */
730 u32 pllc = CPR0_READ(DCRN_CPR0_PLLC);
731 u32 plld = CPR0_READ(DCRN_CPR0_PLLD);
732 u32 cpud = CPR0_READ(DCRN_CPR0_PRIMAD);
733 u32 plbd = CPR0_READ(DCRN_CPR0_PRIMBD);
734 u32 opbd = CPR0_READ(DCRN_CPR0_OPBD);
735 u32 perd = CPR0_READ(DCRN_CPR0_PERD);
736
737 /* Dividers */
738 u32 fbdv = ibm405ex_get_fbdv(__fix_zero((plld >> 24) & 0xff, 1));
739
740 u32 fwdva = ibm405ex_get_fwdva(__fix_zero((plld >> 16) & 0x0f, 1));
741
742 u32 cpudv0 = __fix_zero((cpud >> 24) & 7, 8);
743
744 /* PLBDV0 is hardwared to 010. */
745 u32 plbdv0 = 2;
746 u32 plb2xdv0 = __fix_zero((plbd >> 16) & 7, 8);
747
748 u32 opbdv0 = __fix_zero((opbd >> 24) & 3, 4);
749
750 u32 perdv0 = __fix_zero((perd >> 24) & 3, 4);
751
752 /* Resulting clocks */
753 u32 cpu, plb, opb, ebc, vco, tb, uart0, uart1;
754
755 /* PLL's VCO is the source for primary forward ? */
756 if (pllc & 0x40000000) {
757 u32 m;
758
759 /* Feedback path */
760 switch ((pllc >> 24) & 7) {
761 case 0:
762 /* PLLOUTx */
763 m = fbdv;
764 break;
765 case 1:
766 /* CPU */
767 m = fbdv * fwdva * cpudv0;
768 break;
769 case 5:
770 /* PERClk */
771 m = fbdv * fwdva * plb2xdv0 * plbdv0 * opbdv0 * perdv0;
772 break;
773 default:
774 printf("WARNING ! Invalid PLL feedback source !\n");
775 goto bypass;
776 }
777
778 vco = (unsigned int)(sys_clk * m);
779 } else {
780bypass:
781 /* Bypass system PLL */
782 vco = 0;
783 }
784
785 /* CPU = VCO / ( FWDVA x CPUDV0) */
786 cpu = vco / (fwdva * cpudv0);
787 /* PLB = VCO / ( FWDVA x PLB2XDV0 x PLBDV0) */
788 plb = vco / (fwdva * plb2xdv0 * plbdv0);
789 /* OPB = PLB / OPBDV0 */
790 opb = plb / opbdv0;
791 /* EBC = OPB / PERDV0 */
792 ebc = opb / perdv0;
793
794 tb = cpu;
795 uart0 = uart1 = uart_clk;
796
797 dt_fixup_cpu_clocks(cpu, tb, 0);
798 dt_fixup_clock("/plb", plb);
799 dt_fixup_clock("/plb/opb", opb);
800 dt_fixup_clock("/plb/opb/ebc", ebc);
801 dt_fixup_clock("/plb/opb/serial@ef600200", uart0);
802 dt_fixup_clock("/plb/opb/serial@ef600300", uart1);
803}
diff --git a/arch/powerpc/boot/4xx.h b/arch/powerpc/boot/4xx.h
index 2606e64f0c4b..7dc5d45361bc 100644
--- a/arch/powerpc/boot/4xx.h
+++ b/arch/powerpc/boot/4xx.h
@@ -21,6 +21,7 @@ void ibm4xx_fixup_ebc_ranges(const char *ebc);
21 21
22void ibm405gp_fixup_clocks(unsigned int sys_clk, unsigned int ser_clk); 22void ibm405gp_fixup_clocks(unsigned int sys_clk, unsigned int ser_clk);
23void ibm405ep_fixup_clocks(unsigned int sys_clk); 23void ibm405ep_fixup_clocks(unsigned int sys_clk);
24void ibm405ex_fixup_clocks(unsigned int sys_clk, unsigned int uart_clk);
24void ibm440gp_fixup_clocks(unsigned int sys_clk, unsigned int ser_clk); 25void ibm440gp_fixup_clocks(unsigned int sys_clk, unsigned int ser_clk);
25void ibm440ep_fixup_clocks(unsigned int sys_clk, unsigned int ser_clk, 26void ibm440ep_fixup_clocks(unsigned int sys_clk, unsigned int ser_clk,
26 unsigned int tmr_clk); 27 unsigned int tmr_clk);
diff --git a/arch/powerpc/boot/Makefile b/arch/powerpc/boot/Makefile
index 9ae7b7e2ba71..7bfc8ad87798 100644
--- a/arch/powerpc/boot/Makefile
+++ b/arch/powerpc/boot/Makefile
@@ -39,6 +39,7 @@ DTS_FLAGS ?= -p 1024
39 39
40$(obj)/4xx.o: BOOTCFLAGS += -mcpu=405 40$(obj)/4xx.o: BOOTCFLAGS += -mcpu=405
41$(obj)/ebony.o: BOOTCFLAGS += -mcpu=405 41$(obj)/ebony.o: BOOTCFLAGS += -mcpu=405
42$(obj)/cuboot-hotfoot.o: BOOTCFLAGS += -mcpu=405
42$(obj)/cuboot-taishan.o: BOOTCFLAGS += -mcpu=405 43$(obj)/cuboot-taishan.o: BOOTCFLAGS += -mcpu=405
43$(obj)/cuboot-katmai.o: BOOTCFLAGS += -mcpu=405 44$(obj)/cuboot-katmai.o: BOOTCFLAGS += -mcpu=405
44$(obj)/cuboot-acadia.o: BOOTCFLAGS += -mcpu=405 45$(obj)/cuboot-acadia.o: BOOTCFLAGS += -mcpu=405
@@ -67,7 +68,7 @@ src-wlib := string.S crt0.S crtsavres.S stdio.c main.c \
67 cpm-serial.c stdlib.c mpc52xx-psc.c planetcore.c uartlite.c \ 68 cpm-serial.c stdlib.c mpc52xx-psc.c planetcore.c uartlite.c \
68 fsl-soc.c mpc8xx.c pq2.c 69 fsl-soc.c mpc8xx.c pq2.c
69src-plat := of.c cuboot-52xx.c cuboot-824x.c cuboot-83xx.c cuboot-85xx.c holly.c \ 70src-plat := of.c cuboot-52xx.c cuboot-824x.c cuboot-83xx.c cuboot-85xx.c holly.c \
70 cuboot-ebony.c treeboot-ebony.c prpmc2800.c \ 71 cuboot-ebony.c cuboot-hotfoot.c treeboot-ebony.c prpmc2800.c \
71 ps3-head.S ps3-hvcall.S ps3.c treeboot-bamboo.c cuboot-8xx.c \ 72 ps3-head.S ps3-hvcall.S ps3.c treeboot-bamboo.c cuboot-8xx.c \
72 cuboot-pq2.c cuboot-sequoia.c treeboot-walnut.c \ 73 cuboot-pq2.c cuboot-sequoia.c treeboot-walnut.c \
73 cuboot-bamboo.c cuboot-mpc7448hpc2.c cuboot-taishan.c \ 74 cuboot-bamboo.c cuboot-mpc7448hpc2.c cuboot-taishan.c \
@@ -75,7 +76,7 @@ src-plat := of.c cuboot-52xx.c cuboot-824x.c cuboot-83xx.c cuboot-85xx.c holly.c
75 cuboot-katmai.c cuboot-rainier.c redboot-8xx.c ep8248e.c \ 76 cuboot-katmai.c cuboot-rainier.c redboot-8xx.c ep8248e.c \
76 cuboot-warp.c cuboot-85xx-cpm2.c cuboot-yosemite.c simpleboot.c \ 77 cuboot-warp.c cuboot-85xx-cpm2.c cuboot-yosemite.c simpleboot.c \
77 virtex405-head.S virtex.c redboot-83xx.c cuboot-sam440ep.c \ 78 virtex405-head.S virtex.c redboot-83xx.c cuboot-sam440ep.c \
78 cuboot-acadia.c cuboot-amigaone.c 79 cuboot-acadia.c cuboot-amigaone.c cuboot-kilauea.c
79src-boot := $(src-wlib) $(src-plat) empty.c 80src-boot := $(src-wlib) $(src-plat) empty.c
80 81
81src-boot := $(addprefix $(obj)/, $(src-boot)) 82src-boot := $(addprefix $(obj)/, $(src-boot))
@@ -190,6 +191,7 @@ image-$(CONFIG_DEFAULT_UIMAGE) += uImage
190 191
191# Board ports in arch/powerpc/platform/40x/Kconfig 192# Board ports in arch/powerpc/platform/40x/Kconfig
192image-$(CONFIG_EP405) += dtbImage.ep405 193image-$(CONFIG_EP405) += dtbImage.ep405
194image-$(CONFIG_HOTFOOT) += cuImage.hotfoot
193image-$(CONFIG_WALNUT) += treeImage.walnut 195image-$(CONFIG_WALNUT) += treeImage.walnut
194image-$(CONFIG_ACADIA) += cuImage.acadia 196image-$(CONFIG_ACADIA) += cuImage.acadia
195 197
diff --git a/arch/powerpc/boot/cuboot-hotfoot.c b/arch/powerpc/boot/cuboot-hotfoot.c
new file mode 100644
index 000000000000..8f697b958e45
--- /dev/null
+++ b/arch/powerpc/boot/cuboot-hotfoot.c
@@ -0,0 +1,142 @@
1/*
2 * Old U-boot compatibility for Esteem 195E Hotfoot CPU Board
3 *
4 * Author: Solomon Peachy <solomon@linux-wlan.com>
5 *
6 * This program is free software; you can redistribute it and/or modify it
7 * under the terms of the GNU General Public License version 2 as published
8 * by the Free Software Foundation.
9 */
10
11#include "ops.h"
12#include "stdio.h"
13#include "reg.h"
14#include "dcr.h"
15#include "4xx.h"
16#include "cuboot.h"
17
18#define TARGET_4xx
19#define TARGET_HOTFOOT
20
21#include "ppcboot-hotfoot.h"
22
23static bd_t bd;
24
25#define NUM_REGS 3
26
27static void hotfoot_fixups(void)
28{
29 u32 uart = mfdcr(DCRN_CPC0_UCR) & 0x7f;
30
31 dt_fixup_memory(bd.bi_memstart, bd.bi_memsize);
32
33 dt_fixup_cpu_clocks(bd.bi_procfreq, bd.bi_procfreq, 0);
34 dt_fixup_clock("/plb", bd.bi_plb_busfreq);
35 dt_fixup_clock("/plb/opb", bd.bi_opbfreq);
36 dt_fixup_clock("/plb/ebc", bd.bi_pci_busfreq);
37 dt_fixup_clock("/plb/opb/serial@ef600300", bd.bi_procfreq / uart);
38 dt_fixup_clock("/plb/opb/serial@ef600400", bd.bi_procfreq / uart);
39
40 dt_fixup_mac_address_by_alias("ethernet0", bd.bi_enetaddr);
41 dt_fixup_mac_address_by_alias("ethernet1", bd.bi_enet1addr);
42
43 /* Is this a single eth/serial board? */
44 if ((bd.bi_enet1addr[0] == 0) &&
45 (bd.bi_enet1addr[1] == 0) &&
46 (bd.bi_enet1addr[2] == 0) &&
47 (bd.bi_enet1addr[3] == 0) &&
48 (bd.bi_enet1addr[4] == 0) &&
49 (bd.bi_enet1addr[5] == 0)) {
50 void *devp;
51
52 printf("Trimming devtree for single serial/eth board\n");
53
54 devp = finddevice("/plb/opb/serial@ef600300");
55 if (!devp)
56 fatal("Can't find node for /plb/opb/serial@ef600300");
57 del_node(devp);
58
59 devp = finddevice("/plb/opb/ethernet@ef600900");
60 if (!devp)
61 fatal("Can't find node for /plb/opb/ethernet@ef600900");
62 del_node(devp);
63 }
64
65 ibm4xx_quiesce_eth((u32 *)0xef600800, (u32 *)0xef600900);
66
67 /* Fix up flash size in fdt for 4M boards. */
68 if (bd.bi_flashsize < 0x800000) {
69 u32 regs[NUM_REGS];
70 void *devp = finddevice("/plb/ebc/nor_flash@0");
71 if (!devp)
72 fatal("Can't find FDT node for nor_flash!??");
73
74 printf("Fixing devtree for 4M Flash\n");
75
76 /* First fix up the base addresse */
77 getprop(devp, "reg", regs, sizeof(regs));
78 regs[0] = 0;
79 regs[1] = 0xffc00000;
80 regs[2] = 0x00400000;
81 setprop(devp, "reg", regs, sizeof(regs));
82
83 /* Then the offsets */
84 devp = finddevice("/plb/ebc/nor_flash@0/partition@0");
85 if (!devp)
86 fatal("Can't find FDT node for partition@0");
87 getprop(devp, "reg", regs, 2*sizeof(u32));
88 regs[0] -= 0x400000;
89 setprop(devp, "reg", regs, 2*sizeof(u32));
90
91 devp = finddevice("/plb/ebc/nor_flash@0/partition@1");
92 if (!devp)
93 fatal("Can't find FDT node for partition@1");
94 getprop(devp, "reg", regs, 2*sizeof(u32));
95 regs[0] -= 0x400000;
96 setprop(devp, "reg", regs, 2*sizeof(u32));
97
98 devp = finddevice("/plb/ebc/nor_flash@0/partition@2");
99 if (!devp)
100 fatal("Can't find FDT node for partition@2");
101 getprop(devp, "reg", regs, 2*sizeof(u32));
102 regs[0] -= 0x400000;
103 setprop(devp, "reg", regs, 2*sizeof(u32));
104
105 devp = finddevice("/plb/ebc/nor_flash@0/partition@3");
106 if (!devp)
107 fatal("Can't find FDT node for partition@3");
108 getprop(devp, "reg", regs, 2*sizeof(u32));
109 regs[0] -= 0x400000;
110 setprop(devp, "reg", regs, 2*sizeof(u32));
111
112 devp = finddevice("/plb/ebc/nor_flash@0/partition@4");
113 if (!devp)
114 fatal("Can't find FDT node for partition@4");
115 getprop(devp, "reg", regs, 2*sizeof(u32));
116 regs[0] -= 0x400000;
117 setprop(devp, "reg", regs, 2*sizeof(u32));
118
119 devp = finddevice("/plb/ebc/nor_flash@0/partition@6");
120 if (!devp)
121 fatal("Can't find FDT node for partition@6");
122 getprop(devp, "reg", regs, 2*sizeof(u32));
123 regs[0] -= 0x400000;
124 setprop(devp, "reg", regs, 2*sizeof(u32));
125
126 /* Delete the FeatFS node */
127 devp = finddevice("/plb/ebc/nor_flash@0/partition@5");
128 if (!devp)
129 fatal("Can't find FDT node for partition@5");
130 del_node(devp);
131 }
132}
133
134void platform_init(unsigned long r3, unsigned long r4, unsigned long r5,
135 unsigned long r6, unsigned long r7)
136{
137 CUBOOT_INIT();
138 platform_ops.fixups = hotfoot_fixups;
139 platform_ops.exit = ibm40x_dbcr_reset;
140 fdt_init(_dtb_start);
141 serial_console_init();
142}
diff --git a/arch/powerpc/boot/cuboot-kilauea.c b/arch/powerpc/boot/cuboot-kilauea.c
new file mode 100644
index 000000000000..80cdad6bbc3f
--- /dev/null
+++ b/arch/powerpc/boot/cuboot-kilauea.c
@@ -0,0 +1,49 @@
1/*
2 * Old U-boot compatibility for PPC405EX. This image is already included
3 * a dtb.
4 *
5 * Author: Tiejun Chen <tiejun.chen@windriver.com>
6 *
7 * Copyright (C) 2009 Wind River Systems, Inc.
8 *
9 * This program is free software; you can redistribute it and/or modify it
10 * under the terms of the GNU General Public License version 2 as published
11 * by the Free Software Foundation.
12 */
13
14#include "ops.h"
15#include "io.h"
16#include "dcr.h"
17#include "stdio.h"
18#include "4xx.h"
19#include "44x.h"
20#include "cuboot.h"
21
22#define TARGET_4xx
23#define TARGET_44x
24#include "ppcboot.h"
25
26#define KILAUEA_SYS_EXT_SERIAL_CLOCK 11059200 /* ext. 11.059MHz clk */
27
28static bd_t bd;
29
30static void kilauea_fixups(void)
31{
32 unsigned long sysclk = 33333333;
33
34 ibm405ex_fixup_clocks(sysclk, KILAUEA_SYS_EXT_SERIAL_CLOCK);
35 dt_fixup_memory(bd.bi_memstart, bd.bi_memsize);
36 ibm4xx_fixup_ebc_ranges("/plb/opb/ebc");
37 dt_fixup_mac_address_by_alias("ethernet0", bd.bi_enetaddr);
38 dt_fixup_mac_address_by_alias("ethernet1", bd.bi_enet1addr);
39}
40
41void platform_init(unsigned long r3, unsigned long r4, unsigned long r5,
42 unsigned long r6, unsigned long r7)
43{
44 CUBOOT_INIT();
45 platform_ops.fixups = kilauea_fixups;
46 platform_ops.exit = ibm40x_dbcr_reset;
47 fdt_init(_dtb_start);
48 serial_console_init();
49}
diff --git a/arch/powerpc/boot/dcr.h b/arch/powerpc/boot/dcr.h
index 95b9f5344016..645a7c964e5f 100644
--- a/arch/powerpc/boot/dcr.h
+++ b/arch/powerpc/boot/dcr.h
@@ -153,9 +153,7 @@ static const unsigned long sdram_bxcr[] = { SDRAM0_B0CR, SDRAM0_B1CR,
153#define DCRN_CPC0_PLLMR1 0xf4 153#define DCRN_CPC0_PLLMR1 0xf4
154#define DCRN_CPC0_UCR 0xf5 154#define DCRN_CPC0_UCR 0xf5
155 155
156/* 440GX Clock control etc */ 156/* 440GX/405EX Clock Control reg */
157
158
159#define DCRN_CPR0_CLKUPD 0x020 157#define DCRN_CPR0_CLKUPD 0x020
160#define DCRN_CPR0_PLLC 0x040 158#define DCRN_CPR0_PLLC 0x040
161#define DCRN_CPR0_PLLD 0x060 159#define DCRN_CPR0_PLLD 0x060
diff --git a/arch/powerpc/boot/dts/arches.dts b/arch/powerpc/boot/dts/arches.dts
index d9113b1e8c1d..414ef8b7e575 100644
--- a/arch/powerpc/boot/dts/arches.dts
+++ b/arch/powerpc/boot/dts/arches.dts
@@ -124,6 +124,16 @@
124 dcr-reg = <0x00c 0x002>; 124 dcr-reg = <0x00c 0x002>;
125 }; 125 };
126 126
127 L2C0: l2c {
128 compatible = "ibm,l2-cache-460gt", "ibm,l2-cache";
129 dcr-reg = <0x020 0x008 /* Internal SRAM DCR's */
130 0x030 0x008>; /* L2 cache DCR's */
131 cache-line-size = <32>; /* 32 bytes */
132 cache-size = <262144>; /* L2, 256K */
133 interrupt-parent = <&UIC1>;
134 interrupts = <11 1>;
135 };
136
127 plb { 137 plb {
128 compatible = "ibm,plb-460gt", "ibm,plb4"; 138 compatible = "ibm,plb-460gt", "ibm,plb4";
129 #address-cells = <2>; 139 #address-cells = <2>;
@@ -168,6 +178,38 @@
168 /* ranges property is supplied by U-Boot */ 178 /* ranges property is supplied by U-Boot */
169 interrupts = <0x6 0x4>; 179 interrupts = <0x6 0x4>;
170 interrupt-parent = <&UIC1>; 180 interrupt-parent = <&UIC1>;
181
182 nor_flash@0,0 {
183 compatible = "amd,s29gl256n", "cfi-flash";
184 bank-width = <2>;
185 reg = <0x00000000 0x00000000 0x02000000>;
186 #address-cells = <1>;
187 #size-cells = <1>;
188 partition@0 {
189 label = "kernel";
190 reg = <0x00000000 0x001e0000>;
191 };
192 partition@1e0000 {
193 label = "dtb";
194 reg = <0x001e0000 0x00020000>;
195 };
196 partition@200000 {
197 label = "root";
198 reg = <0x00200000 0x00200000>;
199 };
200 partition@400000 {
201 label = "user";
202 reg = <0x00400000 0x01b60000>;
203 };
204 partition@1f60000 {
205 label = "env";
206 reg = <0x01f60000 0x00040000>;
207 };
208 partition@1fa0000 {
209 label = "u-boot";
210 reg = <0x01fa0000 0x00060000>;
211 };
212 };
171 }; 213 };
172 214
173 UART0: serial@ef600300 { 215 UART0: serial@ef600300 {
@@ -186,6 +228,14 @@
186 reg = <0xef600700 0x00000014>; 228 reg = <0xef600700 0x00000014>;
187 interrupt-parent = <&UIC0>; 229 interrupt-parent = <&UIC0>;
188 interrupts = <0x2 0x4>; 230 interrupts = <0x2 0x4>;
231 #address-cells = <1>;
232 #size-cells = <0>;
233 sttm@4a {
234 compatible = "ad,ad7414";
235 reg = <0x4a>;
236 interrupt-parent = <&UIC1>;
237 interrupts = <0x0 0x8>;
238 };
189 }; 239 };
190 240
191 IIC1: i2c@ef600800 { 241 IIC1: i2c@ef600800 {
diff --git a/arch/powerpc/boot/dts/canyonlands.dts b/arch/powerpc/boot/dts/canyonlands.dts
index 5fd1ad09bdf2..c920170b7dfe 100644
--- a/arch/powerpc/boot/dts/canyonlands.dts
+++ b/arch/powerpc/boot/dts/canyonlands.dts
@@ -1,7 +1,7 @@
1/* 1/*
2 * Device Tree Source for AMCC Canyonlands (460EX) 2 * Device Tree Source for AMCC Canyonlands (460EX)
3 * 3 *
4 * Copyright 2008 DENX Software Engineering, Stefan Roese <sr@denx.de> 4 * Copyright 2008-2009 DENX Software Engineering, Stefan Roese <sr@denx.de>
5 * 5 *
6 * This file is licensed under the terms of the GNU General Public 6 * This file is licensed under the terms of the GNU General Public
7 * License version 2. This program is licensed "as is" without 7 * License version 2. This program is licensed "as is" without
@@ -149,19 +149,19 @@
149 /*RXDE*/ 0x5 0x4>; 149 /*RXDE*/ 0x5 0x4>;
150 }; 150 };
151 151
152 USB0: ehci@bffd0400 { 152 USB0: ehci@bffd0400 {
153 compatible = "ibm,usb-ehci-460ex", "usb-ehci"; 153 compatible = "ibm,usb-ehci-460ex", "usb-ehci";
154 interrupt-parent = <&UIC2>; 154 interrupt-parent = <&UIC2>;
155 interrupts = <0x1d 4>; 155 interrupts = <0x1d 4>;
156 reg = <4 0xbffd0400 0x90 4 0xbffd0490 0x70>; 156 reg = <4 0xbffd0400 0x90 4 0xbffd0490 0x70>;
157 }; 157 };
158 158
159 USB1: usb@bffd0000 { 159 USB1: usb@bffd0000 {
160 compatible = "ohci-le"; 160 compatible = "ohci-le";
161 reg = <4 0xbffd0000 0x60>; 161 reg = <4 0xbffd0000 0x60>;
162 interrupt-parent = <&UIC2>; 162 interrupt-parent = <&UIC2>;
163 interrupts = <0x1e 4>; 163 interrupts = <0x1e 4>;
164 }; 164 };
165 165
166 POB0: opb { 166 POB0: opb {
167 compatible = "ibm,opb-460ex", "ibm,opb"; 167 compatible = "ibm,opb-460ex", "ibm,opb";
@@ -215,6 +215,29 @@
215 reg = <0x03fa0000 0x00060000>; 215 reg = <0x03fa0000 0x00060000>;
216 }; 216 };
217 }; 217 };
218
219 ndfc@3,0 {
220 compatible = "ibm,ndfc";
221 reg = <0x00000003 0x00000000 0x00002000>;
222 ccr = <0x00001000>;
223 bank-settings = <0x80002222>;
224 #address-cells = <1>;
225 #size-cells = <1>;
226
227 nand {
228 #address-cells = <1>;
229 #size-cells = <1>;
230
231 partition@0 {
232 label = "u-boot";
233 reg = <0x00000000 0x00100000>;
234 };
235 partition@100000 {
236 label = "user";
237 reg = <0x00000000 0x03f00000>;
238 };
239 };
240 };
218 }; 241 };
219 242
220 UART0: serial@ef600300 { 243 UART0: serial@ef600300 {
diff --git a/arch/powerpc/boot/dts/eiger.dts b/arch/powerpc/boot/dts/eiger.dts
new file mode 100644
index 000000000000..c4a934f2e886
--- /dev/null
+++ b/arch/powerpc/boot/dts/eiger.dts
@@ -0,0 +1,421 @@
1/*
2 * Device Tree Source for AMCC (AppliedMicro) Eiger(460SX)
3 *
4 * Copyright 2009 AMCC (AppliedMicro) <ttnguyen@amcc.com>
5 *
6 * This file is licensed under the terms of the GNU General Public
7 * License version 2. This program is licensed "as is" without
8 * any warranty of any kind, whether express or implied.
9 */
10
11/dts-v1/;
12
13/ {
14 #address-cells = <2>;
15 #size-cells = <1>;
16 model = "amcc,eiger";
17 compatible = "amcc,eiger";
18 dcr-parent = <&{/cpus/cpu@0}>;
19
20 aliases {
21 ethernet0 = &EMAC0;
22 ethernet1 = &EMAC1;
23 ethernet2 = &EMAC2;
24 ethernet3 = &EMAC3;
25 serial0 = &UART0;
26 serial1 = &UART1;
27 };
28
29 cpus {
30 #address-cells = <1>;
31 #size-cells = <0>;
32
33 cpu@0 {
34 device_type = "cpu";
35 model = "PowerPC,460SX";
36 reg = <0x00000000>;
37 clock-frequency = <0>; /* Filled in by U-Boot */
38 timebase-frequency = <0>; /* Filled in by U-Boot */
39 i-cache-line-size = <32>;
40 d-cache-line-size = <32>;
41 i-cache-size = <32768>;
42 d-cache-size = <32768>;
43 dcr-controller;
44 dcr-access-method = "native";
45 };
46 };
47
48 memory {
49 device_type = "memory";
50 reg = <0x00000000 0x00000000 0x00000000>; /* Filled in by U-Boot */
51 };
52
53 UIC0: interrupt-controller0 {
54 compatible = "ibm,uic-460sx","ibm,uic";
55 interrupt-controller;
56 cell-index = <0>;
57 dcr-reg = <0x0c0 0x009>;
58 #address-cells = <0>;
59 #size-cells = <0>;
60 #interrupt-cells = <2>;
61 };
62
63 UIC1: interrupt-controller1 {
64 compatible = "ibm,uic-460sx","ibm,uic";
65 interrupt-controller;
66 cell-index = <1>;
67 dcr-reg = <0x0d0 0x009>;
68 #address-cells = <0>;
69 #size-cells = <0>;
70 #interrupt-cells = <2>;
71 interrupts = <0x1e 0x4 0x1f 0x4>; /* cascade */
72 interrupt-parent = <&UIC0>;
73 };
74
75 UIC2: interrupt-controller2 {
76 compatible = "ibm,uic-460sx","ibm,uic";
77 interrupt-controller;
78 cell-index = <2>;
79 dcr-reg = <0x0e0 0x009>;
80 #address-cells = <0>;
81 #size-cells = <0>;
82 #interrupt-cells = <2>;
83 interrupts = <0xa 0x4 0xb 0x4>; /* cascade */
84 interrupt-parent = <&UIC0>;
85 };
86
87 UIC3: interrupt-controller3 {
88 compatible = "ibm,uic-460sx","ibm,uic";
89 interrupt-controller;
90 cell-index = <3>;
91 dcr-reg = <0x0f0 0x009>;
92 #address-cells = <0>;
93 #size-cells = <0>;
94 #interrupt-cells = <2>;
95 interrupts = <0x10 0x4 0x11 0x4>; /* cascade */
96 interrupt-parent = <&UIC0>;
97 };
98
99 SDR0: sdr {
100 compatible = "ibm,sdr-460sx";
101 dcr-reg = <0x00e 0x002>;
102 };
103
104 CPR0: cpr {
105 compatible = "ibm,cpr-460sx";
106 dcr-reg = <0x00c 0x002>;
107 };
108
109 plb {
110 compatible = "ibm,plb-460sx", "ibm,plb4";
111 #address-cells = <2>;
112 #size-cells = <1>;
113 ranges;
114 clock-frequency = <0>; /* Filled in by U-Boot */
115
116 SDRAM0: sdram {
117 compatible = "ibm,sdram-460sx", "ibm,sdram-405gp";
118 dcr-reg = <0x010 0x002>;
119 };
120
121 MAL0: mcmal {
122 compatible = "ibm,mcmal-460sx", "ibm,mcmal2";
123 dcr-reg = <0x180 0x62>;
124 num-tx-chans = <4>;
125 num-rx-chans = <32>;
126 #address-cells = <1>;
127 #size-cells = <1>;
128 interrupt-parent = <&UIC1>;
129 interrupts = < /*TXEOB*/ 0x6 0x4
130 /*RXEOB*/ 0x7 0x4
131 /*SERR*/ 0x1 0x4
132 /*TXDE*/ 0x2 0x4
133 /*RXDE*/ 0x3 0x4
134 /*COAL TX0*/ 0x18 0x2
135 /*COAL TX1*/ 0x19 0x2
136 /*COAL TX2*/ 0x1a 0x2
137 /*COAL TX3*/ 0x1b 0x2
138 /*COAL RX0*/ 0x1c 0x2
139 /*COAL RX1*/ 0x1d 0x2
140 /*COAL RX2*/ 0x1e 0x2
141 /*COAL RX3*/ 0x1f 0x2>;
142 };
143
144 POB0: opb {
145 compatible = "ibm,opb-460sx", "ibm,opb";
146 #address-cells = <1>;
147 #size-cells = <1>;
148 ranges = <0xb0000000 0x00000004 0xb0000000 0x50000000>;
149 clock-frequency = <0>; /* Filled in by U-Boot */
150
151 EBC0: ebc {
152 compatible = "ibm,ebc-460sx", "ibm,ebc";
153 dcr-reg = <0x012 0x002>;
154 #address-cells = <2>;
155 #size-cells = <1>;
156 clock-frequency = <0>; /* Filled in by U-Boot */
157 /* ranges property is supplied by U-Boot */
158 interrupts = <0x6 0x4>;
159 interrupt-parent = <&UIC1>;
160
161 nor_flash@0,0 {
162 compatible = "amd,s29gl512n", "cfi-flash";
163 bank-width = <2>;
164 /* reg property is supplied in by U-Boot */
165 #address-cells = <1>;
166 #size-cells = <1>;
167 partition@0 {
168 label = "kernel";
169 reg = <0x00000000 0x001e0000>;
170 };
171 partition@1e0000 {
172 label = "dtb";
173 reg = <0x001e0000 0x00020000>;
174 };
175 partition@200000 {
176 label = "ramdisk";
177 reg = <0x00200000 0x01400000>;
178 };
179 partition@1600000 {
180 label = "jffs2";
181 reg = <0x01600000 0x00400000>;
182 };
183 partition@1a00000 {
184 label = "user";
185 reg = <0x01a00000 0x02560000>;
186 };
187 partition@3f60000 {
188 label = "env";
189 reg = <0x03f60000 0x00040000>;
190 };
191 partition@3fa0000 {
192 label = "u-boot";
193 reg = <0x03fa0000 0x00060000>;
194 };
195 };
196
197 ndfc@1,0 {
198 compatible = "ibm,ndfc";
199 /* reg property is supplied by U-boot */
200 ccr = <0x00003000>;
201 bank-settings = <0x80002222>;
202 #address-cells = <1>;
203 #size-cells = <1>;
204
205 nand {
206 #address-cells = <1>;
207 #size-cells = <1>;
208 partition@0 {
209 label = "uboot";
210 reg = <0x00000000 0x00200000>;
211 };
212 partition@200000 {
213 label = "uboot-environment";
214 reg = <0x00200000 0x00100000>;
215 };
216 partition@300000 {
217 label = "linux";
218 reg = <0x00300000 0x00300000>;
219 };
220 partition@600000 {
221 label = "root-file-system";
222 reg = <0x00600000 0x01900000>;
223 };
224 partition@1f00000 {
225 label = "device-tree";
226 reg = <0x01f00000 0x00020000>;
227 };
228 partition@1f20000 {
229 label = "data";
230 reg = <0x01f20000 0x060E0000>;
231 };
232 };
233 };
234 };
235
236 UART0: serial@ef600200 {
237 device_type = "serial";
238 compatible = "ns16550";
239 reg = <0xef600200 0x00000008>;
240 virtual-reg = <0xef600200>;
241 clock-frequency = <0>; /* Filled in by U-Boot */
242 current-speed = <0>; /* Filled in by U-Boot */
243 interrupt-parent = <&UIC0>;
244 interrupts = <0x0 0x4>;
245 };
246
247 UART1: serial@ef600300 {
248 device_type = "serial";
249 compatible = "ns16550";
250 reg = <0xef600300 0x00000008>;
251 virtual-reg = <0xef600300>;
252 clock-frequency = <0>; /* Filled in by U-Boot */
253 current-speed = <0>; /* Filled in by U-Boot */
254 interrupt-parent = <&UIC0>;
255 interrupts = <0x1 0x4>;
256 };
257
258 IIC0: i2c@ef600400 {
259 compatible = "ibm,iic-460sx", "ibm,iic";
260 reg = <0xef600400 0x00000014>;
261 interrupt-parent = <&UIC0>;
262 interrupts = <0x2 0x4>;
263 #address-cells = <1>;
264 #size-cells = <0>;
265 index = <0>;
266 };
267
268 IIC1: i2c@ef600500 {
269 compatible = "ibm,iic-460sx", "ibm,iic";
270 reg = <0xef600500 0x00000014>;
271 interrupt-parent = <&UIC0>;
272 interrupts = <0x3 0x4>;
273 #address-cells = <1>;
274 #size-cells = <0>;
275 index = <1>;
276 };
277
278 RGMII0: emac-rgmii@ef600900 {
279 compatible = "ibm,rgmii-460sx", "ibm,rgmii";
280 reg = <0xef600900 0x00000008>;
281 has-mdio;
282 };
283
284 RGMII1: emac-rgmii@ef600920 {
285 compatible = "ibm,rgmii-460sx", "ibm,rgmii";
286 reg = <0xef600920 0x00000008>;
287 has-mdio;
288 };
289
290 TAH0: emac-tah@ef600e50 {
291 compatible = "ibm,tah-460sx", "ibm,tah";
292 reg = <0xef600e50 0x00000030>;
293 };
294
295 TAH1: emac-tah@ef600f50 {
296 compatible = "ibm,tah-460sx", "ibm,tah";
297 reg = <0xef600f50 0x00000030>;
298 };
299
300 EMAC0: ethernet@ef600a00 {
301 device_type = "network";
302 compatible = "ibm,emac-460sx", "ibm,emac4";
303 interrupt-parent = <&EMAC0>;
304 interrupts = <0x0 0x1>;
305 #interrupt-cells = <1>;
306 #address-cells = <0>;
307 #size-cells = <0>;
308 interrupt-map = </*Status*/ 0x0 &UIC0 0x13 0x4
309 /*Wake*/ 0x1 &UIC2 0x1d 0x4>;
310 reg = <0xef600a00 0x00000070>;
311 local-mac-address = [000000000000]; /* Filled in by U-Boot */
312 mal-device = <&MAL0>;
313 mal-tx-channel = <0>;
314 mal-rx-channel = <0>;
315 cell-index = <0>;
316 max-frame-size = <9000>;
317 rx-fifo-size = <4096>;
318 tx-fifo-size = <2048>;
319 phy-mode = "rgmii";
320 phy-map = <0x00000000>;
321 rgmii-device = <&RGMII0>;
322 rgmii-channel = <0>;
323 tah-device = <&TAH0>;
324 tah-channel = <0>;
325 has-inverted-stacr-oc;
326 has-new-stacr-staopc;
327 };
328
329 EMAC1: ethernet@ef600b00 {
330 device_type = "network";
331 compatible = "ibm,emac-460sx", "ibm,emac4";
332 interrupt-parent = <&EMAC1>;
333 interrupts = <0x0 0x1>;
334 #interrupt-cells = <1>;
335 #address-cells = <0>;
336 #size-cells = <0>;
337 interrupt-map = </*Status*/ 0x0 &UIC0 0x14 0x4
338 /*Wake*/ 0x1 &UIC2 0x1d 0x4>;
339 reg = <0xef600b00 0x00000070>;
340 local-mac-address = [000000000000]; /* Filled in by U-Boot */
341 mal-device = <&MAL0>;
342 mal-tx-channel = <1>;
343 mal-rx-channel = <8>;
344 cell-index = <1>;
345 max-frame-size = <9000>;
346 rx-fifo-size = <4096>;
347 tx-fifo-size = <2048>;
348 phy-mode = "rgmii";
349 phy-map = <0x00000000>;
350 rgmii-device = <&RGMII0>;
351 rgmii-channel = <1>;
352 tah-device = <&TAH1>;
353 tah-channel = <1>;
354 has-inverted-stacr-oc;
355 has-new-stacr-staopc;
356 mdio-device = <&EMAC0>;
357 };
358
359 EMAC2: ethernet@ef600c00 {
360 device_type = "network";
361 compatible = "ibm,emac-460sx", "ibm,emac4";
362 interrupt-parent = <&EMAC2>;
363 interrupts = <0x0 0x1>;
364 #interrupt-cells = <1>;
365 #address-cells = <0>;
366 #size-cells = <0>;
367 interrupt-map = </*Status*/ 0x0 &UIC0 0x15 0x4
368 /*Wake*/ 0x1 &UIC2 0x1d 0x4>;
369 reg = <0xef600c00 0x00000070>;
370 local-mac-address = [000000000000]; /* Filled in by U-Boot */
371 mal-device = <&MAL0>;
372 mal-tx-channel = <2>;
373 mal-rx-channel = <16>;
374 cell-index = <2>;
375 max-frame-size = <9000>;
376 rx-fifo-size = <4096>;
377 tx-fifo-size = <2048>;
378 phy-mode = "rgmii";
379 phy-map = <0x00000000>;
380 rgmii-device = <&RGMII1>;
381 rgmii-channel = <0>;
382 has-inverted-stacr-oc;
383 has-new-stacr-staopc;
384 mdio-device = <&EMAC0>;
385 };
386
387 EMAC3: ethernet@ef600d00 {
388 device_type = "network";
389 compatible = "ibm,emac-460sx", "ibm,emac4";
390 interrupt-parent = <&EMAC3>;
391 interrupts = <0x0 0x1>;
392 #interrupt-cells = <1>;
393 #address-cells = <0>;
394 #size-cells = <0>;
395 interrupt-map = </*Status*/ 0x0 &UIC0 0x16 0x4
396 /*Wake*/ 0x1 &UIC2 0x1d 0x4>;
397 reg = <0xef600d00 0x00000070>;
398 local-mac-address = [000000000000]; /* Filled in by U-Boot */
399 mal-device = <&MAL0>;
400 mal-tx-channel = <3>;
401 mal-rx-channel = <24>;
402 cell-index = <3>;
403 max-frame-size = <9000>;
404 rx-fifo-size = <4096>;
405 tx-fifo-size = <2048>;
406 phy-mode = "rgmii";
407 phy-map = <0x00000000>;
408 rgmii-device = <&RGMII1>;
409 rgmii-channel = <1>;
410 has-inverted-stacr-oc;
411 has-new-stacr-staopc;
412 mdio-device = <&EMAC0>;
413 };
414 };
415
416 };
417 chosen {
418 linux,stdout-path = "/plb/opb/serial@ef600200";
419 };
420
421};
diff --git a/arch/powerpc/boot/dts/gef_sbc310.dts b/arch/powerpc/boot/dts/gef_sbc310.dts
index 0f4c9ec2c3a6..2107d3c7cfe1 100644
--- a/arch/powerpc/boot/dts/gef_sbc310.dts
+++ b/arch/powerpc/boot/dts/gef_sbc310.dts
@@ -83,34 +83,34 @@
83 83
84 /* flash@0,0 is a mirror of part of the memory in flash@1,0 84 /* flash@0,0 is a mirror of part of the memory in flash@1,0
85 flash@0,0 { 85 flash@0,0 {
86 compatible = "cfi-flash"; 86 compatible = "gef,sbc310-firmware-mirror", "cfi-flash";
87 reg = <0 0 0x01000000>; 87 reg = <0x0 0x0 0x01000000>;
88 bank-width = <2>; 88 bank-width = <2>;
89 device-width = <2>; 89 device-width = <2>;
90 #address-cells = <1>; 90 #address-cells = <1>;
91 #size-cells = <1>; 91 #size-cells = <1>;
92 partition@0 { 92 partition@0 {
93 label = "firmware"; 93 label = "firmware";
94 reg = <0x00000000 0x01000000>; 94 reg = <0x0 0x01000000>;
95 read-only; 95 read-only;
96 }; 96 };
97 }; 97 };
98 */ 98 */
99 99
100 flash@1,0 { 100 flash@1,0 {
101 compatible = "cfi-flash"; 101 compatible = "gef,sbc310-paged-flash", "cfi-flash";
102 reg = <1 0 0x8000000>; 102 reg = <0x1 0x0 0x8000000>;
103 bank-width = <2>; 103 bank-width = <2>;
104 device-width = <2>; 104 device-width = <2>;
105 #address-cells = <1>; 105 #address-cells = <1>;
106 #size-cells = <1>; 106 #size-cells = <1>;
107 partition@0 { 107 partition@0 {
108 label = "user"; 108 label = "user";
109 reg = <0x00000000 0x07800000>; 109 reg = <0x0 0x7800000>;
110 }; 110 };
111 partition@7800000 { 111 partition@7800000 {
112 label = "firmware"; 112 label = "firmware";
113 reg = <0x07800000 0x00800000>; 113 reg = <0x7800000 0x800000>;
114 read-only; 114 read-only;
115 }; 115 };
116 }; 116 };
@@ -121,18 +121,16 @@
121 }; 121 };
122 122
123 wdt@4,2000 { 123 wdt@4,2000 {
124 #interrupt-cells = <2>; 124 compatible = "gef,sbc310-fpga-wdt", "gef,fpga-wdt-1.00",
125 device_type = "watchdog"; 125 "gef,fpga-wdt";
126 compatible = "gef,fpga-wdt";
127 reg = <0x4 0x2000 0x8>; 126 reg = <0x4 0x2000 0x8>;
128 interrupts = <0x1a 0x4>; 127 interrupts = <0x1a 0x4>;
129 interrupt-parent = <&gef_pic>; 128 interrupt-parent = <&gef_pic>;
130 }; 129 };
131/* 130/*
132 wdt@4,2010 { 131 wdt@4,2010 {
133 #interrupt-cells = <2>; 132 compatible = "gef,sbc310-fpga-wdt", "gef,fpga-wdt-1.00",
134 device_type = "watchdog"; 133 "gef,fpga-wdt";
135 compatible = "gef,fpga-wdt";
136 reg = <0x4 0x2010 0x8>; 134 reg = <0x4 0x2010 0x8>;
137 interrupts = <0x1b 0x4>; 135 interrupts = <0x1b 0x4>;
138 interrupt-parent = <&gef_pic>; 136 interrupt-parent = <&gef_pic>;
@@ -141,7 +139,7 @@
141 gef_pic: pic@4,4000 { 139 gef_pic: pic@4,4000 {
142 #interrupt-cells = <1>; 140 #interrupt-cells = <1>;
143 interrupt-controller; 141 interrupt-controller;
144 compatible = "gef,fpga-pic"; 142 compatible = "gef,sbc310-fpga-pic", "gef,fpga-pic";
145 reg = <0x4 0x4000 0x20>; 143 reg = <0x4 0x4000 0x20>;
146 interrupts = <0x8 144 interrupts = <0x8
147 0x9>; 145 0x9>;
@@ -161,7 +159,7 @@
161 #size-cells = <1>; 159 #size-cells = <1>;
162 #interrupt-cells = <2>; 160 #interrupt-cells = <2>;
163 device_type = "soc"; 161 device_type = "soc";
164 compatible = "simple-bus"; 162 compatible = "fsl,mpc8641-soc", "simple-bus";
165 ranges = <0x0 0xfef00000 0x00100000>; 163 ranges = <0x0 0xfef00000 0x00100000>;
166 bus-frequency = <33333333>; 164 bus-frequency = <33333333>;
167 165
@@ -376,4 +374,40 @@
376 0x0 0x00400000>; 374 0x0 0x00400000>;
377 }; 375 };
378 }; 376 };
377
378 pci1: pcie@fef09000 {
379 compatible = "fsl,mpc8641-pcie";
380 device_type = "pci";
381 #interrupt-cells = <1>;
382 #size-cells = <2>;
383 #address-cells = <3>;
384 reg = <0xfef09000 0x1000>;
385 bus-range = <0x0 0xff>;
386 ranges = <0x02000000 0x0 0xc0000000 0xc0000000 0x0 0x20000000
387 0x01000000 0x0 0x00000000 0xfe400000 0x0 0x00400000>;
388 clock-frequency = <33333333>;
389 interrupt-parent = <&mpic>;
390 interrupts = <0x19 0x2>;
391 interrupt-map-mask = <0xf800 0x0 0x0 0x7>;
392 interrupt-map = <
393 0x0000 0x0 0x0 0x1 &mpic 0x4 0x2
394 0x0000 0x0 0x0 0x2 &mpic 0x5 0x2
395 0x0000 0x0 0x0 0x3 &mpic 0x6 0x2
396 0x0000 0x0 0x0 0x4 &mpic 0x7 0x2
397 >;
398
399 pcie@0 {
400 reg = <0 0 0 0 0>;
401 #size-cells = <2>;
402 #address-cells = <3>;
403 device_type = "pci";
404 ranges = <0x02000000 0x0 0xc0000000
405 0x02000000 0x0 0xc0000000
406 0x0 0x20000000
407
408 0x01000000 0x0 0x00000000
409 0x01000000 0x0 0x00000000
410 0x0 0x00400000>;
411 };
412 };
379}; 413};
diff --git a/arch/powerpc/boot/dts/hotfoot.dts b/arch/powerpc/boot/dts/hotfoot.dts
new file mode 100644
index 000000000000..cad9c3840afc
--- /dev/null
+++ b/arch/powerpc/boot/dts/hotfoot.dts
@@ -0,0 +1,294 @@
1/*
2 * Device Tree Source for ESTeem 195E Hotfoot
3 *
4 * Copyright 2009 AbsoluteValue Systems <solomon@linux-wlan.com>
5 *
6 * This file is licensed under the terms of the GNU General Public
7 * License version 2. This program is licensed "as is" without
8 * any warranty of any kind, whether express or implied.
9 */
10
11/dts-v1/;
12
13/ {
14 #address-cells = <1>;
15 #size-cells = <1>;
16 model = "est,hotfoot";
17 compatible = "est,hotfoot";
18 dcr-parent = <&{/cpus/cpu@0}>;
19
20 aliases {
21 ethernet0 = &EMAC0;
22 ethernet1 = &EMAC1;
23 serial0 = &UART0;
24 serial1 = &UART1;
25 };
26
27 cpus {
28 #address-cells = <1>;
29 #size-cells = <0>;
30
31 cpu@0 {
32 device_type = "cpu";
33 model = "PowerPC,405EP";
34 reg = <0x00000000>;
35 clock-frequency = <0>; /* Filled in by zImage */
36 timebase-frequency = <0>; /* Filled in by zImage */
37 i-cache-line-size = <0x20>;
38 d-cache-line-size = <0x20>;
39 i-cache-size = <0x4000>;
40 d-cache-size = <0x4000>;
41 dcr-controller;
42 dcr-access-method = "native";
43 };
44 };
45
46 memory {
47 device_type = "memory";
48 reg = <0x00000000 0x00000000>; /* Filled in by zImage */
49 };
50
51 UIC0: interrupt-controller {
52 compatible = "ibm,uic";
53 interrupt-controller;
54 cell-index = <0>;
55 dcr-reg = <0x0c0 0x009>;
56 #address-cells = <0>;
57 #size-cells = <0>;
58 #interrupt-cells = <2>;
59 };
60
61 plb {
62 compatible = "ibm,plb3";
63 #address-cells = <1>;
64 #size-cells = <1>;
65 ranges;
66 clock-frequency = <0>; /* Filled in by zImage */
67
68 SDRAM0: memory-controller {
69 compatible = "ibm,sdram-405ep";
70 dcr-reg = <0x010 0x002>;
71 };
72
73 MAL: mcmal {
74 compatible = "ibm,mcmal-405ep", "ibm,mcmal";
75 dcr-reg = <0x180 0x062>;
76 num-tx-chans = <4>;
77 num-rx-chans = <2>;
78 interrupt-parent = <&UIC0>;
79 interrupts = <
80 0xb 0x4 /* TXEOB */
81 0xc 0x4 /* RXEOB */
82 0xa 0x4 /* SERR */
83 0xd 0x4 /* TXDE */
84 0xe 0x4 /* RXDE */>;
85 };
86
87 POB0: opb {
88 compatible = "ibm,opb-405ep", "ibm,opb";
89 #address-cells = <1>;
90 #size-cells = <1>;
91 ranges = <0xef600000 0xef600000 0x00a00000>;
92 dcr-reg = <0x0a0 0x005>;
93 clock-frequency = <0>; /* Filled in by zImage */
94
95 /* Hotfoot has UART0/UART1 swapped */
96
97 UART0: serial@ef600400 {
98 device_type = "serial";
99 compatible = "ns16550";
100 reg = <0xef600400 0x00000008>;
101 virtual-reg = <0xef600400>;
102 clock-frequency = <0>; /* Filled in by zImage */
103 current-speed = <0x9600>;
104 interrupt-parent = <&UIC0>;
105 interrupts = <0x1 0x4>;
106 };
107
108 UART1: serial@ef600300 {
109 device_type = "serial";
110 compatible = "ns16550";
111 reg = <0xef600300 0x00000008>;
112 virtual-reg = <0xef600300>;
113 clock-frequency = <0>; /* Filled in by zImage */
114 current-speed = <0x9600>;
115 interrupt-parent = <&UIC0>;
116 interrupts = <0x0 0x4>;
117 };
118
119 IIC: i2c@ef600500 {
120 compatible = "ibm,iic-405ep", "ibm,iic";
121 reg = <0xef600500 0x00000011>;
122 interrupt-parent = <&UIC0>;
123 interrupts = <0x2 0x4>;
124
125 rtc@68 {
126 /* Actually a DS1339 */
127 compatible = "dallas,ds1307";
128 reg = <0x68>;
129 };
130
131 temp@4a {
132 /* Not present on all boards */
133 compatible = "national,lm75";
134 reg = <0x4a>;
135 };
136 };
137
138 GPIO: gpio@ef600700 {
139 #gpio-cells = <2>;
140 compatible = "ibm,ppc4xx-gpio";
141 reg = <0xef600700 0x00000020>;
142 gpio-controller;
143 };
144
145 gpio-leds {
146 compatible = "gpio-leds";
147 status {
148 label = "Status";
149 gpios = <&GPIO 1 0>;
150 };
151 radiorx {
152 label = "Rx";
153 gpios = <&GPIO 0xe 0>;
154 };
155 };
156
157 EMAC0: ethernet@ef600800 {
158 linux,network-index = <0x0>;
159 device_type = "network";
160 compatible = "ibm,emac-405ep", "ibm,emac";
161 interrupt-parent = <&UIC0>;
162 interrupts = <
163 0xf 0x4 /* Ethernet */
164 0x9 0x4 /* Ethernet Wake Up */>;
165 local-mac-address = [000000000000]; /* Filled in by zImage */
166 reg = <0xef600800 0x00000070>;
167 mal-device = <&MAL>;
168 mal-tx-channel = <0>;
169 mal-rx-channel = <0>;
170 cell-index = <0>;
171 max-frame-size = <0x5dc>;
172 rx-fifo-size = <0x1000>;
173 tx-fifo-size = <0x800>;
174 phy-mode = "mii";
175 phy-map = <0x00000000>;
176 };
177
178 EMAC1: ethernet@ef600900 {
179 linux,network-index = <0x1>;
180 device_type = "network";
181 compatible = "ibm,emac-405ep", "ibm,emac";
182 interrupt-parent = <&UIC0>;
183 interrupts = <
184 0x11 0x4 /* Ethernet */
185 0x9 0x4 /* Ethernet Wake Up */>;
186 local-mac-address = [000000000000]; /* Filled in by zImage */
187 reg = <0xef600900 0x00000070>;
188 mal-device = <&MAL>;
189 mal-tx-channel = <2>;
190 mal-rx-channel = <1>;
191 cell-index = <1>;
192 max-frame-size = <0x5dc>;
193 rx-fifo-size = <0x1000>;
194 tx-fifo-size = <0x800>;
195 mdio-device = <&EMAC0>;
196 phy-mode = "mii";
197 phy-map = <0x0000001>;
198 };
199 };
200
201 EBC0: ebc {
202 compatible = "ibm,ebc-405ep", "ibm,ebc";
203 dcr-reg = <0x012 0x002>;
204 #address-cells = <2>;
205 #size-cells = <1>;
206
207 /* The ranges property is supplied by the bootwrapper
208 * and is based on the firmware's configuration of the
209 * EBC bridge
210 */
211 clock-frequency = <0>; /* Filled in by zImage */
212
213 nor_flash@0 {
214 compatible = "cfi-flash";
215 bank-width = <2>;
216 reg = <0x0 0xff800000 0x00800000>;
217 #address-cells = <1>;
218 #size-cells = <1>;
219
220 /* This mapping is for the 8M flash
221 4M flash has all ofssets -= 4M,
222 and FeatFS partition is not present */
223 partition@0 {
224 label = "Bootloader";
225 reg = <0x7c0000 0x40000>;
226 /* read-only; */
227 };
228 partition@1 {
229 label = "Env_and_Config_Primary";
230 reg = <0x400000 0x10000>;
231 };
232 partition@2 {
233 label = "Kernel";
234 reg = <0x420000 0x100000>;
235 };
236 partition@3 {
237 label = "Filesystem";
238 reg = <0x520000 0x2a0000>;
239 };
240 partition@4 {
241 label = "Env_and_Config_Secondary";
242 reg = <0x410000 0x10000>;
243 };
244 partition@5 {
245 label = "FeatFS";
246 reg = <0x000000 0x400000>;
247 };
248 partition@6 {
249 label = "Bootloader_Env";
250 reg = <0x7d0000 0x10000>;
251 };
252 };
253 };
254
255 PCI0: pci@ec000000 {
256 device_type = "pci";
257 #interrupt-cells = <1>;
258 #size-cells = <2>;
259 #address-cells = <3>;
260 compatible = "ibm,plb405ep-pci", "ibm,plb-pci";
261 primary;
262 reg = <0xeec00000 0x00000008 /* Config space access */
263 0xeed80000 0x00000004 /* IACK */
264 0xeed80000 0x00000004 /* Special cycle */
265 0xef480000 0x00000040>; /* Internal registers */
266
267 /* Outbound ranges, one memory and one IO,
268 * later cannot be changed. Chip supports a second
269 * IO range but we don't use it for now
270 */
271 ranges = <0x02000000 0x00000000 0x80000000 0x80000000 0x00000000 0x20000000
272 0x01000000 0x00000000 0x00000000 0xe8000000 0x00000000 0x00010000>;
273
274 /* Inbound 2GB range starting at 0 */
275 dma-ranges = <0x42000000 0x0 0x0 0x0 0x0 0x80000000>;
276
277 interrupt-parent = <&UIC0>;
278 interrupt-map-mask = <0xf800 0x0 0x0 0x7>;
279 interrupt-map = <
280 /* IDSEL 3 -- slot1 (optional) 27/29 A/B IRQ2/4 */
281 0x1800 0x0 0x0 0x1 &UIC0 0x1b 0x8
282 0x1800 0x0 0x0 0x2 &UIC0 0x1d 0x8
283
284 /* IDSEL 4 -- slot0, 26/28 A/B IRQ1/3 */
285 0x2000 0x0 0x0 0x1 &UIC0 0x1a 0x8
286 0x2000 0x0 0x0 0x2 &UIC0 0x1c 0x8
287 >;
288 };
289 };
290
291 chosen {
292 linux,stdout-path = &UART0;
293 };
294};
diff --git a/arch/powerpc/boot/dts/kilauea.dts b/arch/powerpc/boot/dts/kilauea.dts
index 5e6b08ff6f67..c46561456ede 100644
--- a/arch/powerpc/boot/dts/kilauea.dts
+++ b/arch/powerpc/boot/dts/kilauea.dts
@@ -1,7 +1,7 @@
1/* 1/*
2 * Device Tree Source for AMCC Kilauea (405EX) 2 * Device Tree Source for AMCC Kilauea (405EX)
3 * 3 *
4 * Copyright 2007 DENX Software Engineering, Stefan Roese <sr@denx.de> 4 * Copyright 2007-2009 DENX Software Engineering, Stefan Roese <sr@denx.de>
5 * 5 *
6 * This file is licensed under the terms of the GNU General Public 6 * This file is licensed under the terms of the GNU General Public
7 * License version 2. This program is licensed "as is" without 7 * License version 2. This program is licensed "as is" without
@@ -150,7 +150,11 @@
150 #size-cells = <1>; 150 #size-cells = <1>;
151 partition@0 { 151 partition@0 {
152 label = "kernel"; 152 label = "kernel";
153 reg = <0x00000000 0x00200000>; 153 reg = <0x00000000 0x001e0000>;
154 };
155 partition@1e0000 {
156 label = "dtb";
157 reg = <0x001e0000 0x00020000>;
154 }; 158 };
155 partition@200000 { 159 partition@200000 {
156 label = "root"; 160 label = "root";
@@ -169,6 +173,29 @@
169 reg = <0x03fa0000 0x00060000>; 173 reg = <0x03fa0000 0x00060000>;
170 }; 174 };
171 }; 175 };
176
177 ndfc@1,0 {
178 compatible = "ibm,ndfc";
179 reg = <0x00000001 0x00000000 0x00002000>;
180 ccr = <0x00001000>;
181 bank-settings = <0x80002222>;
182 #address-cells = <1>;
183 #size-cells = <1>;
184
185 nand {
186 #address-cells = <1>;
187 #size-cells = <1>;
188
189 partition@0 {
190 label = "u-boot";
191 reg = <0x00000000 0x00100000>;
192 };
193 partition@100000 {
194 label = "user";
195 reg = <0x00000000 0x03f00000>;
196 };
197 };
198 };
172 }; 199 };
173 200
174 UART0: serial@ef600200 { 201 UART0: serial@ef600200 {
@@ -198,6 +225,18 @@
198 reg = <0xef600400 0x00000014>; 225 reg = <0xef600400 0x00000014>;
199 interrupt-parent = <&UIC0>; 226 interrupt-parent = <&UIC0>;
200 interrupts = <0x2 0x4>; 227 interrupts = <0x2 0x4>;
228 #address-cells = <1>;
229 #size-cells = <0>;
230
231 rtc@68 {
232 compatible = "dallas,ds1338";
233 reg = <0x68>;
234 };
235
236 dtt@48 {
237 compatible = "dallas,ds1775";
238 reg = <0x48>;
239 };
201 }; 240 };
202 241
203 IIC1: i2c@ef600500 { 242 IIC1: i2c@ef600500 {
@@ -207,7 +246,6 @@
207 interrupts = <0x7 0x4>; 246 interrupts = <0x7 0x4>;
208 }; 247 };
209 248
210
211 RGMII0: emac-rgmii@ef600b00 { 249 RGMII0: emac-rgmii@ef600b00 {
212 compatible = "ibm,rgmii-405ex", "ibm,rgmii"; 250 compatible = "ibm,rgmii-405ex", "ibm,rgmii";
213 reg = <0xef600b00 0x00000104>; 251 reg = <0xef600b00 0x00000104>;
diff --git a/arch/powerpc/boot/dts/mgcoge.dts b/arch/powerpc/boot/dts/mgcoge.dts
index 633255a97557..0ce96644176d 100644
--- a/arch/powerpc/boot/dts/mgcoge.dts
+++ b/arch/powerpc/boot/dts/mgcoge.dts
@@ -162,6 +162,59 @@
162 fixed-link = <0 0 10 0 0>; 162 fixed-link = <0 0 10 0 0>;
163 }; 163 };
164 164
165 i2c@11860 {
166 compatible = "fsl,mpc8272-i2c",
167 "fsl,cpm2-i2c";
168 reg = <0x11860 0x20 0x8afc 0x2>;
169 interrupts = <1 8>;
170 interrupt-parent = <&PIC>;
171 fsl,cpm-command = <0x29600000>;
172 #address-cells = <1>;
173 #size-cells = <0>;
174 };
175
176 mdio@10d40 {
177 compatible = "fsl,cpm2-mdio-bitbang";
178 reg = <0x10d00 0x14>;
179 #address-cells = <1>;
180 #size-cells = <0>;
181 fsl,mdio-pin = <12>;
182 fsl,mdc-pin = <13>;
183
184 phy0: ethernet-phy@0 {
185 reg = <0x0>;
186 };
187
188 phy1: ethernet-phy@1 {
189 reg = <0x1>;
190 };
191 };
192
193 /* FCC1 management to switch */
194 ethernet@11300 {
195 device_type = "network";
196 compatible = "fsl,cpm2-fcc-enet";
197 reg = <0x11300 0x20 0x8400 0x100 0x11390 0x1>;
198 local-mac-address = [ 00 01 02 03 04 07 ];
199 interrupts = <32 8>;
200 interrupt-parent = <&PIC>;
201 phy-handle = <&phy0>;
202 linux,network-index = <1>;
203 fsl,cpm-command = <0x12000300>;
204 };
205
206 /* FCC2 to redundant core unit over backplane */
207 ethernet@11320 {
208 device_type = "network";
209 compatible = "fsl,cpm2-fcc-enet";
210 reg = <0x11320 0x20 0x8500 0x100 0x113b0 0x1>;
211 local-mac-address = [ 00 01 02 03 04 08 ];
212 interrupts = <33 8>;
213 interrupt-parent = <&PIC>;
214 phy-handle = <&phy1>;
215 linux,network-index = <2>;
216 fsl,cpm-command = <0x16200300>;
217 };
165 }; 218 };
166 219
167 PIC: interrupt-controller@10c00 { 220 PIC: interrupt-controller@10c00 {
diff --git a/arch/powerpc/boot/dts/mpc8272ads.dts b/arch/powerpc/boot/dts/mpc8272ads.dts
index 60f332778e41..e802ebd88cb1 100644
--- a/arch/powerpc/boot/dts/mpc8272ads.dts
+++ b/arch/powerpc/boot/dts/mpc8272ads.dts
@@ -173,6 +173,14 @@
173 fsl,cpm-command = <0xce00000>; 173 fsl,cpm-command = <0xce00000>;
174 }; 174 };
175 175
176 usb@11b60 {
177 compatible = "fsl,mpc8272-cpm-usb";
178 reg = <0x11b60 0x40 0x8b00 0x100>;
179 interrupts = <11 8>;
180 interrupt-parent = <&PIC>;
181 mode = "peripheral";
182 };
183
176 mdio@10d40 { 184 mdio@10d40 {
177 device_type = "mdio"; 185 device_type = "mdio";
178 compatible = "fsl,mpc8272ads-mdio-bitbang", 186 compatible = "fsl,mpc8272ads-mdio-bitbang",
diff --git a/arch/powerpc/boot/dts/mpc8377_rdb.dts b/arch/powerpc/boot/dts/mpc8377_rdb.dts
index 4f06dbc0d27e..28e022ac4179 100644
--- a/arch/powerpc/boot/dts/mpc8377_rdb.dts
+++ b/arch/powerpc/boot/dts/mpc8377_rdb.dts
@@ -174,7 +174,7 @@
174 interrupts = <42 0x8>; 174 interrupts = <42 0x8>;
175 interrupt-parent = <&ipic>; 175 interrupt-parent = <&ipic>;
176 /* Filled in by U-Boot */ 176 /* Filled in by U-Boot */
177 clock-frequency = <0>; 177 clock-frequency = <111111111>;
178 }; 178 };
179 }; 179 };
180 180
diff --git a/arch/powerpc/boot/dts/mpc8377_wlan.dts b/arch/powerpc/boot/dts/mpc8377_wlan.dts
new file mode 100644
index 000000000000..3febc4e91b10
--- /dev/null
+++ b/arch/powerpc/boot/dts/mpc8377_wlan.dts
@@ -0,0 +1,464 @@
1/*
2 * MPC8377E WLAN Device Tree Source
3 *
4 * Copyright 2007-2009 Freescale Semiconductor Inc.
5 * Copyright 2009 MontaVista Software, Inc.
6 *
7 * This program is free software; you can redistribute it and/or modify it
8 * under the terms of the GNU General Public License as published by the
9 * Free Software Foundation; either version 2 of the License, or (at your
10 * option) any later version.
11 */
12
13/dts-v1/;
14
15/ {
16 compatible = "fsl,mpc8377wlan";
17 #address-cells = <1>;
18 #size-cells = <1>;
19
20 aliases {
21 ethernet0 = &enet0;
22 ethernet1 = &enet1;
23 serial0 = &serial0;
24 serial1 = &serial1;
25 pci0 = &pci0;
26 pci1 = &pci1;
27 pci2 = &pci2;
28 };
29
30 cpus {
31 #address-cells = <1>;
32 #size-cells = <0>;
33
34 PowerPC,8377@0 {
35 device_type = "cpu";
36 reg = <0x0>;
37 d-cache-line-size = <32>;
38 i-cache-line-size = <32>;
39 d-cache-size = <32768>;
40 i-cache-size = <32768>;
41 timebase-frequency = <0>;
42 bus-frequency = <0>;
43 clock-frequency = <0>;
44 };
45 };
46
47 memory {
48 device_type = "memory";
49 reg = <0x00000000 0x20000000>; // 512MB at 0
50 };
51
52 localbus@e0005000 {
53 #address-cells = <2>;
54 #size-cells = <1>;
55 compatible = "fsl,mpc8377-elbc", "fsl,elbc", "simple-bus";
56 reg = <0xe0005000 0x1000>;
57 interrupts = <77 0x8>;
58 interrupt-parent = <&ipic>;
59 ranges = <0x0 0x0 0xfc000000 0x04000000>;
60
61 flash@0,0 {
62 #address-cells = <1>;
63 #size-cells = <1>;
64 compatible = "cfi-flash";
65 reg = <0x0 0x0 0x4000000>;
66 bank-width = <2>;
67 device-width = <1>;
68
69 partition@0 {
70 reg = <0 0x8000>;
71 label = "u-boot";
72 read-only;
73 };
74
75 partition@a0000 {
76 reg = <0xa0000 0x300000>;
77 label = "kernel";
78 };
79
80 partition@3a0000 {
81 reg = <0x3a0000 0x3c60000>;
82 label = "rootfs";
83 };
84 };
85 };
86
87 immr@e0000000 {
88 #address-cells = <1>;
89 #size-cells = <1>;
90 device_type = "soc";
91 compatible = "simple-bus";
92 ranges = <0x0 0xe0000000 0x00100000>;
93 reg = <0xe0000000 0x00000200>;
94 bus-frequency = <0>;
95
96 wdt@200 {
97 device_type = "watchdog";
98 compatible = "mpc83xx_wdt";
99 reg = <0x200 0x100>;
100 };
101
102 gpio1: gpio-controller@c00 {
103 #gpio-cells = <2>;
104 compatible = "fsl,mpc8377-gpio", "fsl,mpc8349-gpio";
105 reg = <0xc00 0x100>;
106 interrupts = <74 0x8>;
107 interrupt-parent = <&ipic>;
108 gpio-controller;
109 };
110
111 gpio2: gpio-controller@d00 {
112 #gpio-cells = <2>;
113 compatible = "fsl,mpc8377-gpio", "fsl,mpc8349-gpio";
114 reg = <0xd00 0x100>;
115 interrupts = <75 0x8>;
116 interrupt-parent = <&ipic>;
117 gpio-controller;
118 };
119
120 sleep-nexus {
121 #address-cells = <1>;
122 #size-cells = <1>;
123 compatible = "simple-bus";
124 sleep = <&pmc 0x0c000000>;
125 ranges;
126
127 i2c@3000 {
128 #address-cells = <1>;
129 #size-cells = <0>;
130 cell-index = <0>;
131 compatible = "fsl-i2c";
132 reg = <0x3000 0x100>;
133 interrupts = <14 0x8>;
134 interrupt-parent = <&ipic>;
135 dfsrr;
136
137 at24@50 {
138 compatible = "at24,24c256";
139 reg = <0x50>;
140 };
141
142 rtc@68 {
143 compatible = "dallas,ds1339";
144 reg = <0x68>;
145 };
146 };
147
148 sdhci@2e000 {
149 compatible = "fsl,mpc8377-esdhc", "fsl,esdhc";
150 reg = <0x2e000 0x1000>;
151 interrupts = <42 0x8>;
152 interrupt-parent = <&ipic>;
153 clock-frequency = <133333333>;
154 };
155 };
156
157 i2c@3100 {
158 #address-cells = <1>;
159 #size-cells = <0>;
160 cell-index = <1>;
161 compatible = "fsl-i2c";
162 reg = <0x3100 0x100>;
163 interrupts = <15 0x8>;
164 interrupt-parent = <&ipic>;
165 dfsrr;
166 };
167
168 spi@7000 {
169 cell-index = <0>;
170 compatible = "fsl,spi";
171 reg = <0x7000 0x1000>;
172 interrupts = <16 0x8>;
173 interrupt-parent = <&ipic>;
174 mode = "cpu";
175 };
176
177 dma@82a8 {
178 #address-cells = <1>;
179 #size-cells = <1>;
180 compatible = "fsl,mpc8377-dma", "fsl,elo-dma";
181 reg = <0x82a8 4>;
182 ranges = <0 0x8100 0x1a8>;
183 interrupt-parent = <&ipic>;
184 interrupts = <71 8>;
185 cell-index = <0>;
186 dma-channel@0 {
187 compatible = "fsl,mpc8377-dma-channel", "fsl,elo-dma-channel";
188 reg = <0 0x80>;
189 cell-index = <0>;
190 interrupt-parent = <&ipic>;
191 interrupts = <71 8>;
192 };
193 dma-channel@80 {
194 compatible = "fsl,mpc8377-dma-channel", "fsl,elo-dma-channel";
195 reg = <0x80 0x80>;
196 cell-index = <1>;
197 interrupt-parent = <&ipic>;
198 interrupts = <71 8>;
199 };
200 dma-channel@100 {
201 compatible = "fsl,mpc8377-dma-channel", "fsl,elo-dma-channel";
202 reg = <0x100 0x80>;
203 cell-index = <2>;
204 interrupt-parent = <&ipic>;
205 interrupts = <71 8>;
206 };
207 dma-channel@180 {
208 compatible = "fsl,mpc8377-dma-channel", "fsl,elo-dma-channel";
209 reg = <0x180 0x28>;
210 cell-index = <3>;
211 interrupt-parent = <&ipic>;
212 interrupts = <71 8>;
213 };
214 };
215
216 usb@23000 {
217 compatible = "fsl-usb2-dr";
218 reg = <0x23000 0x1000>;
219 #address-cells = <1>;
220 #size-cells = <0>;
221 interrupt-parent = <&ipic>;
222 interrupts = <38 0x8>;
223 phy_type = "ulpi";
224 sleep = <&pmc 0x00c00000>;
225 };
226
227 enet0: ethernet@24000 {
228 #address-cells = <1>;
229 #size-cells = <1>;
230 cell-index = <0>;
231 device_type = "network";
232 model = "eTSEC";
233 compatible = "gianfar";
234 reg = <0x24000 0x1000>;
235 ranges = <0x0 0x24000 0x1000>;
236 local-mac-address = [ 00 00 00 00 00 00 ];
237 interrupts = <32 0x8 33 0x8 34 0x8>;
238 phy-connection-type = "mii";
239 interrupt-parent = <&ipic>;
240 tbi-handle = <&tbi0>;
241 phy-handle = <&phy2>;
242 sleep = <&pmc 0xc0000000>;
243 fsl,magic-packet;
244
245 mdio@520 {
246 #address-cells = <1>;
247 #size-cells = <0>;
248 compatible = "fsl,gianfar-mdio";
249 reg = <0x520 0x20>;
250
251 phy2: ethernet-phy@2 {
252 interrupt-parent = <&ipic>;
253 interrupts = <17 0x8>;
254 reg = <0x2>;
255 device_type = "ethernet-phy";
256 };
257
258 phy3: ethernet-phy@3 {
259 interrupt-parent = <&ipic>;
260 interrupts = <18 0x8>;
261 reg = <0x3>;
262 device_type = "ethernet-phy";
263 };
264
265 tbi0: tbi-phy@11 {
266 reg = <0x11>;
267 device_type = "tbi-phy";
268 };
269 };
270 };
271
272 enet1: ethernet@25000 {
273 #address-cells = <1>;
274 #size-cells = <1>;
275 cell-index = <1>;
276 device_type = "network";
277 model = "eTSEC";
278 compatible = "gianfar";
279 reg = <0x25000 0x1000>;
280 ranges = <0x0 0x25000 0x1000>;
281 local-mac-address = [ 00 00 00 00 00 00 ];
282 interrupts = <35 0x8 36 0x8 37 0x8>;
283 phy-connection-type = "mii";
284 interrupt-parent = <&ipic>;
285 phy-handle = <&phy3>;
286 tbi-handle = <&tbi1>;
287 sleep = <&pmc 0x30000000>;
288 fsl,magic-packet;
289
290 mdio@520 {
291 #address-cells = <1>;
292 #size-cells = <0>;
293 compatible = "fsl,gianfar-tbi";
294 reg = <0x520 0x20>;
295
296 tbi1: tbi-phy@11 {
297 reg = <0x11>;
298 device_type = "tbi-phy";
299 };
300 };
301 };
302
303 serial0: serial@4500 {
304 cell-index = <0>;
305 device_type = "serial";
306 compatible = "ns16550";
307 reg = <0x4500 0x100>;
308 clock-frequency = <0>;
309 interrupts = <9 0x8>;
310 interrupt-parent = <&ipic>;
311 };
312
313 serial1: serial@4600 {
314 cell-index = <1>;
315 device_type = "serial";
316 compatible = "ns16550";
317 reg = <0x4600 0x100>;
318 clock-frequency = <0>;
319 interrupts = <10 0x8>;
320 interrupt-parent = <&ipic>;
321 };
322
323 crypto@30000 {
324 compatible = "fsl,sec3.0", "fsl,sec2.4", "fsl,sec2.2",
325 "fsl,sec2.1", "fsl,sec2.0";
326 reg = <0x30000 0x10000>;
327 interrupts = <11 0x8>;
328 interrupt-parent = <&ipic>;
329 fsl,num-channels = <4>;
330 fsl,channel-fifo-len = <24>;
331 fsl,exec-units-mask = <0x9fe>;
332 fsl,descriptor-types-mask = <0x3ab0ebf>;
333 sleep = <&pmc 0x03000000>;
334 };
335
336 sata@18000 {
337 compatible = "fsl,mpc8377-sata", "fsl,pq-sata";
338 reg = <0x18000 0x1000>;
339 interrupts = <44 0x8>;
340 interrupt-parent = <&ipic>;
341 sleep = <&pmc 0x000000c0>;
342 };
343
344 sata@19000 {
345 compatible = "fsl,mpc8377-sata", "fsl,pq-sata";
346 reg = <0x19000 0x1000>;
347 interrupts = <45 0x8>;
348 interrupt-parent = <&ipic>;
349 sleep = <&pmc 0x00000030>;
350 };
351
352 /* IPIC
353 * interrupts cell = <intr #, sense>
354 * sense values match linux IORESOURCE_IRQ_* defines:
355 * sense == 8: Level, low assertion
356 * sense == 2: Edge, high-to-low change
357 */
358 ipic: interrupt-controller@700 {
359 compatible = "fsl,ipic";
360 interrupt-controller;
361 #address-cells = <0>;
362 #interrupt-cells = <2>;
363 reg = <0x700 0x100>;
364 };
365
366 pmc: power@b00 {
367 compatible = "fsl,mpc8377-pmc", "fsl,mpc8349-pmc";
368 reg = <0xb00 0x100 0xa00 0x100>;
369 interrupts = <80 0x8>;
370 interrupt-parent = <&ipic>;
371 };
372 };
373
374 pci0: pci@e0008500 {
375 interrupt-map-mask = <0xf800 0 0 7>;
376 interrupt-map = <
377 /* IRQ5 = 21 = 0x15, IRQ6 = 0x16, IRQ7 = 23 = 0x17 */
378
379 /* IDSEL AD14 IRQ6 inta */
380 0x7000 0x0 0x0 0x1 &ipic 22 0x8
381
382 /* IDSEL AD15 IRQ5 inta */
383 0x7800 0x0 0x0 0x1 &ipic 21 0x8>;
384 interrupt-parent = <&ipic>;
385 interrupts = <66 0x8>;
386 bus-range = <0 0>;
387 ranges = <0x02000000 0x0 0x90000000 0x90000000 0x0 0x10000000
388 0x42000000 0x0 0x80000000 0x80000000 0x0 0x10000000
389 0x01000000 0x0 0x00000000 0xe0300000 0x0 0x00100000>;
390 sleep = <&pmc 0x00010000>;
391 clock-frequency = <66666666>;
392 #interrupt-cells = <1>;
393 #size-cells = <2>;
394 #address-cells = <3>;
395 reg = <0xe0008500 0x100 /* internal registers */
396 0xe0008300 0x8>; /* config space access registers */
397 compatible = "fsl,mpc8349-pci";
398 device_type = "pci";
399 };
400
401 pci1: pcie@e0009000 {
402 #address-cells = <3>;
403 #size-cells = <2>;
404 #interrupt-cells = <1>;
405 device_type = "pci";
406 compatible = "fsl,mpc8377-pcie", "fsl,mpc8314-pcie";
407 reg = <0xe0009000 0x00001000>;
408 ranges = <0x02000000 0 0xa8000000 0xa8000000 0 0x10000000
409 0x01000000 0 0x00000000 0xb8000000 0 0x00800000>;
410 bus-range = <0 255>;
411 interrupt-map-mask = <0xf800 0 0 7>;
412 interrupt-map = <0 0 0 1 &ipic 1 8
413 0 0 0 2 &ipic 1 8
414 0 0 0 3 &ipic 1 8
415 0 0 0 4 &ipic 1 8>;
416 sleep = <&pmc 0x00300000>;
417 clock-frequency = <0>;
418
419 pcie@0 {
420 #address-cells = <3>;
421 #size-cells = <2>;
422 device_type = "pci";
423 reg = <0 0 0 0 0>;
424 ranges = <0x02000000 0 0xa8000000
425 0x02000000 0 0xa8000000
426 0 0x10000000
427 0x01000000 0 0x00000000
428 0x01000000 0 0x00000000
429 0 0x00800000>;
430 };
431 };
432
433 pci2: pcie@e000a000 {
434 #address-cells = <3>;
435 #size-cells = <2>;
436 #interrupt-cells = <1>;
437 device_type = "pci";
438 compatible = "fsl,mpc8377-pcie", "fsl,mpc8314-pcie";
439 reg = <0xe000a000 0x00001000>;
440 ranges = <0x02000000 0 0xc8000000 0xc8000000 0 0x10000000
441 0x01000000 0 0x00000000 0xd8000000 0 0x00800000>;
442 bus-range = <0 255>;
443 interrupt-map-mask = <0xf800 0 0 7>;
444 interrupt-map = <0 0 0 1 &ipic 2 8
445 0 0 0 2 &ipic 2 8
446 0 0 0 3 &ipic 2 8
447 0 0 0 4 &ipic 2 8>;
448 sleep = <&pmc 0x000c0000>;
449 clock-frequency = <0>;
450
451 pcie@0 {
452 #address-cells = <3>;
453 #size-cells = <2>;
454 device_type = "pci";
455 reg = <0 0 0 0 0>;
456 ranges = <0x02000000 0 0xc8000000
457 0x02000000 0 0xc8000000
458 0 0x10000000
459 0x01000000 0 0x00000000
460 0x01000000 0 0x00000000
461 0 0x00800000>;
462 };
463 };
464};
diff --git a/arch/powerpc/boot/dts/mpc8378_rdb.dts b/arch/powerpc/boot/dts/mpc8378_rdb.dts
index aabf3437cadf..a11ead8214b4 100644
--- a/arch/powerpc/boot/dts/mpc8378_rdb.dts
+++ b/arch/powerpc/boot/dts/mpc8378_rdb.dts
@@ -174,7 +174,7 @@
174 interrupts = <42 0x8>; 174 interrupts = <42 0x8>;
175 interrupt-parent = <&ipic>; 175 interrupt-parent = <&ipic>;
176 /* Filled in by U-Boot */ 176 /* Filled in by U-Boot */
177 clock-frequency = <0>; 177 clock-frequency = <111111111>;
178 }; 178 };
179 }; 179 };
180 180
diff --git a/arch/powerpc/boot/dts/mpc8379_rdb.dts b/arch/powerpc/boot/dts/mpc8379_rdb.dts
index 9b1da864d890..e35dfba587c8 100644
--- a/arch/powerpc/boot/dts/mpc8379_rdb.dts
+++ b/arch/powerpc/boot/dts/mpc8379_rdb.dts
@@ -172,7 +172,7 @@
172 interrupts = <42 0x8>; 172 interrupts = <42 0x8>;
173 interrupt-parent = <&ipic>; 173 interrupt-parent = <&ipic>;
174 /* Filled in by U-Boot */ 174 /* Filled in by U-Boot */
175 clock-frequency = <0>; 175 clock-frequency = <111111111>;
176 }; 176 };
177 }; 177 };
178 178
diff --git a/arch/powerpc/boot/dts/mpc8536ds.dts b/arch/powerpc/boot/dts/mpc8536ds.dts
index e781ad2f1f8a..815cebb2e3e5 100644
--- a/arch/powerpc/boot/dts/mpc8536ds.dts
+++ b/arch/powerpc/boot/dts/mpc8536ds.dts
@@ -14,8 +14,8 @@
14/ { 14/ {
15 model = "fsl,mpc8536ds"; 15 model = "fsl,mpc8536ds";
16 compatible = "fsl,mpc8536ds"; 16 compatible = "fsl,mpc8536ds";
17 #address-cells = <1>; 17 #address-cells = <2>;
18 #size-cells = <1>; 18 #size-cells = <2>;
19 19
20 aliases { 20 aliases {
21 ethernet0 = &enet0; 21 ethernet0 = &enet0;
@@ -42,7 +42,7 @@
42 42
43 memory { 43 memory {
44 device_type = "memory"; 44 device_type = "memory";
45 reg = <00000000 00000000>; // Filled by U-Boot 45 reg = <0 0 0 0>; // Filled by U-Boot
46 }; 46 };
47 47
48 soc@ffe00000 { 48 soc@ffe00000 {
@@ -50,7 +50,7 @@
50 #size-cells = <1>; 50 #size-cells = <1>;
51 device_type = "soc"; 51 device_type = "soc";
52 compatible = "simple-bus"; 52 compatible = "simple-bus";
53 ranges = <0x0 0xffe00000 0x100000>; 53 ranges = <0x0 0 0xffe00000 0x100000>;
54 bus-frequency = <0>; // Filled out by uboot. 54 bus-frequency = <0>; // Filled out by uboot.
55 55
56 ecm-law@0 { 56 ecm-law@0 {
@@ -250,6 +250,14 @@
250 phy_type = "ulpi"; 250 phy_type = "ulpi";
251 }; 251 };
252 252
253 sdhci@2e000 {
254 compatible = "fsl,mpc8536-esdhc", "fsl,esdhc";
255 reg = <0x2e000 0x1000>;
256 interrupts = <72 0x2>;
257 interrupt-parent = <&mpic>;
258 clock-frequency = <250000000>;
259 };
260
253 serial0: serial@4500 { 261 serial0: serial@4500 {
254 cell-index = <0>; 262 cell-index = <0>;
255 device_type = "serial"; 263 device_type = "serial";
@@ -347,13 +355,13 @@
347 interrupt-parent = <&mpic>; 355 interrupt-parent = <&mpic>;
348 interrupts = <24 0x2>; 356 interrupts = <24 0x2>;
349 bus-range = <0 0xff>; 357 bus-range = <0 0xff>;
350 ranges = <0x02000000 0 0x80000000 0x80000000 0 0x10000000 358 ranges = <0x02000000 0 0x80000000 0 0x80000000 0 0x10000000
351 0x01000000 0 0x00000000 0xffc00000 0 0x00010000>; 359 0x01000000 0 0x00000000 0 0xffc00000 0 0x00010000>;
352 clock-frequency = <66666666>; 360 clock-frequency = <66666666>;
353 #interrupt-cells = <1>; 361 #interrupt-cells = <1>;
354 #size-cells = <2>; 362 #size-cells = <2>;
355 #address-cells = <3>; 363 #address-cells = <3>;
356 reg = <0xffe08000 0x1000>; 364 reg = <0 0xffe08000 0 0x1000>;
357 }; 365 };
358 366
359 pci1: pcie@ffe09000 { 367 pci1: pcie@ffe09000 {
@@ -362,10 +370,10 @@
362 #interrupt-cells = <1>; 370 #interrupt-cells = <1>;
363 #size-cells = <2>; 371 #size-cells = <2>;
364 #address-cells = <3>; 372 #address-cells = <3>;
365 reg = <0xffe09000 0x1000>; 373 reg = <0 0xffe09000 0 0x1000>;
366 bus-range = <0 0xff>; 374 bus-range = <0 0xff>;
367 ranges = <0x02000000 0 0x98000000 0x98000000 0 0x08000000 375 ranges = <0x02000000 0 0x98000000 0 0x98000000 0 0x08000000
368 0x01000000 0 0x00000000 0xffc20000 0 0x00010000>; 376 0x01000000 0 0x00000000 0 0xffc20000 0 0x00010000>;
369 clock-frequency = <33333333>; 377 clock-frequency = <33333333>;
370 interrupt-parent = <&mpic>; 378 interrupt-parent = <&mpic>;
371 interrupts = <25 0x2>; 379 interrupts = <25 0x2>;
@@ -398,10 +406,10 @@
398 #interrupt-cells = <1>; 406 #interrupt-cells = <1>;
399 #size-cells = <2>; 407 #size-cells = <2>;
400 #address-cells = <3>; 408 #address-cells = <3>;
401 reg = <0xffe0a000 0x1000>; 409 reg = <0 0xffe0a000 0 0x1000>;
402 bus-range = <0 0xff>; 410 bus-range = <0 0xff>;
403 ranges = <0x02000000 0 0x90000000 0x90000000 0 0x08000000 411 ranges = <0x02000000 0 0x90000000 0 0x90000000 0 0x08000000
404 0x01000000 0 0x00000000 0xffc10000 0 0x00010000>; 412 0x01000000 0 0x00000000 0 0xffc10000 0 0x00010000>;
405 clock-frequency = <33333333>; 413 clock-frequency = <33333333>;
406 interrupt-parent = <&mpic>; 414 interrupt-parent = <&mpic>;
407 interrupts = <26 0x2>; 415 interrupts = <26 0x2>;
@@ -434,10 +442,10 @@
434 #interrupt-cells = <1>; 442 #interrupt-cells = <1>;
435 #size-cells = <2>; 443 #size-cells = <2>;
436 #address-cells = <3>; 444 #address-cells = <3>;
437 reg = <0xffe0b000 0x1000>; 445 reg = <0 0xffe0b000 0 0x1000>;
438 bus-range = <0 0xff>; 446 bus-range = <0 0xff>;
439 ranges = <0x02000000 0 0xa0000000 0xa0000000 0 0x20000000 447 ranges = <0x02000000 0 0xa0000000 0 0xa0000000 0 0x20000000
440 0x01000000 0 0x00000000 0xffc30000 0 0x00010000>; 448 0x01000000 0 0x00000000 0 0xffc30000 0 0x00010000>;
441 clock-frequency = <33333333>; 449 clock-frequency = <33333333>;
442 interrupt-parent = <&mpic>; 450 interrupt-parent = <&mpic>;
443 interrupts = <27 0x2>; 451 interrupts = <27 0x2>;
diff --git a/arch/powerpc/boot/dts/mpc8536ds_36b.dts b/arch/powerpc/boot/dts/mpc8536ds_36b.dts
new file mode 100644
index 000000000000..d95b26021e62
--- /dev/null
+++ b/arch/powerpc/boot/dts/mpc8536ds_36b.dts
@@ -0,0 +1,475 @@
1/*
2 * MPC8536 DS Device Tree Source
3 *
4 * Copyright 2008-2009 Freescale Semiconductor, Inc.
5 *
6 * This program is free software; you can redistribute it and/or modify it
7 * under the terms of the GNU General Public License as published by the
8 * Free Software Foundation; either version 2 of the License, or (at your
9 * option) any later version.
10 */
11
12/dts-v1/;
13
14/ {
15 model = "fsl,mpc8536ds";
16 compatible = "fsl,mpc8536ds";
17 #address-cells = <2>;
18 #size-cells = <2>;
19
20 aliases {
21 ethernet0 = &enet0;
22 ethernet1 = &enet1;
23 serial0 = &serial0;
24 serial1 = &serial1;
25 pci0 = &pci0;
26 pci1 = &pci1;
27 pci2 = &pci2;
28 pci3 = &pci3;
29 };
30
31 cpus {
32 #cpus = <1>;
33 #address-cells = <1>;
34 #size-cells = <0>;
35
36 PowerPC,8536@0 {
37 device_type = "cpu";
38 reg = <0>;
39 next-level-cache = <&L2>;
40 };
41 };
42
43 memory {
44 device_type = "memory";
45 reg = <0 0 0 0>; // Filled by U-Boot
46 };
47
48 soc@fffe00000 {
49 #address-cells = <1>;
50 #size-cells = <1>;
51 device_type = "soc";
52 compatible = "simple-bus";
53 ranges = <0x0 0xf 0xffe00000 0x100000>;
54 bus-frequency = <0>; // Filled out by uboot.
55
56 ecm-law@0 {
57 compatible = "fsl,ecm-law";
58 reg = <0x0 0x1000>;
59 fsl,num-laws = <12>;
60 };
61
62 ecm@1000 {
63 compatible = "fsl,mpc8536-ecm", "fsl,ecm";
64 reg = <0x1000 0x1000>;
65 interrupts = <17 2>;
66 interrupt-parent = <&mpic>;
67 };
68
69 memory-controller@2000 {
70 compatible = "fsl,mpc8536-memory-controller";
71 reg = <0x2000 0x1000>;
72 interrupt-parent = <&mpic>;
73 interrupts = <18 0x2>;
74 };
75
76 L2: l2-cache-controller@20000 {
77 compatible = "fsl,mpc8536-l2-cache-controller";
78 reg = <0x20000 0x1000>;
79 interrupt-parent = <&mpic>;
80 interrupts = <16 0x2>;
81 };
82
83 i2c@3000 {
84 #address-cells = <1>;
85 #size-cells = <0>;
86 cell-index = <0>;
87 compatible = "fsl-i2c";
88 reg = <0x3000 0x100>;
89 interrupts = <43 0x2>;
90 interrupt-parent = <&mpic>;
91 dfsrr;
92 };
93
94 i2c@3100 {
95 #address-cells = <1>;
96 #size-cells = <0>;
97 cell-index = <1>;
98 compatible = "fsl-i2c";
99 reg = <0x3100 0x100>;
100 interrupts = <43 0x2>;
101 interrupt-parent = <&mpic>;
102 dfsrr;
103 rtc@68 {
104 compatible = "dallas,ds3232";
105 reg = <0x68>;
106 interrupts = <0 0x1>;
107 interrupt-parent = <&mpic>;
108 };
109 };
110
111 dma@21300 {
112 #address-cells = <1>;
113 #size-cells = <1>;
114 compatible = "fsl,mpc8536-dma", "fsl,eloplus-dma";
115 reg = <0x21300 4>;
116 ranges = <0 0x21100 0x200>;
117 cell-index = <0>;
118 dma-channel@0 {
119 compatible = "fsl,mpc8536-dma-channel",
120 "fsl,eloplus-dma-channel";
121 reg = <0x0 0x80>;
122 cell-index = <0>;
123 interrupt-parent = <&mpic>;
124 interrupts = <20 2>;
125 };
126 dma-channel@80 {
127 compatible = "fsl,mpc8536-dma-channel",
128 "fsl,eloplus-dma-channel";
129 reg = <0x80 0x80>;
130 cell-index = <1>;
131 interrupt-parent = <&mpic>;
132 interrupts = <21 2>;
133 };
134 dma-channel@100 {
135 compatible = "fsl,mpc8536-dma-channel",
136 "fsl,eloplus-dma-channel";
137 reg = <0x100 0x80>;
138 cell-index = <2>;
139 interrupt-parent = <&mpic>;
140 interrupts = <22 2>;
141 };
142 dma-channel@180 {
143 compatible = "fsl,mpc8536-dma-channel",
144 "fsl,eloplus-dma-channel";
145 reg = <0x180 0x80>;
146 cell-index = <3>;
147 interrupt-parent = <&mpic>;
148 interrupts = <23 2>;
149 };
150 };
151
152 usb@22000 {
153 compatible = "fsl,mpc8536-usb2-mph", "fsl-usb2-mph";
154 reg = <0x22000 0x1000>;
155 #address-cells = <1>;
156 #size-cells = <0>;
157 interrupt-parent = <&mpic>;
158 interrupts = <28 0x2>;
159 phy_type = "ulpi";
160 };
161
162 usb@23000 {
163 compatible = "fsl,mpc8536-usb2-mph", "fsl-usb2-mph";
164 reg = <0x23000 0x1000>;
165 #address-cells = <1>;
166 #size-cells = <0>;
167 interrupt-parent = <&mpic>;
168 interrupts = <46 0x2>;
169 phy_type = "ulpi";
170 };
171
172 enet0: ethernet@24000 {
173 #address-cells = <1>;
174 #size-cells = <1>;
175 cell-index = <0>;
176 device_type = "network";
177 model = "eTSEC";
178 compatible = "gianfar";
179 reg = <0x24000 0x1000>;
180 ranges = <0x0 0x24000 0x1000>;
181 local-mac-address = [ 00 00 00 00 00 00 ];
182 interrupts = <29 2 30 2 34 2>;
183 interrupt-parent = <&mpic>;
184 tbi-handle = <&tbi0>;
185 phy-handle = <&phy1>;
186 phy-connection-type = "rgmii-id";
187
188 mdio@520 {
189 #address-cells = <1>;
190 #size-cells = <0>;
191 compatible = "fsl,gianfar-mdio";
192 reg = <0x520 0x20>;
193
194 phy0: ethernet-phy@0 {
195 interrupt-parent = <&mpic>;
196 interrupts = <10 0x1>;
197 reg = <0>;
198 device_type = "ethernet-phy";
199 };
200 phy1: ethernet-phy@1 {
201 interrupt-parent = <&mpic>;
202 interrupts = <10 0x1>;
203 reg = <1>;
204 device_type = "ethernet-phy";
205 };
206 tbi0: tbi-phy@11 {
207 reg = <0x11>;
208 device_type = "tbi-phy";
209 };
210 };
211 };
212
213 enet1: ethernet@26000 {
214 #address-cells = <1>;
215 #size-cells = <1>;
216 cell-index = <1>;
217 device_type = "network";
218 model = "eTSEC";
219 compatible = "gianfar";
220 reg = <0x26000 0x1000>;
221 ranges = <0x0 0x26000 0x1000>;
222 local-mac-address = [ 00 00 00 00 00 00 ];
223 interrupts = <31 2 32 2 33 2>;
224 interrupt-parent = <&mpic>;
225 tbi-handle = <&tbi1>;
226 phy-handle = <&phy0>;
227 phy-connection-type = "rgmii-id";
228
229 mdio@520 {
230 #address-cells = <1>;
231 #size-cells = <0>;
232 compatible = "fsl,gianfar-tbi";
233 reg = <0x520 0x20>;
234
235 tbi1: tbi-phy@11 {
236 reg = <0x11>;
237 device_type = "tbi-phy";
238 };
239 };
240 };
241
242 usb@2b000 {
243 compatible = "fsl,mpc8536-usb2-dr", "fsl-usb2-dr";
244 reg = <0x2b000 0x1000>;
245 #address-cells = <1>;
246 #size-cells = <0>;
247 interrupt-parent = <&mpic>;
248 interrupts = <60 0x2>;
249 dr_mode = "peripheral";
250 phy_type = "ulpi";
251 };
252
253 sdhci@2e000 {
254 compatible = "fsl,mpc8536-esdhc", "fsl,esdhc";
255 reg = <0x2e000 0x1000>;
256 interrupts = <72 0x2>;
257 interrupt-parent = <&mpic>;
258 clock-frequency = <250000000>;
259 };
260
261 serial0: serial@4500 {
262 cell-index = <0>;
263 device_type = "serial";
264 compatible = "ns16550";
265 reg = <0x4500 0x100>;
266 clock-frequency = <0>;
267 interrupts = <42 0x2>;
268 interrupt-parent = <&mpic>;
269 };
270
271 serial1: serial@4600 {
272 cell-index = <1>;
273 device_type = "serial";
274 compatible = "ns16550";
275 reg = <0x4600 0x100>;
276 clock-frequency = <0>;
277 interrupts = <42 0x2>;
278 interrupt-parent = <&mpic>;
279 };
280
281 crypto@30000 {
282 compatible = "fsl,sec3.0", "fsl,sec2.4", "fsl,sec2.2",
283 "fsl,sec2.1", "fsl,sec2.0";
284 reg = <0x30000 0x10000>;
285 interrupts = <45 2 58 2>;
286 interrupt-parent = <&mpic>;
287 fsl,num-channels = <4>;
288 fsl,channel-fifo-len = <24>;
289 fsl,exec-units-mask = <0x9fe>;
290 fsl,descriptor-types-mask = <0x3ab0ebf>;
291 };
292
293 sata@18000 {
294 compatible = "fsl,mpc8536-sata", "fsl,pq-sata";
295 reg = <0x18000 0x1000>;
296 cell-index = <1>;
297 interrupts = <74 0x2>;
298 interrupt-parent = <&mpic>;
299 };
300
301 sata@19000 {
302 compatible = "fsl,mpc8536-sata", "fsl,pq-sata";
303 reg = <0x19000 0x1000>;
304 cell-index = <2>;
305 interrupts = <41 0x2>;
306 interrupt-parent = <&mpic>;
307 };
308
309 global-utilities@e0000 { //global utilities block
310 compatible = "fsl,mpc8548-guts";
311 reg = <0xe0000 0x1000>;
312 fsl,has-rstcr;
313 };
314
315 mpic: pic@40000 {
316 clock-frequency = <0>;
317 interrupt-controller;
318 #address-cells = <0>;
319 #interrupt-cells = <2>;
320 reg = <0x40000 0x40000>;
321 compatible = "chrp,open-pic";
322 device_type = "open-pic";
323 big-endian;
324 };
325
326 msi@41600 {
327 compatible = "fsl,mpc8536-msi", "fsl,mpic-msi";
328 reg = <0x41600 0x80>;
329 msi-available-ranges = <0 0x100>;
330 interrupts = <
331 0xe0 0
332 0xe1 0
333 0xe2 0
334 0xe3 0
335 0xe4 0
336 0xe5 0
337 0xe6 0
338 0xe7 0>;
339 interrupt-parent = <&mpic>;
340 };
341 };
342
343 pci0: pci@fffe08000 {
344 compatible = "fsl,mpc8540-pci";
345 device_type = "pci";
346 interrupt-map-mask = <0xf800 0x0 0x0 0x7>;
347 interrupt-map = <
348
349 /* IDSEL 0x11 J17 Slot 1 */
350 0x8800 0 0 1 &mpic 1 1
351 0x8800 0 0 2 &mpic 2 1
352 0x8800 0 0 3 &mpic 3 1
353 0x8800 0 0 4 &mpic 4 1>;
354
355 interrupt-parent = <&mpic>;
356 interrupts = <24 0x2>;
357 bus-range = <0 0xff>;
358 ranges = <0x02000000 0 0xf0000000 0xc 0x00000000 0 0x10000000
359 0x01000000 0 0x00000000 0xf 0xffc00000 0 0x00010000>;
360 clock-frequency = <66666666>;
361 #interrupt-cells = <1>;
362 #size-cells = <2>;
363 #address-cells = <3>;
364 reg = <0xf 0xffe08000 0 0x1000>;
365 };
366
367 pci1: pcie@fffe09000 {
368 compatible = "fsl,mpc8548-pcie";
369 device_type = "pci";
370 #interrupt-cells = <1>;
371 #size-cells = <2>;
372 #address-cells = <3>;
373 reg = <0xf 0xffe09000 0 0x1000>;
374 bus-range = <0 0xff>;
375 ranges = <0x02000000 0 0xf8000000 0xc 0x18000000 0 0x08000000
376 0x01000000 0 0x00000000 0xf 0xffc20000 0 0x00010000>;
377 clock-frequency = <33333333>;
378 interrupt-parent = <&mpic>;
379 interrupts = <25 0x2>;
380 interrupt-map-mask = <0xf800 0 0 7>;
381 interrupt-map = <
382 /* IDSEL 0x0 */
383 0000 0 0 1 &mpic 4 1
384 0000 0 0 2 &mpic 5 1
385 0000 0 0 3 &mpic 6 1
386 0000 0 0 4 &mpic 7 1
387 >;
388 pcie@0 {
389 reg = <0 0 0 0 0>;
390 #size-cells = <2>;
391 #address-cells = <3>;
392 device_type = "pci";
393 ranges = <0x02000000 0 0xf8000000
394 0x02000000 0 0xf8000000
395 0 0x08000000
396
397 0x01000000 0 0x00000000
398 0x01000000 0 0x00000000
399 0 0x00010000>;
400 };
401 };
402
403 pci2: pcie@fffe0a000 {
404 compatible = "fsl,mpc8548-pcie";
405 device_type = "pci";
406 #interrupt-cells = <1>;
407 #size-cells = <2>;
408 #address-cells = <3>;
409 reg = <0xf 0xffe0a000 0 0x1000>;
410 bus-range = <0 0xff>;
411 ranges = <0x02000000 0 0xf8000000 0xc 0x10000000 0 0x08000000
412 0x01000000 0 0x00000000 0xf 0xffc10000 0 0x00010000>;
413 clock-frequency = <33333333>;
414 interrupt-parent = <&mpic>;
415 interrupts = <26 0x2>;
416 interrupt-map-mask = <0xf800 0 0 7>;
417 interrupt-map = <
418 /* IDSEL 0x0 */
419 0000 0 0 1 &mpic 0 1
420 0000 0 0 2 &mpic 1 1
421 0000 0 0 3 &mpic 2 1
422 0000 0 0 4 &mpic 3 1
423 >;
424 pcie@0 {
425 reg = <0 0 0 0 0>;
426 #size-cells = <2>;
427 #address-cells = <3>;
428 device_type = "pci";
429 ranges = <0x02000000 0 0xf8000000
430 0x02000000 0 0xf8000000
431 0 0x08000000
432
433 0x01000000 0 0x00000000
434 0x01000000 0 0x00000000
435 0 0x00010000>;
436 };
437 };
438
439 pci3: pcie@fffe0b000 {
440 compatible = "fsl,mpc8548-pcie";
441 device_type = "pci";
442 #interrupt-cells = <1>;
443 #size-cells = <2>;
444 #address-cells = <3>;
445 reg = <0xf 0xffe0b000 0 0x1000>;
446 bus-range = <0 0xff>;
447 ranges = <0x02000000 0 0xe0000000 0xc 0x20000000 0 0x20000000
448 0x01000000 0 0x00000000 0xf 0xffc30000 0 0x00010000>;
449 clock-frequency = <33333333>;
450 interrupt-parent = <&mpic>;
451 interrupts = <27 0x2>;
452 interrupt-map-mask = <0xf800 0 0 7>;
453 interrupt-map = <
454 /* IDSEL 0x0 */
455 0000 0 0 1 &mpic 8 1
456 0000 0 0 2 &mpic 9 1
457 0000 0 0 3 &mpic 10 1
458 0000 0 0 4 &mpic 11 1
459 >;
460
461 pcie@0 {
462 reg = <0 0 0 0 0>;
463 #size-cells = <2>;
464 #address-cells = <3>;
465 device_type = "pci";
466 ranges = <0x02000000 0 0xe0000000
467 0x02000000 0 0xe0000000
468 0 0x20000000
469
470 0x01000000 0 0x00000000
471 0x01000000 0 0x00000000
472 0 0x00100000>;
473 };
474 };
475};
diff --git a/arch/powerpc/boot/dts/mpc8548cds.dts b/arch/powerpc/boot/dts/mpc8548cds.dts
index 475be1433fe1..4173af387c63 100644
--- a/arch/powerpc/boot/dts/mpc8548cds.dts
+++ b/arch/powerpc/boot/dts/mpc8548cds.dts
@@ -100,6 +100,21 @@
100 interrupts = <43 2>; 100 interrupts = <43 2>;
101 interrupt-parent = <&mpic>; 101 interrupt-parent = <&mpic>;
102 dfsrr; 102 dfsrr;
103
104 eeprom@50 {
105 compatible = "atmel,24c64";
106 reg = <0x50>;
107 };
108
109 eeprom@56 {
110 compatible = "atmel,24c64";
111 reg = <0x56>;
112 };
113
114 eeprom@57 {
115 compatible = "atmel,24c64";
116 reg = <0x57>;
117 };
103 }; 118 };
104 119
105 i2c@3100 { 120 i2c@3100 {
@@ -111,6 +126,11 @@
111 interrupts = <43 2>; 126 interrupts = <43 2>;
112 interrupt-parent = <&mpic>; 127 interrupt-parent = <&mpic>;
113 dfsrr; 128 dfsrr;
129
130 eeprom@50 {
131 compatible = "atmel,24c64";
132 reg = <0x50>;
133 };
114 }; 134 };
115 135
116 dma@21300 { 136 dma@21300 {
diff --git a/arch/powerpc/boot/dts/mpc8569mds.dts b/arch/powerpc/boot/dts/mpc8569mds.dts
index 9e4ce99e1613..06332d61830a 100644
--- a/arch/powerpc/boot/dts/mpc8569mds.dts
+++ b/arch/powerpc/boot/dts/mpc8569mds.dts
@@ -99,8 +99,18 @@
99 }; 99 };
100 100
101 bcsr@1,0 { 101 bcsr@1,0 {
102 #address-cells = <1>;
103 #size-cells = <1>;
102 compatible = "fsl,mpc8569mds-bcsr"; 104 compatible = "fsl,mpc8569mds-bcsr";
103 reg = <1 0 0x8000>; 105 reg = <1 0 0x8000>;
106 ranges = <0 1 0 0x8000>;
107
108 bcsr17: gpio-controller@11 {
109 #gpio-cells = <2>;
110 compatible = "fsl,mpc8569mds-bcsr-gpio";
111 reg = <0x11 0x1>;
112 gpio-controller;
113 };
104 }; 114 };
105 115
106 nand@3,0 { 116 nand@3,0 {
@@ -315,6 +325,14 @@
315 gpio-controller; 325 gpio-controller;
316 }; 326 };
317 327
328 qe_pio_f: gpio-controller@a0 {
329 #gpio-cells = <2>;
330 compatible = "fsl,mpc8569-qe-pario-bank",
331 "fsl,mpc8323-qe-pario-bank";
332 reg = <0xa0 0x18>;
333 gpio-controller;
334 };
335
318 pio1: ucc_pin@01 { 336 pio1: ucc_pin@01 {
319 pio-map = < 337 pio-map = <
320 /* port pin dir open_drain assignment has_irq */ 338 /* port pin dir open_drain assignment has_irq */
@@ -419,6 +437,16 @@
419 interrupt-parent = <&mpic>; 437 interrupt-parent = <&mpic>;
420 }; 438 };
421 439
440 timer@440 {
441 compatible = "fsl,mpc8569-qe-gtm",
442 "fsl,qe-gtm", "fsl,gtm";
443 reg = <0x440 0x40>;
444 interrupts = <12 13 14 15>;
445 interrupt-parent = <&qeic>;
446 /* Filled in by U-Boot */
447 clock-frequency = <0>;
448 };
449
422 spi@4c0 { 450 spi@4c0 {
423 #address-cells = <1>; 451 #address-cells = <1>;
424 #size-cells = <0>; 452 #size-cells = <0>;
@@ -446,6 +474,23 @@
446 mode = "cpu"; 474 mode = "cpu";
447 }; 475 };
448 476
477 usb@6c0 {
478 compatible = "fsl,mpc8569-qe-usb",
479 "fsl,mpc8323-qe-usb";
480 reg = <0x6c0 0x40 0x8b00 0x100>;
481 interrupts = <11>;
482 interrupt-parent = <&qeic>;
483 fsl,fullspeed-clock = "clk5";
484 fsl,lowspeed-clock = "brg10";
485 gpios = <&qe_pio_f 3 0 /* USBOE */
486 &qe_pio_f 4 0 /* USBTP */
487 &qe_pio_f 5 0 /* USBTN */
488 &qe_pio_f 6 0 /* USBRP */
489 &qe_pio_f 8 0 /* USBRN */
490 &bcsr17 6 0 /* SPEED */
491 &bcsr17 5 1>; /* POWER */
492 };
493
449 enet0: ucc@2000 { 494 enet0: ucc@2000 {
450 device_type = "network"; 495 device_type = "network";
451 compatible = "ucc_geth"; 496 compatible = "ucc_geth";
diff --git a/arch/powerpc/boot/dts/p2020rdb.dts b/arch/powerpc/boot/dts/p2020rdb.dts
new file mode 100644
index 000000000000..da4cb0d8d215
--- /dev/null
+++ b/arch/powerpc/boot/dts/p2020rdb.dts
@@ -0,0 +1,586 @@
1/*
2 * P2020 RDB Device Tree Source
3 *
4 * Copyright 2009 Freescale Semiconductor Inc.
5 *
6 * This program is free software; you can redistribute it and/or modify it
7 * under the terms of the GNU General Public License as published by the
8 * Free Software Foundation; either version 2 of the License, or (at your
9 * option) any later version.
10 */
11
12/dts-v1/;
13/ {
14 model = "fsl,P2020";
15 compatible = "fsl,P2020RDB";
16 #address-cells = <2>;
17 #size-cells = <2>;
18
19 aliases {
20 ethernet0 = &enet0;
21 ethernet1 = &enet1;
22 ethernet2 = &enet2;
23 serial0 = &serial0;
24 serial1 = &serial1;
25 pci0 = &pci0;
26 pci1 = &pci1;
27 };
28
29 cpus {
30 #address-cells = <1>;
31 #size-cells = <0>;
32
33 PowerPC,P2020@0 {
34 device_type = "cpu";
35 reg = <0x0>;
36 next-level-cache = <&L2>;
37 };
38
39 PowerPC,P2020@1 {
40 device_type = "cpu";
41 reg = <0x1>;
42 next-level-cache = <&L2>;
43 };
44 };
45
46 memory {
47 device_type = "memory";
48 };
49
50 localbus@ffe05000 {
51 #address-cells = <2>;
52 #size-cells = <1>;
53 compatible = "fsl,p2020-elbc", "fsl,elbc", "simple-bus";
54 reg = <0 0xffe05000 0 0x1000>;
55 interrupts = <19 2>;
56 interrupt-parent = <&mpic>;
57
58 /* NOR and NAND Flashes */
59 ranges = <0x0 0x0 0x0 0xef000000 0x01000000
60 0x1 0x0 0x0 0xffa00000 0x00040000
61 0x2 0x0 0x0 0xffb00000 0x00020000>;
62
63 nor@0,0 {
64 #address-cells = <1>;
65 #size-cells = <1>;
66 compatible = "cfi-flash";
67 reg = <0x0 0x0 0x1000000>;
68 bank-width = <2>;
69 device-width = <1>;
70
71 partition@0 {
72 /* This location must not be altered */
73 /* 256KB for Vitesse 7385 Switch firmware */
74 reg = <0x0 0x00040000>;
75 label = "NOR (RO) Vitesse-7385 Firmware";
76 read-only;
77 };
78
79 partition@40000 {
80 /* 256KB for DTB Image */
81 reg = <0x00040000 0x00040000>;
82 label = "NOR (RO) DTB Image";
83 read-only;
84 };
85
86 partition@80000 {
87 /* 3.5 MB for Linux Kernel Image */
88 reg = <0x00080000 0x00380000>;
89 label = "NOR (RO) Linux Kernel Image";
90 read-only;
91 };
92
93 partition@400000 {
94 /* 11MB for JFFS2 based Root file System */
95 reg = <0x00400000 0x00b00000>;
96 label = "NOR (RW) JFFS2 Root File System";
97 };
98
99 partition@f00000 {
100 /* This location must not be altered */
101 /* 512KB for u-boot Bootloader Image */
102 /* 512KB for u-boot Environment Variables */
103 reg = <0x00f00000 0x00100000>;
104 label = "NOR (RO) U-Boot Image";
105 read-only;
106 };
107 };
108
109 nand@1,0 {
110 #address-cells = <1>;
111 #size-cells = <1>;
112 compatible = "fsl,p2020-fcm-nand",
113 "fsl,elbc-fcm-nand";
114 reg = <0x1 0x0 0x40000>;
115
116 partition@0 {
117 /* This location must not be altered */
118 /* 1MB for u-boot Bootloader Image */
119 reg = <0x0 0x00100000>;
120 label = "NAND (RO) U-Boot Image";
121 read-only;
122 };
123
124 partition@100000 {
125 /* 1MB for DTB Image */
126 reg = <0x00100000 0x00100000>;
127 label = "NAND (RO) DTB Image";
128 read-only;
129 };
130
131 partition@200000 {
132 /* 4MB for Linux Kernel Image */
133 reg = <0x00200000 0x00400000>;
134 label = "NAND (RO) Linux Kernel Image";
135 read-only;
136 };
137
138 partition@600000 {
139 /* 4MB for Compressed Root file System Image */
140 reg = <0x00600000 0x00400000>;
141 label = "NAND (RO) Compressed RFS Image";
142 read-only;
143 };
144
145 partition@a00000 {
146 /* 7MB for JFFS2 based Root file System */
147 reg = <0x00a00000 0x00700000>;
148 label = "NAND (RW) JFFS2 Root File System";
149 };
150
151 partition@1100000 {
152 /* 15MB for JFFS2 based Root file System */
153 reg = <0x01100000 0x00f00000>;
154 label = "NAND (RW) Writable User area";
155 };
156 };
157
158 L2switch@2,0 {
159 #address-cells = <1>;
160 #size-cells = <1>;
161 compatible = "vitesse-7385";
162 reg = <0x2 0x0 0x20000>;
163 };
164
165 };
166
167 soc@ffe00000 {
168 #address-cells = <1>;
169 #size-cells = <1>;
170 device_type = "soc";
171 compatible = "fsl,p2020-immr", "simple-bus";
172 ranges = <0x0 0x0 0xffe00000 0x100000>;
173 bus-frequency = <0>; // Filled out by uboot.
174
175 ecm-law@0 {
176 compatible = "fsl,ecm-law";
177 reg = <0x0 0x1000>;
178 fsl,num-laws = <12>;
179 };
180
181 ecm@1000 {
182 compatible = "fsl,p2020-ecm", "fsl,ecm";
183 reg = <0x1000 0x1000>;
184 interrupts = <17 2>;
185 interrupt-parent = <&mpic>;
186 };
187
188 memory-controller@2000 {
189 compatible = "fsl,p2020-memory-controller";
190 reg = <0x2000 0x1000>;
191 interrupt-parent = <&mpic>;
192 interrupts = <18 2>;
193 };
194
195 i2c@3000 {
196 #address-cells = <1>;
197 #size-cells = <0>;
198 cell-index = <0>;
199 compatible = "fsl-i2c";
200 reg = <0x3000 0x100>;
201 interrupts = <43 2>;
202 interrupt-parent = <&mpic>;
203 dfsrr;
204 rtc@68 {
205 compatible = "dallas,ds1339";
206 reg = <0x68>;
207 };
208 };
209
210 i2c@3100 {
211 #address-cells = <1>;
212 #size-cells = <0>;
213 cell-index = <1>;
214 compatible = "fsl-i2c";
215 reg = <0x3100 0x100>;
216 interrupts = <43 2>;
217 interrupt-parent = <&mpic>;
218 dfsrr;
219 };
220
221 serial0: serial@4500 {
222 cell-index = <0>;
223 device_type = "serial";
224 compatible = "ns16550";
225 reg = <0x4500 0x100>;
226 clock-frequency = <0>;
227 interrupts = <42 2>;
228 interrupt-parent = <&mpic>;
229 };
230
231 serial1: serial@4600 {
232 cell-index = <1>;
233 device_type = "serial";
234 compatible = "ns16550";
235 reg = <0x4600 0x100>;
236 clock-frequency = <0>;
237 interrupts = <42 2>;
238 interrupt-parent = <&mpic>;
239 };
240
241 spi@7000 {
242 cell-index = <0>;
243 #address-cells = <1>;
244 #size-cells = <0>;
245 compatible = "fsl,espi";
246 reg = <0x7000 0x1000>;
247 interrupts = <59 0x2>;
248 interrupt-parent = <&mpic>;
249 mode = "cpu";
250
251 fsl_m25p80@0 {
252 #address-cells = <1>;
253 #size-cells = <1>;
254 compatible = "fsl,espi-flash";
255 reg = <0>;
256 linux,modalias = "fsl_m25p80";
257 modal = "s25sl128b";
258 spi-max-frequency = <50000000>;
259 mode = <0>;
260
261 partition@0 {
262 /* 512KB for u-boot Bootloader Image */
263 reg = <0x0 0x00080000>;
264 label = "SPI (RO) U-Boot Image";
265 read-only;
266 };
267
268 partition@80000 {
269 /* 512KB for DTB Image */
270 reg = <0x00080000 0x00080000>;
271 label = "SPI (RO) DTB Image";
272 read-only;
273 };
274
275 partition@100000 {
276 /* 4MB for Linux Kernel Image */
277 reg = <0x00100000 0x00400000>;
278 label = "SPI (RO) Linux Kernel Image";
279 read-only;
280 };
281
282 partition@500000 {
283 /* 4MB for Compressed RFS Image */
284 reg = <0x00500000 0x00400000>;
285 label = "SPI (RO) Compressed RFS Image";
286 read-only;
287 };
288
289 partition@900000 {
290 /* 7MB for JFFS2 based RFS */
291 reg = <0x00900000 0x00700000>;
292 label = "SPI (RW) JFFS2 RFS";
293 };
294 };
295 };
296
297 dma@c300 {
298 #address-cells = <1>;
299 #size-cells = <1>;
300 compatible = "fsl,eloplus-dma";
301 reg = <0xc300 0x4>;
302 ranges = <0x0 0xc100 0x200>;
303 cell-index = <1>;
304 dma-channel@0 {
305 compatible = "fsl,eloplus-dma-channel";
306 reg = <0x0 0x80>;
307 cell-index = <0>;
308 interrupt-parent = <&mpic>;
309 interrupts = <76 2>;
310 };
311 dma-channel@80 {
312 compatible = "fsl,eloplus-dma-channel";
313 reg = <0x80 0x80>;
314 cell-index = <1>;
315 interrupt-parent = <&mpic>;
316 interrupts = <77 2>;
317 };
318 dma-channel@100 {
319 compatible = "fsl,eloplus-dma-channel";
320 reg = <0x100 0x80>;
321 cell-index = <2>;
322 interrupt-parent = <&mpic>;
323 interrupts = <78 2>;
324 };
325 dma-channel@180 {
326 compatible = "fsl,eloplus-dma-channel";
327 reg = <0x180 0x80>;
328 cell-index = <3>;
329 interrupt-parent = <&mpic>;
330 interrupts = <79 2>;
331 };
332 };
333
334 gpio: gpio-controller@f000 {
335 #gpio-cells = <2>;
336 compatible = "fsl,mpc8572-gpio";
337 reg = <0xf000 0x100>;
338 interrupts = <47 0x2>;
339 interrupt-parent = <&mpic>;
340 gpio-controller;
341 };
342
343 L2: l2-cache-controller@20000 {
344 compatible = "fsl,p2020-l2-cache-controller";
345 reg = <0x20000 0x1000>;
346 cache-line-size = <32>; // 32 bytes
347 cache-size = <0x80000>; // L2,512K
348 interrupt-parent = <&mpic>;
349 interrupts = <16 2>;
350 };
351
352 dma@21300 {
353 #address-cells = <1>;
354 #size-cells = <1>;
355 compatible = "fsl,eloplus-dma";
356 reg = <0x21300 0x4>;
357 ranges = <0x0 0x21100 0x200>;
358 cell-index = <0>;
359 dma-channel@0 {
360 compatible = "fsl,eloplus-dma-channel";
361 reg = <0x0 0x80>;
362 cell-index = <0>;
363 interrupt-parent = <&mpic>;
364 interrupts = <20 2>;
365 };
366 dma-channel@80 {
367 compatible = "fsl,eloplus-dma-channel";
368 reg = <0x80 0x80>;
369 cell-index = <1>;
370 interrupt-parent = <&mpic>;
371 interrupts = <21 2>;
372 };
373 dma-channel@100 {
374 compatible = "fsl,eloplus-dma-channel";
375 reg = <0x100 0x80>;
376 cell-index = <2>;
377 interrupt-parent = <&mpic>;
378 interrupts = <22 2>;
379 };
380 dma-channel@180 {
381 compatible = "fsl,eloplus-dma-channel";
382 reg = <0x180 0x80>;
383 cell-index = <3>;
384 interrupt-parent = <&mpic>;
385 interrupts = <23 2>;
386 };
387 };
388
389 usb@22000 {
390 #address-cells = <1>;
391 #size-cells = <0>;
392 compatible = "fsl-usb2-dr";
393 reg = <0x22000 0x1000>;
394 interrupt-parent = <&mpic>;
395 interrupts = <28 0x2>;
396 phy_type = "ulpi";
397 };
398
399 enet0: ethernet@24000 {
400 #address-cells = <1>;
401 #size-cells = <1>;
402 cell-index = <0>;
403 device_type = "network";
404 model = "eTSEC";
405 compatible = "gianfar";
406 reg = <0x24000 0x1000>;
407 ranges = <0x0 0x24000 0x1000>;
408 local-mac-address = [ 00 00 00 00 00 00 ];
409 interrupts = <29 2 30 2 34 2>;
410 interrupt-parent = <&mpic>;
411 fixed-link = <1 1 1000 0 0>;
412 phy-connection-type = "rgmii-id";
413
414 mdio@520 {
415 #address-cells = <1>;
416 #size-cells = <0>;
417 compatible = "fsl,gianfar-mdio";
418 reg = <0x520 0x20>;
419
420 phy0: ethernet-phy@0 {
421 interrupt-parent = <&mpic>;
422 interrupts = <3 1>;
423 reg = <0x0>;
424 };
425 phy1: ethernet-phy@1 {
426 interrupt-parent = <&mpic>;
427 interrupts = <3 1>;
428 reg = <0x1>;
429 };
430 };
431 };
432
433 enet1: ethernet@25000 {
434 #address-cells = <1>;
435 #size-cells = <1>;
436 cell-index = <1>;
437 device_type = "network";
438 model = "eTSEC";
439 compatible = "gianfar";
440 reg = <0x25000 0x1000>;
441 ranges = <0x0 0x25000 0x1000>;
442 local-mac-address = [ 00 00 00 00 00 00 ];
443 interrupts = <35 2 36 2 40 2>;
444 interrupt-parent = <&mpic>;
445 tbi-handle = <&tbi0>;
446 phy-handle = <&phy0>;
447 phy-connection-type = "sgmii";
448
449 mdio@520 {
450 #address-cells = <1>;
451 #size-cells = <0>;
452 compatible = "fsl,gianfar-tbi";
453 reg = <0x520 0x20>;
454
455 tbi0: tbi-phy@11 {
456 reg = <0x11>;
457 device_type = "tbi-phy";
458 };
459 };
460 };
461
462 enet2: ethernet@26000 {
463 #address-cells = <1>;
464 #size-cells = <1>;
465 cell-index = <2>;
466 device_type = "network";
467 model = "eTSEC";
468 compatible = "gianfar";
469 reg = <0x26000 0x1000>;
470 ranges = <0x0 0x26000 0x1000>;
471 local-mac-address = [ 00 00 00 00 00 00 ];
472 interrupts = <31 2 32 2 33 2>;
473 interrupt-parent = <&mpic>;
474 phy-handle = <&phy1>;
475 phy-connection-type = "rgmii-id";
476 };
477
478 sdhci@2e000 {
479 compatible = "fsl,p2020-esdhc", "fsl,esdhc";
480 reg = <0x2e000 0x1000>;
481 interrupts = <72 0x2>;
482 interrupt-parent = <&mpic>;
483 /* Filled in by U-Boot */
484 clock-frequency = <0>;
485 };
486
487 crypto@30000 {
488 compatible = "fsl,sec3.1", "fsl,sec3.0", "fsl,sec2.4",
489 "fsl,sec2.2", "fsl,sec2.1", "fsl,sec2.0";
490 reg = <0x30000 0x10000>;
491 interrupts = <45 2 58 2>;
492 interrupt-parent = <&mpic>;
493 fsl,num-channels = <4>;
494 fsl,channel-fifo-len = <24>;
495 fsl,exec-units-mask = <0xbfe>;
496 fsl,descriptor-types-mask = <0x3ab0ebf>;
497 };
498
499 mpic: pic@40000 {
500 interrupt-controller;
501 #address-cells = <0>;
502 #interrupt-cells = <2>;
503 reg = <0x40000 0x40000>;
504 compatible = "chrp,open-pic";
505 device_type = "open-pic";
506 };
507
508 msi@41600 {
509 compatible = "fsl,p2020-msi", "fsl,mpic-msi";
510 reg = <0x41600 0x80>;
511 msi-available-ranges = <0 0x100>;
512 interrupts = <
513 0xe0 0
514 0xe1 0
515 0xe2 0
516 0xe3 0
517 0xe4 0
518 0xe5 0
519 0xe6 0
520 0xe7 0>;
521 interrupt-parent = <&mpic>;
522 };
523
524 global-utilities@e0000 { //global utilities block
525 compatible = "fsl,p2020-guts";
526 reg = <0xe0000 0x1000>;
527 fsl,has-rstcr;
528 };
529 };
530
531 pci0: pcie@ffe09000 {
532 compatible = "fsl,mpc8548-pcie";
533 device_type = "pci";
534 #interrupt-cells = <1>;
535 #size-cells = <2>;
536 #address-cells = <3>;
537 reg = <0 0xffe09000 0 0x1000>;
538 bus-range = <0 255>;
539 ranges = <0x2000000 0x0 0xa0000000 0 0xa0000000 0x0 0x20000000
540 0x1000000 0x0 0x00000000 0 0xffc30000 0x0 0x10000>;
541 clock-frequency = <33333333>;
542 interrupt-parent = <&mpic>;
543 interrupts = <25 2>;
544 pcie@0 {
545 reg = <0x0 0x0 0x0 0x0 0x0>;
546 #size-cells = <2>;
547 #address-cells = <3>;
548 device_type = "pci";
549 ranges = <0x2000000 0x0 0xa0000000
550 0x2000000 0x0 0xa0000000
551 0x0 0x20000000
552
553 0x1000000 0x0 0x0
554 0x1000000 0x0 0x0
555 0x0 0x100000>;
556 };
557 };
558
559 pci1: pcie@ffe0a000 {
560 compatible = "fsl,mpc8548-pcie";
561 device_type = "pci";
562 #interrupt-cells = <1>;
563 #size-cells = <2>;
564 #address-cells = <3>;
565 reg = <0 0xffe0a000 0 0x1000>;
566 bus-range = <0 255>;
567 ranges = <0x2000000 0x0 0xc0000000 0 0xc0000000 0x0 0x20000000
568 0x1000000 0x0 0x00000000 0 0xffc20000 0x0 0x10000>;
569 clock-frequency = <33333333>;
570 interrupt-parent = <&mpic>;
571 interrupts = <26 2>;
572 pcie@0 {
573 reg = <0x0 0x0 0x0 0x0 0x0>;
574 #size-cells = <2>;
575 #address-cells = <3>;
576 device_type = "pci";
577 ranges = <0x2000000 0x0 0xc0000000
578 0x2000000 0x0 0xc0000000
579 0x0 0x20000000
580
581 0x1000000 0x0 0x0
582 0x1000000 0x0 0x0
583 0x0 0x100000>;
584 };
585 };
586};
diff --git a/arch/powerpc/boot/dts/sbc8349.dts b/arch/powerpc/boot/dts/sbc8349.dts
index 2d9fa68f641c..0dc90f9bd814 100644
--- a/arch/powerpc/boot/dts/sbc8349.dts
+++ b/arch/powerpc/boot/dts/sbc8349.dts
@@ -146,18 +146,6 @@
146 phy_type = "ulpi"; 146 phy_type = "ulpi";
147 port0; 147 port0;
148 }; 148 };
149 /* phy type (ULPI, UTMI, UTMI_WIDE, SERIAL) */
150 usb@23000 {
151 device_type = "usb";
152 compatible = "fsl-usb2-dr";
153 reg = <0x23000 0x1000>;
154 #address-cells = <1>;
155 #size-cells = <0>;
156 interrupt-parent = <&ipic>;
157 interrupts = <38 0x8>;
158 dr_mode = "otg";
159 phy_type = "ulpi";
160 };
161 149
162 enet0: ethernet@24000 { 150 enet0: ethernet@24000 {
163 #address-cells = <1>; 151 #address-cells = <1>;
@@ -277,15 +265,55 @@
277 }; 265 };
278 }; 266 };
279 267
268 localbus@e0005000 {
269 #address-cells = <2>;
270 #size-cells = <1>;
271 compatible = "fsl,mpc8349-localbus", "simple-bus";
272 reg = <0xe0005000 0x1000>;
273 interrupts = <77 0x8>;
274 interrupt-parent = <&ipic>;
275 ranges = <0x0 0x0 0xff800000 0x00800000 /* 8MB Flash */
276 0x1 0x0 0xf8000000 0x00002000 /* 8KB EEPROM */
277 0x2 0x0 0x10000000 0x04000000 /* 64MB SDRAM */
278 0x3 0x0 0x10000000 0x04000000>; /* 64MB SDRAM */
279
280 flash@0,0 {
281 #address-cells = <1>;
282 #size-cells = <1>;
283 compatible = "intel,28F640J3A", "cfi-flash";
284 reg = <0x0 0x0 0x800000>;
285 bank-width = <2>;
286 device-width = <1>;
287
288 partition@0 {
289 label = "u-boot";
290 reg = <0x00000000 0x00040000>;
291 read-only;
292 };
293
294 partition@40000 {
295 label = "user";
296 reg = <0x00040000 0x006c0000>;
297 };
298
299 partition@700000 {
300 label = "legacy u-boot";
301 reg = <0x00700000 0x00100000>;
302 read-only;
303 };
304
305 };
306 };
307
280 pci0: pci@e0008500 { 308 pci0: pci@e0008500 {
281 interrupt-map-mask = <0xf800 0x0 0x0 0x7>; 309 interrupt-map-mask = <0xf800 0x0 0x0 0x7>;
282 interrupt-map = < 310 interrupt-map = <
283 311
284 /* IDSEL 0x11 */ 312 /* IDSEL 0x11 */
285 0x8800 0x0 0x0 0x1 &ipic 20 0x8 313 0x8800 0x0 0x0 0x1 &ipic 48 0x8
286 0x8800 0x0 0x0 0x2 &ipic 21 0x8 314 0x8800 0x0 0x0 0x2 &ipic 17 0x8
287 0x8800 0x0 0x0 0x3 &ipic 22 0x8 315 0x8800 0x0 0x0 0x3 &ipic 18 0x8
288 0x8800 0x0 0x0 0x4 &ipic 23 0x8>; 316 0x8800 0x0 0x0 0x4 &ipic 19 0x8>;
289 317
290 interrupt-parent = <&ipic>; 318 interrupt-parent = <&ipic>;
291 interrupts = <0x42 0x8>; 319 interrupts = <0x42 0x8>;
diff --git a/arch/powerpc/boot/dts/sbc8560.dts b/arch/powerpc/boot/dts/sbc8560.dts
index 239d57a55cf4..9e13ed8a1193 100644
--- a/arch/powerpc/boot/dts/sbc8560.dts
+++ b/arch/powerpc/boot/dts/sbc8560.dts
@@ -303,7 +303,6 @@
303 global-utilities@e0000 { 303 global-utilities@e0000 {
304 compatible = "fsl,mpc8560-guts"; 304 compatible = "fsl,mpc8560-guts";
305 reg = <0xe0000 0x1000>; 305 reg = <0xe0000 0x1000>;
306 fsl,has-rstcr;
307 }; 306 };
308 }; 307 };
309 308
diff --git a/arch/powerpc/boot/mktree.c b/arch/powerpc/boot/mktree.c
index c2baae0a3d89..e2ae24340fc8 100644
--- a/arch/powerpc/boot/mktree.c
+++ b/arch/powerpc/boot/mktree.c
@@ -36,7 +36,7 @@ typedef struct boot_block {
36} boot_block_t; 36} boot_block_t;
37 37
38#define IMGBLK 512 38#define IMGBLK 512
39char tmpbuf[IMGBLK]; 39unsigned int tmpbuf[IMGBLK / sizeof(unsigned int)];
40 40
41int main(int argc, char *argv[]) 41int main(int argc, char *argv[])
42{ 42{
@@ -95,13 +95,13 @@ int main(int argc, char *argv[])
95 95
96 /* Assume zImage is an ELF file, and skip the 64K header. 96 /* Assume zImage is an ELF file, and skip the 64K header.
97 */ 97 */
98 if (read(in_fd, tmpbuf, IMGBLK) != IMGBLK) { 98 if (read(in_fd, tmpbuf, sizeof(tmpbuf)) != sizeof(tmpbuf)) {
99 fprintf(stderr, "%s is too small to be an ELF image\n", 99 fprintf(stderr, "%s is too small to be an ELF image\n",
100 argv[1]); 100 argv[1]);
101 exit(4); 101 exit(4);
102 } 102 }
103 103
104 if ((*(unsigned int *)tmpbuf) != htonl(0x7f454c46)) { 104 if (tmpbuf[0] != htonl(0x7f454c46)) {
105 fprintf(stderr, "%s is not an ELF image\n", argv[1]); 105 fprintf(stderr, "%s is not an ELF image\n", argv[1]);
106 exit(4); 106 exit(4);
107 } 107 }
@@ -121,11 +121,11 @@ int main(int argc, char *argv[])
121 } 121 }
122 122
123 while (nblks-- > 0) { 123 while (nblks-- > 0) {
124 if (read(in_fd, tmpbuf, IMGBLK) < 0) { 124 if (read(in_fd, tmpbuf, sizeof(tmpbuf)) < 0) {
125 perror("zImage read"); 125 perror("zImage read");
126 exit(5); 126 exit(5);
127 } 127 }
128 cp = (unsigned int *)tmpbuf; 128 cp = tmpbuf;
129 for (i = 0; i < sizeof(tmpbuf) / sizeof(unsigned int); i++) 129 for (i = 0; i < sizeof(tmpbuf) / sizeof(unsigned int); i++)
130 cksum += *cp++; 130 cksum += *cp++;
131 if (write(out_fd, tmpbuf, sizeof(tmpbuf)) != sizeof(tmpbuf)) { 131 if (write(out_fd, tmpbuf, sizeof(tmpbuf)) != sizeof(tmpbuf)) {
diff --git a/arch/powerpc/boot/ppcboot-hotfoot.h b/arch/powerpc/boot/ppcboot-hotfoot.h
new file mode 100644
index 000000000000..1a3e80b533da
--- /dev/null
+++ b/arch/powerpc/boot/ppcboot-hotfoot.h
@@ -0,0 +1,133 @@
1/*
2 * This interface is used for compatibility with old U-boots *ONLY*.
3 * Please do not imitate or extend this.
4 */
5
6/*
7 * Unfortunately, the ESTeem Hotfoot board uses a mangled version of
8 * ppcboot.h for historical reasons, and in the interest of having a
9 * mainline kernel boot on the production board+bootloader, this was the
10 * least-offensive solution. Please direct all flames to:
11 *
12 * Solomon Peachy <solomon@linux-wlan.com>
13 *
14 * (This header is identical to ppcboot.h except for the
15 * TARGET_HOTFOOT bits)
16 */
17
18/*
19 * (C) Copyright 2000, 2001
20 * Wolfgang Denk, DENX Software Engineering, wd@denx.de.
21 *
22 * This program is free software; you can redistribute it and/or
23 * modify it under the terms of the GNU General Public License as
24 * published by the Free Software Foundation; either version 2 of
25 * the License, or (at your option) any later version.
26 *
27 * This program is distributed in the hope that it will be useful,
28 * but WITHOUT ANY WARRANTY; without even the implied warranty of
29 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
30 * GNU General Public License for more details.
31 *
32 * You should have received a copy of the GNU General Public License
33 * along with this program; if not, write to the Free Software
34 * Foundation, Inc., 59 Temple Place, Suite 330, Boston,
35 * MA 02111-1307 USA
36 */
37
38#ifndef __PPCBOOT_H__
39#define __PPCBOOT_H__
40
41/*
42 * Board information passed to kernel from PPCBoot
43 *
44 * include/asm-ppc/ppcboot.h
45 */
46
47#include "types.h"
48
49typedef struct bd_info {
50 unsigned long bi_memstart; /* start of DRAM memory */
51 unsigned long bi_memsize; /* size of DRAM memory in bytes */
52 unsigned long bi_flashstart; /* start of FLASH memory */
53 unsigned long bi_flashsize; /* size of FLASH memory */
54 unsigned long bi_flashoffset; /* reserved area for startup monitor */
55 unsigned long bi_sramstart; /* start of SRAM memory */
56 unsigned long bi_sramsize; /* size of SRAM memory */
57#if defined(TARGET_8xx) || defined(TARGET_CPM2) || defined(TARGET_85xx) ||\
58 defined(TARGET_83xx)
59 unsigned long bi_immr_base; /* base of IMMR register */
60#endif
61#if defined(TARGET_PPC_MPC52xx)
62 unsigned long bi_mbar_base; /* base of internal registers */
63#endif
64 unsigned long bi_bootflags; /* boot / reboot flag (for LynxOS) */
65 unsigned long bi_ip_addr; /* IP Address */
66 unsigned char bi_enetaddr[6]; /* Ethernet address */
67#if defined(TARGET_HOTFOOT)
68 /* second onboard ethernet port */
69 unsigned char bi_enet1addr[6];
70#define HAVE_ENET1ADDR
71#endif /* TARGET_HOOTFOOT */
72 unsigned short bi_ethspeed; /* Ethernet speed in Mbps */
73 unsigned long bi_intfreq; /* Internal Freq, in MHz */
74 unsigned long bi_busfreq; /* Bus Freq, in MHz */
75#if defined(TARGET_CPM2)
76 unsigned long bi_cpmfreq; /* CPM_CLK Freq, in MHz */
77 unsigned long bi_brgfreq; /* BRG_CLK Freq, in MHz */
78 unsigned long bi_sccfreq; /* SCC_CLK Freq, in MHz */
79 unsigned long bi_vco; /* VCO Out from PLL, in MHz */
80#endif
81#if defined(TARGET_PPC_MPC52xx)
82 unsigned long bi_ipbfreq; /* IPB Bus Freq, in MHz */
83 unsigned long bi_pcifreq; /* PCI Bus Freq, in MHz */
84#endif
85 unsigned long bi_baudrate; /* Console Baudrate */
86#if defined(TARGET_4xx)
87 unsigned char bi_s_version[4]; /* Version of this structure */
88 unsigned char bi_r_version[32]; /* Version of the ROM (IBM) */
89 unsigned int bi_procfreq; /* CPU (Internal) Freq, in Hz */
90 unsigned int bi_plb_busfreq; /* PLB Bus speed, in Hz */
91 unsigned int bi_pci_busfreq; /* PCI Bus speed, in Hz */
92 unsigned char bi_pci_enetaddr[6]; /* PCI Ethernet MAC address */
93#endif
94#if defined(TARGET_HOTFOOT)
95 unsigned int bi_pllouta_freq; /* PLL OUTA speed, in Hz */
96#endif
97#if defined(TARGET_HYMOD)
98 hymod_conf_t bi_hymod_conf; /* hymod configuration information */
99#endif
100#if defined(TARGET_EVB64260) || defined(TARGET_405EP) || defined(TARGET_44x) || \
101 defined(TARGET_85xx) || defined(TARGET_83xx) || defined(TARGET_HAS_ETH1)
102 /* second onboard ethernet port */
103 unsigned char bi_enet1addr[6];
104#define HAVE_ENET1ADDR
105#endif
106#if defined(TARGET_EVB64260) || defined(TARGET_440GX) || \
107 defined(TARGET_85xx) || defined(TARGET_HAS_ETH2)
108 /* third onboard ethernet ports */
109 unsigned char bi_enet2addr[6];
110#define HAVE_ENET2ADDR
111#endif
112#if defined(TARGET_440GX) || defined(TARGET_HAS_ETH3)
113 /* fourth onboard ethernet ports */
114 unsigned char bi_enet3addr[6];
115#define HAVE_ENET3ADDR
116#endif
117#if defined(TARGET_HOTFOOT)
118 int bi_phynum[2]; /* Determines phy mapping */
119 int bi_phymode[2]; /* Determines phy mode */
120#endif
121#if defined(TARGET_4xx)
122 unsigned int bi_opbfreq; /* OB clock in Hz */
123 int bi_iic_fast[2]; /* Use fast i2c mode */
124#endif
125#if defined(TARGET_440GX)
126 int bi_phynum[4]; /* phy mapping */
127 int bi_phymode[4]; /* phy mode */
128#endif
129} bd_t;
130
131#define bi_tbfreq bi_intfreq
132
133#endif /* __PPCBOOT_H__ */
diff --git a/arch/powerpc/boot/wrapper b/arch/powerpc/boot/wrapper
index 4db487d1d2a8..ac9e9a58b2b0 100755
--- a/arch/powerpc/boot/wrapper
+++ b/arch/powerpc/boot/wrapper
@@ -46,6 +46,7 @@ CROSS=
46# directory for object and other files used by this script 46# directory for object and other files used by this script
47object=arch/powerpc/boot 47object=arch/powerpc/boot
48objbin=$object 48objbin=$object
49dtc=scripts/dtc/dtc
49 50
50# directory for working files 51# directory for working files
51tmpdir=. 52tmpdir=.
@@ -124,7 +125,7 @@ if [ -n "$dts" ]; then
124 if [ -z "$dtb" ]; then 125 if [ -z "$dtb" ]; then
125 dtb="$platform.dtb" 126 dtb="$platform.dtb"
126 fi 127 fi
127 $object/dtc -O dtb -o "$dtb" -b 0 "$dts" 128 $dtc -O dtb -o "$dtb" -b 0 "$dts"
128fi 129fi
129 130
130if [ -z "$kernel" ]; then 131if [ -z "$kernel" ]; then
diff --git a/arch/powerpc/configs/40x/kilauea_defconfig b/arch/powerpc/configs/40x/kilauea_defconfig
index 865725effe93..9a05ec0ec312 100644
--- a/arch/powerpc/configs/40x/kilauea_defconfig
+++ b/arch/powerpc/configs/40x/kilauea_defconfig
@@ -1,14 +1,14 @@
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-rc7 3# Linux kernel version: 2.6.31-rc4
4# Wed Jun 3 10:18:16 2009 4# Wed Jul 29 13:28:37 2009
5# 5#
6# CONFIG_PPC64 is not set 6# CONFIG_PPC64 is not set
7 7
8# 8#
9# Processor support 9# Processor support
10# 10#
11# CONFIG_6xx is not set 11# CONFIG_PPC_BOOK3S_32 is not set
12# CONFIG_PPC_85xx is not set 12# CONFIG_PPC_85xx is not set
13# CONFIG_PPC_8xx is not set 13# CONFIG_PPC_8xx is not set
14CONFIG_40x=y 14CONFIG_40x=y
@@ -32,11 +32,11 @@ CONFIG_GENERIC_HARDIRQS_NO__DO_IRQ=y
32CONFIG_IRQ_PER_CPU=y 32CONFIG_IRQ_PER_CPU=y
33CONFIG_STACKTRACE_SUPPORT=y 33CONFIG_STACKTRACE_SUPPORT=y
34CONFIG_HAVE_LATENCYTOP_SUPPORT=y 34CONFIG_HAVE_LATENCYTOP_SUPPORT=y
35CONFIG_TRACE_IRQFLAGS_SUPPORT=y
35CONFIG_LOCKDEP_SUPPORT=y 36CONFIG_LOCKDEP_SUPPORT=y
36CONFIG_RWSEM_XCHGADD_ALGORITHM=y 37CONFIG_RWSEM_XCHGADD_ALGORITHM=y
37CONFIG_ARCH_HAS_ILOG2_U32=y 38CONFIG_ARCH_HAS_ILOG2_U32=y
38CONFIG_GENERIC_HWEIGHT=y 39CONFIG_GENERIC_HWEIGHT=y
39CONFIG_GENERIC_CALIBRATE_DELAY=y
40CONFIG_GENERIC_FIND_NEXT_BIT=y 40CONFIG_GENERIC_FIND_NEXT_BIT=y
41# CONFIG_ARCH_NO_VIRT_TO_BUS is not set 41# CONFIG_ARCH_NO_VIRT_TO_BUS is not set
42CONFIG_PPC=y 42CONFIG_PPC=y
@@ -57,6 +57,7 @@ CONFIG_PPC_DCR_NATIVE=y
57CONFIG_PPC_DCR=y 57CONFIG_PPC_DCR=y
58CONFIG_ARCH_SUPPORTS_DEBUG_PAGEALLOC=y 58CONFIG_ARCH_SUPPORTS_DEBUG_PAGEALLOC=y
59CONFIG_DEFCONFIG_LIST="/lib/modules/$UNAME_RELEASE/.config" 59CONFIG_DEFCONFIG_LIST="/lib/modules/$UNAME_RELEASE/.config"
60CONFIG_CONSTRUCTORS=y
60 61
61# 62#
62# General setup 63# General setup
@@ -108,7 +109,6 @@ CONFIG_SYSCTL_SYSCALL=y
108CONFIG_KALLSYMS=y 109CONFIG_KALLSYMS=y
109CONFIG_KALLSYMS_ALL=y 110CONFIG_KALLSYMS_ALL=y
110CONFIG_KALLSYMS_EXTRA_PASS=y 111CONFIG_KALLSYMS_EXTRA_PASS=y
111# CONFIG_STRIP_ASM_SYMS is not set
112CONFIG_HOTPLUG=y 112CONFIG_HOTPLUG=y
113CONFIG_PRINTK=y 113CONFIG_PRINTK=y
114CONFIG_BUG=y 114CONFIG_BUG=y
@@ -121,9 +121,16 @@ CONFIG_TIMERFD=y
121CONFIG_EVENTFD=y 121CONFIG_EVENTFD=y
122CONFIG_SHMEM=y 122CONFIG_SHMEM=y
123CONFIG_AIO=y 123CONFIG_AIO=y
124CONFIG_HAVE_PERF_COUNTERS=y
125
126#
127# Performance Counters
128#
129# CONFIG_PERF_COUNTERS is not set
124CONFIG_VM_EVENT_COUNTERS=y 130CONFIG_VM_EVENT_COUNTERS=y
125CONFIG_PCI_QUIRKS=y 131CONFIG_PCI_QUIRKS=y
126CONFIG_SLUB_DEBUG=y 132CONFIG_SLUB_DEBUG=y
133# CONFIG_STRIP_ASM_SYMS is not set
127CONFIG_COMPAT_BRK=y 134CONFIG_COMPAT_BRK=y
128# CONFIG_SLAB is not set 135# CONFIG_SLAB is not set
129CONFIG_SLUB=y 136CONFIG_SLUB=y
@@ -137,6 +144,11 @@ CONFIG_HAVE_IOREMAP_PROT=y
137CONFIG_HAVE_KPROBES=y 144CONFIG_HAVE_KPROBES=y
138CONFIG_HAVE_KRETPROBES=y 145CONFIG_HAVE_KRETPROBES=y
139CONFIG_HAVE_ARCH_TRACEHOOK=y 146CONFIG_HAVE_ARCH_TRACEHOOK=y
147
148#
149# GCOV-based kernel profiling
150#
151# CONFIG_GCOV_KERNEL is not set
140# CONFIG_SLOW_WORK is not set 152# CONFIG_SLOW_WORK is not set
141# CONFIG_HAVE_GENERIC_DMA_COHERENT is not set 153# CONFIG_HAVE_GENERIC_DMA_COHERENT is not set
142CONFIG_SLABINFO=y 154CONFIG_SLABINFO=y
@@ -149,7 +161,7 @@ CONFIG_MODULE_UNLOAD=y
149# CONFIG_MODVERSIONS is not set 161# CONFIG_MODVERSIONS is not set
150# CONFIG_MODULE_SRCVERSION_ALL is not set 162# CONFIG_MODULE_SRCVERSION_ALL is not set
151CONFIG_BLOCK=y 163CONFIG_BLOCK=y
152CONFIG_LBD=y 164CONFIG_LBDAF=y
153# CONFIG_BLK_DEV_BSG is not set 165# CONFIG_BLK_DEV_BSG is not set
154# CONFIG_BLK_DEV_INTEGRITY is not set 166# CONFIG_BLK_DEV_INTEGRITY is not set
155 167
@@ -220,6 +232,7 @@ CONFIG_BINFMT_ELF=y
220# CONFIG_BINFMT_MISC is not set 232# CONFIG_BINFMT_MISC is not set
221# CONFIG_MATH_EMULATION is not set 233# CONFIG_MATH_EMULATION is not set
222# CONFIG_IOMMU_HELPER is not set 234# CONFIG_IOMMU_HELPER is not set
235# CONFIG_SWIOTLB is not set
223CONFIG_PPC_NEED_DMA_SYNC_OPS=y 236CONFIG_PPC_NEED_DMA_SYNC_OPS=y
224CONFIG_ARCH_ENABLE_MEMORY_HOTPLUG=y 237CONFIG_ARCH_ENABLE_MEMORY_HOTPLUG=y
225CONFIG_ARCH_HAS_WALK_MEMORY=y 238CONFIG_ARCH_HAS_WALK_MEMORY=y
@@ -239,9 +252,9 @@ CONFIG_MIGRATION=y
239CONFIG_ZONE_DMA_FLAG=1 252CONFIG_ZONE_DMA_FLAG=1
240CONFIG_BOUNCE=y 253CONFIG_BOUNCE=y
241CONFIG_VIRT_TO_BUS=y 254CONFIG_VIRT_TO_BUS=y
242CONFIG_UNEVICTABLE_LRU=y
243CONFIG_HAVE_MLOCK=y 255CONFIG_HAVE_MLOCK=y
244CONFIG_HAVE_MLOCKED_PAGE_BIT=y 256CONFIG_HAVE_MLOCKED_PAGE_BIT=y
257CONFIG_DEFAULT_MMAP_MIN_ADDR=4096
245CONFIG_PPC_4K_PAGES=y 258CONFIG_PPC_4K_PAGES=y
246# CONFIG_PPC_16K_PAGES is not set 259# CONFIG_PPC_16K_PAGES is not set
247# CONFIG_PPC_64K_PAGES is not set 260# CONFIG_PPC_64K_PAGES is not set
@@ -344,6 +357,7 @@ CONFIG_DEFAULT_TCP_CONG="cubic"
344# CONFIG_ECONET is not set 357# CONFIG_ECONET is not set
345# CONFIG_WAN_ROUTER is not set 358# CONFIG_WAN_ROUTER is not set
346# CONFIG_PHONET is not set 359# CONFIG_PHONET is not set
360# CONFIG_IEEE802154 is not set
347# CONFIG_NET_SCHED is not set 361# CONFIG_NET_SCHED is not set
348# CONFIG_DCB is not set 362# CONFIG_DCB is not set
349 363
@@ -393,9 +407,8 @@ CONFIG_MTD_OF_PARTS=y
393# User Modules And Translation Layers 407# User Modules And Translation Layers
394# 408#
395CONFIG_MTD_CHAR=y 409CONFIG_MTD_CHAR=y
396CONFIG_MTD_BLKDEVS=m 410CONFIG_MTD_BLKDEVS=y
397CONFIG_MTD_BLOCK=m 411CONFIG_MTD_BLOCK=y
398# CONFIG_MTD_BLOCK_RO is not set
399# CONFIG_FTL is not set 412# CONFIG_FTL is not set
400# CONFIG_NFTL is not set 413# CONFIG_NFTL is not set
401# CONFIG_INFTL is not set 414# CONFIG_INFTL is not set
@@ -452,7 +465,17 @@ CONFIG_MTD_PHYSMAP_OF=y
452# CONFIG_MTD_DOC2000 is not set 465# CONFIG_MTD_DOC2000 is not set
453# CONFIG_MTD_DOC2001 is not set 466# CONFIG_MTD_DOC2001 is not set
454# CONFIG_MTD_DOC2001PLUS is not set 467# CONFIG_MTD_DOC2001PLUS is not set
455# CONFIG_MTD_NAND is not set 468CONFIG_MTD_NAND=y
469# CONFIG_MTD_NAND_VERIFY_WRITE is not set
470CONFIG_MTD_NAND_ECC_SMC=y
471# CONFIG_MTD_NAND_MUSEUM_IDS is not set
472CONFIG_MTD_NAND_IDS=y
473CONFIG_MTD_NAND_NDFC=y
474# CONFIG_MTD_NAND_DISKONCHIP is not set
475# CONFIG_MTD_NAND_CAFE is not set
476# CONFIG_MTD_NAND_NANDSIM is not set
477# CONFIG_MTD_NAND_PLATFORM is not set
478# CONFIG_MTD_NAND_FSL_ELBC is not set
456# CONFIG_MTD_ONENAND is not set 479# CONFIG_MTD_ONENAND is not set
457 480
458# 481#
@@ -465,6 +488,7 @@ CONFIG_MTD_PHYSMAP_OF=y
465# 488#
466# CONFIG_MTD_UBI is not set 489# CONFIG_MTD_UBI is not set
467CONFIG_OF_DEVICE=y 490CONFIG_OF_DEVICE=y
491CONFIG_OF_I2C=y
468# CONFIG_PARPORT is not set 492# CONFIG_PARPORT is not set
469CONFIG_BLK_DEV=y 493CONFIG_BLK_DEV=y
470# CONFIG_BLK_DEV_FD is not set 494# CONFIG_BLK_DEV_FD is not set
@@ -504,14 +528,17 @@ CONFIG_HAVE_IDE=y
504# 528#
505 529
506# 530#
507# Enable only one of the two stacks, unless you know what you are doing 531# You can enable one or both FireWire driver stacks.
532#
533
534#
535# See the help texts for more information.
508# 536#
509# CONFIG_FIREWIRE is not set 537# CONFIG_FIREWIRE is not set
510# CONFIG_IEEE1394 is not set 538# CONFIG_IEEE1394 is not set
511# CONFIG_I2O is not set 539# CONFIG_I2O is not set
512# CONFIG_MACINTOSH_DRIVERS is not set 540# CONFIG_MACINTOSH_DRIVERS is not set
513CONFIG_NETDEVICES=y 541CONFIG_NETDEVICES=y
514CONFIG_COMPAT_NET_DEV_OPS=y
515# CONFIG_DUMMY is not set 542# CONFIG_DUMMY is not set
516# CONFIG_BONDING is not set 543# CONFIG_BONDING is not set
517# CONFIG_MACVLAN is not set 544# CONFIG_MACVLAN is not set
@@ -546,6 +573,7 @@ CONFIG_IBM_NEW_EMAC_EMAC4=y
546# CONFIG_IBM_NEW_EMAC_MAL_COMMON_ERR is not set 573# CONFIG_IBM_NEW_EMAC_MAL_COMMON_ERR is not set
547# CONFIG_NET_PCI is not set 574# CONFIG_NET_PCI is not set
548# CONFIG_B44 is not set 575# CONFIG_B44 is not set
576# CONFIG_KS8842 is not set
549# CONFIG_ATL2 is not set 577# CONFIG_ATL2 is not set
550# CONFIG_NETDEV_1000 is not set 578# CONFIG_NETDEV_1000 is not set
551# CONFIG_NETDEV_10000 is not set 579# CONFIG_NETDEV_10000 is not set
@@ -621,20 +649,150 @@ CONFIG_LEGACY_PTY_COUNT=256
621# CONFIG_IPMI_HANDLER is not set 649# CONFIG_IPMI_HANDLER is not set
622# CONFIG_HW_RANDOM is not set 650# CONFIG_HW_RANDOM is not set
623# CONFIG_NVRAM is not set 651# CONFIG_NVRAM is not set
624# CONFIG_GEN_RTC is not set
625# CONFIG_R3964 is not set 652# CONFIG_R3964 is not set
626# CONFIG_APPLICOM is not set 653# CONFIG_APPLICOM is not set
627# CONFIG_RAW_DRIVER is not set 654# CONFIG_RAW_DRIVER is not set
628# CONFIG_TCG_TPM is not set 655# CONFIG_TCG_TPM is not set
629CONFIG_DEVPORT=y 656CONFIG_DEVPORT=y
630# CONFIG_I2C is not set 657CONFIG_I2C=y
658CONFIG_I2C_BOARDINFO=y
659CONFIG_I2C_CHARDEV=y
660CONFIG_I2C_HELPER_AUTO=y
661
662#
663# I2C Hardware Bus support
664#
665
666#
667# PC SMBus host controller drivers
668#
669# CONFIG_I2C_ALI1535 is not set
670# CONFIG_I2C_ALI1563 is not set
671# CONFIG_I2C_ALI15X3 is not set
672# CONFIG_I2C_AMD756 is not set
673# CONFIG_I2C_AMD8111 is not set
674# CONFIG_I2C_I801 is not set
675# CONFIG_I2C_ISCH is not set
676# CONFIG_I2C_PIIX4 is not set
677# CONFIG_I2C_NFORCE2 is not set
678# CONFIG_I2C_SIS5595 is not set
679# CONFIG_I2C_SIS630 is not set
680# CONFIG_I2C_SIS96X is not set
681# CONFIG_I2C_VIA is not set
682# CONFIG_I2C_VIAPRO is not set
683
684#
685# I2C system bus drivers (mostly embedded / system-on-chip)
686#
687CONFIG_I2C_IBM_IIC=y
688# CONFIG_I2C_MPC is not set
689# CONFIG_I2C_OCORES is not set
690# CONFIG_I2C_SIMTEC is not set
691
692#
693# External I2C/SMBus adapter drivers
694#
695# CONFIG_I2C_PARPORT_LIGHT is not set
696# CONFIG_I2C_TAOS_EVM is not set
697
698#
699# Graphics adapter I2C/DDC channel drivers
700#
701# CONFIG_I2C_VOODOO3 is not set
702
703#
704# Other I2C/SMBus bus drivers
705#
706# CONFIG_I2C_PCA_PLATFORM is not set
707# CONFIG_I2C_STUB is not set
708
709#
710# Miscellaneous I2C Chip support
711#
712# CONFIG_DS1682 is not set
713# CONFIG_SENSORS_PCF8574 is not set
714# CONFIG_PCF8575 is not set
715# CONFIG_SENSORS_PCA9539 is not set
716# CONFIG_SENSORS_TSL2550 is not set
717# CONFIG_I2C_DEBUG_CORE is not set
718# CONFIG_I2C_DEBUG_ALGO is not set
719# CONFIG_I2C_DEBUG_BUS is not set
720# CONFIG_I2C_DEBUG_CHIP is not set
631# CONFIG_SPI is not set 721# CONFIG_SPI is not set
722
723#
724# PPS support
725#
726# CONFIG_PPS is not set
632CONFIG_ARCH_WANT_OPTIONAL_GPIOLIB=y 727CONFIG_ARCH_WANT_OPTIONAL_GPIOLIB=y
633# CONFIG_GPIOLIB is not set 728# CONFIG_GPIOLIB is not set
634# CONFIG_W1 is not set 729# CONFIG_W1 is not set
635# CONFIG_POWER_SUPPLY is not set 730# CONFIG_POWER_SUPPLY is not set
636# CONFIG_HWMON is not set 731CONFIG_HWMON=y
732# CONFIG_HWMON_VID is not set
733# CONFIG_SENSORS_AD7414 is not set
734# CONFIG_SENSORS_AD7418 is not set
735# CONFIG_SENSORS_ADM1021 is not set
736# CONFIG_SENSORS_ADM1025 is not set
737# CONFIG_SENSORS_ADM1026 is not set
738# CONFIG_SENSORS_ADM1029 is not set
739# CONFIG_SENSORS_ADM1031 is not set
740# CONFIG_SENSORS_ADM9240 is not set
741# CONFIG_SENSORS_ADT7462 is not set
742# CONFIG_SENSORS_ADT7470 is not set
743# CONFIG_SENSORS_ADT7473 is not set
744# CONFIG_SENSORS_ADT7475 is not set
745# CONFIG_SENSORS_ATXP1 is not set
746# CONFIG_SENSORS_DS1621 is not set
747# CONFIG_SENSORS_I5K_AMB is not set
748# CONFIG_SENSORS_F71805F is not set
749# CONFIG_SENSORS_F71882FG is not set
750# CONFIG_SENSORS_F75375S is not set
751# CONFIG_SENSORS_G760A is not set
752# CONFIG_SENSORS_GL518SM is not set
753# CONFIG_SENSORS_GL520SM is not set
754# CONFIG_SENSORS_IT87 is not set
755# CONFIG_SENSORS_LM63 is not set
756CONFIG_SENSORS_LM75=y
757# CONFIG_SENSORS_LM77 is not set
758# CONFIG_SENSORS_LM78 is not set
759# CONFIG_SENSORS_LM80 is not set
760# CONFIG_SENSORS_LM83 is not set
761# CONFIG_SENSORS_LM85 is not set
762# CONFIG_SENSORS_LM87 is not set
763# CONFIG_SENSORS_LM90 is not set
764# CONFIG_SENSORS_LM92 is not set
765# CONFIG_SENSORS_LM93 is not set
766# CONFIG_SENSORS_LTC4215 is not set
767# CONFIG_SENSORS_LTC4245 is not set
768# CONFIG_SENSORS_LM95241 is not set
769# CONFIG_SENSORS_MAX1619 is not set
770# CONFIG_SENSORS_MAX6650 is not set
771# CONFIG_SENSORS_PC87360 is not set
772# CONFIG_SENSORS_PC87427 is not set
773# CONFIG_SENSORS_PCF8591 is not set
774# CONFIG_SENSORS_SIS5595 is not set
775# CONFIG_SENSORS_DME1737 is not set
776# CONFIG_SENSORS_SMSC47M1 is not set
777# CONFIG_SENSORS_SMSC47M192 is not set
778# CONFIG_SENSORS_SMSC47B397 is not set
779# CONFIG_SENSORS_ADS7828 is not set
780# CONFIG_SENSORS_THMC50 is not set
781# CONFIG_SENSORS_TMP401 is not set
782# CONFIG_SENSORS_VIA686A is not set
783# CONFIG_SENSORS_VT1211 is not set
784# CONFIG_SENSORS_VT8231 is not set
785# CONFIG_SENSORS_W83781D is not set
786# CONFIG_SENSORS_W83791D is not set
787# CONFIG_SENSORS_W83792D is not set
788# CONFIG_SENSORS_W83793 is not set
789# CONFIG_SENSORS_W83L785TS is not set
790# CONFIG_SENSORS_W83L786NG is not set
791# CONFIG_SENSORS_W83627HF is not set
792# CONFIG_SENSORS_W83627EHF is not set
793# CONFIG_HWMON_DEBUG_CHIP is not set
637CONFIG_THERMAL=y 794CONFIG_THERMAL=y
795# CONFIG_THERMAL_HWMON is not set
638# CONFIG_WATCHDOG is not set 796# CONFIG_WATCHDOG is not set
639CONFIG_SSB_POSSIBLE=y 797CONFIG_SSB_POSSIBLE=y
640 798
@@ -649,24 +807,15 @@ CONFIG_SSB_POSSIBLE=y
649# CONFIG_MFD_CORE is not set 807# CONFIG_MFD_CORE is not set
650# CONFIG_MFD_SM501 is not set 808# CONFIG_MFD_SM501 is not set
651# CONFIG_HTC_PASIC3 is not set 809# CONFIG_HTC_PASIC3 is not set
810# CONFIG_TWL4030_CORE is not set
652# CONFIG_MFD_TMIO is not set 811# CONFIG_MFD_TMIO is not set
812# CONFIG_PMIC_DA903X is not set
813# CONFIG_MFD_WM8400 is not set
814# CONFIG_MFD_WM8350_I2C is not set
815# CONFIG_MFD_PCF50633 is not set
816# CONFIG_AB3100_CORE is not set
653# CONFIG_REGULATOR is not set 817# CONFIG_REGULATOR is not set
654 818# CONFIG_MEDIA_SUPPORT is not set
655#
656# Multimedia devices
657#
658
659#
660# Multimedia core support
661#
662# CONFIG_VIDEO_DEV is not set
663# CONFIG_DVB_CORE is not set
664# CONFIG_VIDEO_MEDIA is not set
665
666#
667# Multimedia drivers
668#
669# CONFIG_DAB is not set
670 819
671# 820#
672# Graphics support 821# Graphics support
@@ -691,10 +840,69 @@ CONFIG_SSB_POSSIBLE=y
691# CONFIG_ACCESSIBILITY is not set 840# CONFIG_ACCESSIBILITY is not set
692# CONFIG_INFINIBAND is not set 841# CONFIG_INFINIBAND is not set
693# CONFIG_EDAC is not set 842# CONFIG_EDAC is not set
694# CONFIG_RTC_CLASS is not set 843CONFIG_RTC_LIB=y
844CONFIG_RTC_CLASS=y
845CONFIG_RTC_HCTOSYS=y
846CONFIG_RTC_HCTOSYS_DEVICE="rtc0"
847# CONFIG_RTC_DEBUG is not set
848
849#
850# RTC interfaces
851#
852CONFIG_RTC_INTF_SYSFS=y
853CONFIG_RTC_INTF_PROC=y
854CONFIG_RTC_INTF_DEV=y
855# CONFIG_RTC_INTF_DEV_UIE_EMUL is not set
856# CONFIG_RTC_DRV_TEST is not set
857
858#
859# I2C RTC drivers
860#
861CONFIG_RTC_DRV_DS1307=y
862# CONFIG_RTC_DRV_DS1374 is not set
863# CONFIG_RTC_DRV_DS1672 is not set
864# CONFIG_RTC_DRV_MAX6900 is not set
865# CONFIG_RTC_DRV_RS5C372 is not set
866# CONFIG_RTC_DRV_ISL1208 is not set
867# CONFIG_RTC_DRV_X1205 is not set
868# CONFIG_RTC_DRV_PCF8563 is not set
869# CONFIG_RTC_DRV_PCF8583 is not set
870# CONFIG_RTC_DRV_M41T80 is not set
871# CONFIG_RTC_DRV_S35390A is not set
872# CONFIG_RTC_DRV_FM3130 is not set
873# CONFIG_RTC_DRV_RX8581 is not set
874# CONFIG_RTC_DRV_RX8025 is not set
875
876#
877# SPI RTC drivers
878#
879
880#
881# Platform RTC drivers
882#
883# CONFIG_RTC_DRV_CMOS is not set
884# CONFIG_RTC_DRV_DS1286 is not set
885# CONFIG_RTC_DRV_DS1511 is not set
886# CONFIG_RTC_DRV_DS1553 is not set
887# CONFIG_RTC_DRV_DS1742 is not set
888# CONFIG_RTC_DRV_STK17TA8 is not set
889# CONFIG_RTC_DRV_M48T86 is not set
890# CONFIG_RTC_DRV_M48T35 is not set
891# CONFIG_RTC_DRV_M48T59 is not set
892# CONFIG_RTC_DRV_BQ4802 is not set
893# CONFIG_RTC_DRV_V3020 is not set
894
895#
896# on-CPU RTC drivers
897#
898# CONFIG_RTC_DRV_GENERIC is not set
695# CONFIG_DMADEVICES is not set 899# CONFIG_DMADEVICES is not set
696# CONFIG_AUXDISPLAY is not set 900# CONFIG_AUXDISPLAY is not set
697# CONFIG_UIO is not set 901# CONFIG_UIO is not set
902
903#
904# TI VLYNQ
905#
698# CONFIG_STAGING is not set 906# CONFIG_STAGING is not set
699 907
700# 908#
@@ -708,11 +916,12 @@ CONFIG_EXT2_FS=y
708# CONFIG_REISERFS_FS is not set 916# CONFIG_REISERFS_FS is not set
709# CONFIG_JFS_FS is not set 917# CONFIG_JFS_FS is not set
710# CONFIG_FS_POSIX_ACL is not set 918# CONFIG_FS_POSIX_ACL is not set
711CONFIG_FILE_LOCKING=y
712# CONFIG_XFS_FS is not set 919# CONFIG_XFS_FS is not set
713# CONFIG_GFS2_FS is not set 920# CONFIG_GFS2_FS is not set
714# CONFIG_OCFS2_FS is not set 921# CONFIG_OCFS2_FS is not set
715# CONFIG_BTRFS_FS is not set 922# CONFIG_BTRFS_FS is not set
923CONFIG_FILE_LOCKING=y
924CONFIG_FSNOTIFY=y
716CONFIG_DNOTIFY=y 925CONFIG_DNOTIFY=y
717CONFIG_INOTIFY=y 926CONFIG_INOTIFY=y
718CONFIG_INOTIFY_USER=y 927CONFIG_INOTIFY_USER=y
@@ -818,6 +1027,7 @@ CONFIG_HAS_IOPORT=y
818CONFIG_HAS_DMA=y 1027CONFIG_HAS_DMA=y
819CONFIG_HAVE_LMB=y 1028CONFIG_HAVE_LMB=y
820CONFIG_NLATTR=y 1029CONFIG_NLATTR=y
1030CONFIG_GENERIC_ATOMIC64=y
821 1031
822# 1032#
823# Kernel hacking 1033# Kernel hacking
@@ -848,6 +1058,9 @@ CONFIG_SCHED_DEBUG=y
848# CONFIG_RT_MUTEX_TESTER is not set 1058# CONFIG_RT_MUTEX_TESTER is not set
849# CONFIG_DEBUG_SPINLOCK is not set 1059# CONFIG_DEBUG_SPINLOCK is not set
850# CONFIG_DEBUG_MUTEXES is not set 1060# CONFIG_DEBUG_MUTEXES is not set
1061# CONFIG_DEBUG_LOCK_ALLOC is not set
1062# CONFIG_PROVE_LOCKING is not set
1063# CONFIG_LOCK_STAT is not set
851# CONFIG_DEBUG_SPINLOCK_SLEEP is not set 1064# CONFIG_DEBUG_SPINLOCK_SLEEP is not set
852# CONFIG_DEBUG_LOCKING_API_SELFTESTS is not set 1065# CONFIG_DEBUG_LOCKING_API_SELFTESTS is not set
853# CONFIG_DEBUG_KOBJECT is not set 1066# CONFIG_DEBUG_KOBJECT is not set
@@ -859,7 +1072,6 @@ CONFIG_DEBUG_BUGVERBOSE=y
859# CONFIG_DEBUG_LIST is not set 1072# CONFIG_DEBUG_LIST is not set
860# CONFIG_DEBUG_SG is not set 1073# CONFIG_DEBUG_SG is not set
861# CONFIG_DEBUG_NOTIFIERS is not set 1074# CONFIG_DEBUG_NOTIFIERS is not set
862# CONFIG_BOOT_PRINTK_DELAY is not set
863# CONFIG_RCU_TORTURE_TEST is not set 1075# CONFIG_RCU_TORTURE_TEST is not set
864# CONFIG_RCU_CPU_STALL_DETECTOR is not set 1076# CONFIG_RCU_CPU_STALL_DETECTOR is not set
865# CONFIG_BACKTRACE_SELF_TEST is not set 1077# CONFIG_BACKTRACE_SELF_TEST is not set
@@ -873,16 +1085,15 @@ CONFIG_HAVE_FUNCTION_GRAPH_TRACER=y
873CONFIG_HAVE_DYNAMIC_FTRACE=y 1085CONFIG_HAVE_DYNAMIC_FTRACE=y
874CONFIG_HAVE_FTRACE_MCOUNT_RECORD=y 1086CONFIG_HAVE_FTRACE_MCOUNT_RECORD=y
875CONFIG_TRACING_SUPPORT=y 1087CONFIG_TRACING_SUPPORT=y
876 1088CONFIG_FTRACE=y
877#
878# Tracers
879#
880# CONFIG_FUNCTION_TRACER is not set 1089# CONFIG_FUNCTION_TRACER is not set
1090# CONFIG_IRQSOFF_TRACER is not set
881# CONFIG_SCHED_TRACER is not set 1091# CONFIG_SCHED_TRACER is not set
882# CONFIG_CONTEXT_SWITCH_TRACER is not set 1092# CONFIG_ENABLE_DEFAULT_TRACERS is not set
883# CONFIG_EVENT_TRACER is not set
884# CONFIG_BOOT_TRACER is not set 1093# CONFIG_BOOT_TRACER is not set
885# CONFIG_TRACE_BRANCH_PROFILING is not set 1094CONFIG_BRANCH_PROFILE_NONE=y
1095# CONFIG_PROFILE_ANNOTATED_BRANCHES is not set
1096# CONFIG_PROFILE_ALL_BRANCHES is not set
886# CONFIG_STACK_TRACER is not set 1097# CONFIG_STACK_TRACER is not set
887# CONFIG_KMEMTRACE is not set 1098# CONFIG_KMEMTRACE is not set
888# CONFIG_WORKQUEUE_TRACER is not set 1099# CONFIG_WORKQUEUE_TRACER is not set
@@ -891,6 +1102,9 @@ CONFIG_TRACING_SUPPORT=y
891# CONFIG_SAMPLES is not set 1102# CONFIG_SAMPLES is not set
892CONFIG_HAVE_ARCH_KGDB=y 1103CONFIG_HAVE_ARCH_KGDB=y
893# CONFIG_KGDB is not set 1104# CONFIG_KGDB is not set
1105# CONFIG_KMEMCHECK is not set
1106# CONFIG_PPC_DISABLE_WERROR is not set
1107CONFIG_PPC_WERROR=y
894CONFIG_PRINT_STACK_DEPTH=64 1108CONFIG_PRINT_STACK_DEPTH=64
895# CONFIG_DEBUG_STACKOVERFLOW is not set 1109# CONFIG_DEBUG_STACKOVERFLOW is not set
896# CONFIG_DEBUG_STACK_USAGE is not set 1110# CONFIG_DEBUG_STACK_USAGE is not set
diff --git a/arch/powerpc/configs/44x/arches_defconfig b/arch/powerpc/configs/44x/arches_defconfig
index f7fd32c09424..6f976b51cdd0 100644
--- a/arch/powerpc/configs/44x/arches_defconfig
+++ b/arch/powerpc/configs/44x/arches_defconfig
@@ -1,14 +1,14 @@
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.31-rc5
4# Tue Jan 20 08:22:31 2009 4# Thu Aug 13 14:14:07 2009
5# 5#
6# CONFIG_PPC64 is not set 6# CONFIG_PPC64 is not set
7 7
8# 8#
9# Processor support 9# Processor support
10# 10#
11# CONFIG_6xx is not set 11# CONFIG_PPC_BOOK3S_32 is not set
12# CONFIG_PPC_85xx is not set 12# CONFIG_PPC_85xx is not set
13# CONFIG_PPC_8xx is not set 13# CONFIG_PPC_8xx is not set
14# CONFIG_40x is not set 14# CONFIG_40x is not set
@@ -31,15 +31,16 @@ CONFIG_GENERIC_TIME=y
31CONFIG_GENERIC_TIME_VSYSCALL=y 31CONFIG_GENERIC_TIME_VSYSCALL=y
32CONFIG_GENERIC_CLOCKEVENTS=y 32CONFIG_GENERIC_CLOCKEVENTS=y
33CONFIG_GENERIC_HARDIRQS=y 33CONFIG_GENERIC_HARDIRQS=y
34CONFIG_GENERIC_HARDIRQS_NO__DO_IRQ=y
34# CONFIG_HAVE_SETUP_PER_CPU_AREA is not set 35# CONFIG_HAVE_SETUP_PER_CPU_AREA is not set
35CONFIG_IRQ_PER_CPU=y 36CONFIG_IRQ_PER_CPU=y
36CONFIG_STACKTRACE_SUPPORT=y 37CONFIG_STACKTRACE_SUPPORT=y
37CONFIG_HAVE_LATENCYTOP_SUPPORT=y 38CONFIG_HAVE_LATENCYTOP_SUPPORT=y
39CONFIG_TRACE_IRQFLAGS_SUPPORT=y
38CONFIG_LOCKDEP_SUPPORT=y 40CONFIG_LOCKDEP_SUPPORT=y
39CONFIG_RWSEM_XCHGADD_ALGORITHM=y 41CONFIG_RWSEM_XCHGADD_ALGORITHM=y
40CONFIG_ARCH_HAS_ILOG2_U32=y 42CONFIG_ARCH_HAS_ILOG2_U32=y
41CONFIG_GENERIC_HWEIGHT=y 43CONFIG_GENERIC_HWEIGHT=y
42CONFIG_GENERIC_CALIBRATE_DELAY=y
43CONFIG_GENERIC_FIND_NEXT_BIT=y 44CONFIG_GENERIC_FIND_NEXT_BIT=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
@@ -53,11 +54,14 @@ 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"
64CONFIG_CONSTRUCTORS=y
61 65
62# 66#
63# General setup 67# General setup
@@ -71,9 +75,19 @@ CONFIG_SWAP=y
71CONFIG_SYSVIPC=y 75CONFIG_SYSVIPC=y
72CONFIG_SYSVIPC_SYSCTL=y 76CONFIG_SYSVIPC_SYSCTL=y
73CONFIG_POSIX_MQUEUE=y 77CONFIG_POSIX_MQUEUE=y
78CONFIG_POSIX_MQUEUE_SYSCTL=y
74# CONFIG_BSD_PROCESS_ACCT is not set 79# CONFIG_BSD_PROCESS_ACCT is not set
75# CONFIG_TASKSTATS is not set 80# CONFIG_TASKSTATS is not set
76# CONFIG_AUDIT is not set 81# CONFIG_AUDIT is not set
82
83#
84# RCU Subsystem
85#
86CONFIG_CLASSIC_RCU=y
87# CONFIG_TREE_RCU is not set
88# CONFIG_PREEMPT_RCU is not set
89# CONFIG_TREE_RCU_TRACE is not set
90# CONFIG_PREEMPT_RCU_TRACE is not set
77# CONFIG_IKCONFIG is not set 91# CONFIG_IKCONFIG is not set
78CONFIG_LOG_BUF_SHIFT=14 92CONFIG_LOG_BUF_SHIFT=14
79# CONFIG_GROUP_SCHED is not set 93# CONFIG_GROUP_SCHED is not set
@@ -84,8 +98,12 @@ CONFIG_SYSFS_DEPRECATED_V2=y
84# CONFIG_NAMESPACES is not set 98# CONFIG_NAMESPACES is not set
85CONFIG_BLK_DEV_INITRD=y 99CONFIG_BLK_DEV_INITRD=y
86CONFIG_INITRAMFS_SOURCE="" 100CONFIG_INITRAMFS_SOURCE=""
101CONFIG_RD_GZIP=y
102# CONFIG_RD_BZIP2 is not set
103# CONFIG_RD_LZMA is not set
87# CONFIG_CC_OPTIMIZE_FOR_SIZE is not set 104# CONFIG_CC_OPTIMIZE_FOR_SIZE is not set
88CONFIG_SYSCTL=y 105CONFIG_SYSCTL=y
106CONFIG_ANON_INODES=y
89CONFIG_EMBEDDED=y 107CONFIG_EMBEDDED=y
90CONFIG_SYSCTL_SYSCALL=y 108CONFIG_SYSCTL_SYSCALL=y
91CONFIG_KALLSYMS=y 109CONFIG_KALLSYMS=y
@@ -95,23 +113,30 @@ CONFIG_HOTPLUG=y
95CONFIG_PRINTK=y 113CONFIG_PRINTK=y
96CONFIG_BUG=y 114CONFIG_BUG=y
97CONFIG_ELF_CORE=y 115CONFIG_ELF_CORE=y
98CONFIG_COMPAT_BRK=y
99CONFIG_BASE_FULL=y 116CONFIG_BASE_FULL=y
100CONFIG_FUTEX=y 117CONFIG_FUTEX=y
101CONFIG_ANON_INODES=y
102CONFIG_EPOLL=y 118CONFIG_EPOLL=y
103CONFIG_SIGNALFD=y 119CONFIG_SIGNALFD=y
104CONFIG_TIMERFD=y 120CONFIG_TIMERFD=y
105CONFIG_EVENTFD=y 121CONFIG_EVENTFD=y
106CONFIG_SHMEM=y 122CONFIG_SHMEM=y
107CONFIG_AIO=y 123CONFIG_AIO=y
124CONFIG_HAVE_PERF_COUNTERS=y
125
126#
127# Performance Counters
128#
129# CONFIG_PERF_COUNTERS is not set
108CONFIG_VM_EVENT_COUNTERS=y 130CONFIG_VM_EVENT_COUNTERS=y
109CONFIG_PCI_QUIRKS=y 131CONFIG_PCI_QUIRKS=y
110CONFIG_SLUB_DEBUG=y 132CONFIG_SLUB_DEBUG=y
133# CONFIG_STRIP_ASM_SYMS is not set
134CONFIG_COMPAT_BRK=y
111# CONFIG_SLAB is not set 135# CONFIG_SLAB is not set
112CONFIG_SLUB=y 136CONFIG_SLUB=y
113# CONFIG_SLOB is not set 137# CONFIG_SLOB is not set
114# CONFIG_PROFILING is not set 138# CONFIG_PROFILING is not set
139# CONFIG_MARKERS is not set
115CONFIG_HAVE_OPROFILE=y 140CONFIG_HAVE_OPROFILE=y
116# CONFIG_KPROBES is not set 141# CONFIG_KPROBES is not set
117CONFIG_HAVE_EFFICIENT_UNALIGNED_ACCESS=y 142CONFIG_HAVE_EFFICIENT_UNALIGNED_ACCESS=y
@@ -119,6 +144,12 @@ CONFIG_HAVE_IOREMAP_PROT=y
119CONFIG_HAVE_KPROBES=y 144CONFIG_HAVE_KPROBES=y
120CONFIG_HAVE_KRETPROBES=y 145CONFIG_HAVE_KRETPROBES=y
121CONFIG_HAVE_ARCH_TRACEHOOK=y 146CONFIG_HAVE_ARCH_TRACEHOOK=y
147
148#
149# GCOV-based kernel profiling
150#
151# CONFIG_GCOV_KERNEL is not set
152# CONFIG_SLOW_WORK is not set
122# CONFIG_HAVE_GENERIC_DMA_COHERENT is not set 153# CONFIG_HAVE_GENERIC_DMA_COHERENT is not set
123CONFIG_SLABINFO=y 154CONFIG_SLABINFO=y
124CONFIG_RT_MUTEXES=y 155CONFIG_RT_MUTEXES=y
@@ -130,8 +161,7 @@ CONFIG_MODULE_UNLOAD=y
130# CONFIG_MODVERSIONS is not set 161# CONFIG_MODVERSIONS is not set
131# CONFIG_MODULE_SRCVERSION_ALL is not set 162# CONFIG_MODULE_SRCVERSION_ALL is not set
132CONFIG_BLOCK=y 163CONFIG_BLOCK=y
133CONFIG_LBD=y 164CONFIG_LBDAF=y
134# CONFIG_BLK_DEV_IO_TRACE is not set
135# CONFIG_BLK_DEV_BSG is not set 165# CONFIG_BLK_DEV_BSG is not set
136# CONFIG_BLK_DEV_INTEGRITY is not set 166# CONFIG_BLK_DEV_INTEGRITY is not set
137 167
@@ -147,11 +177,6 @@ CONFIG_DEFAULT_AS=y
147# CONFIG_DEFAULT_CFQ is not set 177# CONFIG_DEFAULT_CFQ is not set
148# CONFIG_DEFAULT_NOOP is not set 178# CONFIG_DEFAULT_NOOP is not set
149CONFIG_DEFAULT_IOSCHED="anticipatory" 179CONFIG_DEFAULT_IOSCHED="anticipatory"
150CONFIG_CLASSIC_RCU=y
151# CONFIG_TREE_RCU is not set
152# CONFIG_PREEMPT_RCU is not set
153# CONFIG_TREE_RCU_TRACE is not set
154# CONFIG_PREEMPT_RCU_TRACE is not set
155# CONFIG_FREEZER is not set 180# CONFIG_FREEZER is not set
156CONFIG_PPC4xx_PCI_EXPRESS=y 181CONFIG_PPC4xx_PCI_EXPRESS=y
157 182
@@ -172,6 +197,7 @@ CONFIG_PPC4xx_PCI_EXPRESS=y
172CONFIG_ARCHES=y 197CONFIG_ARCHES=y
173# CONFIG_CANYONLANDS is not set 198# CONFIG_CANYONLANDS is not set
174# CONFIG_GLACIER is not set 199# CONFIG_GLACIER is not set
200# CONFIG_REDWOOD is not set
175# CONFIG_YOSEMITE is not set 201# CONFIG_YOSEMITE is not set
176# CONFIG_XILINX_VIRTEX440_GENERIC_BOARD is not set 202# CONFIG_XILINX_VIRTEX440_GENERIC_BOARD is not set
177CONFIG_PPC44x_SIMPLE=y 203CONFIG_PPC44x_SIMPLE=y
@@ -214,6 +240,7 @@ CONFIG_BINFMT_ELF=y
214# CONFIG_BINFMT_MISC is not set 240# CONFIG_BINFMT_MISC is not set
215# CONFIG_MATH_EMULATION is not set 241# CONFIG_MATH_EMULATION is not set
216# CONFIG_IOMMU_HELPER is not set 242# CONFIG_IOMMU_HELPER is not set
243# CONFIG_SWIOTLB is not set
217CONFIG_PPC_NEED_DMA_SYNC_OPS=y 244CONFIG_PPC_NEED_DMA_SYNC_OPS=y
218CONFIG_ARCH_ENABLE_MEMORY_HOTPLUG=y 245CONFIG_ARCH_ENABLE_MEMORY_HOTPLUG=y
219CONFIG_ARCH_HAS_WALK_MEMORY=y 246CONFIG_ARCH_HAS_WALK_MEMORY=y
@@ -233,10 +260,14 @@ CONFIG_PHYS_ADDR_T_64BIT=y
233CONFIG_ZONE_DMA_FLAG=1 260CONFIG_ZONE_DMA_FLAG=1
234CONFIG_BOUNCE=y 261CONFIG_BOUNCE=y
235CONFIG_VIRT_TO_BUS=y 262CONFIG_VIRT_TO_BUS=y
236CONFIG_UNEVICTABLE_LRU=y 263CONFIG_HAVE_MLOCK=y
264CONFIG_HAVE_MLOCKED_PAGE_BIT=y
265CONFIG_DEFAULT_MMAP_MIN_ADDR=4096
266CONFIG_STDBINUTILS=y
237CONFIG_PPC_4K_PAGES=y 267CONFIG_PPC_4K_PAGES=y
238# CONFIG_PPC_16K_PAGES is not set 268# CONFIG_PPC_16K_PAGES is not set
239# CONFIG_PPC_64K_PAGES is not set 269# CONFIG_PPC_64K_PAGES is not set
270# CONFIG_PPC_256K_PAGES is not set
240CONFIG_FORCE_MAX_ZONEORDER=11 271CONFIG_FORCE_MAX_ZONEORDER=11
241CONFIG_PROC_DEVICETREE=y 272CONFIG_PROC_DEVICETREE=y
242CONFIG_CMDLINE_BOOL=y 273CONFIG_CMDLINE_BOOL=y
@@ -261,6 +292,7 @@ CONFIG_ARCH_SUPPORTS_MSI=y
261# CONFIG_PCI_LEGACY is not set 292# CONFIG_PCI_LEGACY is not set
262# CONFIG_PCI_DEBUG is not set 293# CONFIG_PCI_DEBUG is not set
263# CONFIG_PCI_STUB is not set 294# CONFIG_PCI_STUB is not set
295# CONFIG_PCI_IOV is not set
264# CONFIG_PCCARD is not set 296# CONFIG_PCCARD is not set
265# CONFIG_HOTPLUG_PCI is not set 297# CONFIG_HOTPLUG_PCI is not set
266# CONFIG_HAS_RAPIDIO is not set 298# CONFIG_HAS_RAPIDIO is not set
@@ -278,14 +310,12 @@ CONFIG_PAGE_OFFSET=0xc0000000
278CONFIG_KERNEL_START=0xc0000000 310CONFIG_KERNEL_START=0xc0000000
279CONFIG_PHYSICAL_START=0x00000000 311CONFIG_PHYSICAL_START=0x00000000
280CONFIG_TASK_SIZE=0xc0000000 312CONFIG_TASK_SIZE=0xc0000000
281CONFIG_CONSISTENT_START=0xff100000
282CONFIG_CONSISTENT_SIZE=0x00200000 313CONFIG_CONSISTENT_SIZE=0x00200000
283CONFIG_NET=y 314CONFIG_NET=y
284 315
285# 316#
286# Networking options 317# Networking options
287# 318#
288CONFIG_COMPAT_NET_DEV_OPS=y
289CONFIG_PACKET=y 319CONFIG_PACKET=y
290# CONFIG_PACKET_MMAP is not set 320# CONFIG_PACKET_MMAP is not set
291CONFIG_UNIX=y 321CONFIG_UNIX=y
@@ -335,6 +365,8 @@ CONFIG_DEFAULT_TCP_CONG="cubic"
335# CONFIG_LAPB is not set 365# CONFIG_LAPB is not set
336# CONFIG_ECONET is not set 366# CONFIG_ECONET is not set
337# CONFIG_WAN_ROUTER is not set 367# CONFIG_WAN_ROUTER is not set
368# CONFIG_PHONET is not set
369# CONFIG_IEEE802154 is not set
338# CONFIG_NET_SCHED is not set 370# CONFIG_NET_SCHED is not set
339# CONFIG_DCB is not set 371# CONFIG_DCB is not set
340 372
@@ -347,7 +379,6 @@ CONFIG_DEFAULT_TCP_CONG="cubic"
347# CONFIG_IRDA is not set 379# CONFIG_IRDA is not set
348# CONFIG_BT is not set 380# CONFIG_BT is not set
349# CONFIG_AF_RXRPC is not set 381# CONFIG_AF_RXRPC is not set
350# CONFIG_PHONET is not set
351# CONFIG_WIRELESS is not set 382# CONFIG_WIRELESS is not set
352# CONFIG_WIMAX is not set 383# CONFIG_WIMAX is not set
353# CONFIG_RFKILL is not set 384# CONFIG_RFKILL is not set
@@ -371,8 +402,92 @@ CONFIG_EXTRA_FIRMWARE=""
371# CONFIG_SYS_HYPERVISOR is not set 402# CONFIG_SYS_HYPERVISOR is not set
372CONFIG_CONNECTOR=y 403CONFIG_CONNECTOR=y
373CONFIG_PROC_EVENTS=y 404CONFIG_PROC_EVENTS=y
374# CONFIG_MTD is not set 405CONFIG_MTD=y
406# CONFIG_MTD_DEBUG is not set
407# CONFIG_MTD_CONCAT is not set
408CONFIG_MTD_PARTITIONS=y
409# CONFIG_MTD_TESTS is not set
410# CONFIG_MTD_REDBOOT_PARTS is not set
411CONFIG_MTD_CMDLINE_PARTS=y
412CONFIG_MTD_OF_PARTS=y
413# CONFIG_MTD_AR7_PARTS is not set
414
415#
416# User Modules And Translation Layers
417#
418CONFIG_MTD_CHAR=y
419CONFIG_MTD_BLKDEVS=y
420CONFIG_MTD_BLOCK=y
421# CONFIG_FTL is not set
422# CONFIG_NFTL is not set
423# CONFIG_INFTL is not set
424# CONFIG_RFD_FTL is not set
425# CONFIG_SSFDC is not set
426# CONFIG_MTD_OOPS is not set
427
428#
429# RAM/ROM/Flash chip drivers
430#
431CONFIG_MTD_CFI=y
432# CONFIG_MTD_JEDECPROBE is not set
433CONFIG_MTD_GEN_PROBE=y
434# CONFIG_MTD_CFI_ADV_OPTIONS is not set
435CONFIG_MTD_MAP_BANK_WIDTH_1=y
436CONFIG_MTD_MAP_BANK_WIDTH_2=y
437CONFIG_MTD_MAP_BANK_WIDTH_4=y
438# CONFIG_MTD_MAP_BANK_WIDTH_8 is not set
439# CONFIG_MTD_MAP_BANK_WIDTH_16 is not set
440# CONFIG_MTD_MAP_BANK_WIDTH_32 is not set
441CONFIG_MTD_CFI_I1=y
442CONFIG_MTD_CFI_I2=y
443# CONFIG_MTD_CFI_I4 is not set
444# CONFIG_MTD_CFI_I8 is not set
445# CONFIG_MTD_CFI_INTELEXT is not set
446CONFIG_MTD_CFI_AMDSTD=y
447# CONFIG_MTD_CFI_STAA is not set
448CONFIG_MTD_CFI_UTIL=y
449# CONFIG_MTD_RAM is not set
450# CONFIG_MTD_ROM is not set
451# CONFIG_MTD_ABSENT is not set
452
453#
454# Mapping drivers for chip access
455#
456# CONFIG_MTD_COMPLEX_MAPPINGS is not set
457# CONFIG_MTD_PHYSMAP is not set
458CONFIG_MTD_PHYSMAP_OF=y
459# CONFIG_MTD_INTEL_VR_NOR is not set
460# CONFIG_MTD_PLATRAM is not set
461
462#
463# Self-contained MTD device drivers
464#
465# CONFIG_MTD_PMC551 is not set
466# CONFIG_MTD_SLRAM is not set
467# CONFIG_MTD_PHRAM is not set
468# CONFIG_MTD_MTDRAM is not set
469# CONFIG_MTD_BLOCK2MTD is not set
470
471#
472# Disk-On-Chip Device Drivers
473#
474# CONFIG_MTD_DOC2000 is not set
475# CONFIG_MTD_DOC2001 is not set
476# CONFIG_MTD_DOC2001PLUS is not set
477# CONFIG_MTD_NAND is not set
478# CONFIG_MTD_ONENAND is not set
479
480#
481# LPDDR flash memory drivers
482#
483# CONFIG_MTD_LPDDR is not set
484
485#
486# UBI - Unsorted block images
487#
488# CONFIG_MTD_UBI is not set
375CONFIG_OF_DEVICE=y 489CONFIG_OF_DEVICE=y
490CONFIG_OF_I2C=y
376# CONFIG_PARPORT is not set 491# CONFIG_PARPORT is not set
377CONFIG_BLK_DEV=y 492CONFIG_BLK_DEV=y
378# CONFIG_BLK_DEV_FD is not set 493# CONFIG_BLK_DEV_FD is not set
@@ -412,7 +527,11 @@ CONFIG_HAVE_IDE=y
412# 527#
413 528
414# 529#
415# Enable only one of the two stacks, unless you know what you are doing 530# You can enable one or both FireWire driver stacks.
531#
532
533#
534# See the help texts for more information.
416# 535#
417# CONFIG_FIREWIRE is not set 536# CONFIG_FIREWIRE is not set
418# CONFIG_IEEE1394 is not set 537# CONFIG_IEEE1394 is not set
@@ -433,6 +552,8 @@ CONFIG_NET_ETHERNET=y
433# CONFIG_SUNGEM is not set 552# CONFIG_SUNGEM is not set
434# CONFIG_CASSINI is not set 553# CONFIG_CASSINI is not set
435# CONFIG_NET_VENDOR_3COM is not set 554# CONFIG_NET_VENDOR_3COM is not set
555# CONFIG_ETHOC is not set
556# CONFIG_DNET is not set
436# CONFIG_NET_TULIP is not set 557# CONFIG_NET_TULIP is not set
437# CONFIG_HP100 is not set 558# CONFIG_HP100 is not set
438CONFIG_IBM_NEW_EMAC=y 559CONFIG_IBM_NEW_EMAC=y
@@ -451,6 +572,7 @@ CONFIG_IBM_NEW_EMAC_EMAC4=y
451# CONFIG_IBM_NEW_EMAC_MAL_COMMON_ERR is not set 572# CONFIG_IBM_NEW_EMAC_MAL_COMMON_ERR is not set
452# CONFIG_NET_PCI is not set 573# CONFIG_NET_PCI is not set
453# CONFIG_B44 is not set 574# CONFIG_B44 is not set
575# CONFIG_KS8842 is not set
454# CONFIG_ATL2 is not set 576# CONFIG_ATL2 is not set
455# CONFIG_NETDEV_1000 is not set 577# CONFIG_NETDEV_1000 is not set
456# CONFIG_NETDEV_10000 is not set 578# CONFIG_NETDEV_10000 is not set
@@ -461,7 +583,6 @@ CONFIG_IBM_NEW_EMAC_EMAC4=y
461# 583#
462# CONFIG_WLAN_PRE80211 is not set 584# CONFIG_WLAN_PRE80211 is not set
463# CONFIG_WLAN_80211 is not set 585# CONFIG_WLAN_80211 is not set
464# CONFIG_IWLWIFI_LEDS is not set
465 586
466# 587#
467# Enable WiMAX (Networking options) to see the WiMAX drivers 588# Enable WiMAX (Networking options) to see the WiMAX drivers
@@ -533,13 +654,143 @@ CONFIG_LEGACY_PTY_COUNT=256
533# CONFIG_RAW_DRIVER is not set 654# CONFIG_RAW_DRIVER is not set
534# CONFIG_TCG_TPM is not set 655# CONFIG_TCG_TPM is not set
535CONFIG_DEVPORT=y 656CONFIG_DEVPORT=y
536# CONFIG_I2C is not set 657CONFIG_I2C=y
658CONFIG_I2C_BOARDINFO=y
659CONFIG_I2C_CHARDEV=y
660CONFIG_I2C_HELPER_AUTO=y
661
662#
663# I2C Hardware Bus support
664#
665
666#
667# PC SMBus host controller drivers
668#
669# CONFIG_I2C_ALI1535 is not set
670# CONFIG_I2C_ALI1563 is not set
671# CONFIG_I2C_ALI15X3 is not set
672# CONFIG_I2C_AMD756 is not set
673# CONFIG_I2C_AMD8111 is not set
674# CONFIG_I2C_I801 is not set
675# CONFIG_I2C_ISCH is not set
676# CONFIG_I2C_PIIX4 is not set
677# CONFIG_I2C_NFORCE2 is not set
678# CONFIG_I2C_SIS5595 is not set
679# CONFIG_I2C_SIS630 is not set
680# CONFIG_I2C_SIS96X is not set
681# CONFIG_I2C_VIA is not set
682# CONFIG_I2C_VIAPRO is not set
683
684#
685# I2C system bus drivers (mostly embedded / system-on-chip)
686#
687CONFIG_I2C_IBM_IIC=y
688# CONFIG_I2C_MPC is not set
689# CONFIG_I2C_OCORES is not set
690# CONFIG_I2C_SIMTEC is not set
691
692#
693# External I2C/SMBus adapter drivers
694#
695# CONFIG_I2C_PARPORT_LIGHT is not set
696# CONFIG_I2C_TAOS_EVM is not set
697
698#
699# Graphics adapter I2C/DDC channel drivers
700#
701# CONFIG_I2C_VOODOO3 is not set
702
703#
704# Other I2C/SMBus bus drivers
705#
706# CONFIG_I2C_PCA_PLATFORM is not set
707# CONFIG_I2C_STUB is not set
708
709#
710# Miscellaneous I2C Chip support
711#
712# CONFIG_DS1682 is not set
713# CONFIG_SENSORS_PCF8574 is not set
714# CONFIG_PCF8575 is not set
715# CONFIG_SENSORS_PCA9539 is not set
716# CONFIG_SENSORS_TSL2550 is not set
717# CONFIG_I2C_DEBUG_CORE is not set
718# CONFIG_I2C_DEBUG_ALGO is not set
719# CONFIG_I2C_DEBUG_BUS is not set
720# CONFIG_I2C_DEBUG_CHIP is not set
537# CONFIG_SPI is not set 721# CONFIG_SPI is not set
722
723#
724# PPS support
725#
726# CONFIG_PPS is not set
538CONFIG_ARCH_WANT_OPTIONAL_GPIOLIB=y 727CONFIG_ARCH_WANT_OPTIONAL_GPIOLIB=y
539# CONFIG_GPIOLIB is not set 728# CONFIG_GPIOLIB is not set
540# CONFIG_W1 is not set 729# CONFIG_W1 is not set
541# CONFIG_POWER_SUPPLY is not set 730# CONFIG_POWER_SUPPLY is not set
542# CONFIG_HWMON is not set 731CONFIG_HWMON=y
732# CONFIG_HWMON_VID is not set
733CONFIG_SENSORS_AD7414=y
734# CONFIG_SENSORS_AD7418 is not set
735# CONFIG_SENSORS_ADM1021 is not set
736# CONFIG_SENSORS_ADM1025 is not set
737# CONFIG_SENSORS_ADM1026 is not set
738# CONFIG_SENSORS_ADM1029 is not set
739# CONFIG_SENSORS_ADM1031 is not set
740# CONFIG_SENSORS_ADM9240 is not set
741# CONFIG_SENSORS_ADT7462 is not set
742# CONFIG_SENSORS_ADT7470 is not set
743# CONFIG_SENSORS_ADT7473 is not set
744# CONFIG_SENSORS_ADT7475 is not set
745# CONFIG_SENSORS_ATXP1 is not set
746# CONFIG_SENSORS_DS1621 is not set
747# CONFIG_SENSORS_I5K_AMB is not set
748# CONFIG_SENSORS_F71805F is not set
749# CONFIG_SENSORS_F71882FG is not set
750# CONFIG_SENSORS_F75375S is not set
751# CONFIG_SENSORS_G760A is not set
752# CONFIG_SENSORS_GL518SM is not set
753# CONFIG_SENSORS_GL520SM is not set
754# CONFIG_SENSORS_IT87 is not set
755# CONFIG_SENSORS_LM63 is not set
756# CONFIG_SENSORS_LM75 is not set
757# CONFIG_SENSORS_LM77 is not set
758# CONFIG_SENSORS_LM78 is not set
759# CONFIG_SENSORS_LM80 is not set
760# CONFIG_SENSORS_LM83 is not set
761# CONFIG_SENSORS_LM85 is not set
762# CONFIG_SENSORS_LM87 is not set
763# CONFIG_SENSORS_LM90 is not set
764# CONFIG_SENSORS_LM92 is not set
765# CONFIG_SENSORS_LM93 is not set
766# CONFIG_SENSORS_LTC4215 is not set
767# CONFIG_SENSORS_LTC4245 is not set
768# CONFIG_SENSORS_LM95241 is not set
769# CONFIG_SENSORS_MAX1619 is not set
770# CONFIG_SENSORS_MAX6650 is not set
771# CONFIG_SENSORS_PC87360 is not set
772# CONFIG_SENSORS_PC87427 is not set
773# CONFIG_SENSORS_PCF8591 is not set
774# CONFIG_SENSORS_SIS5595 is not set
775# CONFIG_SENSORS_DME1737 is not set
776# CONFIG_SENSORS_SMSC47M1 is not set
777# CONFIG_SENSORS_SMSC47M192 is not set
778# CONFIG_SENSORS_SMSC47B397 is not set
779# CONFIG_SENSORS_ADS7828 is not set
780# CONFIG_SENSORS_THMC50 is not set
781# CONFIG_SENSORS_TMP401 is not set
782# CONFIG_SENSORS_VIA686A is not set
783# CONFIG_SENSORS_VT1211 is not set
784# CONFIG_SENSORS_VT8231 is not set
785# CONFIG_SENSORS_W83781D is not set
786# CONFIG_SENSORS_W83791D is not set
787# CONFIG_SENSORS_W83792D is not set
788# CONFIG_SENSORS_W83793 is not set
789# CONFIG_SENSORS_W83L785TS is not set
790# CONFIG_SENSORS_W83L786NG is not set
791# CONFIG_SENSORS_W83627HF is not set
792# CONFIG_SENSORS_W83627EHF is not set
793# CONFIG_HWMON_DEBUG_CHIP is not set
543# CONFIG_THERMAL is not set 794# CONFIG_THERMAL is not set
544# CONFIG_THERMAL_HWMON is not set 795# CONFIG_THERMAL_HWMON is not set
545# CONFIG_WATCHDOG is not set 796# CONFIG_WATCHDOG is not set
@@ -556,24 +807,15 @@ CONFIG_SSB_POSSIBLE=y
556# CONFIG_MFD_CORE is not set 807# CONFIG_MFD_CORE is not set
557# CONFIG_MFD_SM501 is not set 808# CONFIG_MFD_SM501 is not set
558# CONFIG_HTC_PASIC3 is not set 809# CONFIG_HTC_PASIC3 is not set
810# CONFIG_TWL4030_CORE is not set
559# CONFIG_MFD_TMIO is not set 811# CONFIG_MFD_TMIO is not set
812# CONFIG_PMIC_DA903X is not set
813# CONFIG_MFD_WM8400 is not set
814# CONFIG_MFD_WM8350_I2C is not set
815# CONFIG_MFD_PCF50633 is not set
816# CONFIG_AB3100_CORE is not set
560# CONFIG_REGULATOR is not set 817# CONFIG_REGULATOR is not set
561 818# CONFIG_MEDIA_SUPPORT is not set
562#
563# Multimedia devices
564#
565
566#
567# Multimedia core support
568#
569# CONFIG_VIDEO_DEV is not set
570# CONFIG_DVB_CORE is not set
571# CONFIG_VIDEO_MEDIA is not set
572
573#
574# Multimedia drivers
575#
576CONFIG_DAB=y
577 819
578# 820#
579# Graphics support 821# Graphics support
@@ -600,7 +842,12 @@ CONFIG_VIDEO_OUTPUT_CONTROL=m
600# CONFIG_EDAC is not set 842# CONFIG_EDAC is not set
601# CONFIG_RTC_CLASS is not set 843# CONFIG_RTC_CLASS is not set
602# CONFIG_DMADEVICES is not set 844# CONFIG_DMADEVICES is not set
845# CONFIG_AUXDISPLAY is not set
603# CONFIG_UIO is not set 846# CONFIG_UIO is not set
847
848#
849# TI VLYNQ
850#
604# CONFIG_STAGING is not set 851# CONFIG_STAGING is not set
605 852
606# 853#
@@ -614,11 +861,12 @@ CONFIG_EXT2_FS=y
614# CONFIG_REISERFS_FS is not set 861# CONFIG_REISERFS_FS is not set
615# CONFIG_JFS_FS is not set 862# CONFIG_JFS_FS is not set
616# CONFIG_FS_POSIX_ACL is not set 863# CONFIG_FS_POSIX_ACL is not set
617CONFIG_FILE_LOCKING=y
618# CONFIG_XFS_FS is not set 864# CONFIG_XFS_FS is not set
619# CONFIG_GFS2_FS is not set 865# CONFIG_GFS2_FS is not set
620# CONFIG_OCFS2_FS is not set 866# CONFIG_OCFS2_FS is not set
621# CONFIG_BTRFS_FS is not set 867# CONFIG_BTRFS_FS is not set
868CONFIG_FILE_LOCKING=y
869CONFIG_FSNOTIFY=y
622CONFIG_DNOTIFY=y 870CONFIG_DNOTIFY=y
623CONFIG_INOTIFY=y 871CONFIG_INOTIFY=y
624CONFIG_INOTIFY_USER=y 872CONFIG_INOTIFY_USER=y
@@ -628,6 +876,11 @@ CONFIG_INOTIFY_USER=y
628# CONFIG_FUSE_FS is not set 876# CONFIG_FUSE_FS is not set
629 877
630# 878#
879# Caches
880#
881# CONFIG_FSCACHE is not set
882
883#
631# CD-ROM/DVD Filesystems 884# CD-ROM/DVD Filesystems
632# 885#
633# CONFIG_ISO9660_FS is not set 886# CONFIG_ISO9660_FS is not set
@@ -660,6 +913,17 @@ CONFIG_MISC_FILESYSTEMS=y
660# CONFIG_BEFS_FS is not set 913# CONFIG_BEFS_FS is not set
661# CONFIG_BFS_FS is not set 914# CONFIG_BFS_FS is not set
662# CONFIG_EFS_FS is not set 915# CONFIG_EFS_FS is not set
916CONFIG_JFFS2_FS=y
917CONFIG_JFFS2_FS_DEBUG=0
918CONFIG_JFFS2_FS_WRITEBUFFER=y
919# CONFIG_JFFS2_FS_WBUF_VERIFY is not set
920# CONFIG_JFFS2_SUMMARY is not set
921# CONFIG_JFFS2_FS_XATTR is not set
922# CONFIG_JFFS2_COMPRESSION_OPTIONS is not set
923CONFIG_JFFS2_ZLIB=y
924# CONFIG_JFFS2_LZO is not set
925CONFIG_JFFS2_RTIME=y
926# CONFIG_JFFS2_RUBIN is not set
663CONFIG_CRAMFS=y 927CONFIG_CRAMFS=y
664# CONFIG_SQUASHFS is not set 928# CONFIG_SQUASHFS is not set
665# CONFIG_VXFS_FS is not set 929# CONFIG_VXFS_FS is not set
@@ -670,6 +934,7 @@ CONFIG_CRAMFS=y
670# CONFIG_ROMFS_FS is not set 934# CONFIG_ROMFS_FS is not set
671# CONFIG_SYSV_FS is not set 935# CONFIG_SYSV_FS is not set
672# CONFIG_UFS_FS is not set 936# CONFIG_UFS_FS is not set
937# CONFIG_NILFS2_FS is not set
673CONFIG_NETWORK_FILESYSTEMS=y 938CONFIG_NETWORK_FILESYSTEMS=y
674CONFIG_NFS_FS=y 939CONFIG_NFS_FS=y
675CONFIG_NFS_V3=y 940CONFIG_NFS_V3=y
@@ -681,7 +946,6 @@ CONFIG_LOCKD=y
681CONFIG_LOCKD_V4=y 946CONFIG_LOCKD_V4=y
682CONFIG_NFS_COMMON=y 947CONFIG_NFS_COMMON=y
683CONFIG_SUNRPC=y 948CONFIG_SUNRPC=y
684# CONFIG_SUNRPC_REGISTER_V4 is not set
685# CONFIG_RPCSEC_GSS_KRB5 is not set 949# CONFIG_RPCSEC_GSS_KRB5 is not set
686# CONFIG_RPCSEC_GSS_SPKM3 is not set 950# CONFIG_RPCSEC_GSS_SPKM3 is not set
687# CONFIG_SMB_FS is not set 951# CONFIG_SMB_FS is not set
@@ -697,6 +961,7 @@ CONFIG_SUNRPC=y
697CONFIG_MSDOS_PARTITION=y 961CONFIG_MSDOS_PARTITION=y
698# CONFIG_NLS is not set 962# CONFIG_NLS is not set
699# CONFIG_DLM is not set 963# CONFIG_DLM is not set
964# CONFIG_BINARY_PRINTF is not set
700 965
701# 966#
702# Library routines 967# Library routines
@@ -711,11 +976,14 @@ CONFIG_CRC32=y
711# CONFIG_CRC7 is not set 976# CONFIG_CRC7 is not set
712# CONFIG_LIBCRC32C is not set 977# CONFIG_LIBCRC32C is not set
713CONFIG_ZLIB_INFLATE=y 978CONFIG_ZLIB_INFLATE=y
714CONFIG_PLIST=y 979CONFIG_ZLIB_DEFLATE=y
980CONFIG_DECOMPRESS_GZIP=y
715CONFIG_HAS_IOMEM=y 981CONFIG_HAS_IOMEM=y
716CONFIG_HAS_IOPORT=y 982CONFIG_HAS_IOPORT=y
717CONFIG_HAS_DMA=y 983CONFIG_HAS_DMA=y
718CONFIG_HAVE_LMB=y 984CONFIG_HAVE_LMB=y
985CONFIG_NLATTR=y
986CONFIG_GENERIC_ATOMIC64=y
719 987
720# 988#
721# Kernel hacking 989# Kernel hacking
@@ -733,6 +1001,9 @@ CONFIG_DEBUG_KERNEL=y
733CONFIG_DETECT_SOFTLOCKUP=y 1001CONFIG_DETECT_SOFTLOCKUP=y
734# CONFIG_BOOTPARAM_SOFTLOCKUP_PANIC is not set 1002# CONFIG_BOOTPARAM_SOFTLOCKUP_PANIC is not set
735CONFIG_BOOTPARAM_SOFTLOCKUP_PANIC_VALUE=0 1003CONFIG_BOOTPARAM_SOFTLOCKUP_PANIC_VALUE=0
1004CONFIG_DETECT_HUNG_TASK=y
1005# CONFIG_BOOTPARAM_HUNG_TASK_PANIC is not set
1006CONFIG_BOOTPARAM_HUNG_TASK_PANIC_VALUE=0
736CONFIG_SCHED_DEBUG=y 1007CONFIG_SCHED_DEBUG=y
737# CONFIG_SCHEDSTATS is not set 1008# CONFIG_SCHEDSTATS is not set
738# CONFIG_TIMER_STATS is not set 1009# CONFIG_TIMER_STATS is not set
@@ -743,6 +1014,9 @@ CONFIG_SCHED_DEBUG=y
743# CONFIG_RT_MUTEX_TESTER is not set 1014# CONFIG_RT_MUTEX_TESTER is not set
744# CONFIG_DEBUG_SPINLOCK is not set 1015# CONFIG_DEBUG_SPINLOCK is not set
745# CONFIG_DEBUG_MUTEXES is not set 1016# CONFIG_DEBUG_MUTEXES is not set
1017# CONFIG_DEBUG_LOCK_ALLOC is not set
1018# CONFIG_PROVE_LOCKING is not set
1019# CONFIG_LOCK_STAT is not set
746# CONFIG_DEBUG_SPINLOCK_SLEEP is not set 1020# CONFIG_DEBUG_SPINLOCK_SLEEP is not set
747# CONFIG_DEBUG_LOCKING_API_SELFTESTS is not set 1021# CONFIG_DEBUG_LOCKING_API_SELFTESTS is not set
748# CONFIG_DEBUG_KOBJECT is not set 1022# CONFIG_DEBUG_KOBJECT is not set
@@ -754,7 +1028,6 @@ CONFIG_SCHED_DEBUG=y
754# CONFIG_DEBUG_LIST is not set 1028# CONFIG_DEBUG_LIST is not set
755# CONFIG_DEBUG_SG is not set 1029# CONFIG_DEBUG_SG is not set
756# CONFIG_DEBUG_NOTIFIERS is not set 1030# CONFIG_DEBUG_NOTIFIERS is not set
757# CONFIG_BOOT_PRINTK_DELAY is not set
758# CONFIG_RCU_TORTURE_TEST is not set 1031# CONFIG_RCU_TORTURE_TEST is not set
759# CONFIG_RCU_CPU_STALL_DETECTOR is not set 1032# CONFIG_RCU_CPU_STALL_DETECTOR is not set
760# CONFIG_BACKTRACE_SELF_TEST is not set 1033# CONFIG_BACKTRACE_SELF_TEST is not set
@@ -762,27 +1035,36 @@ CONFIG_SCHED_DEBUG=y
762# CONFIG_FAULT_INJECTION is not set 1035# CONFIG_FAULT_INJECTION is not set
763# CONFIG_LATENCYTOP is not set 1036# CONFIG_LATENCYTOP is not set
764CONFIG_SYSCTL_SYSCALL_CHECK=y 1037CONFIG_SYSCTL_SYSCALL_CHECK=y
1038# CONFIG_DEBUG_PAGEALLOC is not set
765CONFIG_HAVE_FUNCTION_TRACER=y 1039CONFIG_HAVE_FUNCTION_TRACER=y
1040CONFIG_HAVE_FUNCTION_GRAPH_TRACER=y
766CONFIG_HAVE_DYNAMIC_FTRACE=y 1041CONFIG_HAVE_DYNAMIC_FTRACE=y
767CONFIG_HAVE_FTRACE_MCOUNT_RECORD=y 1042CONFIG_HAVE_FTRACE_MCOUNT_RECORD=y
768 1043CONFIG_TRACING_SUPPORT=y
769# 1044CONFIG_FTRACE=y
770# Tracers
771#
772# CONFIG_FUNCTION_TRACER is not set 1045# CONFIG_FUNCTION_TRACER is not set
1046# CONFIG_IRQSOFF_TRACER is not set
773# CONFIG_SCHED_TRACER is not set 1047# CONFIG_SCHED_TRACER is not set
774# CONFIG_CONTEXT_SWITCH_TRACER is not set 1048# CONFIG_ENABLE_DEFAULT_TRACERS is not set
775# CONFIG_BOOT_TRACER is not set 1049# CONFIG_BOOT_TRACER is not set
776# CONFIG_TRACE_BRANCH_PROFILING is not set 1050CONFIG_BRANCH_PROFILE_NONE=y
1051# CONFIG_PROFILE_ANNOTATED_BRANCHES is not set
1052# CONFIG_PROFILE_ALL_BRANCHES is not set
777# CONFIG_STACK_TRACER is not set 1053# CONFIG_STACK_TRACER is not set
778# CONFIG_DYNAMIC_PRINTK_DEBUG is not set 1054# CONFIG_KMEMTRACE is not set
1055# CONFIG_WORKQUEUE_TRACER is not set
1056# CONFIG_BLK_DEV_IO_TRACE is not set
1057# CONFIG_DYNAMIC_DEBUG is not set
779# CONFIG_SAMPLES is not set 1058# CONFIG_SAMPLES is not set
780CONFIG_HAVE_ARCH_KGDB=y 1059CONFIG_HAVE_ARCH_KGDB=y
781# CONFIG_KGDB is not set 1060# CONFIG_KGDB is not set
1061# CONFIG_KMEMCHECK is not set
1062# CONFIG_PPC_DISABLE_WERROR is not set
1063CONFIG_PPC_WERROR=y
782CONFIG_PRINT_STACK_DEPTH=64 1064CONFIG_PRINT_STACK_DEPTH=64
783# CONFIG_DEBUG_STACKOVERFLOW is not set 1065# CONFIG_DEBUG_STACKOVERFLOW is not set
784# CONFIG_DEBUG_STACK_USAGE is not set 1066# CONFIG_DEBUG_STACK_USAGE is not set
785# CONFIG_DEBUG_PAGEALLOC is not set 1067# CONFIG_PPC_EMULATED_STATS is not set
786# CONFIG_CODE_PATCHING_SELFTEST is not set 1068# CONFIG_CODE_PATCHING_SELFTEST is not set
787# CONFIG_FTR_FIXUP_SELFTEST is not set 1069# CONFIG_FTR_FIXUP_SELFTEST is not set
788# CONFIG_MSI_BITMAP_SELFTEST is not set 1070# CONFIG_MSI_BITMAP_SELFTEST is not set
diff --git a/arch/powerpc/configs/44x/canyonlands_defconfig b/arch/powerpc/configs/44x/canyonlands_defconfig
index 5e85412eb9fa..b312b166be66 100644
--- a/arch/powerpc/configs/44x/canyonlands_defconfig
+++ b/arch/powerpc/configs/44x/canyonlands_defconfig
@@ -1,14 +1,14 @@
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-rc3 3# Linux kernel version: 2.6.31-rc4
4# Mon Feb 2 13:13:04 2009 4# Wed Jul 29 17:27:20 2009
5# 5#
6# CONFIG_PPC64 is not set 6# CONFIG_PPC64 is not set
7 7
8# 8#
9# Processor support 9# Processor support
10# 10#
11# CONFIG_6xx is not set 11# CONFIG_PPC_BOOK3S_32 is not set
12# CONFIG_PPC_85xx is not set 12# CONFIG_PPC_85xx is not set
13# CONFIG_PPC_8xx is not set 13# CONFIG_PPC_8xx is not set
14# CONFIG_40x is not set 14# CONFIG_40x is not set
@@ -31,15 +31,16 @@ CONFIG_GENERIC_TIME=y
31CONFIG_GENERIC_TIME_VSYSCALL=y 31CONFIG_GENERIC_TIME_VSYSCALL=y
32CONFIG_GENERIC_CLOCKEVENTS=y 32CONFIG_GENERIC_CLOCKEVENTS=y
33CONFIG_GENERIC_HARDIRQS=y 33CONFIG_GENERIC_HARDIRQS=y
34CONFIG_GENERIC_HARDIRQS_NO__DO_IRQ=y
34# CONFIG_HAVE_SETUP_PER_CPU_AREA is not set 35# CONFIG_HAVE_SETUP_PER_CPU_AREA is not set
35CONFIG_IRQ_PER_CPU=y 36CONFIG_IRQ_PER_CPU=y
36CONFIG_STACKTRACE_SUPPORT=y 37CONFIG_STACKTRACE_SUPPORT=y
37CONFIG_HAVE_LATENCYTOP_SUPPORT=y 38CONFIG_HAVE_LATENCYTOP_SUPPORT=y
39CONFIG_TRACE_IRQFLAGS_SUPPORT=y
38CONFIG_LOCKDEP_SUPPORT=y 40CONFIG_LOCKDEP_SUPPORT=y
39CONFIG_RWSEM_XCHGADD_ALGORITHM=y 41CONFIG_RWSEM_XCHGADD_ALGORITHM=y
40CONFIG_ARCH_HAS_ILOG2_U32=y 42CONFIG_ARCH_HAS_ILOG2_U32=y
41CONFIG_GENERIC_HWEIGHT=y 43CONFIG_GENERIC_HWEIGHT=y
42CONFIG_GENERIC_CALIBRATE_DELAY=y
43CONFIG_GENERIC_FIND_NEXT_BIT=y 44CONFIG_GENERIC_FIND_NEXT_BIT=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
@@ -53,11 +54,14 @@ 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"
64CONFIG_CONSTRUCTORS=y
61 65
62# 66#
63# General setup 67# General setup
@@ -71,6 +75,7 @@ CONFIG_SWAP=y
71CONFIG_SYSVIPC=y 75CONFIG_SYSVIPC=y
72CONFIG_SYSVIPC_SYSCTL=y 76CONFIG_SYSVIPC_SYSCTL=y
73CONFIG_POSIX_MQUEUE=y 77CONFIG_POSIX_MQUEUE=y
78CONFIG_POSIX_MQUEUE_SYSCTL=y
74# CONFIG_BSD_PROCESS_ACCT is not set 79# CONFIG_BSD_PROCESS_ACCT is not set
75# CONFIG_TASKSTATS is not set 80# CONFIG_TASKSTATS is not set
76# CONFIG_AUDIT is not set 81# CONFIG_AUDIT is not set
@@ -93,8 +98,12 @@ CONFIG_SYSFS_DEPRECATED_V2=y
93# CONFIG_NAMESPACES is not set 98# CONFIG_NAMESPACES is not set
94CONFIG_BLK_DEV_INITRD=y 99CONFIG_BLK_DEV_INITRD=y
95CONFIG_INITRAMFS_SOURCE="" 100CONFIG_INITRAMFS_SOURCE=""
101CONFIG_RD_GZIP=y
102# CONFIG_RD_BZIP2 is not set
103# CONFIG_RD_LZMA is not set
96# CONFIG_CC_OPTIMIZE_FOR_SIZE is not set 104# CONFIG_CC_OPTIMIZE_FOR_SIZE is not set
97CONFIG_SYSCTL=y 105CONFIG_SYSCTL=y
106CONFIG_ANON_INODES=y
98CONFIG_EMBEDDED=y 107CONFIG_EMBEDDED=y
99CONFIG_SYSCTL_SYSCALL=y 108CONFIG_SYSCTL_SYSCALL=y
100CONFIG_KALLSYMS=y 109CONFIG_KALLSYMS=y
@@ -104,23 +113,30 @@ CONFIG_HOTPLUG=y
104CONFIG_PRINTK=y 113CONFIG_PRINTK=y
105CONFIG_BUG=y 114CONFIG_BUG=y
106CONFIG_ELF_CORE=y 115CONFIG_ELF_CORE=y
107CONFIG_COMPAT_BRK=y
108CONFIG_BASE_FULL=y 116CONFIG_BASE_FULL=y
109CONFIG_FUTEX=y 117CONFIG_FUTEX=y
110CONFIG_ANON_INODES=y
111CONFIG_EPOLL=y 118CONFIG_EPOLL=y
112CONFIG_SIGNALFD=y 119CONFIG_SIGNALFD=y
113CONFIG_TIMERFD=y 120CONFIG_TIMERFD=y
114CONFIG_EVENTFD=y 121CONFIG_EVENTFD=y
115CONFIG_SHMEM=y 122CONFIG_SHMEM=y
116CONFIG_AIO=y 123CONFIG_AIO=y
124CONFIG_HAVE_PERF_COUNTERS=y
125
126#
127# Performance Counters
128#
129# CONFIG_PERF_COUNTERS is not set
117CONFIG_VM_EVENT_COUNTERS=y 130CONFIG_VM_EVENT_COUNTERS=y
118CONFIG_PCI_QUIRKS=y 131CONFIG_PCI_QUIRKS=y
119CONFIG_SLUB_DEBUG=y 132CONFIG_SLUB_DEBUG=y
133# CONFIG_STRIP_ASM_SYMS is not set
134CONFIG_COMPAT_BRK=y
120# CONFIG_SLAB is not set 135# CONFIG_SLAB is not set
121CONFIG_SLUB=y 136CONFIG_SLUB=y
122# CONFIG_SLOB is not set 137# CONFIG_SLOB is not set
123# CONFIG_PROFILING is not set 138# CONFIG_PROFILING is not set
139# CONFIG_MARKERS is not set
124CONFIG_HAVE_OPROFILE=y 140CONFIG_HAVE_OPROFILE=y
125# CONFIG_KPROBES is not set 141# CONFIG_KPROBES is not set
126CONFIG_HAVE_EFFICIENT_UNALIGNED_ACCESS=y 142CONFIG_HAVE_EFFICIENT_UNALIGNED_ACCESS=y
@@ -128,6 +144,12 @@ CONFIG_HAVE_IOREMAP_PROT=y
128CONFIG_HAVE_KPROBES=y 144CONFIG_HAVE_KPROBES=y
129CONFIG_HAVE_KRETPROBES=y 145CONFIG_HAVE_KRETPROBES=y
130CONFIG_HAVE_ARCH_TRACEHOOK=y 146CONFIG_HAVE_ARCH_TRACEHOOK=y
147
148#
149# GCOV-based kernel profiling
150#
151# CONFIG_GCOV_KERNEL is not set
152# CONFIG_SLOW_WORK is not set
131# CONFIG_HAVE_GENERIC_DMA_COHERENT is not set 153# CONFIG_HAVE_GENERIC_DMA_COHERENT is not set
132CONFIG_SLABINFO=y 154CONFIG_SLABINFO=y
133CONFIG_RT_MUTEXES=y 155CONFIG_RT_MUTEXES=y
@@ -139,8 +161,7 @@ CONFIG_MODULE_UNLOAD=y
139# CONFIG_MODVERSIONS is not set 161# CONFIG_MODVERSIONS is not set
140# CONFIG_MODULE_SRCVERSION_ALL is not set 162# CONFIG_MODULE_SRCVERSION_ALL is not set
141CONFIG_BLOCK=y 163CONFIG_BLOCK=y
142CONFIG_LBD=y 164CONFIG_LBDAF=y
143# CONFIG_BLK_DEV_IO_TRACE is not set
144# CONFIG_BLK_DEV_BSG is not set 165# CONFIG_BLK_DEV_BSG is not set
145# CONFIG_BLK_DEV_INTEGRITY is not set 166# CONFIG_BLK_DEV_INTEGRITY is not set
146 167
@@ -176,6 +197,7 @@ CONFIG_PPC4xx_PCI_EXPRESS=y
176# CONFIG_ARCHES is not set 197# CONFIG_ARCHES is not set
177CONFIG_CANYONLANDS=y 198CONFIG_CANYONLANDS=y
178# CONFIG_GLACIER is not set 199# CONFIG_GLACIER is not set
200# CONFIG_REDWOOD is not set
179# CONFIG_YOSEMITE is not set 201# CONFIG_YOSEMITE is not set
180# CONFIG_XILINX_VIRTEX440_GENERIC_BOARD is not set 202# CONFIG_XILINX_VIRTEX440_GENERIC_BOARD is not set
181CONFIG_PPC44x_SIMPLE=y 203CONFIG_PPC44x_SIMPLE=y
@@ -218,6 +240,7 @@ CONFIG_BINFMT_ELF=y
218# CONFIG_BINFMT_MISC is not set 240# CONFIG_BINFMT_MISC is not set
219# CONFIG_MATH_EMULATION is not set 241# CONFIG_MATH_EMULATION is not set
220# CONFIG_IOMMU_HELPER is not set 242# CONFIG_IOMMU_HELPER is not set
243# CONFIG_SWIOTLB is not set
221CONFIG_PPC_NEED_DMA_SYNC_OPS=y 244CONFIG_PPC_NEED_DMA_SYNC_OPS=y
222CONFIG_ARCH_ENABLE_MEMORY_HOTPLUG=y 245CONFIG_ARCH_ENABLE_MEMORY_HOTPLUG=y
223CONFIG_ARCH_HAS_WALK_MEMORY=y 246CONFIG_ARCH_HAS_WALK_MEMORY=y
@@ -237,10 +260,14 @@ CONFIG_PHYS_ADDR_T_64BIT=y
237CONFIG_ZONE_DMA_FLAG=1 260CONFIG_ZONE_DMA_FLAG=1
238CONFIG_BOUNCE=y 261CONFIG_BOUNCE=y
239CONFIG_VIRT_TO_BUS=y 262CONFIG_VIRT_TO_BUS=y
240CONFIG_UNEVICTABLE_LRU=y 263CONFIG_HAVE_MLOCK=y
264CONFIG_HAVE_MLOCKED_PAGE_BIT=y
265CONFIG_DEFAULT_MMAP_MIN_ADDR=4096
266CONFIG_STDBINUTILS=y
241CONFIG_PPC_4K_PAGES=y 267CONFIG_PPC_4K_PAGES=y
242# CONFIG_PPC_16K_PAGES is not set 268# CONFIG_PPC_16K_PAGES is not set
243# CONFIG_PPC_64K_PAGES is not set 269# CONFIG_PPC_64K_PAGES is not set
270# CONFIG_PPC_256K_PAGES is not set
244CONFIG_FORCE_MAX_ZONEORDER=11 271CONFIG_FORCE_MAX_ZONEORDER=11
245CONFIG_PROC_DEVICETREE=y 272CONFIG_PROC_DEVICETREE=y
246CONFIG_CMDLINE_BOOL=y 273CONFIG_CMDLINE_BOOL=y
@@ -265,6 +292,7 @@ CONFIG_ARCH_SUPPORTS_MSI=y
265# CONFIG_PCI_LEGACY is not set 292# CONFIG_PCI_LEGACY is not set
266# CONFIG_PCI_DEBUG is not set 293# CONFIG_PCI_DEBUG is not set
267# CONFIG_PCI_STUB is not set 294# CONFIG_PCI_STUB is not set
295# CONFIG_PCI_IOV is not set
268# CONFIG_PCCARD is not set 296# CONFIG_PCCARD is not set
269# CONFIG_HOTPLUG_PCI is not set 297# CONFIG_HOTPLUG_PCI is not set
270# CONFIG_HAS_RAPIDIO is not set 298# CONFIG_HAS_RAPIDIO is not set
@@ -282,14 +310,12 @@ CONFIG_PAGE_OFFSET=0xc0000000
282CONFIG_KERNEL_START=0xc0000000 310CONFIG_KERNEL_START=0xc0000000
283CONFIG_PHYSICAL_START=0x00000000 311CONFIG_PHYSICAL_START=0x00000000
284CONFIG_TASK_SIZE=0xc0000000 312CONFIG_TASK_SIZE=0xc0000000
285CONFIG_CONSISTENT_START=0xff100000
286CONFIG_CONSISTENT_SIZE=0x00200000 313CONFIG_CONSISTENT_SIZE=0x00200000
287CONFIG_NET=y 314CONFIG_NET=y
288 315
289# 316#
290# Networking options 317# Networking options
291# 318#
292CONFIG_COMPAT_NET_DEV_OPS=y
293CONFIG_PACKET=y 319CONFIG_PACKET=y
294# CONFIG_PACKET_MMAP is not set 320# CONFIG_PACKET_MMAP is not set
295CONFIG_UNIX=y 321CONFIG_UNIX=y
@@ -339,6 +365,8 @@ CONFIG_DEFAULT_TCP_CONG="cubic"
339# CONFIG_LAPB is not set 365# CONFIG_LAPB is not set
340# CONFIG_ECONET is not set 366# CONFIG_ECONET is not set
341# CONFIG_WAN_ROUTER is not set 367# CONFIG_WAN_ROUTER is not set
368# CONFIG_PHONET is not set
369# CONFIG_IEEE802154 is not set
342# CONFIG_NET_SCHED is not set 370# CONFIG_NET_SCHED is not set
343# CONFIG_DCB is not set 371# CONFIG_DCB is not set
344 372
@@ -351,7 +379,6 @@ CONFIG_DEFAULT_TCP_CONG="cubic"
351# CONFIG_IRDA is not set 379# CONFIG_IRDA is not set
352# CONFIG_BT is not set 380# CONFIG_BT is not set
353# CONFIG_AF_RXRPC is not set 381# CONFIG_AF_RXRPC is not set
354# CONFIG_PHONET is not set
355# CONFIG_WIRELESS is not set 382# CONFIG_WIRELESS is not set
356# CONFIG_WIMAX is not set 383# CONFIG_WIMAX is not set
357# CONFIG_RFKILL is not set 384# CONFIG_RFKILL is not set
@@ -375,7 +402,101 @@ CONFIG_EXTRA_FIRMWARE=""
375# CONFIG_SYS_HYPERVISOR is not set 402# CONFIG_SYS_HYPERVISOR is not set
376CONFIG_CONNECTOR=y 403CONFIG_CONNECTOR=y
377CONFIG_PROC_EVENTS=y 404CONFIG_PROC_EVENTS=y
378# CONFIG_MTD is not set 405CONFIG_MTD=y
406# CONFIG_MTD_DEBUG is not set
407# CONFIG_MTD_CONCAT is not set
408CONFIG_MTD_PARTITIONS=y
409# CONFIG_MTD_TESTS is not set
410# CONFIG_MTD_REDBOOT_PARTS is not set
411CONFIG_MTD_CMDLINE_PARTS=y
412CONFIG_MTD_OF_PARTS=y
413# CONFIG_MTD_AR7_PARTS is not set
414
415#
416# User Modules And Translation Layers
417#
418CONFIG_MTD_CHAR=y
419CONFIG_MTD_BLKDEVS=y
420CONFIG_MTD_BLOCK=y
421# CONFIG_FTL is not set
422# CONFIG_NFTL is not set
423# CONFIG_INFTL is not set
424# CONFIG_RFD_FTL is not set
425# CONFIG_SSFDC is not set
426# CONFIG_MTD_OOPS is not set
427
428#
429# RAM/ROM/Flash chip drivers
430#
431CONFIG_MTD_CFI=y
432# CONFIG_MTD_JEDECPROBE is not set
433CONFIG_MTD_GEN_PROBE=y
434# CONFIG_MTD_CFI_ADV_OPTIONS is not set
435CONFIG_MTD_MAP_BANK_WIDTH_1=y
436CONFIG_MTD_MAP_BANK_WIDTH_2=y
437CONFIG_MTD_MAP_BANK_WIDTH_4=y
438# CONFIG_MTD_MAP_BANK_WIDTH_8 is not set
439# CONFIG_MTD_MAP_BANK_WIDTH_16 is not set
440# CONFIG_MTD_MAP_BANK_WIDTH_32 is not set
441CONFIG_MTD_CFI_I1=y
442CONFIG_MTD_CFI_I2=y
443# CONFIG_MTD_CFI_I4 is not set
444# CONFIG_MTD_CFI_I8 is not set
445# CONFIG_MTD_CFI_INTELEXT is not set
446CONFIG_MTD_CFI_AMDSTD=y
447# CONFIG_MTD_CFI_STAA is not set
448CONFIG_MTD_CFI_UTIL=y
449# CONFIG_MTD_RAM is not set
450# CONFIG_MTD_ROM is not set
451# CONFIG_MTD_ABSENT is not set
452
453#
454# Mapping drivers for chip access
455#
456# CONFIG_MTD_COMPLEX_MAPPINGS is not set
457# CONFIG_MTD_PHYSMAP is not set
458CONFIG_MTD_PHYSMAP_OF=y
459# CONFIG_MTD_INTEL_VR_NOR is not set
460# CONFIG_MTD_PLATRAM is not set
461
462#
463# Self-contained MTD device drivers
464#
465# CONFIG_MTD_PMC551 is not set
466# CONFIG_MTD_SLRAM is not set
467# CONFIG_MTD_PHRAM is not set
468# CONFIG_MTD_MTDRAM is not set
469# CONFIG_MTD_BLOCK2MTD is not set
470
471#
472# Disk-On-Chip Device Drivers
473#
474# CONFIG_MTD_DOC2000 is not set
475# CONFIG_MTD_DOC2001 is not set
476# CONFIG_MTD_DOC2001PLUS is not set
477CONFIG_MTD_NAND=y
478# CONFIG_MTD_NAND_VERIFY_WRITE is not set
479CONFIG_MTD_NAND_ECC_SMC=y
480# CONFIG_MTD_NAND_MUSEUM_IDS is not set
481CONFIG_MTD_NAND_IDS=y
482CONFIG_MTD_NAND_NDFC=y
483# CONFIG_MTD_NAND_DISKONCHIP is not set
484# CONFIG_MTD_NAND_CAFE is not set
485# CONFIG_MTD_NAND_NANDSIM is not set
486# CONFIG_MTD_NAND_PLATFORM is not set
487# CONFIG_MTD_ALAUDA is not set
488# CONFIG_MTD_NAND_FSL_ELBC is not set
489# CONFIG_MTD_ONENAND is not set
490
491#
492# LPDDR flash memory drivers
493#
494# CONFIG_MTD_LPDDR is not set
495
496#
497# UBI - Unsorted block images
498#
499# CONFIG_MTD_UBI is not set
379CONFIG_OF_DEVICE=y 500CONFIG_OF_DEVICE=y
380CONFIG_OF_I2C=y 501CONFIG_OF_I2C=y
381# CONFIG_PARPORT is not set 502# CONFIG_PARPORT is not set
@@ -418,7 +539,11 @@ CONFIG_HAVE_IDE=y
418# 539#
419 540
420# 541#
421# Enable only one of the two stacks, unless you know what you are doing 542# You can enable one or both FireWire driver stacks.
543#
544
545#
546# See the help texts for more information.
422# 547#
423# CONFIG_FIREWIRE is not set 548# CONFIG_FIREWIRE is not set
424# CONFIG_IEEE1394 is not set 549# CONFIG_IEEE1394 is not set
@@ -439,6 +564,8 @@ CONFIG_NET_ETHERNET=y
439# CONFIG_SUNGEM is not set 564# CONFIG_SUNGEM is not set
440# CONFIG_CASSINI is not set 565# CONFIG_CASSINI is not set
441# CONFIG_NET_VENDOR_3COM is not set 566# CONFIG_NET_VENDOR_3COM is not set
567# CONFIG_ETHOC is not set
568# CONFIG_DNET is not set
442# CONFIG_NET_TULIP is not set 569# CONFIG_NET_TULIP is not set
443# CONFIG_HP100 is not set 570# CONFIG_HP100 is not set
444CONFIG_IBM_NEW_EMAC=y 571CONFIG_IBM_NEW_EMAC=y
@@ -457,6 +584,7 @@ CONFIG_IBM_NEW_EMAC_EMAC4=y
457# CONFIG_IBM_NEW_EMAC_MAL_COMMON_ERR is not set 584# CONFIG_IBM_NEW_EMAC_MAL_COMMON_ERR is not set
458# CONFIG_NET_PCI is not set 585# CONFIG_NET_PCI is not set
459# CONFIG_B44 is not set 586# CONFIG_B44 is not set
587# CONFIG_KS8842 is not set
460# CONFIG_ATL2 is not set 588# CONFIG_ATL2 is not set
461# CONFIG_NETDEV_1000 is not set 589# CONFIG_NETDEV_1000 is not set
462# CONFIG_NETDEV_10000 is not set 590# CONFIG_NETDEV_10000 is not set
@@ -467,7 +595,6 @@ CONFIG_IBM_NEW_EMAC_EMAC4=y
467# 595#
468# CONFIG_WLAN_PRE80211 is not set 596# CONFIG_WLAN_PRE80211 is not set
469# CONFIG_WLAN_80211 is not set 597# CONFIG_WLAN_80211 is not set
470# CONFIG_IWLWIFI_LEDS is not set
471 598
472# 599#
473# Enable WiMAX (Networking options) to see the WiMAX drivers 600# Enable WiMAX (Networking options) to see the WiMAX drivers
@@ -542,7 +669,6 @@ CONFIG_LEGACY_PTY_COUNT=256
542# CONFIG_IPMI_HANDLER is not set 669# CONFIG_IPMI_HANDLER is not set
543# CONFIG_HW_RANDOM is not set 670# CONFIG_HW_RANDOM is not set
544# CONFIG_NVRAM is not set 671# CONFIG_NVRAM is not set
545# CONFIG_GEN_RTC is not set
546# CONFIG_R3964 is not set 672# CONFIG_R3964 is not set
547# CONFIG_APPLICOM is not set 673# CONFIG_APPLICOM is not set
548# CONFIG_RAW_DRIVER is not set 674# CONFIG_RAW_DRIVER is not set
@@ -608,14 +734,17 @@ CONFIG_I2C_IBM_IIC=y
608# CONFIG_SENSORS_PCF8574 is not set 734# CONFIG_SENSORS_PCF8574 is not set
609# CONFIG_PCF8575 is not set 735# CONFIG_PCF8575 is not set
610# CONFIG_SENSORS_PCA9539 is not set 736# CONFIG_SENSORS_PCA9539 is not set
611# CONFIG_SENSORS_PCF8591 is not set
612# CONFIG_SENSORS_MAX6875 is not set
613# CONFIG_SENSORS_TSL2550 is not set 737# CONFIG_SENSORS_TSL2550 is not set
614# CONFIG_I2C_DEBUG_CORE is not set 738# CONFIG_I2C_DEBUG_CORE is not set
615# CONFIG_I2C_DEBUG_ALGO is not set 739# CONFIG_I2C_DEBUG_ALGO is not set
616# CONFIG_I2C_DEBUG_BUS is not set 740# CONFIG_I2C_DEBUG_BUS is not set
617# CONFIG_I2C_DEBUG_CHIP is not set 741# CONFIG_I2C_DEBUG_CHIP is not set
618# CONFIG_SPI is not set 742# CONFIG_SPI is not set
743
744#
745# PPS support
746#
747# CONFIG_PPS is not set
619CONFIG_ARCH_WANT_OPTIONAL_GPIOLIB=y 748CONFIG_ARCH_WANT_OPTIONAL_GPIOLIB=y
620# CONFIG_GPIOLIB is not set 749# CONFIG_GPIOLIB is not set
621# CONFIG_W1 is not set 750# CONFIG_W1 is not set
@@ -640,6 +769,7 @@ CONFIG_SENSORS_AD7414=y
640# CONFIG_SENSORS_F71805F is not set 769# CONFIG_SENSORS_F71805F is not set
641# CONFIG_SENSORS_F71882FG is not set 770# CONFIG_SENSORS_F71882FG is not set
642# CONFIG_SENSORS_F75375S is not set 771# CONFIG_SENSORS_F75375S is not set
772# CONFIG_SENSORS_G760A is not set
643# CONFIG_SENSORS_GL518SM is not set 773# CONFIG_SENSORS_GL518SM is not set
644# CONFIG_SENSORS_GL520SM is not set 774# CONFIG_SENSORS_GL520SM is not set
645# CONFIG_SENSORS_IT87 is not set 775# CONFIG_SENSORS_IT87 is not set
@@ -654,11 +784,14 @@ CONFIG_SENSORS_AD7414=y
654# CONFIG_SENSORS_LM90 is not set 784# CONFIG_SENSORS_LM90 is not set
655# CONFIG_SENSORS_LM92 is not set 785# CONFIG_SENSORS_LM92 is not set
656# CONFIG_SENSORS_LM93 is not set 786# CONFIG_SENSORS_LM93 is not set
787# CONFIG_SENSORS_LTC4215 is not set
657# CONFIG_SENSORS_LTC4245 is not set 788# CONFIG_SENSORS_LTC4245 is not set
789# CONFIG_SENSORS_LM95241 is not set
658# CONFIG_SENSORS_MAX1619 is not set 790# CONFIG_SENSORS_MAX1619 is not set
659# CONFIG_SENSORS_MAX6650 is not set 791# CONFIG_SENSORS_MAX6650 is not set
660# CONFIG_SENSORS_PC87360 is not set 792# CONFIG_SENSORS_PC87360 is not set
661# CONFIG_SENSORS_PC87427 is not set 793# CONFIG_SENSORS_PC87427 is not set
794# CONFIG_SENSORS_PCF8591 is not set
662# CONFIG_SENSORS_SIS5595 is not set 795# CONFIG_SENSORS_SIS5595 is not set
663# CONFIG_SENSORS_DME1737 is not set 796# CONFIG_SENSORS_DME1737 is not set
664# CONFIG_SENSORS_SMSC47M1 is not set 797# CONFIG_SENSORS_SMSC47M1 is not set
@@ -666,6 +799,7 @@ CONFIG_SENSORS_AD7414=y
666# CONFIG_SENSORS_SMSC47B397 is not set 799# CONFIG_SENSORS_SMSC47B397 is not set
667# CONFIG_SENSORS_ADS7828 is not set 800# CONFIG_SENSORS_ADS7828 is not set
668# CONFIG_SENSORS_THMC50 is not set 801# CONFIG_SENSORS_THMC50 is not set
802# CONFIG_SENSORS_TMP401 is not set
669# CONFIG_SENSORS_VIA686A is not set 803# CONFIG_SENSORS_VIA686A is not set
670# CONFIG_SENSORS_VT1211 is not set 804# CONFIG_SENSORS_VT1211 is not set
671# CONFIG_SENSORS_VT8231 is not set 805# CONFIG_SENSORS_VT8231 is not set
@@ -700,24 +834,9 @@ CONFIG_SSB_POSSIBLE=y
700# CONFIG_MFD_WM8400 is not set 834# CONFIG_MFD_WM8400 is not set
701# CONFIG_MFD_WM8350_I2C is not set 835# CONFIG_MFD_WM8350_I2C is not set
702# CONFIG_MFD_PCF50633 is not set 836# CONFIG_MFD_PCF50633 is not set
837# CONFIG_AB3100_CORE is not set
703# CONFIG_REGULATOR is not set 838# CONFIG_REGULATOR is not set
704 839# CONFIG_MEDIA_SUPPORT is not set
705#
706# Multimedia devices
707#
708
709#
710# Multimedia core support
711#
712# CONFIG_VIDEO_DEV is not set
713# CONFIG_DVB_CORE is not set
714# CONFIG_VIDEO_MEDIA is not set
715
716#
717# Multimedia drivers
718#
719# CONFIG_DAB is not set
720# CONFIG_USB_DABUSB is not set
721 840
722# 841#
723# Graphics support 842# Graphics support
@@ -759,6 +878,7 @@ CONFIG_USB_MON=y
759# USB Host Controller Drivers 878# USB Host Controller Drivers
760# 879#
761# CONFIG_USB_C67X00_HCD is not set 880# CONFIG_USB_C67X00_HCD is not set
881# CONFIG_USB_XHCI_HCD is not set
762CONFIG_USB_EHCI_HCD=m 882CONFIG_USB_EHCI_HCD=m
763# CONFIG_USB_EHCI_ROOT_HUB_TT is not set 883# CONFIG_USB_EHCI_ROOT_HUB_TT is not set
764# CONFIG_USB_EHCI_TT_NEWSCHED is not set 884# CONFIG_USB_EHCI_TT_NEWSCHED is not set
@@ -767,9 +887,9 @@ CONFIG_USB_EHCI_HCD_PPC_OF=y
767# CONFIG_USB_ISP116X_HCD is not set 887# CONFIG_USB_ISP116X_HCD is not set
768# CONFIG_USB_ISP1760_HCD is not set 888# CONFIG_USB_ISP1760_HCD is not set
769CONFIG_USB_OHCI_HCD=y 889CONFIG_USB_OHCI_HCD=y
770CONFIG_USB_OHCI_HCD_PPC_OF=y
771CONFIG_USB_OHCI_HCD_PPC_OF_BE=y 890CONFIG_USB_OHCI_HCD_PPC_OF_BE=y
772CONFIG_USB_OHCI_HCD_PPC_OF_LE=y 891CONFIG_USB_OHCI_HCD_PPC_OF_LE=y
892CONFIG_USB_OHCI_HCD_PPC_OF=y
773CONFIG_USB_OHCI_HCD_PCI=y 893CONFIG_USB_OHCI_HCD_PCI=y
774CONFIG_USB_OHCI_BIG_ENDIAN_DESC=y 894CONFIG_USB_OHCI_BIG_ENDIAN_DESC=y
775CONFIG_USB_OHCI_BIG_ENDIAN_MMIO=y 895CONFIG_USB_OHCI_BIG_ENDIAN_MMIO=y
@@ -789,11 +909,11 @@ CONFIG_USB_OHCI_LITTLE_ENDIAN=y
789# CONFIG_USB_TMC is not set 909# CONFIG_USB_TMC is not set
790 910
791# 911#
792# NOTE: USB_STORAGE depends on SCSI but BLK_DEV_SD may also be needed; 912# NOTE: USB_STORAGE depends on SCSI but BLK_DEV_SD may
793# 913#
794 914
795# 915#
796# see USB_STORAGE Help for more information 916# also be needed; see USB_STORAGE Help for more info
797# 917#
798CONFIG_USB_LIBUSUAL=y 918CONFIG_USB_LIBUSUAL=y
799 919
@@ -821,7 +941,6 @@ CONFIG_USB_LIBUSUAL=y
821# CONFIG_USB_LED is not set 941# CONFIG_USB_LED is not set
822# CONFIG_USB_CYPRESS_CY7C63 is not set 942# CONFIG_USB_CYPRESS_CY7C63 is not set
823# CONFIG_USB_CYTHERM is not set 943# CONFIG_USB_CYTHERM is not set
824# CONFIG_USB_PHIDGET is not set
825# CONFIG_USB_IDMOUSE is not set 944# CONFIG_USB_IDMOUSE is not set
826# CONFIG_USB_FTDI_ELAN is not set 945# CONFIG_USB_FTDI_ELAN is not set
827# CONFIG_USB_APPLEDISPLAY is not set 946# CONFIG_USB_APPLEDISPLAY is not set
@@ -837,6 +956,7 @@ CONFIG_USB_LIBUSUAL=y
837# 956#
838# OTG and related infrastructure 957# OTG and related infrastructure
839# 958#
959# CONFIG_NOP_USB_XCEIV is not set
840# CONFIG_UWB is not set 960# CONFIG_UWB is not set
841# CONFIG_MMC is not set 961# CONFIG_MMC is not set
842# CONFIG_MEMSTICK is not set 962# CONFIG_MEMSTICK is not set
@@ -844,9 +964,70 @@ CONFIG_USB_LIBUSUAL=y
844# CONFIG_ACCESSIBILITY is not set 964# CONFIG_ACCESSIBILITY is not set
845# CONFIG_INFINIBAND is not set 965# CONFIG_INFINIBAND is not set
846# CONFIG_EDAC is not set 966# CONFIG_EDAC is not set
847# CONFIG_RTC_CLASS is not set 967CONFIG_RTC_LIB=y
968CONFIG_RTC_CLASS=y
969CONFIG_RTC_HCTOSYS=y
970CONFIG_RTC_HCTOSYS_DEVICE="rtc0"
971# CONFIG_RTC_DEBUG is not set
972
973#
974# RTC interfaces
975#
976CONFIG_RTC_INTF_SYSFS=y
977CONFIG_RTC_INTF_PROC=y
978CONFIG_RTC_INTF_DEV=y
979# CONFIG_RTC_INTF_DEV_UIE_EMUL is not set
980# CONFIG_RTC_DRV_TEST is not set
981
982#
983# I2C RTC drivers
984#
985# CONFIG_RTC_DRV_DS1307 is not set
986# CONFIG_RTC_DRV_DS1374 is not set
987# CONFIG_RTC_DRV_DS1672 is not set
988# CONFIG_RTC_DRV_MAX6900 is not set
989# CONFIG_RTC_DRV_RS5C372 is not set
990# CONFIG_RTC_DRV_ISL1208 is not set
991# CONFIG_RTC_DRV_X1205 is not set
992# CONFIG_RTC_DRV_PCF8563 is not set
993# CONFIG_RTC_DRV_PCF8583 is not set
994CONFIG_RTC_DRV_M41T80=y
995# CONFIG_RTC_DRV_M41T80_WDT is not set
996# CONFIG_RTC_DRV_S35390A is not set
997# CONFIG_RTC_DRV_FM3130 is not set
998# CONFIG_RTC_DRV_RX8581 is not set
999# CONFIG_RTC_DRV_RX8025 is not set
1000
1001#
1002# SPI RTC drivers
1003#
1004
1005#
1006# Platform RTC drivers
1007#
1008# CONFIG_RTC_DRV_CMOS is not set
1009# CONFIG_RTC_DRV_DS1286 is not set
1010# CONFIG_RTC_DRV_DS1511 is not set
1011# CONFIG_RTC_DRV_DS1553 is not set
1012# CONFIG_RTC_DRV_DS1742 is not set
1013# CONFIG_RTC_DRV_STK17TA8 is not set
1014# CONFIG_RTC_DRV_M48T86 is not set
1015# CONFIG_RTC_DRV_M48T35 is not set
1016# CONFIG_RTC_DRV_M48T59 is not set
1017# CONFIG_RTC_DRV_BQ4802 is not set
1018# CONFIG_RTC_DRV_V3020 is not set
1019
1020#
1021# on-CPU RTC drivers
1022#
1023# CONFIG_RTC_DRV_GENERIC is not set
848# CONFIG_DMADEVICES is not set 1024# CONFIG_DMADEVICES is not set
1025# CONFIG_AUXDISPLAY is not set
849# CONFIG_UIO is not set 1026# CONFIG_UIO is not set
1027
1028#
1029# TI VLYNQ
1030#
850# CONFIG_STAGING is not set 1031# CONFIG_STAGING is not set
851 1032
852# 1033#
@@ -860,11 +1041,12 @@ CONFIG_EXT2_FS=y
860# CONFIG_REISERFS_FS is not set 1041# CONFIG_REISERFS_FS is not set
861# CONFIG_JFS_FS is not set 1042# CONFIG_JFS_FS is not set
862# CONFIG_FS_POSIX_ACL is not set 1043# CONFIG_FS_POSIX_ACL is not set
863CONFIG_FILE_LOCKING=y
864# CONFIG_XFS_FS is not set 1044# CONFIG_XFS_FS is not set
865# CONFIG_GFS2_FS is not set 1045# CONFIG_GFS2_FS is not set
866# CONFIG_OCFS2_FS is not set 1046# CONFIG_OCFS2_FS is not set
867# CONFIG_BTRFS_FS is not set 1047# CONFIG_BTRFS_FS is not set
1048CONFIG_FILE_LOCKING=y
1049CONFIG_FSNOTIFY=y
868CONFIG_DNOTIFY=y 1050CONFIG_DNOTIFY=y
869CONFIG_INOTIFY=y 1051CONFIG_INOTIFY=y
870CONFIG_INOTIFY_USER=y 1052CONFIG_INOTIFY_USER=y
@@ -874,6 +1056,11 @@ CONFIG_INOTIFY_USER=y
874# CONFIG_FUSE_FS is not set 1056# CONFIG_FUSE_FS is not set
875 1057
876# 1058#
1059# Caches
1060#
1061# CONFIG_FSCACHE is not set
1062
1063#
877# CD-ROM/DVD Filesystems 1064# CD-ROM/DVD Filesystems
878# 1065#
879# CONFIG_ISO9660_FS is not set 1066# CONFIG_ISO9660_FS is not set
@@ -906,6 +1093,7 @@ CONFIG_MISC_FILESYSTEMS=y
906# CONFIG_BEFS_FS is not set 1093# CONFIG_BEFS_FS is not set
907# CONFIG_BFS_FS is not set 1094# CONFIG_BFS_FS is not set
908# CONFIG_EFS_FS is not set 1095# CONFIG_EFS_FS is not set
1096# CONFIG_JFFS2_FS is not set
909CONFIG_CRAMFS=y 1097CONFIG_CRAMFS=y
910# CONFIG_SQUASHFS is not set 1098# CONFIG_SQUASHFS is not set
911# CONFIG_VXFS_FS is not set 1099# CONFIG_VXFS_FS is not set
@@ -916,6 +1104,7 @@ CONFIG_CRAMFS=y
916# CONFIG_ROMFS_FS is not set 1104# CONFIG_ROMFS_FS is not set
917# CONFIG_SYSV_FS is not set 1105# CONFIG_SYSV_FS is not set
918# CONFIG_UFS_FS is not set 1106# CONFIG_UFS_FS is not set
1107# CONFIG_NILFS2_FS is not set
919CONFIG_NETWORK_FILESYSTEMS=y 1108CONFIG_NETWORK_FILESYSTEMS=y
920CONFIG_NFS_FS=y 1109CONFIG_NFS_FS=y
921CONFIG_NFS_V3=y 1110CONFIG_NFS_V3=y
@@ -927,7 +1116,6 @@ CONFIG_LOCKD=y
927CONFIG_LOCKD_V4=y 1116CONFIG_LOCKD_V4=y
928CONFIG_NFS_COMMON=y 1117CONFIG_NFS_COMMON=y
929CONFIG_SUNRPC=y 1118CONFIG_SUNRPC=y
930# CONFIG_SUNRPC_REGISTER_V4 is not set
931# CONFIG_RPCSEC_GSS_KRB5 is not set 1119# CONFIG_RPCSEC_GSS_KRB5 is not set
932# CONFIG_RPCSEC_GSS_SPKM3 is not set 1120# CONFIG_RPCSEC_GSS_SPKM3 is not set
933# CONFIG_SMB_FS is not set 1121# CONFIG_SMB_FS is not set
@@ -941,8 +1129,48 @@ CONFIG_SUNRPC=y
941# 1129#
942# CONFIG_PARTITION_ADVANCED is not set 1130# CONFIG_PARTITION_ADVANCED is not set
943CONFIG_MSDOS_PARTITION=y 1131CONFIG_MSDOS_PARTITION=y
944# CONFIG_NLS is not set 1132CONFIG_NLS=y
1133CONFIG_NLS_DEFAULT="iso8859-1"
1134# CONFIG_NLS_CODEPAGE_437 is not set
1135# CONFIG_NLS_CODEPAGE_737 is not set
1136# CONFIG_NLS_CODEPAGE_775 is not set
1137# CONFIG_NLS_CODEPAGE_850 is not set
1138# CONFIG_NLS_CODEPAGE_852 is not set
1139# CONFIG_NLS_CODEPAGE_855 is not set
1140# CONFIG_NLS_CODEPAGE_857 is not set
1141# CONFIG_NLS_CODEPAGE_860 is not set
1142# CONFIG_NLS_CODEPAGE_861 is not set
1143# CONFIG_NLS_CODEPAGE_862 is not set
1144# CONFIG_NLS_CODEPAGE_863 is not set
1145# CONFIG_NLS_CODEPAGE_864 is not set
1146# CONFIG_NLS_CODEPAGE_865 is not set
1147# CONFIG_NLS_CODEPAGE_866 is not set
1148# CONFIG_NLS_CODEPAGE_869 is not set
1149# CONFIG_NLS_CODEPAGE_936 is not set
1150# CONFIG_NLS_CODEPAGE_950 is not set
1151# CONFIG_NLS_CODEPAGE_932 is not set
1152# CONFIG_NLS_CODEPAGE_949 is not set
1153# CONFIG_NLS_CODEPAGE_874 is not set
1154# CONFIG_NLS_ISO8859_8 is not set
1155# CONFIG_NLS_CODEPAGE_1250 is not set
1156# CONFIG_NLS_CODEPAGE_1251 is not set
1157# CONFIG_NLS_ASCII is not set
1158# CONFIG_NLS_ISO8859_1 is not set
1159# CONFIG_NLS_ISO8859_2 is not set
1160# CONFIG_NLS_ISO8859_3 is not set
1161# CONFIG_NLS_ISO8859_4 is not set
1162# CONFIG_NLS_ISO8859_5 is not set
1163# CONFIG_NLS_ISO8859_6 is not set
1164# CONFIG_NLS_ISO8859_7 is not set
1165# CONFIG_NLS_ISO8859_9 is not set
1166# CONFIG_NLS_ISO8859_13 is not set
1167# CONFIG_NLS_ISO8859_14 is not set
1168# CONFIG_NLS_ISO8859_15 is not set
1169# CONFIG_NLS_KOI8_R is not set
1170# CONFIG_NLS_KOI8_U is not set
1171# CONFIG_NLS_UTF8 is not set
945# CONFIG_DLM is not set 1172# CONFIG_DLM is not set
1173# CONFIG_BINARY_PRINTF is not set
946 1174
947# 1175#
948# Library routines 1176# Library routines
@@ -957,11 +1185,13 @@ CONFIG_CRC32=y
957# CONFIG_CRC7 is not set 1185# CONFIG_CRC7 is not set
958# CONFIG_LIBCRC32C is not set 1186# CONFIG_LIBCRC32C is not set
959CONFIG_ZLIB_INFLATE=y 1187CONFIG_ZLIB_INFLATE=y
960CONFIG_PLIST=y 1188CONFIG_DECOMPRESS_GZIP=y
961CONFIG_HAS_IOMEM=y 1189CONFIG_HAS_IOMEM=y
962CONFIG_HAS_IOPORT=y 1190CONFIG_HAS_IOPORT=y
963CONFIG_HAS_DMA=y 1191CONFIG_HAS_DMA=y
964CONFIG_HAVE_LMB=y 1192CONFIG_HAVE_LMB=y
1193CONFIG_NLATTR=y
1194CONFIG_GENERIC_ATOMIC64=y
965 1195
966# 1196#
967# Kernel hacking 1197# Kernel hacking
@@ -979,6 +1209,9 @@ CONFIG_DEBUG_KERNEL=y
979CONFIG_DETECT_SOFTLOCKUP=y 1209CONFIG_DETECT_SOFTLOCKUP=y
980# CONFIG_BOOTPARAM_SOFTLOCKUP_PANIC is not set 1210# CONFIG_BOOTPARAM_SOFTLOCKUP_PANIC is not set
981CONFIG_BOOTPARAM_SOFTLOCKUP_PANIC_VALUE=0 1211CONFIG_BOOTPARAM_SOFTLOCKUP_PANIC_VALUE=0
1212CONFIG_DETECT_HUNG_TASK=y
1213# CONFIG_BOOTPARAM_HUNG_TASK_PANIC is not set
1214CONFIG_BOOTPARAM_HUNG_TASK_PANIC_VALUE=0
982CONFIG_SCHED_DEBUG=y 1215CONFIG_SCHED_DEBUG=y
983# CONFIG_SCHEDSTATS is not set 1216# CONFIG_SCHEDSTATS is not set
984# CONFIG_TIMER_STATS is not set 1217# CONFIG_TIMER_STATS is not set
@@ -989,6 +1222,9 @@ CONFIG_SCHED_DEBUG=y
989# CONFIG_RT_MUTEX_TESTER is not set 1222# CONFIG_RT_MUTEX_TESTER is not set
990# CONFIG_DEBUG_SPINLOCK is not set 1223# CONFIG_DEBUG_SPINLOCK is not set
991# CONFIG_DEBUG_MUTEXES is not set 1224# CONFIG_DEBUG_MUTEXES is not set
1225# CONFIG_DEBUG_LOCK_ALLOC is not set
1226# CONFIG_PROVE_LOCKING is not set
1227# CONFIG_LOCK_STAT is not set
992# CONFIG_DEBUG_SPINLOCK_SLEEP is not set 1228# CONFIG_DEBUG_SPINLOCK_SLEEP is not set
993# CONFIG_DEBUG_LOCKING_API_SELFTESTS is not set 1229# CONFIG_DEBUG_LOCKING_API_SELFTESTS is not set
994# CONFIG_DEBUG_KOBJECT is not set 1230# CONFIG_DEBUG_KOBJECT is not set
@@ -1000,7 +1236,6 @@ CONFIG_SCHED_DEBUG=y
1000# CONFIG_DEBUG_LIST is not set 1236# CONFIG_DEBUG_LIST is not set
1001# CONFIG_DEBUG_SG is not set 1237# CONFIG_DEBUG_SG is not set
1002# CONFIG_DEBUG_NOTIFIERS is not set 1238# CONFIG_DEBUG_NOTIFIERS is not set
1003# CONFIG_BOOT_PRINTK_DELAY is not set
1004# CONFIG_RCU_TORTURE_TEST is not set 1239# CONFIG_RCU_TORTURE_TEST is not set
1005# CONFIG_RCU_CPU_STALL_DETECTOR is not set 1240# CONFIG_RCU_CPU_STALL_DETECTOR is not set
1006# CONFIG_BACKTRACE_SELF_TEST is not set 1241# CONFIG_BACKTRACE_SELF_TEST is not set
@@ -1008,27 +1243,36 @@ CONFIG_SCHED_DEBUG=y
1008# CONFIG_FAULT_INJECTION is not set 1243# CONFIG_FAULT_INJECTION is not set
1009# CONFIG_LATENCYTOP is not set 1244# CONFIG_LATENCYTOP is not set
1010CONFIG_SYSCTL_SYSCALL_CHECK=y 1245CONFIG_SYSCTL_SYSCALL_CHECK=y
1246# CONFIG_DEBUG_PAGEALLOC is not set
1011CONFIG_HAVE_FUNCTION_TRACER=y 1247CONFIG_HAVE_FUNCTION_TRACER=y
1248CONFIG_HAVE_FUNCTION_GRAPH_TRACER=y
1012CONFIG_HAVE_DYNAMIC_FTRACE=y 1249CONFIG_HAVE_DYNAMIC_FTRACE=y
1013CONFIG_HAVE_FTRACE_MCOUNT_RECORD=y 1250CONFIG_HAVE_FTRACE_MCOUNT_RECORD=y
1014 1251CONFIG_TRACING_SUPPORT=y
1015# 1252CONFIG_FTRACE=y
1016# Tracers
1017#
1018# CONFIG_FUNCTION_TRACER is not set 1253# CONFIG_FUNCTION_TRACER is not set
1254# CONFIG_IRQSOFF_TRACER is not set
1019# CONFIG_SCHED_TRACER is not set 1255# CONFIG_SCHED_TRACER is not set
1020# CONFIG_CONTEXT_SWITCH_TRACER is not set 1256# CONFIG_ENABLE_DEFAULT_TRACERS is not set
1021# CONFIG_BOOT_TRACER is not set 1257# CONFIG_BOOT_TRACER is not set
1022# CONFIG_TRACE_BRANCH_PROFILING is not set 1258CONFIG_BRANCH_PROFILE_NONE=y
1259# CONFIG_PROFILE_ANNOTATED_BRANCHES is not set
1260# CONFIG_PROFILE_ALL_BRANCHES is not set
1023# CONFIG_STACK_TRACER is not set 1261# CONFIG_STACK_TRACER is not set
1024# CONFIG_DYNAMIC_PRINTK_DEBUG is not set 1262# CONFIG_KMEMTRACE is not set
1263# CONFIG_WORKQUEUE_TRACER is not set
1264# CONFIG_BLK_DEV_IO_TRACE is not set
1265# CONFIG_DYNAMIC_DEBUG is not set
1025# CONFIG_SAMPLES is not set 1266# CONFIG_SAMPLES is not set
1026CONFIG_HAVE_ARCH_KGDB=y 1267CONFIG_HAVE_ARCH_KGDB=y
1027# CONFIG_KGDB is not set 1268# CONFIG_KGDB is not set
1269# CONFIG_KMEMCHECK is not set
1270# CONFIG_PPC_DISABLE_WERROR is not set
1271CONFIG_PPC_WERROR=y
1028CONFIG_PRINT_STACK_DEPTH=64 1272CONFIG_PRINT_STACK_DEPTH=64
1029# CONFIG_DEBUG_STACKOVERFLOW is not set 1273# CONFIG_DEBUG_STACKOVERFLOW is not set
1030# CONFIG_DEBUG_STACK_USAGE is not set 1274# CONFIG_DEBUG_STACK_USAGE is not set
1031# CONFIG_DEBUG_PAGEALLOC is not set 1275# CONFIG_PPC_EMULATED_STATS is not set
1032# CONFIG_CODE_PATCHING_SELFTEST is not set 1276# CONFIG_CODE_PATCHING_SELFTEST is not set
1033# CONFIG_FTR_FIXUP_SELFTEST is not set 1277# CONFIG_FTR_FIXUP_SELFTEST is not set
1034# CONFIG_MSI_BITMAP_SELFTEST is not set 1278# CONFIG_MSI_BITMAP_SELFTEST is not set
diff --git a/arch/powerpc/configs/44x/eiger_defconfig b/arch/powerpc/configs/44x/eiger_defconfig
new file mode 100644
index 000000000000..007f3bd939e7
--- /dev/null
+++ b/arch/powerpc/configs/44x/eiger_defconfig
@@ -0,0 +1,1252 @@
1#
2# Automatically generated make config: don't edit
3# Linux kernel version: 2.6.31-rc6
4# Wed Aug 19 13:06:50 2009
5#
6# CONFIG_PPC64 is not set
7
8#
9# Processor support
10#
11# CONFIG_PPC_BOOK3S_32 is not set
12# CONFIG_PPC_85xx is not set
13# CONFIG_PPC_8xx is not set
14# CONFIG_40x is not set
15CONFIG_44x=y
16# CONFIG_E200 is not set
17CONFIG_PPC_FPU=y
18CONFIG_4xx=y
19CONFIG_BOOKE=y
20CONFIG_PTE_64BIT=y
21CONFIG_PHYS_64BIT=y
22CONFIG_PPC_MMU_NOHASH=y
23CONFIG_PPC_MMU_NOHASH_32=y
24# CONFIG_PPC_MM_SLICES is not set
25CONFIG_NOT_COHERENT_CACHE=y
26CONFIG_PPC32=y
27CONFIG_WORD_SIZE=32
28CONFIG_ARCH_PHYS_ADDR_T_64BIT=y
29CONFIG_MMU=y
30CONFIG_GENERIC_CMOS_UPDATE=y
31CONFIG_GENERIC_TIME=y
32CONFIG_GENERIC_TIME_VSYSCALL=y
33CONFIG_GENERIC_CLOCKEVENTS=y
34CONFIG_GENERIC_HARDIRQS=y
35CONFIG_GENERIC_HARDIRQS_NO__DO_IRQ=y
36# CONFIG_HAVE_SETUP_PER_CPU_AREA is not set
37CONFIG_IRQ_PER_CPU=y
38CONFIG_STACKTRACE_SUPPORT=y
39CONFIG_HAVE_LATENCYTOP_SUPPORT=y
40CONFIG_TRACE_IRQFLAGS_SUPPORT=y
41CONFIG_LOCKDEP_SUPPORT=y
42CONFIG_RWSEM_XCHGADD_ALGORITHM=y
43CONFIG_ARCH_HAS_ILOG2_U32=y
44CONFIG_GENERIC_HWEIGHT=y
45CONFIG_GENERIC_FIND_NEXT_BIT=y
46# CONFIG_ARCH_NO_VIRT_TO_BUS is not set
47CONFIG_PPC=y
48CONFIG_EARLY_PRINTK=y
49CONFIG_GENERIC_NVRAM=y
50CONFIG_SCHED_OMIT_FRAME_POINTER=y
51CONFIG_ARCH_MAY_HAVE_PC_FDC=y
52CONFIG_PPC_OF=y
53CONFIG_OF=y
54CONFIG_PPC_UDBG_16550=y
55# CONFIG_GENERIC_TBSYNC is not set
56CONFIG_AUDIT_ARCH=y
57CONFIG_GENERIC_BUG=y
58CONFIG_DTC=y
59# CONFIG_DEFAULT_UIMAGE is not set
60CONFIG_PPC_DCR_NATIVE=y
61# CONFIG_PPC_DCR_MMIO is not set
62CONFIG_PPC_DCR=y
63CONFIG_ARCH_SUPPORTS_DEBUG_PAGEALLOC=y
64CONFIG_DEFCONFIG_LIST="/lib/modules/$UNAME_RELEASE/.config"
65CONFIG_CONSTRUCTORS=y
66
67#
68# General setup
69#
70CONFIG_EXPERIMENTAL=y
71CONFIG_BROKEN_ON_SMP=y
72CONFIG_INIT_ENV_ARG_LIMIT=32
73CONFIG_LOCALVERSION=""
74CONFIG_LOCALVERSION_AUTO=y
75CONFIG_SWAP=y
76CONFIG_SYSVIPC=y
77CONFIG_SYSVIPC_SYSCTL=y
78CONFIG_POSIX_MQUEUE=y
79CONFIG_POSIX_MQUEUE_SYSCTL=y
80# CONFIG_BSD_PROCESS_ACCT is not set
81# CONFIG_TASKSTATS is not set
82# CONFIG_AUDIT is not set
83
84#
85# RCU Subsystem
86#
87CONFIG_CLASSIC_RCU=y
88# CONFIG_TREE_RCU is not set
89# CONFIG_PREEMPT_RCU is not set
90# CONFIG_TREE_RCU_TRACE is not set
91# CONFIG_PREEMPT_RCU_TRACE is not set
92# CONFIG_IKCONFIG is not set
93CONFIG_LOG_BUF_SHIFT=14
94# CONFIG_GROUP_SCHED is not set
95# CONFIG_CGROUPS is not set
96CONFIG_SYSFS_DEPRECATED=y
97CONFIG_SYSFS_DEPRECATED_V2=y
98# CONFIG_RELAY is not set
99# CONFIG_NAMESPACES is not set
100CONFIG_BLK_DEV_INITRD=y
101CONFIG_INITRAMFS_SOURCE=""
102CONFIG_RD_GZIP=y
103# CONFIG_RD_BZIP2 is not set
104# CONFIG_RD_LZMA is not set
105# CONFIG_CC_OPTIMIZE_FOR_SIZE is not set
106CONFIG_SYSCTL=y
107CONFIG_ANON_INODES=y
108CONFIG_EMBEDDED=y
109CONFIG_SYSCTL_SYSCALL=y
110CONFIG_KALLSYMS=y
111# CONFIG_KALLSYMS_ALL is not set
112# CONFIG_KALLSYMS_EXTRA_PASS is not set
113CONFIG_HOTPLUG=y
114CONFIG_PRINTK=y
115CONFIG_BUG=y
116CONFIG_ELF_CORE=y
117CONFIG_BASE_FULL=y
118CONFIG_FUTEX=y
119CONFIG_EPOLL=y
120CONFIG_SIGNALFD=y
121CONFIG_TIMERFD=y
122CONFIG_EVENTFD=y
123CONFIG_SHMEM=y
124CONFIG_AIO=y
125CONFIG_HAVE_PERF_COUNTERS=y
126
127#
128# Performance Counters
129#
130# CONFIG_PERF_COUNTERS is not set
131CONFIG_VM_EVENT_COUNTERS=y
132CONFIG_PCI_QUIRKS=y
133CONFIG_SLUB_DEBUG=y
134# CONFIG_STRIP_ASM_SYMS is not set
135CONFIG_COMPAT_BRK=y
136# CONFIG_SLAB is not set
137CONFIG_SLUB=y
138# CONFIG_SLOB is not set
139# CONFIG_PROFILING is not set
140# CONFIG_MARKERS is not set
141CONFIG_HAVE_OPROFILE=y
142# CONFIG_KPROBES is not set
143CONFIG_HAVE_EFFICIENT_UNALIGNED_ACCESS=y
144CONFIG_HAVE_IOREMAP_PROT=y
145CONFIG_HAVE_KPROBES=y
146CONFIG_HAVE_KRETPROBES=y
147CONFIG_HAVE_ARCH_TRACEHOOK=y
148
149#
150# GCOV-based kernel profiling
151#
152# CONFIG_GCOV_KERNEL is not set
153# CONFIG_SLOW_WORK is not set
154# CONFIG_HAVE_GENERIC_DMA_COHERENT is not set
155CONFIG_SLABINFO=y
156CONFIG_RT_MUTEXES=y
157CONFIG_BASE_SMALL=0
158CONFIG_MODULES=y
159# CONFIG_MODULE_FORCE_LOAD is not set
160CONFIG_MODULE_UNLOAD=y
161# CONFIG_MODULE_FORCE_UNLOAD is not set
162# CONFIG_MODVERSIONS is not set
163# CONFIG_MODULE_SRCVERSION_ALL is not set
164CONFIG_BLOCK=y
165CONFIG_LBDAF=y
166# CONFIG_BLK_DEV_BSG is not set
167# CONFIG_BLK_DEV_INTEGRITY is not set
168
169#
170# IO Schedulers
171#
172CONFIG_IOSCHED_NOOP=y
173CONFIG_IOSCHED_AS=y
174CONFIG_IOSCHED_DEADLINE=y
175CONFIG_IOSCHED_CFQ=y
176CONFIG_DEFAULT_AS=y
177# CONFIG_DEFAULT_DEADLINE is not set
178# CONFIG_DEFAULT_CFQ is not set
179# CONFIG_DEFAULT_NOOP is not set
180CONFIG_DEFAULT_IOSCHED="anticipatory"
181# CONFIG_FREEZER is not set
182CONFIG_PPC4xx_PCI_EXPRESS=y
183
184#
185# Platform support
186#
187# CONFIG_PPC_CELL is not set
188# CONFIG_PPC_CELL_NATIVE is not set
189# CONFIG_PQ2ADS is not set
190# CONFIG_BAMBOO is not set
191# CONFIG_EBONY is not set
192# CONFIG_SAM440EP is not set
193# CONFIG_SEQUOIA is not set
194# CONFIG_TAISHAN is not set
195# CONFIG_KATMAI is not set
196# CONFIG_RAINIER is not set
197# CONFIG_WARP is not set
198# CONFIG_ARCHES is not set
199# CONFIG_CANYONLANDS is not set
200# CONFIG_GLACIER is not set
201# CONFIG_REDWOOD is not set
202CONFIG_EIGER=y
203# CONFIG_YOSEMITE is not set
204# CONFIG_XILINX_VIRTEX440_GENERIC_BOARD is not set
205CONFIG_PPC44x_SIMPLE=y
206# CONFIG_PPC4xx_GPIO is not set
207CONFIG_460SX=y
208# CONFIG_IPIC is not set
209# CONFIG_MPIC is not set
210# CONFIG_MPIC_WEIRD is not set
211# CONFIG_PPC_I8259 is not set
212# CONFIG_PPC_RTAS is not set
213# CONFIG_MMIO_NVRAM is not set
214# CONFIG_PPC_MPC106 is not set
215# CONFIG_PPC_970_NAP is not set
216# CONFIG_PPC_INDIRECT_IO is not set
217# CONFIG_GENERIC_IOMAP is not set
218# CONFIG_CPU_FREQ is not set
219# CONFIG_FSL_ULI1575 is not set
220# CONFIG_SIMPLE_GPIO is not set
221
222#
223# Kernel options
224#
225# CONFIG_HIGHMEM is not set
226CONFIG_TICK_ONESHOT=y
227CONFIG_NO_HZ=y
228CONFIG_HIGH_RES_TIMERS=y
229CONFIG_GENERIC_CLOCKEVENTS_BUILD=y
230# CONFIG_HZ_100 is not set
231CONFIG_HZ_250=y
232# CONFIG_HZ_300 is not set
233# CONFIG_HZ_1000 is not set
234CONFIG_HZ=250
235CONFIG_SCHED_HRTICK=y
236CONFIG_PREEMPT_NONE=y
237# CONFIG_PREEMPT_VOLUNTARY is not set
238# CONFIG_PREEMPT is not set
239CONFIG_BINFMT_ELF=y
240# CONFIG_CORE_DUMP_DEFAULT_ELF_HEADERS is not set
241# CONFIG_HAVE_AOUT is not set
242# CONFIG_BINFMT_MISC is not set
243# CONFIG_MATH_EMULATION is not set
244# CONFIG_IOMMU_HELPER is not set
245# CONFIG_SWIOTLB is not set
246CONFIG_PPC_NEED_DMA_SYNC_OPS=y
247CONFIG_ARCH_ENABLE_MEMORY_HOTPLUG=y
248CONFIG_ARCH_HAS_WALK_MEMORY=y
249CONFIG_ARCH_ENABLE_MEMORY_HOTREMOVE=y
250CONFIG_ARCH_FLATMEM_ENABLE=y
251CONFIG_ARCH_POPULATES_NODE_MAP=y
252CONFIG_SELECT_MEMORY_MODEL=y
253CONFIG_FLATMEM_MANUAL=y
254# CONFIG_DISCONTIGMEM_MANUAL is not set
255# CONFIG_SPARSEMEM_MANUAL is not set
256CONFIG_FLATMEM=y
257CONFIG_FLAT_NODE_MEM_MAP=y
258CONFIG_PAGEFLAGS_EXTENDED=y
259CONFIG_SPLIT_PTLOCK_CPUS=4
260CONFIG_MIGRATION=y
261CONFIG_PHYS_ADDR_T_64BIT=y
262CONFIG_ZONE_DMA_FLAG=1
263CONFIG_BOUNCE=y
264CONFIG_VIRT_TO_BUS=y
265CONFIG_HAVE_MLOCK=y
266CONFIG_HAVE_MLOCKED_PAGE_BIT=y
267CONFIG_DEFAULT_MMAP_MIN_ADDR=4096
268CONFIG_STDBINUTILS=y
269CONFIG_PPC_4K_PAGES=y
270# CONFIG_PPC_16K_PAGES is not set
271# CONFIG_PPC_64K_PAGES is not set
272# CONFIG_PPC_256K_PAGES is not set
273CONFIG_FORCE_MAX_ZONEORDER=11
274CONFIG_PROC_DEVICETREE=y
275CONFIG_CMDLINE_BOOL=y
276CONFIG_CMDLINE=""
277CONFIG_EXTRA_TARGETS=""
278CONFIG_SECCOMP=y
279CONFIG_ISA_DMA_API=y
280
281#
282# Bus options
283#
284CONFIG_ZONE_DMA=y
285CONFIG_PPC_INDIRECT_PCI=y
286CONFIG_4xx_SOC=y
287CONFIG_PPC_PCI_CHOICE=y
288CONFIG_PCI=y
289CONFIG_PCI_DOMAINS=y
290CONFIG_PCI_SYSCALL=y
291CONFIG_PCIEPORTBUS=y
292CONFIG_PCIEAER=y
293# CONFIG_PCIE_ECRC is not set
294# CONFIG_PCIEAER_INJECT is not set
295# CONFIG_PCIEASPM is not set
296CONFIG_ARCH_SUPPORTS_MSI=y
297# CONFIG_PCI_MSI is not set
298CONFIG_PCI_LEGACY=y
299# CONFIG_PCI_DEBUG is not set
300# CONFIG_PCI_STUB is not set
301# CONFIG_PCI_IOV is not set
302# CONFIG_PCCARD is not set
303# CONFIG_HOTPLUG_PCI is not set
304# CONFIG_HAS_RAPIDIO is not set
305
306#
307# Advanced setup
308#
309# CONFIG_ADVANCED_OPTIONS is not set
310
311#
312# Default settings for advanced configuration options are used
313#
314CONFIG_LOWMEM_SIZE=0x30000000
315CONFIG_PAGE_OFFSET=0xc0000000
316CONFIG_KERNEL_START=0xc0000000
317CONFIG_PHYSICAL_START=0x00000000
318CONFIG_TASK_SIZE=0xc0000000
319CONFIG_CONSISTENT_SIZE=0x00200000
320CONFIG_NET=y
321
322#
323# Networking options
324#
325CONFIG_PACKET=y
326# CONFIG_PACKET_MMAP is not set
327CONFIG_UNIX=y
328# CONFIG_NET_KEY is not set
329CONFIG_INET=y
330# CONFIG_IP_MULTICAST is not set
331# CONFIG_IP_ADVANCED_ROUTER is not set
332CONFIG_IP_FIB_HASH=y
333CONFIG_IP_PNP=y
334CONFIG_IP_PNP_DHCP=y
335CONFIG_IP_PNP_BOOTP=y
336# CONFIG_IP_PNP_RARP is not set
337# CONFIG_NET_IPIP is not set
338# CONFIG_NET_IPGRE is not set
339# CONFIG_ARPD is not set
340# CONFIG_SYN_COOKIES is not set
341# CONFIG_INET_AH is not set
342# CONFIG_INET_ESP is not set
343# CONFIG_INET_IPCOMP is not set
344# CONFIG_INET_XFRM_TUNNEL is not set
345# CONFIG_INET_TUNNEL is not set
346# CONFIG_INET_XFRM_MODE_TRANSPORT is not set
347# CONFIG_INET_XFRM_MODE_TUNNEL is not set
348# CONFIG_INET_XFRM_MODE_BEET is not set
349# CONFIG_INET_LRO is not set
350CONFIG_INET_DIAG=y
351CONFIG_INET_TCP_DIAG=y
352# CONFIG_TCP_CONG_ADVANCED is not set
353CONFIG_TCP_CONG_CUBIC=y
354CONFIG_DEFAULT_TCP_CONG="cubic"
355# CONFIG_TCP_MD5SIG is not set
356# CONFIG_IPV6 is not set
357# CONFIG_NETWORK_SECMARK is not set
358# CONFIG_NETFILTER is not set
359# CONFIG_IP_DCCP is not set
360# CONFIG_IP_SCTP is not set
361# CONFIG_TIPC is not set
362# CONFIG_ATM is not set
363# CONFIG_BRIDGE is not set
364# CONFIG_NET_DSA is not set
365# CONFIG_VLAN_8021Q is not set
366# CONFIG_DECNET is not set
367# CONFIG_LLC2 is not set
368# CONFIG_IPX is not set
369# CONFIG_ATALK is not set
370# CONFIG_X25 is not set
371# CONFIG_LAPB is not set
372# CONFIG_ECONET is not set
373# CONFIG_WAN_ROUTER is not set
374# CONFIG_PHONET is not set
375# CONFIG_IEEE802154 is not set
376# CONFIG_NET_SCHED is not set
377# CONFIG_DCB is not set
378
379#
380# Network testing
381#
382# CONFIG_NET_PKTGEN is not set
383# CONFIG_HAMRADIO is not set
384# CONFIG_CAN is not set
385# CONFIG_IRDA is not set
386# CONFIG_BT is not set
387# CONFIG_AF_RXRPC is not set
388CONFIG_WIRELESS=y
389# CONFIG_CFG80211 is not set
390CONFIG_WIRELESS_OLD_REGULATORY=y
391# CONFIG_WIRELESS_EXT is not set
392# CONFIG_LIB80211 is not set
393
394#
395# CFG80211 needs to be enabled for MAC80211
396#
397CONFIG_MAC80211_DEFAULT_PS_VALUE=0
398# CONFIG_WIMAX is not set
399# CONFIG_RFKILL is not set
400# CONFIG_NET_9P is not set
401
402#
403# Device Drivers
404#
405
406#
407# Generic Driver Options
408#
409CONFIG_UEVENT_HELPER_PATH="/sbin/hotplug"
410CONFIG_STANDALONE=y
411CONFIG_PREVENT_FIRMWARE_BUILD=y
412CONFIG_FW_LOADER=y
413CONFIG_FIRMWARE_IN_KERNEL=y
414CONFIG_EXTRA_FIRMWARE=""
415# CONFIG_DEBUG_DRIVER is not set
416# CONFIG_DEBUG_DEVRES is not set
417# CONFIG_SYS_HYPERVISOR is not set
418CONFIG_CONNECTOR=y
419CONFIG_PROC_EVENTS=y
420CONFIG_MTD=y
421# CONFIG_MTD_DEBUG is not set
422CONFIG_MTD_CONCAT=y
423CONFIG_MTD_PARTITIONS=y
424# CONFIG_MTD_TESTS is not set
425# CONFIG_MTD_REDBOOT_PARTS is not set
426CONFIG_MTD_CMDLINE_PARTS=y
427CONFIG_MTD_OF_PARTS=y
428# CONFIG_MTD_AR7_PARTS is not set
429
430#
431# User Modules And Translation Layers
432#
433CONFIG_MTD_CHAR=y
434CONFIG_MTD_BLKDEVS=y
435CONFIG_MTD_BLOCK=y
436# CONFIG_FTL is not set
437# CONFIG_NFTL is not set
438# CONFIG_INFTL is not set
439# CONFIG_RFD_FTL is not set
440# CONFIG_SSFDC is not set
441# CONFIG_MTD_OOPS is not set
442
443#
444# RAM/ROM/Flash chip drivers
445#
446CONFIG_MTD_CFI=y
447# CONFIG_MTD_JEDECPROBE is not set
448CONFIG_MTD_GEN_PROBE=y
449# CONFIG_MTD_CFI_ADV_OPTIONS is not set
450CONFIG_MTD_MAP_BANK_WIDTH_1=y
451CONFIG_MTD_MAP_BANK_WIDTH_2=y
452CONFIG_MTD_MAP_BANK_WIDTH_4=y
453# CONFIG_MTD_MAP_BANK_WIDTH_8 is not set
454# CONFIG_MTD_MAP_BANK_WIDTH_16 is not set
455# CONFIG_MTD_MAP_BANK_WIDTH_32 is not set
456CONFIG_MTD_CFI_I1=y
457CONFIG_MTD_CFI_I2=y
458# CONFIG_MTD_CFI_I4 is not set
459# CONFIG_MTD_CFI_I8 is not set
460# CONFIG_MTD_CFI_INTELEXT is not set
461CONFIG_MTD_CFI_AMDSTD=y
462# CONFIG_MTD_CFI_STAA is not set
463CONFIG_MTD_CFI_UTIL=y
464# CONFIG_MTD_RAM is not set
465# CONFIG_MTD_ROM is not set
466# CONFIG_MTD_ABSENT is not set
467
468#
469# Mapping drivers for chip access
470#
471# CONFIG_MTD_COMPLEX_MAPPINGS is not set
472# CONFIG_MTD_PHYSMAP is not set
473CONFIG_MTD_PHYSMAP_OF=y
474# CONFIG_MTD_INTEL_VR_NOR is not set
475# CONFIG_MTD_PLATRAM is not set
476
477#
478# Self-contained MTD device drivers
479#
480# CONFIG_MTD_PMC551 is not set
481# CONFIG_MTD_SLRAM is not set
482# CONFIG_MTD_PHRAM is not set
483# CONFIG_MTD_MTDRAM is not set
484# CONFIG_MTD_BLOCK2MTD is not set
485
486#
487# Disk-On-Chip Device Drivers
488#
489# CONFIG_MTD_DOC2000 is not set
490# CONFIG_MTD_DOC2001 is not set
491# CONFIG_MTD_DOC2001PLUS is not set
492CONFIG_MTD_NAND=y
493# CONFIG_MTD_NAND_VERIFY_WRITE is not set
494CONFIG_MTD_NAND_ECC_SMC=y
495# CONFIG_MTD_NAND_MUSEUM_IDS is not set
496CONFIG_MTD_NAND_IDS=y
497CONFIG_MTD_NAND_NDFC=y
498# CONFIG_MTD_NAND_DISKONCHIP is not set
499# CONFIG_MTD_NAND_CAFE is not set
500# CONFIG_MTD_NAND_NANDSIM is not set
501# CONFIG_MTD_NAND_PLATFORM is not set
502# CONFIG_MTD_NAND_FSL_ELBC is not set
503# CONFIG_MTD_ONENAND is not set
504
505#
506# LPDDR flash memory drivers
507#
508# CONFIG_MTD_LPDDR is not set
509
510#
511# UBI - Unsorted block images
512#
513# CONFIG_MTD_UBI is not set
514CONFIG_OF_DEVICE=y
515CONFIG_OF_I2C=y
516# CONFIG_PARPORT is not set
517CONFIG_BLK_DEV=y
518# CONFIG_BLK_DEV_FD is not set
519# CONFIG_BLK_CPQ_DA is not set
520# CONFIG_BLK_CPQ_CISS_DA is not set
521# CONFIG_BLK_DEV_DAC960 is not set
522# CONFIG_BLK_DEV_UMEM is not set
523# CONFIG_BLK_DEV_COW_COMMON is not set
524# CONFIG_BLK_DEV_LOOP is not set
525# CONFIG_BLK_DEV_NBD is not set
526# CONFIG_BLK_DEV_SX8 is not set
527CONFIG_BLK_DEV_RAM=y
528CONFIG_BLK_DEV_RAM_COUNT=16
529CONFIG_BLK_DEV_RAM_SIZE=35000
530# CONFIG_BLK_DEV_XIP is not set
531# CONFIG_CDROM_PKTCDVD is not set
532# CONFIG_ATA_OVER_ETH is not set
533# CONFIG_XILINX_SYSACE is not set
534# CONFIG_BLK_DEV_HD is not set
535# CONFIG_MISC_DEVICES is not set
536CONFIG_HAVE_IDE=y
537# CONFIG_IDE is not set
538
539#
540# SCSI device support
541#
542# CONFIG_RAID_ATTRS is not set
543CONFIG_SCSI=y
544CONFIG_SCSI_DMA=y
545# CONFIG_SCSI_TGT is not set
546# CONFIG_SCSI_NETLINK is not set
547CONFIG_SCSI_PROC_FS=y
548
549#
550# SCSI support type (disk, tape, CD-ROM)
551#
552CONFIG_BLK_DEV_SD=y
553# CONFIG_CHR_DEV_ST is not set
554# CONFIG_CHR_DEV_OSST is not set
555# CONFIG_BLK_DEV_SR is not set
556CONFIG_CHR_DEV_SG=y
557# CONFIG_CHR_DEV_SCH is not set
558# CONFIG_SCSI_MULTI_LUN is not set
559# CONFIG_SCSI_CONSTANTS is not set
560# CONFIG_SCSI_LOGGING is not set
561# CONFIG_SCSI_SCAN_ASYNC is not set
562CONFIG_SCSI_WAIT_SCAN=m
563
564#
565# SCSI Transports
566#
567# CONFIG_SCSI_SPI_ATTRS is not set
568# CONFIG_SCSI_FC_ATTRS is not set
569# CONFIG_SCSI_ISCSI_ATTRS is not set
570CONFIG_SCSI_SAS_ATTRS=y
571# CONFIG_SCSI_SAS_LIBSAS is not set
572# CONFIG_SCSI_SRP_ATTRS is not set
573CONFIG_SCSI_LOWLEVEL=y
574# CONFIG_ISCSI_TCP is not set
575# CONFIG_SCSI_BNX2_ISCSI is not set
576# CONFIG_BLK_DEV_3W_XXXX_RAID is not set
577# CONFIG_SCSI_3W_9XXX is not set
578# CONFIG_SCSI_ACARD is not set
579# CONFIG_SCSI_AACRAID is not set
580# CONFIG_SCSI_AIC7XXX is not set
581# CONFIG_SCSI_AIC7XXX_OLD is not set
582# CONFIG_SCSI_AIC79XX is not set
583# CONFIG_SCSI_AIC94XX is not set
584# CONFIG_SCSI_MVSAS is not set
585# CONFIG_SCSI_DPT_I2O is not set
586# CONFIG_SCSI_ADVANSYS is not set
587# CONFIG_SCSI_ARCMSR is not set
588# CONFIG_MEGARAID_NEWGEN is not set
589# CONFIG_MEGARAID_LEGACY is not set
590# CONFIG_MEGARAID_SAS is not set
591# CONFIG_SCSI_MPT2SAS is not set
592# CONFIG_SCSI_HPTIOP is not set
593# CONFIG_SCSI_BUSLOGIC is not set
594# CONFIG_LIBFC is not set
595# CONFIG_LIBFCOE is not set
596# CONFIG_FCOE is not set
597# CONFIG_SCSI_DMX3191D is not set
598# CONFIG_SCSI_EATA is not set
599# CONFIG_SCSI_FUTURE_DOMAIN is not set
600# CONFIG_SCSI_GDTH is not set
601# CONFIG_SCSI_IPS is not set
602# CONFIG_SCSI_INITIO is not set
603# CONFIG_SCSI_INIA100 is not set
604# CONFIG_SCSI_STEX is not set
605# CONFIG_SCSI_SYM53C8XX_2 is not set
606# CONFIG_SCSI_QLOGIC_1280 is not set
607# CONFIG_SCSI_QLA_FC is not set
608# CONFIG_SCSI_QLA_ISCSI is not set
609# CONFIG_SCSI_LPFC is not set
610# CONFIG_SCSI_DC395x is not set
611# CONFIG_SCSI_DC390T is not set
612# CONFIG_SCSI_NSP32 is not set
613# CONFIG_SCSI_DEBUG is not set
614# CONFIG_SCSI_SRP is not set
615# CONFIG_SCSI_DH is not set
616# CONFIG_SCSI_OSD_INITIATOR is not set
617# CONFIG_ATA is not set
618# CONFIG_MD is not set
619CONFIG_FUSION=y
620# CONFIG_FUSION_SPI is not set
621# CONFIG_FUSION_FC is not set
622CONFIG_FUSION_SAS=y
623CONFIG_FUSION_MAX_SGE=128
624# CONFIG_FUSION_CTL is not set
625# CONFIG_FUSION_LOGGING is not set
626
627#
628# IEEE 1394 (FireWire) support
629#
630
631#
632# You can enable one or both FireWire driver stacks.
633#
634
635#
636# See the help texts for more information.
637#
638# CONFIG_FIREWIRE is not set
639# CONFIG_IEEE1394 is not set
640CONFIG_I2O=y
641CONFIG_I2O_LCT_NOTIFY_ON_CHANGES=y
642CONFIG_I2O_EXT_ADAPTEC=y
643# CONFIG_I2O_CONFIG is not set
644# CONFIG_I2O_BUS is not set
645# CONFIG_I2O_BLOCK is not set
646# CONFIG_I2O_SCSI is not set
647# CONFIG_I2O_PROC is not set
648# CONFIG_MACINTOSH_DRIVERS is not set
649CONFIG_NETDEVICES=y
650# CONFIG_DUMMY is not set
651# CONFIG_BONDING is not set
652# CONFIG_MACVLAN is not set
653# CONFIG_EQUALIZER is not set
654# CONFIG_TUN is not set
655# CONFIG_VETH is not set
656# CONFIG_ARCNET is not set
657# CONFIG_PHYLIB is not set
658CONFIG_NET_ETHERNET=y
659# CONFIG_MII is not set
660# CONFIG_HAPPYMEAL is not set
661# CONFIG_SUNGEM is not set
662# CONFIG_CASSINI is not set
663# CONFIG_NET_VENDOR_3COM is not set
664# CONFIG_ETHOC is not set
665# CONFIG_DNET is not set
666# CONFIG_NET_TULIP is not set
667# CONFIG_HP100 is not set
668CONFIG_IBM_NEW_EMAC=y
669CONFIG_IBM_NEW_EMAC_RXB=256
670CONFIG_IBM_NEW_EMAC_TXB=256
671CONFIG_IBM_NEW_EMAC_POLL_WEIGHT=32
672CONFIG_IBM_NEW_EMAC_RX_COPY_THRESHOLD=256
673CONFIG_IBM_NEW_EMAC_RX_SKB_HEADROOM=0
674# CONFIG_IBM_NEW_EMAC_DEBUG is not set
675CONFIG_IBM_NEW_EMAC_ZMII=y
676CONFIG_IBM_NEW_EMAC_RGMII=y
677CONFIG_IBM_NEW_EMAC_TAH=y
678CONFIG_IBM_NEW_EMAC_EMAC4=y
679# CONFIG_IBM_NEW_EMAC_NO_FLOW_CTRL is not set
680# CONFIG_IBM_NEW_EMAC_MAL_CLR_ICINTSTAT is not set
681# CONFIG_IBM_NEW_EMAC_MAL_COMMON_ERR is not set
682# CONFIG_NET_PCI is not set
683# CONFIG_B44 is not set
684# CONFIG_KS8842 is not set
685# CONFIG_ATL2 is not set
686CONFIG_NETDEV_1000=y
687# CONFIG_ACENIC is not set
688# CONFIG_DL2K is not set
689# CONFIG_E1000 is not set
690CONFIG_E1000E=y
691# CONFIG_IP1000 is not set
692# CONFIG_IGB is not set
693# CONFIG_IGBVF is not set
694# CONFIG_NS83820 is not set
695# CONFIG_HAMACHI is not set
696# CONFIG_YELLOWFIN is not set
697# CONFIG_R8169 is not set
698# CONFIG_SIS190 is not set
699# CONFIG_SKGE is not set
700# CONFIG_SKY2 is not set
701# CONFIG_VIA_VELOCITY is not set
702# CONFIG_TIGON3 is not set
703# CONFIG_BNX2 is not set
704# CONFIG_CNIC is not set
705# CONFIG_MV643XX_ETH is not set
706# CONFIG_XILINX_LL_TEMAC is not set
707# CONFIG_QLA3XXX is not set
708# CONFIG_ATL1 is not set
709# CONFIG_ATL1E is not set
710# CONFIG_ATL1C is not set
711# CONFIG_JME is not set
712# CONFIG_NETDEV_10000 is not set
713# CONFIG_TR is not set
714
715#
716# Wireless LAN
717#
718# CONFIG_WLAN_PRE80211 is not set
719# CONFIG_WLAN_80211 is not set
720
721#
722# Enable WiMAX (Networking options) to see the WiMAX drivers
723#
724# CONFIG_WAN is not set
725# CONFIG_FDDI is not set
726# CONFIG_HIPPI is not set
727# CONFIG_PPP is not set
728# CONFIG_SLIP is not set
729# CONFIG_NET_FC is not set
730# CONFIG_NETCONSOLE is not set
731# CONFIG_NETPOLL is not set
732# CONFIG_NET_POLL_CONTROLLER is not set
733# CONFIG_ISDN is not set
734# CONFIG_PHONE is not set
735
736#
737# Input device support
738#
739# CONFIG_INPUT is not set
740
741#
742# Hardware I/O ports
743#
744# CONFIG_SERIO is not set
745# CONFIG_GAMEPORT is not set
746
747#
748# Character devices
749#
750# CONFIG_VT is not set
751CONFIG_DEVKMEM=y
752# CONFIG_SERIAL_NONSTANDARD is not set
753# CONFIG_NOZOMI is not set
754
755#
756# Serial drivers
757#
758CONFIG_SERIAL_8250=y
759CONFIG_SERIAL_8250_CONSOLE=y
760# CONFIG_SERIAL_8250_PCI is not set
761CONFIG_SERIAL_8250_NR_UARTS=2
762CONFIG_SERIAL_8250_RUNTIME_UARTS=2
763CONFIG_SERIAL_8250_EXTENDED=y
764# CONFIG_SERIAL_8250_MANY_PORTS is not set
765CONFIG_SERIAL_8250_SHARE_IRQ=y
766# CONFIG_SERIAL_8250_DETECT_IRQ is not set
767# CONFIG_SERIAL_8250_RSA is not set
768
769#
770# Non-8250 serial port support
771#
772# CONFIG_SERIAL_UARTLITE is not set
773CONFIG_SERIAL_CORE=y
774CONFIG_SERIAL_CORE_CONSOLE=y
775# CONFIG_SERIAL_JSM is not set
776CONFIG_SERIAL_OF_PLATFORM=y
777# CONFIG_SERIAL_OF_PLATFORM_NWPSERIAL is not set
778CONFIG_UNIX98_PTYS=y
779# CONFIG_DEVPTS_MULTIPLE_INSTANCES is not set
780CONFIG_LEGACY_PTYS=y
781CONFIG_LEGACY_PTY_COUNT=256
782# CONFIG_HVC_UDBG is not set
783# CONFIG_IPMI_HANDLER is not set
784# CONFIG_HW_RANDOM is not set
785# CONFIG_NVRAM is not set
786# CONFIG_GEN_RTC is not set
787# CONFIG_R3964 is not set
788# CONFIG_APPLICOM is not set
789# CONFIG_RAW_DRIVER is not set
790# CONFIG_TCG_TPM is not set
791CONFIG_DEVPORT=y
792CONFIG_I2C=y
793CONFIG_I2C_BOARDINFO=y
794CONFIG_I2C_CHARDEV=y
795CONFIG_I2C_HELPER_AUTO=y
796
797#
798# I2C Hardware Bus support
799#
800
801#
802# PC SMBus host controller drivers
803#
804# CONFIG_I2C_ALI1535 is not set
805# CONFIG_I2C_ALI1563 is not set
806# CONFIG_I2C_ALI15X3 is not set
807# CONFIG_I2C_AMD756 is not set
808# CONFIG_I2C_AMD8111 is not set
809# CONFIG_I2C_I801 is not set
810# CONFIG_I2C_ISCH is not set
811# CONFIG_I2C_PIIX4 is not set
812# CONFIG_I2C_NFORCE2 is not set
813# CONFIG_I2C_SIS5595 is not set
814# CONFIG_I2C_SIS630 is not set
815# CONFIG_I2C_SIS96X is not set
816# CONFIG_I2C_VIA is not set
817# CONFIG_I2C_VIAPRO is not set
818
819#
820# I2C system bus drivers (mostly embedded / system-on-chip)
821#
822CONFIG_I2C_IBM_IIC=y
823# CONFIG_I2C_MPC is not set
824# CONFIG_I2C_OCORES is not set
825# CONFIG_I2C_SIMTEC is not set
826
827#
828# External I2C/SMBus adapter drivers
829#
830# CONFIG_I2C_PARPORT_LIGHT is not set
831# CONFIG_I2C_TAOS_EVM is not set
832
833#
834# Graphics adapter I2C/DDC channel drivers
835#
836# CONFIG_I2C_VOODOO3 is not set
837
838#
839# Other I2C/SMBus bus drivers
840#
841# CONFIG_I2C_PCA_PLATFORM is not set
842# CONFIG_I2C_STUB is not set
843
844#
845# Miscellaneous I2C Chip support
846#
847# CONFIG_DS1682 is not set
848# CONFIG_SENSORS_PCF8574 is not set
849# CONFIG_PCF8575 is not set
850# CONFIG_SENSORS_PCA9539 is not set
851# CONFIG_SENSORS_TSL2550 is not set
852CONFIG_I2C_DEBUG_CORE=y
853CONFIG_I2C_DEBUG_ALGO=y
854CONFIG_I2C_DEBUG_BUS=y
855CONFIG_I2C_DEBUG_CHIP=y
856# CONFIG_SPI is not set
857
858#
859# PPS support
860#
861# CONFIG_PPS is not set
862CONFIG_ARCH_WANT_OPTIONAL_GPIOLIB=y
863# CONFIG_GPIOLIB is not set
864# CONFIG_W1 is not set
865# CONFIG_POWER_SUPPLY is not set
866# CONFIG_HWMON is not set
867# CONFIG_THERMAL is not set
868# CONFIG_THERMAL_HWMON is not set
869# CONFIG_WATCHDOG is not set
870CONFIG_SSB_POSSIBLE=y
871
872#
873# Sonics Silicon Backplane
874#
875# CONFIG_SSB is not set
876
877#
878# Multifunction device drivers
879#
880# CONFIG_MFD_CORE is not set
881# CONFIG_MFD_SM501 is not set
882# CONFIG_HTC_PASIC3 is not set
883# CONFIG_TWL4030_CORE is not set
884# CONFIG_MFD_TMIO is not set
885# CONFIG_PMIC_DA903X is not set
886# CONFIG_MFD_WM8400 is not set
887# CONFIG_MFD_WM8350_I2C is not set
888# CONFIG_MFD_PCF50633 is not set
889# CONFIG_AB3100_CORE is not set
890# CONFIG_REGULATOR is not set
891# CONFIG_MEDIA_SUPPORT is not set
892
893#
894# Graphics support
895#
896# CONFIG_AGP is not set
897# CONFIG_DRM is not set
898# CONFIG_VGASTATE is not set
899CONFIG_VIDEO_OUTPUT_CONTROL=m
900# CONFIG_FB is not set
901# CONFIG_BACKLIGHT_LCD_SUPPORT is not set
902
903#
904# Display device support
905#
906# CONFIG_DISPLAY_SUPPORT is not set
907# CONFIG_SOUND is not set
908# CONFIG_USB_SUPPORT is not set
909# CONFIG_UWB is not set
910# CONFIG_MMC is not set
911# CONFIG_MEMSTICK is not set
912# CONFIG_NEW_LEDS is not set
913# CONFIG_ACCESSIBILITY is not set
914# CONFIG_INFINIBAND is not set
915# CONFIG_EDAC is not set
916# CONFIG_RTC_CLASS is not set
917CONFIG_DMADEVICES=y
918
919#
920# DMA Devices
921#
922# CONFIG_AUXDISPLAY is not set
923# CONFIG_UIO is not set
924
925#
926# TI VLYNQ
927#
928# CONFIG_STAGING is not set
929
930#
931# File systems
932#
933CONFIG_EXT2_FS=y
934# CONFIG_EXT2_FS_XATTR is not set
935# CONFIG_EXT2_FS_XIP is not set
936# CONFIG_EXT3_FS is not set
937# CONFIG_EXT4_FS is not set
938# CONFIG_REISERFS_FS is not set
939# CONFIG_JFS_FS is not set
940# CONFIG_FS_POSIX_ACL is not set
941# CONFIG_XFS_FS is not set
942# CONFIG_GFS2_FS is not set
943# CONFIG_OCFS2_FS is not set
944# CONFIG_BTRFS_FS is not set
945CONFIG_FILE_LOCKING=y
946CONFIG_FSNOTIFY=y
947CONFIG_DNOTIFY=y
948CONFIG_INOTIFY=y
949CONFIG_INOTIFY_USER=y
950# CONFIG_QUOTA is not set
951# CONFIG_AUTOFS_FS is not set
952# CONFIG_AUTOFS4_FS is not set
953# CONFIG_FUSE_FS is not set
954
955#
956# Caches
957#
958# CONFIG_FSCACHE is not set
959
960#
961# CD-ROM/DVD Filesystems
962#
963# CONFIG_ISO9660_FS is not set
964# CONFIG_UDF_FS is not set
965
966#
967# DOS/FAT/NT Filesystems
968#
969# CONFIG_MSDOS_FS is not set
970# CONFIG_VFAT_FS is not set
971# CONFIG_NTFS_FS is not set
972
973#
974# Pseudo filesystems
975#
976CONFIG_PROC_FS=y
977CONFIG_PROC_KCORE=y
978CONFIG_PROC_SYSCTL=y
979CONFIG_PROC_PAGE_MONITOR=y
980CONFIG_SYSFS=y
981CONFIG_TMPFS=y
982# CONFIG_TMPFS_POSIX_ACL is not set
983# CONFIG_HUGETLB_PAGE is not set
984# CONFIG_CONFIGFS_FS is not set
985CONFIG_MISC_FILESYSTEMS=y
986# CONFIG_ADFS_FS is not set
987# CONFIG_AFFS_FS is not set
988# CONFIG_HFS_FS is not set
989# CONFIG_HFSPLUS_FS is not set
990# CONFIG_BEFS_FS is not set
991# CONFIG_BFS_FS is not set
992# CONFIG_EFS_FS is not set
993# CONFIG_JFFS2_FS is not set
994CONFIG_CRAMFS=y
995# CONFIG_SQUASHFS is not set
996# CONFIG_VXFS_FS is not set
997# CONFIG_MINIX_FS is not set
998# CONFIG_OMFS_FS is not set
999# CONFIG_HPFS_FS is not set
1000# CONFIG_QNX4FS_FS is not set
1001# CONFIG_ROMFS_FS is not set
1002# CONFIG_SYSV_FS is not set
1003# CONFIG_UFS_FS is not set
1004# CONFIG_NILFS2_FS is not set
1005CONFIG_NETWORK_FILESYSTEMS=y
1006CONFIG_NFS_FS=y
1007CONFIG_NFS_V3=y
1008# CONFIG_NFS_V3_ACL is not set
1009# CONFIG_NFS_V4 is not set
1010CONFIG_ROOT_NFS=y
1011# CONFIG_NFSD is not set
1012CONFIG_LOCKD=y
1013CONFIG_LOCKD_V4=y
1014CONFIG_NFS_COMMON=y
1015CONFIG_SUNRPC=y
1016# CONFIG_RPCSEC_GSS_KRB5 is not set
1017# CONFIG_RPCSEC_GSS_SPKM3 is not set
1018# CONFIG_SMB_FS is not set
1019# CONFIG_CIFS is not set
1020# CONFIG_NCP_FS is not set
1021# CONFIG_CODA_FS is not set
1022# CONFIG_AFS_FS is not set
1023
1024#
1025# Partition Types
1026#
1027# CONFIG_PARTITION_ADVANCED is not set
1028CONFIG_MSDOS_PARTITION=y
1029# CONFIG_NLS is not set
1030# CONFIG_DLM is not set
1031# CONFIG_BINARY_PRINTF is not set
1032
1033#
1034# Library routines
1035#
1036CONFIG_BITREVERSE=y
1037CONFIG_GENERIC_FIND_LAST_BIT=y
1038# CONFIG_CRC_CCITT is not set
1039# CONFIG_CRC16 is not set
1040# CONFIG_CRC_T10DIF is not set
1041# CONFIG_CRC_ITU_T is not set
1042CONFIG_CRC32=y
1043# CONFIG_CRC7 is not set
1044# CONFIG_LIBCRC32C is not set
1045CONFIG_ZLIB_INFLATE=y
1046CONFIG_DECOMPRESS_GZIP=y
1047CONFIG_HAS_IOMEM=y
1048CONFIG_HAS_IOPORT=y
1049CONFIG_HAS_DMA=y
1050CONFIG_HAVE_LMB=y
1051CONFIG_NLATTR=y
1052CONFIG_GENERIC_ATOMIC64=y
1053
1054#
1055# Kernel hacking
1056#
1057# CONFIG_PRINTK_TIME is not set
1058CONFIG_ENABLE_WARN_DEPRECATED=y
1059CONFIG_ENABLE_MUST_CHECK=y
1060CONFIG_FRAME_WARN=1024
1061CONFIG_MAGIC_SYSRQ=y
1062# CONFIG_UNUSED_SYMBOLS is not set
1063CONFIG_DEBUG_FS=y
1064# CONFIG_HEADERS_CHECK is not set
1065CONFIG_DEBUG_KERNEL=y
1066# CONFIG_DEBUG_SHIRQ is not set
1067CONFIG_DETECT_SOFTLOCKUP=y
1068# CONFIG_BOOTPARAM_SOFTLOCKUP_PANIC is not set
1069CONFIG_BOOTPARAM_SOFTLOCKUP_PANIC_VALUE=0
1070CONFIG_DETECT_HUNG_TASK=y
1071# CONFIG_BOOTPARAM_HUNG_TASK_PANIC is not set
1072CONFIG_BOOTPARAM_HUNG_TASK_PANIC_VALUE=0
1073CONFIG_SCHED_DEBUG=y
1074# CONFIG_SCHEDSTATS is not set
1075# CONFIG_TIMER_STATS is not set
1076# CONFIG_DEBUG_OBJECTS is not set
1077# CONFIG_SLUB_DEBUG_ON is not set
1078# CONFIG_SLUB_STATS is not set
1079# CONFIG_DEBUG_KMEMLEAK is not set
1080# CONFIG_DEBUG_RT_MUTEXES is not set
1081# CONFIG_RT_MUTEX_TESTER is not set
1082# CONFIG_DEBUG_SPINLOCK is not set
1083# CONFIG_DEBUG_MUTEXES is not set
1084# CONFIG_DEBUG_LOCK_ALLOC is not set
1085# CONFIG_PROVE_LOCKING is not set
1086# CONFIG_LOCK_STAT is not set
1087# CONFIG_DEBUG_SPINLOCK_SLEEP is not set
1088# CONFIG_DEBUG_LOCKING_API_SELFTESTS is not set
1089# CONFIG_DEBUG_KOBJECT is not set
1090# CONFIG_DEBUG_BUGVERBOSE is not set
1091# CONFIG_DEBUG_INFO is not set
1092# CONFIG_DEBUG_VM is not set
1093# CONFIG_DEBUG_WRITECOUNT is not set
1094# CONFIG_DEBUG_MEMORY_INIT is not set
1095# CONFIG_DEBUG_LIST is not set
1096# CONFIG_DEBUG_SG is not set
1097# CONFIG_DEBUG_NOTIFIERS is not set
1098# CONFIG_RCU_TORTURE_TEST is not set
1099# CONFIG_RCU_CPU_STALL_DETECTOR is not set
1100# CONFIG_BACKTRACE_SELF_TEST is not set
1101# CONFIG_DEBUG_BLOCK_EXT_DEVT is not set
1102# CONFIG_FAULT_INJECTION is not set
1103# CONFIG_LATENCYTOP is not set
1104CONFIG_SYSCTL_SYSCALL_CHECK=y
1105# CONFIG_DEBUG_PAGEALLOC is not set
1106CONFIG_HAVE_FUNCTION_TRACER=y
1107CONFIG_HAVE_FUNCTION_GRAPH_TRACER=y
1108CONFIG_HAVE_DYNAMIC_FTRACE=y
1109CONFIG_HAVE_FTRACE_MCOUNT_RECORD=y
1110CONFIG_TRACING_SUPPORT=y
1111CONFIG_FTRACE=y
1112# CONFIG_FUNCTION_TRACER is not set
1113# CONFIG_IRQSOFF_TRACER is not set
1114# CONFIG_SCHED_TRACER is not set
1115# CONFIG_ENABLE_DEFAULT_TRACERS is not set
1116# CONFIG_BOOT_TRACER is not set
1117CONFIG_BRANCH_PROFILE_NONE=y
1118# CONFIG_PROFILE_ANNOTATED_BRANCHES is not set
1119# CONFIG_PROFILE_ALL_BRANCHES is not set
1120# CONFIG_STACK_TRACER is not set
1121# CONFIG_KMEMTRACE is not set
1122# CONFIG_WORKQUEUE_TRACER is not set
1123# CONFIG_BLK_DEV_IO_TRACE is not set
1124# CONFIG_DYNAMIC_DEBUG is not set
1125# CONFIG_SAMPLES is not set
1126CONFIG_HAVE_ARCH_KGDB=y
1127# CONFIG_KGDB is not set
1128# CONFIG_KMEMCHECK is not set
1129# CONFIG_PPC_DISABLE_WERROR is not set
1130CONFIG_PPC_WERROR=y
1131CONFIG_PRINT_STACK_DEPTH=64
1132# CONFIG_DEBUG_STACKOVERFLOW is not set
1133# CONFIG_DEBUG_STACK_USAGE is not set
1134# CONFIG_PPC_EMULATED_STATS is not set
1135# CONFIG_CODE_PATCHING_SELFTEST is not set
1136# CONFIG_FTR_FIXUP_SELFTEST is not set
1137# CONFIG_MSI_BITMAP_SELFTEST is not set
1138# CONFIG_XMON is not set
1139# CONFIG_IRQSTACKS is not set
1140# CONFIG_VIRQ_DEBUG is not set
1141# CONFIG_BDI_SWITCH is not set
1142# CONFIG_PPC_EARLY_DEBUG is not set
1143
1144#
1145# Security options
1146#
1147# CONFIG_KEYS is not set
1148# CONFIG_SECURITY is not set
1149# CONFIG_SECURITYFS is not set
1150# CONFIG_SECURITY_FILE_CAPABILITIES is not set
1151CONFIG_CRYPTO=y
1152
1153#
1154# Crypto core or helper
1155#
1156# CONFIG_CRYPTO_FIPS is not set
1157CONFIG_CRYPTO_ALGAPI=y
1158CONFIG_CRYPTO_ALGAPI2=y
1159CONFIG_CRYPTO_AEAD=y
1160CONFIG_CRYPTO_AEAD2=y
1161CONFIG_CRYPTO_BLKCIPHER=y
1162CONFIG_CRYPTO_BLKCIPHER2=y
1163CONFIG_CRYPTO_HASH=y
1164CONFIG_CRYPTO_HASH2=y
1165CONFIG_CRYPTO_RNG=y
1166CONFIG_CRYPTO_RNG2=y
1167CONFIG_CRYPTO_PCOMP=y
1168CONFIG_CRYPTO_MANAGER=y
1169CONFIG_CRYPTO_MANAGER2=y
1170CONFIG_CRYPTO_GF128MUL=y
1171# CONFIG_CRYPTO_NULL is not set
1172CONFIG_CRYPTO_WORKQUEUE=y
1173CONFIG_CRYPTO_CRYPTD=y
1174CONFIG_CRYPTO_AUTHENC=y
1175# CONFIG_CRYPTO_TEST is not set
1176
1177#
1178# Authenticated Encryption with Associated Data
1179#
1180CONFIG_CRYPTO_CCM=y
1181CONFIG_CRYPTO_GCM=y
1182CONFIG_CRYPTO_SEQIV=y
1183
1184#
1185# Block modes
1186#
1187CONFIG_CRYPTO_CBC=y
1188CONFIG_CRYPTO_CTR=y
1189CONFIG_CRYPTO_CTS=y
1190CONFIG_CRYPTO_ECB=y
1191CONFIG_CRYPTO_LRW=y
1192CONFIG_CRYPTO_PCBC=y
1193CONFIG_CRYPTO_XTS=y
1194
1195#
1196# Hash modes
1197#
1198CONFIG_CRYPTO_HMAC=y
1199CONFIG_CRYPTO_XCBC=y
1200
1201#
1202# Digest
1203#
1204# CONFIG_CRYPTO_CRC32C is not set
1205CONFIG_CRYPTO_MD4=y
1206CONFIG_CRYPTO_MD5=y
1207# CONFIG_CRYPTO_MICHAEL_MIC is not set
1208# CONFIG_CRYPTO_RMD128 is not set
1209# CONFIG_CRYPTO_RMD160 is not set
1210# CONFIG_CRYPTO_RMD256 is not set
1211# CONFIG_CRYPTO_RMD320 is not set
1212CONFIG_CRYPTO_SHA1=y
1213CONFIG_CRYPTO_SHA256=y
1214CONFIG_CRYPTO_SHA512=y
1215# CONFIG_CRYPTO_TGR192 is not set
1216# CONFIG_CRYPTO_WP512 is not set
1217
1218#
1219# Ciphers
1220#
1221CONFIG_CRYPTO_AES=y
1222# CONFIG_CRYPTO_ANUBIS is not set
1223CONFIG_CRYPTO_ARC4=y
1224CONFIG_CRYPTO_BLOWFISH=y
1225# CONFIG_CRYPTO_CAMELLIA is not set
1226# CONFIG_CRYPTO_CAST5 is not set
1227# CONFIG_CRYPTO_CAST6 is not set
1228CONFIG_CRYPTO_DES=y
1229# CONFIG_CRYPTO_FCRYPT is not set
1230# CONFIG_CRYPTO_KHAZAD is not set
1231# CONFIG_CRYPTO_SALSA20 is not set
1232# CONFIG_CRYPTO_SEED is not set
1233# CONFIG_CRYPTO_SERPENT is not set
1234# CONFIG_CRYPTO_TEA is not set
1235# CONFIG_CRYPTO_TWOFISH is not set
1236
1237#
1238# Compression
1239#
1240# CONFIG_CRYPTO_DEFLATE is not set
1241# CONFIG_CRYPTO_ZLIB is not set
1242# CONFIG_CRYPTO_LZO is not set
1243
1244#
1245# Random Number Generation
1246#
1247# CONFIG_CRYPTO_ANSI_CPRNG is not set
1248CONFIG_CRYPTO_HW=y
1249# CONFIG_CRYPTO_DEV_HIFN_795X is not set
1250# CONFIG_CRYPTO_DEV_PPC4XX is not set
1251# CONFIG_PPC_CLOCK is not set
1252# CONFIG_VIRTUALIZATION is not set
diff --git a/arch/powerpc/configs/83xx/sbc834x_defconfig b/arch/powerpc/configs/83xx/sbc834x_defconfig
index a592b5efdc4d..3a68f861b1bd 100644
--- a/arch/powerpc/configs/83xx/sbc834x_defconfig
+++ b/arch/powerpc/configs/83xx/sbc834x_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.31-rc4 3# Linux kernel version: 2.6.31-rc5
4# Wed Jul 29 23:32:13 2009 4# Tue Aug 11 19:57:51 2009
5# 5#
6# CONFIG_PPC64 is not set 6# CONFIG_PPC64 is not set
7 7
@@ -420,7 +420,90 @@ CONFIG_PREVENT_FIRMWARE_BUILD=y
420# CONFIG_FW_LOADER is not set 420# CONFIG_FW_LOADER is not set
421# CONFIG_SYS_HYPERVISOR is not set 421# CONFIG_SYS_HYPERVISOR is not set
422# CONFIG_CONNECTOR is not set 422# CONFIG_CONNECTOR is not set
423# CONFIG_MTD is not set 423CONFIG_MTD=y
424# CONFIG_MTD_DEBUG is not set
425CONFIG_MTD_CONCAT=y
426CONFIG_MTD_PARTITIONS=y
427# CONFIG_MTD_TESTS is not set
428# CONFIG_MTD_REDBOOT_PARTS is not set
429CONFIG_MTD_CMDLINE_PARTS=y
430CONFIG_MTD_OF_PARTS=y
431# CONFIG_MTD_AR7_PARTS is not set
432
433#
434# User Modules And Translation Layers
435#
436CONFIG_MTD_CHAR=y
437CONFIG_MTD_BLKDEVS=y
438CONFIG_MTD_BLOCK=y
439# CONFIG_FTL is not set
440# CONFIG_NFTL is not set
441# CONFIG_INFTL is not set
442# CONFIG_RFD_FTL is not set
443# CONFIG_SSFDC is not set
444# CONFIG_MTD_OOPS is not set
445
446#
447# RAM/ROM/Flash chip drivers
448#
449CONFIG_MTD_CFI=y
450# CONFIG_MTD_JEDECPROBE is not set
451CONFIG_MTD_GEN_PROBE=y
452# CONFIG_MTD_CFI_ADV_OPTIONS is not set
453CONFIG_MTD_MAP_BANK_WIDTH_1=y
454CONFIG_MTD_MAP_BANK_WIDTH_2=y
455CONFIG_MTD_MAP_BANK_WIDTH_4=y
456# CONFIG_MTD_MAP_BANK_WIDTH_8 is not set
457# CONFIG_MTD_MAP_BANK_WIDTH_16 is not set
458# CONFIG_MTD_MAP_BANK_WIDTH_32 is not set
459CONFIG_MTD_CFI_I1=y
460CONFIG_MTD_CFI_I2=y
461# CONFIG_MTD_CFI_I4 is not set
462# CONFIG_MTD_CFI_I8 is not set
463CONFIG_MTD_CFI_INTELEXT=y
464# CONFIG_MTD_CFI_AMDSTD is not set
465# CONFIG_MTD_CFI_STAA is not set
466CONFIG_MTD_CFI_UTIL=y
467# CONFIG_MTD_RAM is not set
468# CONFIG_MTD_ROM is not set
469# CONFIG_MTD_ABSENT is not set
470
471#
472# Mapping drivers for chip access
473#
474# CONFIG_MTD_COMPLEX_MAPPINGS is not set
475# CONFIG_MTD_PHYSMAP is not set
476CONFIG_MTD_PHYSMAP_OF=y
477# CONFIG_MTD_INTEL_VR_NOR is not set
478# CONFIG_MTD_PLATRAM is not set
479
480#
481# Self-contained MTD device drivers
482#
483# CONFIG_MTD_PMC551 is not set
484# CONFIG_MTD_SLRAM is not set
485# CONFIG_MTD_PHRAM is not set
486# CONFIG_MTD_MTDRAM is not set
487# CONFIG_MTD_BLOCK2MTD is not set
488
489#
490# Disk-On-Chip Device Drivers
491#
492# CONFIG_MTD_DOC2000 is not set
493# CONFIG_MTD_DOC2001 is not set
494# CONFIG_MTD_DOC2001PLUS is not set
495# CONFIG_MTD_NAND is not set
496# CONFIG_MTD_ONENAND is not set
497
498#
499# LPDDR flash memory drivers
500#
501# CONFIG_MTD_LPDDR is not set
502
503#
504# UBI - Unsorted block images
505#
506# CONFIG_MTD_UBI is not set
424CONFIG_OF_DEVICE=y 507CONFIG_OF_DEVICE=y
425CONFIG_OF_I2C=y 508CONFIG_OF_I2C=y
426CONFIG_OF_MDIO=y 509CONFIG_OF_MDIO=y
@@ -436,6 +519,7 @@ CONFIG_BLK_DEV_LOOP=y
436# CONFIG_BLK_DEV_CRYPTOLOOP is not set 519# CONFIG_BLK_DEV_CRYPTOLOOP is not set
437# CONFIG_BLK_DEV_NBD is not set 520# CONFIG_BLK_DEV_NBD is not set
438# CONFIG_BLK_DEV_SX8 is not set 521# CONFIG_BLK_DEV_SX8 is not set
522# CONFIG_BLK_DEV_UB is not set
439CONFIG_BLK_DEV_RAM=y 523CONFIG_BLK_DEV_RAM=y
440CONFIG_BLK_DEV_RAM_COUNT=16 524CONFIG_BLK_DEV_RAM_COUNT=16
441CONFIG_BLK_DEV_RAM_SIZE=32768 525CONFIG_BLK_DEV_RAM_SIZE=32768
@@ -468,9 +552,38 @@ CONFIG_HAVE_IDE=y
468# SCSI device support 552# SCSI device support
469# 553#
470# CONFIG_RAID_ATTRS is not set 554# CONFIG_RAID_ATTRS is not set
471# CONFIG_SCSI is not set 555CONFIG_SCSI=y
472# CONFIG_SCSI_DMA is not set 556CONFIG_SCSI_DMA=y
557# CONFIG_SCSI_TGT is not set
473# CONFIG_SCSI_NETLINK is not set 558# CONFIG_SCSI_NETLINK is not set
559# CONFIG_SCSI_PROC_FS is not set
560
561#
562# SCSI support type (disk, tape, CD-ROM)
563#
564CONFIG_BLK_DEV_SD=y
565# CONFIG_CHR_DEV_ST is not set
566# CONFIG_CHR_DEV_OSST is not set
567# CONFIG_BLK_DEV_SR is not set
568# CONFIG_CHR_DEV_SG is not set
569# CONFIG_CHR_DEV_SCH is not set
570# CONFIG_SCSI_MULTI_LUN is not set
571# CONFIG_SCSI_CONSTANTS is not set
572# CONFIG_SCSI_LOGGING is not set
573# CONFIG_SCSI_SCAN_ASYNC is not set
574CONFIG_SCSI_WAIT_SCAN=m
575
576#
577# SCSI Transports
578#
579# CONFIG_SCSI_SPI_ATTRS is not set
580# CONFIG_SCSI_FC_ATTRS is not set
581# CONFIG_SCSI_ISCSI_ATTRS is not set
582# CONFIG_SCSI_SAS_LIBSAS is not set
583# CONFIG_SCSI_SRP_ATTRS is not set
584# CONFIG_SCSI_LOWLEVEL is not set
585# CONFIG_SCSI_DH is not set
586# CONFIG_SCSI_OSD_INITIATOR is not set
474# CONFIG_ATA is not set 587# CONFIG_ATA is not set
475# CONFIG_MD is not set 588# CONFIG_MD is not set
476# CONFIG_FUSION is not set 589# CONFIG_FUSION is not set
@@ -578,11 +691,21 @@ CONFIG_GIANFAR=y
578# 691#
579# Enable WiMAX (Networking options) to see the WiMAX drivers 692# Enable WiMAX (Networking options) to see the WiMAX drivers
580# 693#
694
695#
696# USB Network Adapters
697#
698# CONFIG_USB_CATC is not set
699# CONFIG_USB_KAWETH is not set
700# CONFIG_USB_PEGASUS is not set
701# CONFIG_USB_RTL8150 is not set
702# CONFIG_USB_USBNET is not set
581# CONFIG_WAN is not set 703# CONFIG_WAN is not set
582# CONFIG_FDDI is not set 704# CONFIG_FDDI is not set
583# CONFIG_HIPPI is not set 705# CONFIG_HIPPI is not set
584# CONFIG_PPP is not set 706# CONFIG_PPP is not set
585# CONFIG_SLIP is not set 707# CONFIG_SLIP is not set
708# CONFIG_NET_FC is not set
586# CONFIG_NETCONSOLE is not set 709# CONFIG_NETCONSOLE is not set
587# CONFIG_NETPOLL is not set 710# CONFIG_NETPOLL is not set
588# CONFIG_NET_POLL_CONTROLLER is not set 711# CONFIG_NET_POLL_CONTROLLER is not set
@@ -633,9 +756,9 @@ CONFIG_DEVKMEM=y
633# 756#
634CONFIG_SERIAL_8250=y 757CONFIG_SERIAL_8250=y
635CONFIG_SERIAL_8250_CONSOLE=y 758CONFIG_SERIAL_8250_CONSOLE=y
636CONFIG_SERIAL_8250_PCI=y 759# CONFIG_SERIAL_8250_PCI is not set
637CONFIG_SERIAL_8250_NR_UARTS=4 760CONFIG_SERIAL_8250_NR_UARTS=2
638CONFIG_SERIAL_8250_RUNTIME_UARTS=4 761CONFIG_SERIAL_8250_RUNTIME_UARTS=2
639# CONFIG_SERIAL_8250_EXTENDED is not set 762# CONFIG_SERIAL_8250_EXTENDED is not set
640 763
641# 764#
@@ -700,6 +823,7 @@ CONFIG_I2C_MPC=y
700# 823#
701# CONFIG_I2C_PARPORT_LIGHT is not set 824# CONFIG_I2C_PARPORT_LIGHT is not set
702# CONFIG_I2C_TAOS_EVM is not set 825# CONFIG_I2C_TAOS_EVM is not set
826# CONFIG_I2C_TINY_USB is not set
703 827
704# 828#
705# Graphics adapter I2C/DDC channel drivers 829# Graphics adapter I2C/DDC channel drivers
@@ -814,6 +938,11 @@ CONFIG_WATCHDOG=y
814# 938#
815# CONFIG_PCIPCWATCHDOG is not set 939# CONFIG_PCIPCWATCHDOG is not set
816# CONFIG_WDTPCI is not set 940# CONFIG_WDTPCI is not set
941
942#
943# USB-based Watchdog Cards
944#
945# CONFIG_USBPCWATCHDOG is not set
817CONFIG_SSB_POSSIBLE=y 946CONFIG_SSB_POSSIBLE=y
818 947
819# 948#
@@ -856,12 +985,134 @@ CONFIG_HID_SUPPORT=y
856CONFIG_HID=y 985CONFIG_HID=y
857# CONFIG_HID_DEBUG is not set 986# CONFIG_HID_DEBUG is not set
858# CONFIG_HIDRAW is not set 987# CONFIG_HIDRAW is not set
988
989#
990# USB Input Devices
991#
992# CONFIG_USB_HID is not set
859# CONFIG_HID_PID is not set 993# CONFIG_HID_PID is not set
860 994
861# 995#
996# USB HID Boot Protocol drivers
997#
998# CONFIG_USB_KBD is not set
999# CONFIG_USB_MOUSE is not set
1000
1001#
862# Special HID drivers 1002# Special HID drivers
863# 1003#
864# CONFIG_USB_SUPPORT is not set 1004CONFIG_USB_SUPPORT=y
1005CONFIG_USB_ARCH_HAS_HCD=y
1006CONFIG_USB_ARCH_HAS_OHCI=y
1007CONFIG_USB_ARCH_HAS_EHCI=y
1008CONFIG_USB=y
1009# CONFIG_USB_DEBUG is not set
1010# CONFIG_USB_ANNOUNCE_NEW_DEVICES is not set
1011
1012#
1013# Miscellaneous USB options
1014#
1015CONFIG_USB_DEVICEFS=y
1016CONFIG_USB_DEVICE_CLASS=y
1017# CONFIG_USB_DYNAMIC_MINORS is not set
1018# CONFIG_USB_OTG is not set
1019# CONFIG_USB_OTG_WHITELIST is not set
1020# CONFIG_USB_OTG_BLACKLIST_HUB is not set
1021CONFIG_USB_MON=y
1022# CONFIG_USB_WUSB is not set
1023# CONFIG_USB_WUSB_CBAF is not set
1024
1025#
1026# USB Host Controller Drivers
1027#
1028# CONFIG_USB_C67X00_HCD is not set
1029# CONFIG_USB_XHCI_HCD is not set
1030CONFIG_USB_EHCI_HCD=y
1031CONFIG_USB_EHCI_ROOT_HUB_TT=y
1032# CONFIG_USB_EHCI_TT_NEWSCHED is not set
1033CONFIG_USB_EHCI_FSL=y
1034CONFIG_USB_EHCI_HCD_PPC_OF=y
1035# CONFIG_USB_OXU210HP_HCD is not set
1036# CONFIG_USB_ISP116X_HCD is not set
1037# CONFIG_USB_ISP1760_HCD is not set
1038# CONFIG_USB_OHCI_HCD is not set
1039# CONFIG_USB_UHCI_HCD is not set
1040# CONFIG_USB_SL811_HCD is not set
1041# CONFIG_USB_R8A66597_HCD is not set
1042# CONFIG_USB_WHCI_HCD is not set
1043# CONFIG_USB_HWA_HCD is not set
1044
1045#
1046# USB Device Class drivers
1047#
1048# CONFIG_USB_ACM is not set
1049# CONFIG_USB_PRINTER is not set
1050# CONFIG_USB_WDM is not set
1051# CONFIG_USB_TMC is not set
1052
1053#
1054# NOTE: USB_STORAGE depends on SCSI but BLK_DEV_SD may
1055#
1056
1057#
1058# also be needed; see USB_STORAGE Help for more info
1059#
1060CONFIG_USB_STORAGE=y
1061# CONFIG_USB_STORAGE_DEBUG is not set
1062# CONFIG_USB_STORAGE_DATAFAB is not set
1063# CONFIG_USB_STORAGE_FREECOM is not set
1064# CONFIG_USB_STORAGE_ISD200 is not set
1065# CONFIG_USB_STORAGE_USBAT is not set
1066# CONFIG_USB_STORAGE_SDDR09 is not set
1067# CONFIG_USB_STORAGE_SDDR55 is not set
1068# CONFIG_USB_STORAGE_JUMPSHOT is not set
1069# CONFIG_USB_STORAGE_ALAUDA is not set
1070# CONFIG_USB_STORAGE_ONETOUCH is not set
1071# CONFIG_USB_STORAGE_KARMA is not set
1072# CONFIG_USB_STORAGE_CYPRESS_ATACB is not set
1073# CONFIG_USB_LIBUSUAL is not set
1074
1075#
1076# USB Imaging devices
1077#
1078# CONFIG_USB_MDC800 is not set
1079# CONFIG_USB_MICROTEK is not set
1080
1081#
1082# USB port drivers
1083#
1084# CONFIG_USB_SERIAL is not set
1085
1086#
1087# USB Miscellaneous drivers
1088#
1089# CONFIG_USB_EMI62 is not set
1090# CONFIG_USB_EMI26 is not set
1091# CONFIG_USB_ADUTUX is not set
1092# CONFIG_USB_SEVSEG is not set
1093# CONFIG_USB_RIO500 is not set
1094# CONFIG_USB_LEGOTOWER is not set
1095# CONFIG_USB_LCD is not set
1096# CONFIG_USB_BERRY_CHARGE is not set
1097# CONFIG_USB_LED is not set
1098# CONFIG_USB_CYPRESS_CY7C63 is not set
1099# CONFIG_USB_CYTHERM is not set
1100# CONFIG_USB_IDMOUSE is not set
1101# CONFIG_USB_FTDI_ELAN is not set
1102# CONFIG_USB_APPLEDISPLAY is not set
1103# CONFIG_USB_SISUSBVGA is not set
1104# CONFIG_USB_LD is not set
1105# CONFIG_USB_TRANCEVIBRATOR is not set
1106# CONFIG_USB_IOWARRIOR is not set
1107# CONFIG_USB_TEST is not set
1108# CONFIG_USB_ISIGHTFW is not set
1109# CONFIG_USB_VST is not set
1110# CONFIG_USB_GADGET is not set
1111
1112#
1113# OTG and related infrastructure
1114#
1115# CONFIG_NOP_USB_XCEIV is not set
865# CONFIG_UWB is not set 1116# CONFIG_UWB is not set
866# CONFIG_MMC is not set 1117# CONFIG_MMC is not set
867# CONFIG_MEMSTICK is not set 1118# CONFIG_MEMSTICK is not set
@@ -882,9 +1133,14 @@ CONFIG_HID=y
882# 1133#
883# File systems 1134# File systems
884# 1135#
885# CONFIG_EXT2_FS is not set 1136CONFIG_EXT2_FS=y
886# CONFIG_EXT3_FS is not set 1137# CONFIG_EXT2_FS_XATTR is not set
1138# CONFIG_EXT2_FS_XIP is not set
1139CONFIG_EXT3_FS=y
1140# CONFIG_EXT3_DEFAULTS_TO_ORDERED is not set
1141# CONFIG_EXT3_FS_XATTR is not set
887# CONFIG_EXT4_FS is not set 1142# CONFIG_EXT4_FS is not set
1143CONFIG_JBD=y
888# CONFIG_REISERFS_FS is not set 1144# CONFIG_REISERFS_FS is not set
889# CONFIG_JFS_FS is not set 1145# CONFIG_JFS_FS is not set
890# CONFIG_FS_POSIX_ACL is not set 1146# CONFIG_FS_POSIX_ACL is not set
@@ -940,6 +1196,7 @@ CONFIG_MISC_FILESYSTEMS=y
940# CONFIG_BEFS_FS is not set 1196# CONFIG_BEFS_FS is not set
941# CONFIG_BFS_FS is not set 1197# CONFIG_BFS_FS is not set
942# CONFIG_EFS_FS is not set 1198# CONFIG_EFS_FS is not set
1199# CONFIG_JFFS2_FS is not set
943# CONFIG_CRAMFS is not set 1200# CONFIG_CRAMFS is not set
944# CONFIG_SQUASHFS is not set 1201# CONFIG_SQUASHFS is not set
945# CONFIG_VXFS_FS is not set 1202# CONFIG_VXFS_FS is not set
@@ -977,7 +1234,46 @@ CONFIG_RPCSEC_GSS_KRB5=y
977# 1234#
978# CONFIG_PARTITION_ADVANCED is not set 1235# CONFIG_PARTITION_ADVANCED is not set
979CONFIG_MSDOS_PARTITION=y 1236CONFIG_MSDOS_PARTITION=y
980# CONFIG_NLS is not set 1237CONFIG_NLS=y
1238CONFIG_NLS_DEFAULT="iso8859-1"
1239# CONFIG_NLS_CODEPAGE_437 is not set
1240# CONFIG_NLS_CODEPAGE_737 is not set
1241# CONFIG_NLS_CODEPAGE_775 is not set
1242# CONFIG_NLS_CODEPAGE_850 is not set
1243# CONFIG_NLS_CODEPAGE_852 is not set
1244# CONFIG_NLS_CODEPAGE_855 is not set
1245# CONFIG_NLS_CODEPAGE_857 is not set
1246# CONFIG_NLS_CODEPAGE_860 is not set
1247# CONFIG_NLS_CODEPAGE_861 is not set
1248# CONFIG_NLS_CODEPAGE_862 is not set
1249# CONFIG_NLS_CODEPAGE_863 is not set
1250# CONFIG_NLS_CODEPAGE_864 is not set
1251# CONFIG_NLS_CODEPAGE_865 is not set
1252# CONFIG_NLS_CODEPAGE_866 is not set
1253# CONFIG_NLS_CODEPAGE_869 is not set
1254# CONFIG_NLS_CODEPAGE_936 is not set
1255# CONFIG_NLS_CODEPAGE_950 is not set
1256# CONFIG_NLS_CODEPAGE_932 is not set
1257# CONFIG_NLS_CODEPAGE_949 is not set
1258# CONFIG_NLS_CODEPAGE_874 is not set
1259# CONFIG_NLS_ISO8859_8 is not set
1260# CONFIG_NLS_CODEPAGE_1250 is not set
1261# CONFIG_NLS_CODEPAGE_1251 is not set
1262# CONFIG_NLS_ASCII is not set
1263# CONFIG_NLS_ISO8859_1 is not set
1264# CONFIG_NLS_ISO8859_2 is not set
1265# CONFIG_NLS_ISO8859_3 is not set
1266# CONFIG_NLS_ISO8859_4 is not set
1267# CONFIG_NLS_ISO8859_5 is not set
1268# CONFIG_NLS_ISO8859_6 is not set
1269# CONFIG_NLS_ISO8859_7 is not set
1270# CONFIG_NLS_ISO8859_9 is not set
1271# CONFIG_NLS_ISO8859_13 is not set
1272# CONFIG_NLS_ISO8859_14 is not set
1273# CONFIG_NLS_ISO8859_15 is not set
1274# CONFIG_NLS_KOI8_R is not set
1275# CONFIG_NLS_KOI8_U is not set
1276# CONFIG_NLS_UTF8 is not set
981# CONFIG_DLM is not set 1277# CONFIG_DLM is not set
982# CONFIG_BINARY_PRINTF is not set 1278# CONFIG_BINARY_PRINTF is not set
983 1279
diff --git a/arch/powerpc/configs/mgcoge_defconfig b/arch/powerpc/configs/mgcoge_defconfig
index e9491c1c3f31..30b68bfacebf 100644
--- a/arch/powerpc/configs/mgcoge_defconfig
+++ b/arch/powerpc/configs/mgcoge_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.31-rc4 3# Linux kernel version: 2.6.31-rc5
4# Wed Jul 29 23:31:51 2009 4# Fri Aug 7 08:19:15 2009
5# 5#
6# CONFIG_PPC64 is not set 6# CONFIG_PPC64 is not set
7 7
@@ -158,6 +158,7 @@ CONFIG_BASE_SMALL=0
158# CONFIG_MODULES is not set 158# CONFIG_MODULES is not set
159CONFIG_BLOCK=y 159CONFIG_BLOCK=y
160CONFIG_LBDAF=y 160CONFIG_LBDAF=y
161CONFIG_BLK_DEV_BSG=y
161# CONFIG_BLK_DEV_INTEGRITY is not set 162# CONFIG_BLK_DEV_INTEGRITY is not set
162 163
163# 164#
@@ -506,6 +507,7 @@ CONFIG_MTD_PHYSMAP_OF=y
506# CONFIG_MTD_UBI is not set 507# CONFIG_MTD_UBI is not set
507CONFIG_OF_DEVICE=y 508CONFIG_OF_DEVICE=y
508CONFIG_OF_GPIO=y 509CONFIG_OF_GPIO=y
510CONFIG_OF_I2C=y
509CONFIG_OF_MDIO=y 511CONFIG_OF_MDIO=y
510# CONFIG_PARPORT is not set 512# CONFIG_PARPORT is not set
511CONFIG_BLK_DEV=y 513CONFIG_BLK_DEV=y
@@ -582,7 +584,8 @@ CONFIG_PHYLIB=y
582# CONFIG_STE10XP is not set 584# CONFIG_STE10XP is not set
583# CONFIG_LSI_ET1011C_PHY is not set 585# CONFIG_LSI_ET1011C_PHY is not set
584CONFIG_FIXED_PHY=y 586CONFIG_FIXED_PHY=y
585# CONFIG_MDIO_BITBANG is not set 587CONFIG_MDIO_BITBANG=y
588# CONFIG_MDIO_GPIO is not set
586CONFIG_NET_ETHERNET=y 589CONFIG_NET_ETHERNET=y
587CONFIG_MII=y 590CONFIG_MII=y
588# CONFIG_MACE is not set 591# CONFIG_MACE is not set
@@ -608,8 +611,8 @@ CONFIG_MII=y
608# CONFIG_ATL2 is not set 611# CONFIG_ATL2 is not set
609CONFIG_FS_ENET=y 612CONFIG_FS_ENET=y
610CONFIG_FS_ENET_HAS_SCC=y 613CONFIG_FS_ENET_HAS_SCC=y
611# CONFIG_FS_ENET_HAS_FCC is not set 614CONFIG_FS_ENET_HAS_FCC=y
612# CONFIG_FS_ENET_MDIO_FCC is not set 615CONFIG_FS_ENET_MDIO_FCC=y
613# CONFIG_NETDEV_1000 is not set 616# CONFIG_NETDEV_1000 is not set
614# CONFIG_NETDEV_10000 is not set 617# CONFIG_NETDEV_10000 is not set
615# CONFIG_TR is not set 618# CONFIG_TR is not set
@@ -680,7 +683,68 @@ CONFIG_HW_RANDOM=y
680# CONFIG_APPLICOM is not set 683# CONFIG_APPLICOM is not set
681# CONFIG_RAW_DRIVER is not set 684# CONFIG_RAW_DRIVER is not set
682CONFIG_DEVPORT=y 685CONFIG_DEVPORT=y
683# CONFIG_I2C is not set 686CONFIG_I2C=y
687CONFIG_I2C_BOARDINFO=y
688CONFIG_I2C_CHARDEV=y
689CONFIG_I2C_HELPER_AUTO=y
690
691#
692# I2C Hardware Bus support
693#
694
695#
696# PC SMBus host controller drivers
697#
698# CONFIG_I2C_ALI1535 is not set
699# CONFIG_I2C_ALI15X3 is not set
700# CONFIG_I2C_AMD756 is not set
701# CONFIG_I2C_AMD8111 is not set
702# CONFIG_I2C_I801 is not set
703# CONFIG_I2C_ISCH is not set
704# CONFIG_I2C_PIIX4 is not set
705# CONFIG_I2C_NFORCE2 is not set
706# CONFIG_I2C_SIS5595 is not set
707# CONFIG_I2C_SIS630 is not set
708# CONFIG_I2C_SIS96X is not set
709# CONFIG_I2C_VIAPRO is not set
710
711#
712# Mac SMBus host controller drivers
713#
714# CONFIG_I2C_POWERMAC is not set
715
716#
717# I2C system bus drivers (mostly embedded / system-on-chip)
718#
719CONFIG_I2C_CPM=y
720# CONFIG_I2C_DESIGNWARE is not set
721# CONFIG_I2C_GPIO is not set
722# CONFIG_I2C_MPC is not set
723# CONFIG_I2C_SIMTEC is not set
724
725#
726# External I2C/SMBus adapter drivers
727#
728# CONFIG_I2C_PARPORT_LIGHT is not set
729
730#
731# Graphics adapter I2C/DDC channel drivers
732#
733# CONFIG_I2C_VOODOO3 is not set
734
735#
736# Other I2C/SMBus bus drivers
737#
738# CONFIG_I2C_PCA_PLATFORM is not set
739
740#
741# Miscellaneous I2C Chip support
742#
743# CONFIG_PCF8575 is not set
744# CONFIG_I2C_DEBUG_CORE is not set
745# CONFIG_I2C_DEBUG_ALGO is not set
746# CONFIG_I2C_DEBUG_BUS is not set
747# CONFIG_I2C_DEBUG_CHIP is not set
684# CONFIG_SPI is not set 748# CONFIG_SPI is not set
685 749
686# 750#
@@ -699,6 +763,9 @@ CONFIG_GPIOLIB=y
699# 763#
700# I2C GPIO expanders: 764# I2C GPIO expanders:
701# 765#
766# CONFIG_GPIO_MAX732X is not set
767# CONFIG_GPIO_PCA953X is not set
768# CONFIG_GPIO_PCF857X is not set
702 769
703# 770#
704# PCI GPIO expanders: 771# PCI GPIO expanders:
@@ -727,7 +794,14 @@ CONFIG_SSB_POSSIBLE=y
727# CONFIG_MFD_CORE is not set 794# CONFIG_MFD_CORE is not set
728# CONFIG_MFD_SM501 is not set 795# CONFIG_MFD_SM501 is not set
729# CONFIG_HTC_PASIC3 is not set 796# CONFIG_HTC_PASIC3 is not set
797# CONFIG_TPS65010 is not set
798# CONFIG_TWL4030_CORE is not set
730# CONFIG_MFD_TMIO is not set 799# CONFIG_MFD_TMIO is not set
800# CONFIG_PMIC_DA903X is not set
801# CONFIG_MFD_WM8400 is not set
802# CONFIG_MFD_WM8350_I2C is not set
803# CONFIG_MFD_PCF50633 is not set
804# CONFIG_AB3100_CORE is not set
731# CONFIG_REGULATOR is not set 805# CONFIG_REGULATOR is not set
732# CONFIG_MEDIA_SUPPORT is not set 806# CONFIG_MEDIA_SUPPORT is not set
733 807
diff --git a/arch/powerpc/configs/mpc85xx_defconfig b/arch/powerpc/configs/mpc85xx_defconfig
index ada595898af1..ee6acc6557f8 100644
--- a/arch/powerpc/configs/mpc85xx_defconfig
+++ b/arch/powerpc/configs/mpc85xx_defconfig
@@ -203,6 +203,7 @@ CONFIG_MPC85xx_CDS=y
203CONFIG_MPC85xx_MDS=y 203CONFIG_MPC85xx_MDS=y
204CONFIG_MPC8536_DS=y 204CONFIG_MPC8536_DS=y
205CONFIG_MPC85xx_DS=y 205CONFIG_MPC85xx_DS=y
206CONFIG_MPC85xx_RDB=y
206CONFIG_SOCRATES=y 207CONFIG_SOCRATES=y
207CONFIG_KSI8560=y 208CONFIG_KSI8560=y
208# CONFIG_XES_MPC85xx is not set 209# CONFIG_XES_MPC85xx is not set
diff --git a/arch/powerpc/include/asm/agp.h b/arch/powerpc/include/asm/agp.h
index 86455c4c31ee..416e12c2d505 100644
--- a/arch/powerpc/include/asm/agp.h
+++ b/arch/powerpc/include/asm/agp.h
@@ -8,10 +8,6 @@
8#define unmap_page_from_agp(page) 8#define unmap_page_from_agp(page)
9#define flush_agp_cache() mb() 9#define flush_agp_cache() mb()
10 10
11/* Convert a physical address to an address suitable for the GART. */
12#define phys_to_gart(x) (x)
13#define gart_to_phys(x) (x)
14
15/* GATT allocation. Returns/accepts GATT kernel virtual address. */ 11/* GATT allocation. Returns/accepts GATT kernel virtual address. */
16#define alloc_gatt_pages(order) \ 12#define alloc_gatt_pages(order) \
17 ((char *)__get_free_pages(GFP_KERNEL, (order))) 13 ((char *)__get_free_pages(GFP_KERNEL, (order)))
diff --git a/arch/powerpc/include/asm/bitops.h b/arch/powerpc/include/asm/bitops.h
index 897eade3afbe..56f2f2ea5631 100644
--- a/arch/powerpc/include/asm/bitops.h
+++ b/arch/powerpc/include/asm/bitops.h
@@ -56,174 +56,102 @@
56#define BITOP_WORD(nr) ((nr) / BITS_PER_LONG) 56#define BITOP_WORD(nr) ((nr) / BITS_PER_LONG)
57#define BITOP_LE_SWIZZLE ((BITS_PER_LONG-1) & ~0x7) 57#define BITOP_LE_SWIZZLE ((BITS_PER_LONG-1) & ~0x7)
58 58
59/* Macro for generating the ***_bits() functions */
60#define DEFINE_BITOP(fn, op, prefix, postfix) \
61static __inline__ void fn(unsigned long mask, \
62 volatile unsigned long *_p) \
63{ \
64 unsigned long old; \
65 unsigned long *p = (unsigned long *)_p; \
66 __asm__ __volatile__ ( \
67 prefix \
68"1:" PPC_LLARX "%0,0,%3\n" \
69 stringify_in_c(op) "%0,%0,%2\n" \
70 PPC405_ERR77(0,%3) \
71 PPC_STLCX "%0,0,%3\n" \
72 "bne- 1b\n" \
73 postfix \
74 : "=&r" (old), "+m" (*p) \
75 : "r" (mask), "r" (p) \
76 : "cc", "memory"); \
77}
78
79DEFINE_BITOP(set_bits, or, "", "")
80DEFINE_BITOP(clear_bits, andc, "", "")
81DEFINE_BITOP(clear_bits_unlock, andc, LWSYNC_ON_SMP, "")
82DEFINE_BITOP(change_bits, xor, "", "")
83
59static __inline__ void set_bit(int nr, volatile unsigned long *addr) 84static __inline__ void set_bit(int nr, volatile unsigned long *addr)
60{ 85{
61 unsigned long old; 86 set_bits(BITOP_MASK(nr), addr + BITOP_WORD(nr));
62 unsigned long mask = BITOP_MASK(nr);
63 unsigned long *p = ((unsigned long *)addr) + BITOP_WORD(nr);
64
65 __asm__ __volatile__(
66"1:" PPC_LLARX "%0,0,%3 # set_bit\n"
67 "or %0,%0,%2\n"
68 PPC405_ERR77(0,%3)
69 PPC_STLCX "%0,0,%3\n"
70 "bne- 1b"
71 : "=&r" (old), "+m" (*p)
72 : "r" (mask), "r" (p)
73 : "cc" );
74} 87}
75 88
76static __inline__ void clear_bit(int nr, volatile unsigned long *addr) 89static __inline__ void clear_bit(int nr, volatile unsigned long *addr)
77{ 90{
78 unsigned long old; 91 clear_bits(BITOP_MASK(nr), addr + BITOP_WORD(nr));
79 unsigned long mask = BITOP_MASK(nr);
80 unsigned long *p = ((unsigned long *)addr) + BITOP_WORD(nr);
81
82 __asm__ __volatile__(
83"1:" PPC_LLARX "%0,0,%3 # clear_bit\n"
84 "andc %0,%0,%2\n"
85 PPC405_ERR77(0,%3)
86 PPC_STLCX "%0,0,%3\n"
87 "bne- 1b"
88 : "=&r" (old), "+m" (*p)
89 : "r" (mask), "r" (p)
90 : "cc" );
91} 92}
92 93
93static __inline__ void clear_bit_unlock(int nr, volatile unsigned long *addr) 94static __inline__ void clear_bit_unlock(int nr, volatile unsigned long *addr)
94{ 95{
95 unsigned long old; 96 clear_bits_unlock(BITOP_MASK(nr), addr + BITOP_WORD(nr));
96 unsigned long mask = BITOP_MASK(nr);
97 unsigned long *p = ((unsigned long *)addr) + BITOP_WORD(nr);
98
99 __asm__ __volatile__(
100 LWSYNC_ON_SMP
101"1:" PPC_LLARX "%0,0,%3 # clear_bit_unlock\n"
102 "andc %0,%0,%2\n"
103 PPC405_ERR77(0,%3)
104 PPC_STLCX "%0,0,%3\n"
105 "bne- 1b"
106 : "=&r" (old), "+m" (*p)
107 : "r" (mask), "r" (p)
108 : "cc", "memory");
109} 97}
110 98
111static __inline__ void change_bit(int nr, volatile unsigned long *addr) 99static __inline__ void change_bit(int nr, volatile unsigned long *addr)
112{ 100{
113 unsigned long old; 101 change_bits(BITOP_MASK(nr), addr + BITOP_WORD(nr));
114 unsigned long mask = BITOP_MASK(nr); 102}
115 unsigned long *p = ((unsigned long *)addr) + BITOP_WORD(nr); 103
116 104/* Like DEFINE_BITOP(), with changes to the arguments to 'op' and the output
117 __asm__ __volatile__( 105 * operands. */
118"1:" PPC_LLARX "%0,0,%3 # change_bit\n" 106#define DEFINE_TESTOP(fn, op, prefix, postfix) \
119 "xor %0,%0,%2\n" 107static __inline__ unsigned long fn( \
120 PPC405_ERR77(0,%3) 108 unsigned long mask, \
121 PPC_STLCX "%0,0,%3\n" 109 volatile unsigned long *_p) \
122 "bne- 1b" 110{ \
123 : "=&r" (old), "+m" (*p) 111 unsigned long old, t; \
124 : "r" (mask), "r" (p) 112 unsigned long *p = (unsigned long *)_p; \
125 : "cc" ); 113 __asm__ __volatile__ ( \
114 prefix \
115"1:" PPC_LLARX "%0,0,%3\n" \
116 stringify_in_c(op) "%1,%0,%2\n" \
117 PPC405_ERR77(0,%3) \
118 PPC_STLCX "%1,0,%3\n" \
119 "bne- 1b\n" \
120 postfix \
121 : "=&r" (old), "=&r" (t) \
122 : "r" (mask), "r" (p) \
123 : "cc", "memory"); \
124 return (old & mask); \
126} 125}
127 126
127DEFINE_TESTOP(test_and_set_bits, or, LWSYNC_ON_SMP, ISYNC_ON_SMP)
128DEFINE_TESTOP(test_and_set_bits_lock, or, "", ISYNC_ON_SMP)
129DEFINE_TESTOP(test_and_clear_bits, andc, LWSYNC_ON_SMP, ISYNC_ON_SMP)
130DEFINE_TESTOP(test_and_change_bits, xor, LWSYNC_ON_SMP, ISYNC_ON_SMP)
131
128static __inline__ int test_and_set_bit(unsigned long nr, 132static __inline__ int test_and_set_bit(unsigned long nr,
129 volatile unsigned long *addr) 133 volatile unsigned long *addr)
130{ 134{
131 unsigned long old, t; 135 return test_and_set_bits(BITOP_MASK(nr), addr + BITOP_WORD(nr)) != 0;
132 unsigned long mask = BITOP_MASK(nr);
133 unsigned long *p = ((unsigned long *)addr) + BITOP_WORD(nr);
134
135 __asm__ __volatile__(
136 LWSYNC_ON_SMP
137"1:" PPC_LLARX "%0,0,%3 # test_and_set_bit\n"
138 "or %1,%0,%2 \n"
139 PPC405_ERR77(0,%3)
140 PPC_STLCX "%1,0,%3 \n"
141 "bne- 1b"
142 ISYNC_ON_SMP
143 : "=&r" (old), "=&r" (t)
144 : "r" (mask), "r" (p)
145 : "cc", "memory");
146
147 return (old & mask) != 0;
148} 136}
149 137
150static __inline__ int test_and_set_bit_lock(unsigned long nr, 138static __inline__ int test_and_set_bit_lock(unsigned long nr,
151 volatile unsigned long *addr) 139 volatile unsigned long *addr)
152{ 140{
153 unsigned long old, t; 141 return test_and_set_bits_lock(BITOP_MASK(nr),
154 unsigned long mask = BITOP_MASK(nr); 142 addr + BITOP_WORD(nr)) != 0;
155 unsigned long *p = ((unsigned long *)addr) + BITOP_WORD(nr);
156
157 __asm__ __volatile__(
158"1:" PPC_LLARX "%0,0,%3 # test_and_set_bit_lock\n"
159 "or %1,%0,%2 \n"
160 PPC405_ERR77(0,%3)
161 PPC_STLCX "%1,0,%3 \n"
162 "bne- 1b"
163 ISYNC_ON_SMP
164 : "=&r" (old), "=&r" (t)
165 : "r" (mask), "r" (p)
166 : "cc", "memory");
167
168 return (old & mask) != 0;
169} 143}
170 144
171static __inline__ int test_and_clear_bit(unsigned long nr, 145static __inline__ int test_and_clear_bit(unsigned long nr,
172 volatile unsigned long *addr) 146 volatile unsigned long *addr)
173{ 147{
174 unsigned long old, t; 148 return test_and_clear_bits(BITOP_MASK(nr), addr + BITOP_WORD(nr)) != 0;
175 unsigned long mask = BITOP_MASK(nr);
176 unsigned long *p = ((unsigned long *)addr) + BITOP_WORD(nr);
177
178 __asm__ __volatile__(
179 LWSYNC_ON_SMP
180"1:" PPC_LLARX "%0,0,%3 # test_and_clear_bit\n"
181 "andc %1,%0,%2 \n"
182 PPC405_ERR77(0,%3)
183 PPC_STLCX "%1,0,%3 \n"
184 "bne- 1b"
185 ISYNC_ON_SMP
186 : "=&r" (old), "=&r" (t)
187 : "r" (mask), "r" (p)
188 : "cc", "memory");
189
190 return (old & mask) != 0;
191} 149}
192 150
193static __inline__ int test_and_change_bit(unsigned long nr, 151static __inline__ int test_and_change_bit(unsigned long nr,
194 volatile unsigned long *addr) 152 volatile unsigned long *addr)
195{ 153{
196 unsigned long old, t; 154 return test_and_change_bits(BITOP_MASK(nr), addr + BITOP_WORD(nr)) != 0;
197 unsigned long mask = BITOP_MASK(nr);
198 unsigned long *p = ((unsigned long *)addr) + BITOP_WORD(nr);
199
200 __asm__ __volatile__(
201 LWSYNC_ON_SMP
202"1:" PPC_LLARX "%0,0,%3 # test_and_change_bit\n"
203 "xor %1,%0,%2 \n"
204 PPC405_ERR77(0,%3)
205 PPC_STLCX "%1,0,%3 \n"
206 "bne- 1b"
207 ISYNC_ON_SMP
208 : "=&r" (old), "=&r" (t)
209 : "r" (mask), "r" (p)
210 : "cc", "memory");
211
212 return (old & mask) != 0;
213}
214
215static __inline__ void set_bits(unsigned long mask, unsigned long *addr)
216{
217 unsigned long old;
218
219 __asm__ __volatile__(
220"1:" PPC_LLARX "%0,0,%3 # set_bits\n"
221 "or %0,%0,%2\n"
222 PPC_STLCX "%0,0,%3\n"
223 "bne- 1b"
224 : "=&r" (old), "+m" (*addr)
225 : "r" (mask), "r" (addr)
226 : "cc");
227} 155}
228 156
229#include <asm-generic/bitops/non-atomic.h> 157#include <asm-generic/bitops/non-atomic.h>
diff --git a/arch/powerpc/include/asm/cell-regs.h b/arch/powerpc/include/asm/cell-regs.h
index fd6fd00434ef..fdf64fd25950 100644
--- a/arch/powerpc/include/asm/cell-regs.h
+++ b/arch/powerpc/include/asm/cell-regs.h
@@ -303,6 +303,17 @@ struct cbe_mic_tm_regs {
303extern struct cbe_mic_tm_regs __iomem *cbe_get_mic_tm_regs(struct device_node *np); 303extern struct cbe_mic_tm_regs __iomem *cbe_get_mic_tm_regs(struct device_node *np);
304extern struct cbe_mic_tm_regs __iomem *cbe_get_cpu_mic_tm_regs(int cpu); 304extern struct cbe_mic_tm_regs __iomem *cbe_get_cpu_mic_tm_regs(int cpu);
305 305
306
307/* Cell page table entries */
308#define CBE_IOPTE_PP_W 0x8000000000000000ul /* protection: write */
309#define CBE_IOPTE_PP_R 0x4000000000000000ul /* protection: read */
310#define CBE_IOPTE_M 0x2000000000000000ul /* coherency required */
311#define CBE_IOPTE_SO_R 0x1000000000000000ul /* ordering: writes */
312#define CBE_IOPTE_SO_RW 0x1800000000000000ul /* ordering: r & w */
313#define CBE_IOPTE_RPN_Mask 0x07fffffffffff000ul /* RPN */
314#define CBE_IOPTE_H 0x0000000000000800ul /* cache hint */
315#define CBE_IOPTE_IOID_Mask 0x00000000000007fful /* ioid */
316
306/* some utility functions to deal with SMT */ 317/* some utility functions to deal with SMT */
307extern u32 cbe_get_hw_thread_id(int cpu); 318extern u32 cbe_get_hw_thread_id(int cpu);
308extern u32 cbe_cpu_to_node(int cpu); 319extern u32 cbe_cpu_to_node(int cpu);
diff --git a/arch/powerpc/include/asm/cputhreads.h b/arch/powerpc/include/asm/cputhreads.h
index fb11b0c459b8..a8e18447c62b 100644
--- a/arch/powerpc/include/asm/cputhreads.h
+++ b/arch/powerpc/include/asm/cputhreads.h
@@ -5,6 +5,15 @@
5 5
6/* 6/*
7 * Mapping of threads to cores 7 * Mapping of threads to cores
8 *
9 * Note: This implementation is limited to a power of 2 number of
10 * threads per core and the same number for each core in the system
11 * (though it would work if some processors had less threads as long
12 * as the CPU numbers are still allocated, just not brought offline).
13 *
14 * However, the API allows for a different implementation in the future
15 * if needed, as long as you only use the functions and not the variables
16 * directly.
8 */ 17 */
9 18
10#ifdef CONFIG_SMP 19#ifdef CONFIG_SMP
@@ -67,5 +76,12 @@ static inline int cpu_first_thread_in_core(int cpu)
67 return cpu & ~(threads_per_core - 1); 76 return cpu & ~(threads_per_core - 1);
68} 77}
69 78
79static inline int cpu_last_thread_in_core(int cpu)
80{
81 return cpu | (threads_per_core - 1);
82}
83
84
85
70#endif /* _ASM_POWERPC_CPUTHREADS_H */ 86#endif /* _ASM_POWERPC_CPUTHREADS_H */
71 87
diff --git a/arch/powerpc/include/asm/device.h b/arch/powerpc/include/asm/device.h
index e3e06e0f7fc0..9dade15d1ab4 100644
--- a/arch/powerpc/include/asm/device.h
+++ b/arch/powerpc/include/asm/device.h
@@ -6,7 +6,7 @@
6#ifndef _ASM_POWERPC_DEVICE_H 6#ifndef _ASM_POWERPC_DEVICE_H
7#define _ASM_POWERPC_DEVICE_H 7#define _ASM_POWERPC_DEVICE_H
8 8
9struct dma_mapping_ops; 9struct dma_map_ops;
10struct device_node; 10struct device_node;
11 11
12struct dev_archdata { 12struct dev_archdata {
@@ -14,8 +14,11 @@ struct dev_archdata {
14 struct device_node *of_node; 14 struct device_node *of_node;
15 15
16 /* DMA operations on that device */ 16 /* DMA operations on that device */
17 struct dma_mapping_ops *dma_ops; 17 struct dma_map_ops *dma_ops;
18 void *dma_data; 18 void *dma_data;
19#ifdef CONFIG_SWIOTLB
20 dma_addr_t max_direct_dma_addr;
21#endif
19}; 22};
20 23
21static inline void dev_archdata_set_node(struct dev_archdata *ad, 24static inline void dev_archdata_set_node(struct dev_archdata *ad,
diff --git a/arch/powerpc/include/asm/dma-mapping.h b/arch/powerpc/include/asm/dma-mapping.h
index 0c34371ec49c..cb2ca41dd526 100644
--- a/arch/powerpc/include/asm/dma-mapping.h
+++ b/arch/powerpc/include/asm/dma-mapping.h
@@ -14,6 +14,7 @@
14#include <linux/mm.h> 14#include <linux/mm.h>
15#include <linux/scatterlist.h> 15#include <linux/scatterlist.h>
16#include <linux/dma-attrs.h> 16#include <linux/dma-attrs.h>
17#include <linux/dma-debug.h>
17#include <asm/io.h> 18#include <asm/io.h>
18#include <asm/swiotlb.h> 19#include <asm/swiotlb.h>
19 20
@@ -64,58 +65,14 @@ static inline unsigned long device_to_mask(struct device *dev)
64} 65}
65 66
66/* 67/*
67 * DMA operations are abstracted for G5 vs. i/pSeries, PCI vs. VIO
68 */
69struct dma_mapping_ops {
70 void * (*alloc_coherent)(struct device *dev, size_t size,
71 dma_addr_t *dma_handle, gfp_t flag);
72 void (*free_coherent)(struct device *dev, size_t size,
73 void *vaddr, dma_addr_t dma_handle);
74 int (*map_sg)(struct device *dev, struct scatterlist *sg,
75 int nents, enum dma_data_direction direction,
76 struct dma_attrs *attrs);
77 void (*unmap_sg)(struct device *dev, struct scatterlist *sg,
78 int nents, enum dma_data_direction direction,
79 struct dma_attrs *attrs);
80 int (*dma_supported)(struct device *dev, u64 mask);
81 int (*set_dma_mask)(struct device *dev, u64 dma_mask);
82 dma_addr_t (*map_page)(struct device *dev, struct page *page,
83 unsigned long offset, size_t size,
84 enum dma_data_direction direction,
85 struct dma_attrs *attrs);
86 void (*unmap_page)(struct device *dev,
87 dma_addr_t dma_address, size_t size,
88 enum dma_data_direction direction,
89 struct dma_attrs *attrs);
90 int (*addr_needs_map)(struct device *dev, dma_addr_t addr,
91 size_t size);
92#ifdef CONFIG_PPC_NEED_DMA_SYNC_OPS
93 void (*sync_single_range_for_cpu)(struct device *hwdev,
94 dma_addr_t dma_handle, unsigned long offset,
95 size_t size,
96 enum dma_data_direction direction);
97 void (*sync_single_range_for_device)(struct device *hwdev,
98 dma_addr_t dma_handle, unsigned long offset,
99 size_t size,
100 enum dma_data_direction direction);
101 void (*sync_sg_for_cpu)(struct device *hwdev,
102 struct scatterlist *sg, int nelems,
103 enum dma_data_direction direction);
104 void (*sync_sg_for_device)(struct device *hwdev,
105 struct scatterlist *sg, int nelems,
106 enum dma_data_direction direction);
107#endif
108};
109
110/*
111 * Available generic sets of operations 68 * Available generic sets of operations
112 */ 69 */
113#ifdef CONFIG_PPC64 70#ifdef CONFIG_PPC64
114extern struct dma_mapping_ops dma_iommu_ops; 71extern struct dma_map_ops dma_iommu_ops;
115#endif 72#endif
116extern struct dma_mapping_ops dma_direct_ops; 73extern struct dma_map_ops dma_direct_ops;
117 74
118static inline struct dma_mapping_ops *get_dma_ops(struct device *dev) 75static inline struct dma_map_ops *get_dma_ops(struct device *dev)
119{ 76{
120 /* We don't handle the NULL dev case for ISA for now. We could 77 /* We don't handle the NULL dev case for ISA for now. We could
121 * do it via an out of line call but it is not needed for now. The 78 * do it via an out of line call but it is not needed for now. The
@@ -128,14 +85,19 @@ static inline struct dma_mapping_ops *get_dma_ops(struct device *dev)
128 return dev->archdata.dma_ops; 85 return dev->archdata.dma_ops;
129} 86}
130 87
131static inline void set_dma_ops(struct device *dev, struct dma_mapping_ops *ops) 88static inline void set_dma_ops(struct device *dev, struct dma_map_ops *ops)
132{ 89{
133 dev->archdata.dma_ops = ops; 90 dev->archdata.dma_ops = ops;
134} 91}
135 92
93/* this will be removed soon */
94#define flush_write_buffers()
95
96#include <asm-generic/dma-mapping-common.h>
97
136static inline int dma_supported(struct device *dev, u64 mask) 98static inline int dma_supported(struct device *dev, u64 mask)
137{ 99{
138 struct dma_mapping_ops *dma_ops = get_dma_ops(dev); 100 struct dma_map_ops *dma_ops = get_dma_ops(dev);
139 101
140 if (unlikely(dma_ops == NULL)) 102 if (unlikely(dma_ops == NULL))
141 return 0; 103 return 0;
@@ -149,7 +111,7 @@ static inline int dma_supported(struct device *dev, u64 mask)
149 111
150static inline int dma_set_mask(struct device *dev, u64 dma_mask) 112static inline int dma_set_mask(struct device *dev, u64 dma_mask)
151{ 113{
152 struct dma_mapping_ops *dma_ops = get_dma_ops(dev); 114 struct dma_map_ops *dma_ops = get_dma_ops(dev);
153 115
154 if (unlikely(dma_ops == NULL)) 116 if (unlikely(dma_ops == NULL))
155 return -EIO; 117 return -EIO;
@@ -161,262 +123,40 @@ static inline int dma_set_mask(struct device *dev, u64 dma_mask)
161 return 0; 123 return 0;
162} 124}
163 125
164/*
165 * map_/unmap_single actually call through to map/unmap_page now that all the
166 * dma_mapping_ops have been converted over. We just have to get the page and
167 * offset to pass through to map_page
168 */
169static inline dma_addr_t dma_map_single_attrs(struct device *dev,
170 void *cpu_addr,
171 size_t size,
172 enum dma_data_direction direction,
173 struct dma_attrs *attrs)
174{
175 struct dma_mapping_ops *dma_ops = get_dma_ops(dev);
176
177 BUG_ON(!dma_ops);
178
179 return dma_ops->map_page(dev, virt_to_page(cpu_addr),
180 (unsigned long)cpu_addr % PAGE_SIZE, size,
181 direction, attrs);
182}
183
184static inline void dma_unmap_single_attrs(struct device *dev,
185 dma_addr_t dma_addr,
186 size_t size,
187 enum dma_data_direction direction,
188 struct dma_attrs *attrs)
189{
190 struct dma_mapping_ops *dma_ops = get_dma_ops(dev);
191
192 BUG_ON(!dma_ops);
193
194 dma_ops->unmap_page(dev, dma_addr, size, direction, attrs);
195}
196
197static inline dma_addr_t dma_map_page_attrs(struct device *dev,
198 struct page *page,
199 unsigned long offset, size_t size,
200 enum dma_data_direction direction,
201 struct dma_attrs *attrs)
202{
203 struct dma_mapping_ops *dma_ops = get_dma_ops(dev);
204
205 BUG_ON(!dma_ops);
206
207 return dma_ops->map_page(dev, page, offset, size, direction, attrs);
208}
209
210static inline void dma_unmap_page_attrs(struct device *dev,
211 dma_addr_t dma_address,
212 size_t size,
213 enum dma_data_direction direction,
214 struct dma_attrs *attrs)
215{
216 struct dma_mapping_ops *dma_ops = get_dma_ops(dev);
217
218 BUG_ON(!dma_ops);
219
220 dma_ops->unmap_page(dev, dma_address, size, direction, attrs);
221}
222
223static inline int dma_map_sg_attrs(struct device *dev, struct scatterlist *sg,
224 int nents, enum dma_data_direction direction,
225 struct dma_attrs *attrs)
226{
227 struct dma_mapping_ops *dma_ops = get_dma_ops(dev);
228
229 BUG_ON(!dma_ops);
230 return dma_ops->map_sg(dev, sg, nents, direction, attrs);
231}
232
233static inline void dma_unmap_sg_attrs(struct device *dev,
234 struct scatterlist *sg,
235 int nhwentries,
236 enum dma_data_direction direction,
237 struct dma_attrs *attrs)
238{
239 struct dma_mapping_ops *dma_ops = get_dma_ops(dev);
240
241 BUG_ON(!dma_ops);
242 dma_ops->unmap_sg(dev, sg, nhwentries, direction, attrs);
243}
244
245static inline void *dma_alloc_coherent(struct device *dev, size_t size, 126static inline void *dma_alloc_coherent(struct device *dev, size_t size,
246 dma_addr_t *dma_handle, gfp_t flag) 127 dma_addr_t *dma_handle, gfp_t flag)
247{ 128{
248 struct dma_mapping_ops *dma_ops = get_dma_ops(dev); 129 struct dma_map_ops *dma_ops = get_dma_ops(dev);
249 130 void *cpu_addr;
250 BUG_ON(!dma_ops);
251 return dma_ops->alloc_coherent(dev, size, dma_handle, flag);
252}
253
254static inline void dma_free_coherent(struct device *dev, size_t size,
255 void *cpu_addr, dma_addr_t dma_handle)
256{
257 struct dma_mapping_ops *dma_ops = get_dma_ops(dev);
258
259 BUG_ON(!dma_ops);
260 dma_ops->free_coherent(dev, size, cpu_addr, dma_handle);
261}
262
263static inline dma_addr_t dma_map_single(struct device *dev, void *cpu_addr,
264 size_t size,
265 enum dma_data_direction direction)
266{
267 return dma_map_single_attrs(dev, cpu_addr, size, direction, NULL);
268}
269
270static inline void dma_unmap_single(struct device *dev, dma_addr_t dma_addr,
271 size_t size,
272 enum dma_data_direction direction)
273{
274 dma_unmap_single_attrs(dev, dma_addr, size, direction, NULL);
275}
276
277static inline dma_addr_t dma_map_page(struct device *dev, struct page *page,
278 unsigned long offset, size_t size,
279 enum dma_data_direction direction)
280{
281 return dma_map_page_attrs(dev, page, offset, size, direction, NULL);
282}
283
284static inline void dma_unmap_page(struct device *dev, dma_addr_t dma_address,
285 size_t size,
286 enum dma_data_direction direction)
287{
288 dma_unmap_page_attrs(dev, dma_address, size, direction, NULL);
289}
290
291static inline int dma_map_sg(struct device *dev, struct scatterlist *sg,
292 int nents, enum dma_data_direction direction)
293{
294 return dma_map_sg_attrs(dev, sg, nents, direction, NULL);
295}
296
297static inline void dma_unmap_sg(struct device *dev, struct scatterlist *sg,
298 int nhwentries,
299 enum dma_data_direction direction)
300{
301 dma_unmap_sg_attrs(dev, sg, nhwentries, direction, NULL);
302}
303
304#ifdef CONFIG_PPC_NEED_DMA_SYNC_OPS
305static inline void dma_sync_single_for_cpu(struct device *dev,
306 dma_addr_t dma_handle, size_t size,
307 enum dma_data_direction direction)
308{
309 struct dma_mapping_ops *dma_ops = get_dma_ops(dev);
310
311 BUG_ON(!dma_ops);
312
313 if (dma_ops->sync_single_range_for_cpu)
314 dma_ops->sync_single_range_for_cpu(dev, dma_handle, 0,
315 size, direction);
316}
317
318static inline void dma_sync_single_for_device(struct device *dev,
319 dma_addr_t dma_handle, size_t size,
320 enum dma_data_direction direction)
321{
322 struct dma_mapping_ops *dma_ops = get_dma_ops(dev);
323
324 BUG_ON(!dma_ops);
325
326 if (dma_ops->sync_single_range_for_device)
327 dma_ops->sync_single_range_for_device(dev, dma_handle,
328 0, size, direction);
329}
330
331static inline void dma_sync_sg_for_cpu(struct device *dev,
332 struct scatterlist *sgl, int nents,
333 enum dma_data_direction direction)
334{
335 struct dma_mapping_ops *dma_ops = get_dma_ops(dev);
336 131
337 BUG_ON(!dma_ops); 132 BUG_ON(!dma_ops);
338 133
339 if (dma_ops->sync_sg_for_cpu) 134 cpu_addr = dma_ops->alloc_coherent(dev, size, dma_handle, flag);
340 dma_ops->sync_sg_for_cpu(dev, sgl, nents, direction);
341}
342
343static inline void dma_sync_sg_for_device(struct device *dev,
344 struct scatterlist *sgl, int nents,
345 enum dma_data_direction direction)
346{
347 struct dma_mapping_ops *dma_ops = get_dma_ops(dev);
348
349 BUG_ON(!dma_ops);
350
351 if (dma_ops->sync_sg_for_device)
352 dma_ops->sync_sg_for_device(dev, sgl, nents, direction);
353}
354
355static inline void dma_sync_single_range_for_cpu(struct device *dev,
356 dma_addr_t dma_handle, unsigned long offset, size_t size,
357 enum dma_data_direction direction)
358{
359 struct dma_mapping_ops *dma_ops = get_dma_ops(dev);
360 135
361 BUG_ON(!dma_ops); 136 debug_dma_alloc_coherent(dev, size, *dma_handle, cpu_addr);
362 137
363 if (dma_ops->sync_single_range_for_cpu) 138 return cpu_addr;
364 dma_ops->sync_single_range_for_cpu(dev, dma_handle,
365 offset, size, direction);
366} 139}
367 140
368static inline void dma_sync_single_range_for_device(struct device *dev, 141static inline void dma_free_coherent(struct device *dev, size_t size,
369 dma_addr_t dma_handle, unsigned long offset, size_t size, 142 void *cpu_addr, dma_addr_t dma_handle)
370 enum dma_data_direction direction)
371{ 143{
372 struct dma_mapping_ops *dma_ops = get_dma_ops(dev); 144 struct dma_map_ops *dma_ops = get_dma_ops(dev);
373 145
374 BUG_ON(!dma_ops); 146 BUG_ON(!dma_ops);
375 147
376 if (dma_ops->sync_single_range_for_device) 148 debug_dma_free_coherent(dev, size, cpu_addr, dma_handle);
377 dma_ops->sync_single_range_for_device(dev, dma_handle, offset,
378 size, direction);
379}
380#else /* CONFIG_PPC_NEED_DMA_SYNC_OPS */
381static inline void dma_sync_single_for_cpu(struct device *dev,
382 dma_addr_t dma_handle, size_t size,
383 enum dma_data_direction direction)
384{
385}
386
387static inline void dma_sync_single_for_device(struct device *dev,
388 dma_addr_t dma_handle, size_t size,
389 enum dma_data_direction direction)
390{
391}
392
393static inline void dma_sync_sg_for_cpu(struct device *dev,
394 struct scatterlist *sgl, int nents,
395 enum dma_data_direction direction)
396{
397}
398 149
399static inline void dma_sync_sg_for_device(struct device *dev, 150 dma_ops->free_coherent(dev, size, cpu_addr, dma_handle);
400 struct scatterlist *sgl, int nents,
401 enum dma_data_direction direction)
402{
403} 151}
404 152
405static inline void dma_sync_single_range_for_cpu(struct device *dev, 153static inline int dma_mapping_error(struct device *dev, dma_addr_t dma_addr)
406 dma_addr_t dma_handle, unsigned long offset, size_t size,
407 enum dma_data_direction direction)
408{ 154{
409} 155 struct dma_map_ops *dma_ops = get_dma_ops(dev);
410 156
411static inline void dma_sync_single_range_for_device(struct device *dev, 157 if (dma_ops->mapping_error)
412 dma_addr_t dma_handle, unsigned long offset, size_t size, 158 return dma_ops->mapping_error(dev, dma_addr);
413 enum dma_data_direction direction)
414{
415}
416#endif
417 159
418static inline int dma_mapping_error(struct device *dev, dma_addr_t dma_addr)
419{
420#ifdef CONFIG_PPC64 160#ifdef CONFIG_PPC64
421 return (dma_addr == DMA_ERROR_CODE); 161 return (dma_addr == DMA_ERROR_CODE);
422#else 162#else
@@ -426,10 +166,12 @@ static inline int dma_mapping_error(struct device *dev, dma_addr_t dma_addr)
426 166
427static inline bool dma_capable(struct device *dev, dma_addr_t addr, size_t size) 167static inline bool dma_capable(struct device *dev, dma_addr_t addr, size_t size)
428{ 168{
429 struct dma_mapping_ops *ops = get_dma_ops(dev); 169#ifdef CONFIG_SWIOTLB
170 struct dev_archdata *sd = &dev->archdata;
430 171
431 if (ops->addr_needs_map && ops->addr_needs_map(dev, addr, size)) 172 if (sd->max_direct_dma_addr && addr + size > sd->max_direct_dma_addr)
432 return 0; 173 return 0;
174#endif
433 175
434 if (!dev->dma_mask) 176 if (!dev->dma_mask)
435 return 0; 177 return 0;
diff --git a/arch/powerpc/include/asm/exception-64e.h b/arch/powerpc/include/asm/exception-64e.h
new file mode 100644
index 000000000000..6d53f311d942
--- /dev/null
+++ b/arch/powerpc/include/asm/exception-64e.h
@@ -0,0 +1,205 @@
1/*
2 * Definitions for use by exception code on Book3-E
3 *
4 * Copyright (C) 2008 Ben. Herrenschmidt (benh@kernel.crashing.org), IBM Corp.
5 *
6 * This program is free software; you can redistribute it and/or
7 * modify it under the terms of the GNU General Public License
8 * as published by the Free Software Foundation; either version
9 * 2 of the License, or (at your option) any later version.
10 */
11#ifndef _ASM_POWERPC_EXCEPTION_64E_H
12#define _ASM_POWERPC_EXCEPTION_64E_H
13
14/*
15 * SPRGs usage an other considerations...
16 *
17 * Since TLB miss and other standard exceptions can be interrupted by
18 * critical exceptions which can themselves be interrupted by machine
19 * checks, and since the two later can themselves cause a TLB miss when
20 * hitting the linear mapping for the kernel stacks, we need to be a bit
21 * creative on how we use SPRGs.
22 *
23 * The base idea is that we have one SRPG reserved for critical and one
24 * for machine check interrupts. Those are used to save a GPR that can
25 * then be used to get the PACA, and store as much context as we need
26 * to save in there. That includes saving the SPRGs used by the TLB miss
27 * handler for linear mapping misses and the associated SRR0/1 due to
28 * the above re-entrancy issue.
29 *
30 * So here's the current usage pattern. It's done regardless of which
31 * SPRGs are user-readable though, thus we might have to change some of
32 * this later. In order to do that more easily, we use special constants
33 * for naming them
34 *
35 * WARNING: Some of these SPRGs are user readable. We need to do something
36 * about it as some point by making sure they can't be used to leak kernel
37 * critical data
38 */
39
40
41/* We are out of SPRGs so we save some things in the PACA. The normal
42 * exception frame is smaller than the CRIT or MC one though
43 */
44#define EX_R1 (0 * 8)
45#define EX_CR (1 * 8)
46#define EX_R10 (2 * 8)
47#define EX_R11 (3 * 8)
48#define EX_R14 (4 * 8)
49#define EX_R15 (5 * 8)
50
51/* The TLB miss exception uses different slots */
52
53#define EX_TLB_R10 ( 0 * 8)
54#define EX_TLB_R11 ( 1 * 8)
55#define EX_TLB_R12 ( 2 * 8)
56#define EX_TLB_R13 ( 3 * 8)
57#define EX_TLB_R14 ( 4 * 8)
58#define EX_TLB_R15 ( 5 * 8)
59#define EX_TLB_R16 ( 6 * 8)
60#define EX_TLB_CR ( 7 * 8)
61#define EX_TLB_DEAR ( 8 * 8) /* Level 0 and 2 only */
62#define EX_TLB_ESR ( 9 * 8) /* Level 0 and 2 only */
63#define EX_TLB_SRR0 (10 * 8)
64#define EX_TLB_SRR1 (11 * 8)
65#define EX_TLB_MMUCR0 (12 * 8) /* Level 0 */
66#define EX_TLB_MAS1 (12 * 8) /* Level 0 */
67#define EX_TLB_MAS2 (13 * 8) /* Level 0 */
68#ifdef CONFIG_BOOK3E_MMU_TLB_STATS
69#define EX_TLB_R8 (14 * 8)
70#define EX_TLB_R9 (15 * 8)
71#define EX_TLB_LR (16 * 8)
72#define EX_TLB_SIZE (17 * 8)
73#else
74#define EX_TLB_SIZE (14 * 8)
75#endif
76
77#define START_EXCEPTION(label) \
78 .globl exc_##label##_book3e; \
79exc_##label##_book3e:
80
81/* TLB miss exception prolog
82 *
83 * This prolog handles re-entrancy (up to 3 levels supported in the PACA
84 * though we currently don't test for overflow). It provides you with a
85 * re-entrancy safe working space of r10...r16 and CR with r12 being used
86 * as the exception area pointer in the PACA for that level of re-entrancy
87 * and r13 containing the PACA pointer.
88 *
89 * SRR0 and SRR1 are saved, but DEAR and ESR are not, since they don't apply
90 * as-is for instruction exceptions. It's up to the actual exception code
91 * to save them as well if required.
92 */
93#define TLB_MISS_PROLOG \
94 mtspr SPRN_SPRG_TLB_SCRATCH,r12; \
95 mfspr r12,SPRN_SPRG_TLB_EXFRAME; \
96 std r10,EX_TLB_R10(r12); \
97 mfcr r10; \
98 std r11,EX_TLB_R11(r12); \
99 mfspr r11,SPRN_SPRG_TLB_SCRATCH; \
100 std r13,EX_TLB_R13(r12); \
101 mfspr r13,SPRN_SPRG_PACA; \
102 std r14,EX_TLB_R14(r12); \
103 addi r14,r12,EX_TLB_SIZE; \
104 std r15,EX_TLB_R15(r12); \
105 mfspr r15,SPRN_SRR1; \
106 std r16,EX_TLB_R16(r12); \
107 mfspr r16,SPRN_SRR0; \
108 std r10,EX_TLB_CR(r12); \
109 std r11,EX_TLB_R12(r12); \
110 mtspr SPRN_SPRG_TLB_EXFRAME,r14; \
111 std r15,EX_TLB_SRR1(r12); \
112 std r16,EX_TLB_SRR0(r12); \
113 TLB_MISS_PROLOG_STATS
114
115/* And these are the matching epilogs that restores things
116 *
117 * There are 3 epilogs:
118 *
119 * - SUCCESS : Unwinds one level
120 * - ERROR : restore from level 0 and reset
121 * - ERROR_SPECIAL : restore from current level and reset
122 *
123 * Normal errors use ERROR, that is, they restore the initial fault context
124 * and trigger a fault. However, there is a special case for linear mapping
125 * errors. Those should basically never happen, but if they do happen, we
126 * want the error to point out the context that did that linear mapping
127 * fault, not the initial level 0 (basically, we got a bogus PGF or something
128 * like that). For userland errors on the linear mapping, there is no
129 * difference since those are always level 0 anyway
130 */
131
132#define TLB_MISS_RESTORE(freg) \
133 ld r14,EX_TLB_CR(r12); \
134 ld r10,EX_TLB_R10(r12); \
135 ld r15,EX_TLB_SRR0(r12); \
136 ld r16,EX_TLB_SRR1(r12); \
137 mtspr SPRN_SPRG_TLB_EXFRAME,freg; \
138 ld r11,EX_TLB_R11(r12); \
139 mtcr r14; \
140 ld r13,EX_TLB_R13(r12); \
141 ld r14,EX_TLB_R14(r12); \
142 mtspr SPRN_SRR0,r15; \
143 ld r15,EX_TLB_R15(r12); \
144 mtspr SPRN_SRR1,r16; \
145 TLB_MISS_RESTORE_STATS \
146 ld r16,EX_TLB_R16(r12); \
147 ld r12,EX_TLB_R12(r12); \
148
149#define TLB_MISS_EPILOG_SUCCESS \
150 TLB_MISS_RESTORE(r12)
151
152#define TLB_MISS_EPILOG_ERROR \
153 addi r12,r13,PACA_EXTLB; \
154 TLB_MISS_RESTORE(r12)
155
156#define TLB_MISS_EPILOG_ERROR_SPECIAL \
157 addi r11,r13,PACA_EXTLB; \
158 TLB_MISS_RESTORE(r11)
159
160#ifdef CONFIG_BOOK3E_MMU_TLB_STATS
161#define TLB_MISS_PROLOG_STATS \
162 mflr r10; \
163 std r8,EX_TLB_R8(r12); \
164 std r9,EX_TLB_R9(r12); \
165 std r10,EX_TLB_LR(r12);
166#define TLB_MISS_RESTORE_STATS \
167 ld r16,EX_TLB_LR(r12); \
168 ld r9,EX_TLB_R9(r12); \
169 ld r8,EX_TLB_R8(r12); \
170 mtlr r16;
171#define TLB_MISS_STATS_D(name) \
172 addi r9,r13,MMSTAT_DSTATS+name; \
173 bl .tlb_stat_inc;
174#define TLB_MISS_STATS_I(name) \
175 addi r9,r13,MMSTAT_ISTATS+name; \
176 bl .tlb_stat_inc;
177#define TLB_MISS_STATS_X(name) \
178 ld r8,PACA_EXTLB+EX_TLB_ESR(r13); \
179 cmpdi cr2,r8,-1; \
180 beq cr2,61f; \
181 addi r9,r13,MMSTAT_DSTATS+name; \
182 b 62f; \
18361: addi r9,r13,MMSTAT_ISTATS+name; \
18462: bl .tlb_stat_inc;
185#define TLB_MISS_STATS_SAVE_INFO \
186 std r14,EX_TLB_ESR(r12); /* save ESR */ \
187
188
189#else
190#define TLB_MISS_PROLOG_STATS
191#define TLB_MISS_RESTORE_STATS
192#define TLB_MISS_STATS_D(name)
193#define TLB_MISS_STATS_I(name)
194#define TLB_MISS_STATS_X(name)
195#define TLB_MISS_STATS_Y(name)
196#define TLB_MISS_STATS_SAVE_INFO
197#endif
198
199#define SET_IVOR(vector_number, vector_offset) \
200 li r3,vector_offset@l; \
201 ori r3,r3,interrupt_base_book3e@l; \
202 mtspr SPRN_IVOR##vector_number,r3;
203
204#endif /* _ASM_POWERPC_EXCEPTION_64E_H */
205
diff --git a/arch/powerpc/include/asm/exception.h b/arch/powerpc/include/asm/exception-64s.h
index d3d4534e3c74..a98653b26231 100644
--- a/arch/powerpc/include/asm/exception.h
+++ b/arch/powerpc/include/asm/exception-64s.h
@@ -57,17 +57,16 @@
57 addi reg,reg,(label)-_stext; /* virt addr of handler ... */ 57 addi reg,reg,(label)-_stext; /* virt addr of handler ... */
58 58
59#define EXCEPTION_PROLOG_1(area) \ 59#define EXCEPTION_PROLOG_1(area) \
60 mfspr r13,SPRN_SPRG3; /* get paca address into r13 */ \ 60 mfspr r13,SPRN_SPRG_PACA; /* get paca address into r13 */ \
61 std r9,area+EX_R9(r13); /* save r9 - r12 */ \ 61 std r9,area+EX_R9(r13); /* save r9 - r12 */ \
62 std r10,area+EX_R10(r13); \ 62 std r10,area+EX_R10(r13); \
63 std r11,area+EX_R11(r13); \ 63 std r11,area+EX_R11(r13); \
64 std r12,area+EX_R12(r13); \ 64 std r12,area+EX_R12(r13); \
65 mfspr r9,SPRN_SPRG1; \ 65 mfspr r9,SPRN_SPRG_SCRATCH0; \
66 std r9,area+EX_R13(r13); \ 66 std r9,area+EX_R13(r13); \
67 mfcr r9 67 mfcr r9
68 68
69#define EXCEPTION_PROLOG_PSERIES(area, label) \ 69#define EXCEPTION_PROLOG_PSERIES_1(label) \
70 EXCEPTION_PROLOG_1(area); \
71 ld r12,PACAKBASE(r13); /* get high part of &label */ \ 70 ld r12,PACAKBASE(r13); /* get high part of &label */ \
72 ld r10,PACAKMSR(r13); /* get MSR value for kernel */ \ 71 ld r10,PACAKMSR(r13); /* get MSR value for kernel */ \
73 mfspr r11,SPRN_SRR0; /* save SRR0 */ \ 72 mfspr r11,SPRN_SRR0; /* save SRR0 */ \
@@ -78,6 +77,10 @@
78 rfid; \ 77 rfid; \
79 b . /* prevent speculative execution */ 78 b . /* prevent speculative execution */
80 79
80#define EXCEPTION_PROLOG_PSERIES(area, label) \
81 EXCEPTION_PROLOG_1(area); \
82 EXCEPTION_PROLOG_PSERIES_1(label);
83
81/* 84/*
82 * The common exception prolog is used for all except a few exceptions 85 * The common exception prolog is used for all except a few exceptions
83 * such as a segment miss on a kernel address. We have to be prepared 86 * such as a segment miss on a kernel address. We have to be prepared
@@ -144,7 +147,7 @@
144 .globl label##_pSeries; \ 147 .globl label##_pSeries; \
145label##_pSeries: \ 148label##_pSeries: \
146 HMT_MEDIUM; \ 149 HMT_MEDIUM; \
147 mtspr SPRN_SPRG1,r13; /* save r13 */ \ 150 mtspr SPRN_SPRG_SCRATCH0,r13; /* save r13 */ \
148 EXCEPTION_PROLOG_PSERIES(PACA_EXGEN, label##_common) 151 EXCEPTION_PROLOG_PSERIES(PACA_EXGEN, label##_common)
149 152
150#define HSTD_EXCEPTION_PSERIES(n, label) \ 153#define HSTD_EXCEPTION_PSERIES(n, label) \
@@ -152,13 +155,13 @@ label##_pSeries: \
152 .globl label##_pSeries; \ 155 .globl label##_pSeries; \
153label##_pSeries: \ 156label##_pSeries: \
154 HMT_MEDIUM; \ 157 HMT_MEDIUM; \
155 mtspr SPRN_SPRG1,r20; /* save r20 */ \ 158 mtspr SPRN_SPRG_SCRATCH0,r20; /* save r20 */ \
156 mfspr r20,SPRN_HSRR0; /* copy HSRR0 to SRR0 */ \ 159 mfspr r20,SPRN_HSRR0; /* copy HSRR0 to SRR0 */ \
157 mtspr SPRN_SRR0,r20; \ 160 mtspr SPRN_SRR0,r20; \
158 mfspr r20,SPRN_HSRR1; /* copy HSRR0 to SRR0 */ \ 161 mfspr r20,SPRN_HSRR1; /* copy HSRR0 to SRR0 */ \
159 mtspr SPRN_SRR1,r20; \ 162 mtspr SPRN_SRR1,r20; \
160 mfspr r20,SPRN_SPRG1; /* restore r20 */ \ 163 mfspr r20,SPRN_SPRG_SCRATCH0; /* restore r20 */ \
161 mtspr SPRN_SPRG1,r13; /* save r13 */ \ 164 mtspr SPRN_SPRG_SCRATCH0,r13; /* save r13 */ \
162 EXCEPTION_PROLOG_PSERIES(PACA_EXGEN, label##_common) 165 EXCEPTION_PROLOG_PSERIES(PACA_EXGEN, label##_common)
163 166
164 167
@@ -167,15 +170,15 @@ label##_pSeries: \
167 .globl label##_pSeries; \ 170 .globl label##_pSeries; \
168label##_pSeries: \ 171label##_pSeries: \
169 HMT_MEDIUM; \ 172 HMT_MEDIUM; \
170 mtspr SPRN_SPRG1,r13; /* save r13 */ \ 173 mtspr SPRN_SPRG_SCRATCH0,r13; /* save r13 */ \
171 mfspr r13,SPRN_SPRG3; /* get paca address into r13 */ \ 174 mfspr r13,SPRN_SPRG_PACA; /* get paca address into r13 */ \
172 std r9,PACA_EXGEN+EX_R9(r13); /* save r9, r10 */ \ 175 std r9,PACA_EXGEN+EX_R9(r13); /* save r9, r10 */ \
173 std r10,PACA_EXGEN+EX_R10(r13); \ 176 std r10,PACA_EXGEN+EX_R10(r13); \
174 lbz r10,PACASOFTIRQEN(r13); \ 177 lbz r10,PACASOFTIRQEN(r13); \
175 mfcr r9; \ 178 mfcr r9; \
176 cmpwi r10,0; \ 179 cmpwi r10,0; \
177 beq masked_interrupt; \ 180 beq masked_interrupt; \
178 mfspr r10,SPRN_SPRG1; \ 181 mfspr r10,SPRN_SPRG_SCRATCH0; \
179 std r10,PACA_EXGEN+EX_R13(r13); \ 182 std r10,PACA_EXGEN+EX_R13(r13); \
180 std r11,PACA_EXGEN+EX_R11(r13); \ 183 std r11,PACA_EXGEN+EX_R11(r13); \
181 std r12,PACA_EXGEN+EX_R12(r13); \ 184 std r12,PACA_EXGEN+EX_R12(r13); \
diff --git a/arch/powerpc/include/asm/hardirq.h b/arch/powerpc/include/asm/hardirq.h
index 288e14d53b7f..fb3c05a0cbbf 100644
--- a/arch/powerpc/include/asm/hardirq.h
+++ b/arch/powerpc/include/asm/hardirq.h
@@ -1,29 +1 @@
1#ifndef _ASM_POWERPC_HARDIRQ_H #include <asm-generic/hardirq.h>
2#define _ASM_POWERPC_HARDIRQ_H
3#ifdef __KERNEL__
4
5#include <asm/irq.h>
6#include <asm/bug.h>
7
8/* The __last_jiffy_stamp field is needed to ensure that no decrementer
9 * interrupt is lost on SMP machines. Since on most CPUs it is in the same
10 * cache line as local_irq_count, it is cheap to access and is also used on UP
11 * for uniformity.
12 */
13typedef struct {
14 unsigned int __softirq_pending; /* set_bit is used on this */
15 unsigned int __last_jiffy_stamp;
16} ____cacheline_aligned irq_cpustat_t;
17
18#include <linux/irq_cpustat.h> /* Standard mappings for irq_cpustat_t above */
19
20#define last_jiffy_stamp(cpu) __IRQ_STAT((cpu), __last_jiffy_stamp)
21
22static inline void ack_bad_irq(int irq)
23{
24 printk(KERN_CRIT "illegal vector %d received!\n", irq);
25 BUG();
26}
27
28#endif /* __KERNEL__ */
29#endif /* _ASM_POWERPC_HARDIRQ_H */
diff --git a/arch/powerpc/include/asm/hw_irq.h b/arch/powerpc/include/asm/hw_irq.h
index 8b505eaaa38a..e73d554538dd 100644
--- a/arch/powerpc/include/asm/hw_irq.h
+++ b/arch/powerpc/include/asm/hw_irq.h
@@ -49,8 +49,13 @@ extern void iseries_handle_interrupts(void);
49#define raw_irqs_disabled() (local_get_flags() == 0) 49#define raw_irqs_disabled() (local_get_flags() == 0)
50#define raw_irqs_disabled_flags(flags) ((flags) == 0) 50#define raw_irqs_disabled_flags(flags) ((flags) == 0)
51 51
52#ifdef CONFIG_PPC_BOOK3E
53#define __hard_irq_enable() __asm__ __volatile__("wrteei 1": : :"memory");
54#define __hard_irq_disable() __asm__ __volatile__("wrteei 0": : :"memory");
55#else
52#define __hard_irq_enable() __mtmsrd(mfmsr() | MSR_EE, 1) 56#define __hard_irq_enable() __mtmsrd(mfmsr() | MSR_EE, 1)
53#define __hard_irq_disable() __mtmsrd(mfmsr() & ~MSR_EE, 1) 57#define __hard_irq_disable() __mtmsrd(mfmsr() & ~MSR_EE, 1)
58#endif
54 59
55#define hard_irq_disable() \ 60#define hard_irq_disable() \
56 do { \ 61 do { \
diff --git a/arch/powerpc/include/asm/iommu.h b/arch/powerpc/include/asm/iommu.h
index 7ead7c16fb7c..7464c0daddd1 100644
--- a/arch/powerpc/include/asm/iommu.h
+++ b/arch/powerpc/include/asm/iommu.h
@@ -35,16 +35,6 @@
35#define IOMMU_PAGE_MASK (~((1 << IOMMU_PAGE_SHIFT) - 1)) 35#define IOMMU_PAGE_MASK (~((1 << IOMMU_PAGE_SHIFT) - 1))
36#define IOMMU_PAGE_ALIGN(addr) _ALIGN_UP(addr, IOMMU_PAGE_SIZE) 36#define IOMMU_PAGE_ALIGN(addr) _ALIGN_UP(addr, IOMMU_PAGE_SIZE)
37 37
38/* Cell page table entries */
39#define CBE_IOPTE_PP_W 0x8000000000000000ul /* protection: write */
40#define CBE_IOPTE_PP_R 0x4000000000000000ul /* protection: read */
41#define CBE_IOPTE_M 0x2000000000000000ul /* coherency required */
42#define CBE_IOPTE_SO_R 0x1000000000000000ul /* ordering: writes */
43#define CBE_IOPTE_SO_RW 0x1800000000000000ul /* ordering: r & w */
44#define CBE_IOPTE_RPN_Mask 0x07fffffffffff000ul /* RPN */
45#define CBE_IOPTE_H 0x0000000000000800ul /* cache hint */
46#define CBE_IOPTE_IOID_Mask 0x00000000000007fful /* ioid */
47
48/* Boot time flags */ 38/* Boot time flags */
49extern int iommu_is_off; 39extern int iommu_is_off;
50extern int iommu_force_on; 40extern int iommu_force_on;
diff --git a/arch/powerpc/include/asm/irq.h b/arch/powerpc/include/asm/irq.h
index 0a5137676e1b..bbcd1aaf3dfd 100644
--- a/arch/powerpc/include/asm/irq.h
+++ b/arch/powerpc/include/asm/irq.h
@@ -302,7 +302,8 @@ extern void irq_free_virt(unsigned int virq, unsigned int count);
302 302
303/* -- OF helpers -- */ 303/* -- OF helpers -- */
304 304
305/* irq_create_of_mapping - Map a hardware interrupt into linux virq space 305/**
306 * irq_create_of_mapping - Map a hardware interrupt into linux virq space
306 * @controller: Device node of the interrupt controller 307 * @controller: Device node of the interrupt controller
307 * @inspec: Interrupt specifier from the device-tree 308 * @inspec: Interrupt specifier from the device-tree
308 * @intsize: Size of the interrupt specifier from the device-tree 309 * @intsize: Size of the interrupt specifier from the device-tree
@@ -314,8 +315,8 @@ extern void irq_free_virt(unsigned int virq, unsigned int count);
314extern unsigned int irq_create_of_mapping(struct device_node *controller, 315extern unsigned int irq_create_of_mapping(struct device_node *controller,
315 u32 *intspec, unsigned int intsize); 316 u32 *intspec, unsigned int intsize);
316 317
317 318/**
318/* irq_of_parse_and_map - Parse nad Map an interrupt into linux virq space 319 * irq_of_parse_and_map - Parse and Map an interrupt into linux virq space
319 * @device: Device node of the device whose interrupt is to be mapped 320 * @device: Device node of the device whose interrupt is to be mapped
320 * @index: Index of the interrupt to map 321 * @index: Index of the interrupt to map
321 * 322 *
diff --git a/arch/powerpc/include/asm/machdep.h b/arch/powerpc/include/asm/machdep.h
index 11d1fc3a8962..9efa2be78331 100644
--- a/arch/powerpc/include/asm/machdep.h
+++ b/arch/powerpc/include/asm/machdep.h
@@ -209,14 +209,14 @@ struct machdep_calls {
209 /* 209 /*
210 * optional PCI "hooks" 210 * optional PCI "hooks"
211 */ 211 */
212 /* Called in indirect_* to avoid touching devices */
213 int (*pci_exclude_device)(struct pci_controller *, unsigned char, unsigned char);
214
215 /* Called at then very end of pcibios_init() */ 212 /* Called at then very end of pcibios_init() */
216 void (*pcibios_after_init)(void); 213 void (*pcibios_after_init)(void);
217 214
218#endif /* CONFIG_PPC32 */ 215#endif /* CONFIG_PPC32 */
219 216
217 /* Called in indirect_* to avoid touching devices */
218 int (*pci_exclude_device)(struct pci_controller *, unsigned char, unsigned char);
219
220 /* Called after PPC generic resource fixup to perform 220 /* Called after PPC generic resource fixup to perform
221 machine specific fixups */ 221 machine specific fixups */
222 void (*pcibios_fixup_resources)(struct pci_dev *); 222 void (*pcibios_fixup_resources)(struct pci_dev *);
diff --git a/arch/powerpc/include/asm/mmu-40x.h b/arch/powerpc/include/asm/mmu-40x.h
index 776f415a36aa..34916865eaef 100644
--- a/arch/powerpc/include/asm/mmu-40x.h
+++ b/arch/powerpc/include/asm/mmu-40x.h
@@ -61,4 +61,7 @@ typedef struct {
61 61
62#endif /* !__ASSEMBLY__ */ 62#endif /* !__ASSEMBLY__ */
63 63
64#define mmu_virtual_psize MMU_PAGE_4K
65#define mmu_linear_psize MMU_PAGE_256M
66
64#endif /* _ASM_POWERPC_MMU_40X_H_ */ 67#endif /* _ASM_POWERPC_MMU_40X_H_ */
diff --git a/arch/powerpc/include/asm/mmu-44x.h b/arch/powerpc/include/asm/mmu-44x.h
index 3c86576bfefa..0372669383a8 100644
--- a/arch/powerpc/include/asm/mmu-44x.h
+++ b/arch/powerpc/include/asm/mmu-44x.h
@@ -79,16 +79,22 @@ typedef struct {
79 79
80#if (PAGE_SHIFT == 12) 80#if (PAGE_SHIFT == 12)
81#define PPC44x_TLBE_SIZE PPC44x_TLB_4K 81#define PPC44x_TLBE_SIZE PPC44x_TLB_4K
82#define mmu_virtual_psize MMU_PAGE_4K
82#elif (PAGE_SHIFT == 14) 83#elif (PAGE_SHIFT == 14)
83#define PPC44x_TLBE_SIZE PPC44x_TLB_16K 84#define PPC44x_TLBE_SIZE PPC44x_TLB_16K
85#define mmu_virtual_psize MMU_PAGE_16K
84#elif (PAGE_SHIFT == 16) 86#elif (PAGE_SHIFT == 16)
85#define PPC44x_TLBE_SIZE PPC44x_TLB_64K 87#define PPC44x_TLBE_SIZE PPC44x_TLB_64K
88#define mmu_virtual_psize MMU_PAGE_64K
86#elif (PAGE_SHIFT == 18) 89#elif (PAGE_SHIFT == 18)
87#define PPC44x_TLBE_SIZE PPC44x_TLB_256K 90#define PPC44x_TLBE_SIZE PPC44x_TLB_256K
91#define mmu_virtual_psize MMU_PAGE_256K
88#else 92#else
89#error "Unsupported PAGE_SIZE" 93#error "Unsupported PAGE_SIZE"
90#endif 94#endif
91 95
96#define mmu_linear_psize MMU_PAGE_256M
97
92#define PPC44x_PGD_OFF_SHIFT (32 - PGDIR_SHIFT + PGD_T_LOG2) 98#define PPC44x_PGD_OFF_SHIFT (32 - PGDIR_SHIFT + PGD_T_LOG2)
93#define PPC44x_PGD_OFF_MASK_BIT (PGDIR_SHIFT - PGD_T_LOG2) 99#define PPC44x_PGD_OFF_MASK_BIT (PGDIR_SHIFT - PGD_T_LOG2)
94#define PPC44x_PTE_ADD_SHIFT (32 - PGDIR_SHIFT + PTE_SHIFT + PTE_T_LOG2) 100#define PPC44x_PTE_ADD_SHIFT (32 - PGDIR_SHIFT + PTE_SHIFT + PTE_T_LOG2)
diff --git a/arch/powerpc/include/asm/mmu-8xx.h b/arch/powerpc/include/asm/mmu-8xx.h
index 07865a357848..3d11d3ce79ec 100644
--- a/arch/powerpc/include/asm/mmu-8xx.h
+++ b/arch/powerpc/include/asm/mmu-8xx.h
@@ -143,4 +143,7 @@ typedef struct {
143} mm_context_t; 143} mm_context_t;
144#endif /* !__ASSEMBLY__ */ 144#endif /* !__ASSEMBLY__ */
145 145
146#define mmu_virtual_psize MMU_PAGE_4K
147#define mmu_linear_psize MMU_PAGE_8M
148
146#endif /* _ASM_POWERPC_MMU_8XX_H_ */ 149#endif /* _ASM_POWERPC_MMU_8XX_H_ */
diff --git a/arch/powerpc/include/asm/mmu-book3e.h b/arch/powerpc/include/asm/mmu-book3e.h
index 7e74cff81d86..74695816205c 100644
--- a/arch/powerpc/include/asm/mmu-book3e.h
+++ b/arch/powerpc/include/asm/mmu-book3e.h
@@ -38,58 +38,140 @@
38#define BOOK3E_PAGESZ_1TB 30 38#define BOOK3E_PAGESZ_1TB 30
39#define BOOK3E_PAGESZ_2TB 31 39#define BOOK3E_PAGESZ_2TB 31
40 40
41#define MAS0_TLBSEL(x) ((x << 28) & 0x30000000) 41/* MAS registers bit definitions */
42#define MAS0_ESEL(x) ((x << 16) & 0x0FFF0000) 42
43#define MAS0_NV(x) ((x) & 0x00000FFF) 43#define MAS0_TLBSEL(x) ((x << 28) & 0x30000000)
44 44#define MAS0_ESEL(x) ((x << 16) & 0x0FFF0000)
45#define MAS1_VALID 0x80000000 45#define MAS0_NV(x) ((x) & 0x00000FFF)
46#define MAS1_IPROT 0x40000000 46#define MAS0_HES 0x00004000
47#define MAS1_TID(x) ((x << 16) & 0x3FFF0000) 47#define MAS0_WQ_ALLWAYS 0x00000000
48#define MAS1_IND 0x00002000 48#define MAS0_WQ_COND 0x00001000
49#define MAS1_TS 0x00001000 49#define MAS0_WQ_CLR_RSRV 0x00002000
50#define MAS1_TSIZE(x) ((x << 7) & 0x00000F80) 50
51 51#define MAS1_VALID 0x80000000
52#define MAS2_EPN 0xFFFFF000 52#define MAS1_IPROT 0x40000000
53#define MAS2_X0 0x00000040 53#define MAS1_TID(x) ((x << 16) & 0x3FFF0000)
54#define MAS2_X1 0x00000020 54#define MAS1_IND 0x00002000
55#define MAS2_W 0x00000010 55#define MAS1_TS 0x00001000
56#define MAS2_I 0x00000008 56#define MAS1_TSIZE_MASK 0x00000f80
57#define MAS2_M 0x00000004 57#define MAS1_TSIZE_SHIFT 7
58#define MAS2_G 0x00000002 58#define MAS1_TSIZE(x) ((x << MAS1_TSIZE_SHIFT) & MAS1_TSIZE_MASK)
59#define MAS2_E 0x00000001 59
60#define MAS2_EPN 0xFFFFF000
61#define MAS2_X0 0x00000040
62#define MAS2_X1 0x00000020
63#define MAS2_W 0x00000010
64#define MAS2_I 0x00000008
65#define MAS2_M 0x00000004
66#define MAS2_G 0x00000002
67#define MAS2_E 0x00000001
60#define MAS2_EPN_MASK(size) (~0 << (size + 10)) 68#define MAS2_EPN_MASK(size) (~0 << (size + 10))
61#define MAS2_VAL(addr, size, flags) ((addr) & MAS2_EPN_MASK(size) | (flags)) 69#define MAS2_VAL(addr, size, flags) ((addr) & MAS2_EPN_MASK(size) | (flags))
62 70
63#define MAS3_RPN 0xFFFFF000 71#define MAS3_RPN 0xFFFFF000
64#define MAS3_U0 0x00000200 72#define MAS3_U0 0x00000200
65#define MAS3_U1 0x00000100 73#define MAS3_U1 0x00000100
66#define MAS3_U2 0x00000080 74#define MAS3_U2 0x00000080
67#define MAS3_U3 0x00000040 75#define MAS3_U3 0x00000040
68#define MAS3_UX 0x00000020 76#define MAS3_UX 0x00000020
69#define MAS3_SX 0x00000010 77#define MAS3_SX 0x00000010
70#define MAS3_UW 0x00000008 78#define MAS3_UW 0x00000008
71#define MAS3_SW 0x00000004 79#define MAS3_SW 0x00000004
72#define MAS3_UR 0x00000002 80#define MAS3_UR 0x00000002
73#define MAS3_SR 0x00000001 81#define MAS3_SR 0x00000001
74 82#define MAS3_SPSIZE 0x0000003e
75#define MAS4_TLBSELD(x) MAS0_TLBSEL(x) 83#define MAS3_SPSIZE_SHIFT 1
76#define MAS4_INDD 0x00008000 84
77#define MAS4_TSIZED(x) MAS1_TSIZE(x) 85#define MAS4_TLBSELD(x) MAS0_TLBSEL(x)
78#define MAS4_X0D 0x00000040 86#define MAS4_INDD 0x00008000 /* Default IND */
79#define MAS4_X1D 0x00000020 87#define MAS4_TSIZED(x) MAS1_TSIZE(x)
80#define MAS4_WD 0x00000010 88#define MAS4_X0D 0x00000040
81#define MAS4_ID 0x00000008 89#define MAS4_X1D 0x00000020
82#define MAS4_MD 0x00000004 90#define MAS4_WD 0x00000010
83#define MAS4_GD 0x00000002 91#define MAS4_ID 0x00000008
84#define MAS4_ED 0x00000001 92#define MAS4_MD 0x00000004
85 93#define MAS4_GD 0x00000002
86#define MAS6_SPID0 0x3FFF0000 94#define MAS4_ED 0x00000001
87#define MAS6_SPID1 0x00007FFE 95#define MAS4_WIMGED_MASK 0x0000001f /* Default WIMGE */
88#define MAS6_ISIZE(x) MAS1_TSIZE(x) 96#define MAS4_WIMGED_SHIFT 0
89#define MAS6_SAS 0x00000001 97#define MAS4_VLED MAS4_X1D /* Default VLE */
90#define MAS6_SPID MAS6_SPID0 98#define MAS4_ACMD 0x000000c0 /* Default ACM */
91 99#define MAS4_ACMD_SHIFT 6
92#define MAS7_RPN 0xFFFFFFFF 100#define MAS4_TSIZED_MASK 0x00000f80 /* Default TSIZE */
101#define MAS4_TSIZED_SHIFT 7
102
103#define MAS6_SPID0 0x3FFF0000
104#define MAS6_SPID1 0x00007FFE
105#define MAS6_ISIZE(x) MAS1_TSIZE(x)
106#define MAS6_SAS 0x00000001
107#define MAS6_SPID MAS6_SPID0
108#define MAS6_SIND 0x00000002 /* Indirect page */
109#define MAS6_SIND_SHIFT 1
110#define MAS6_SPID_MASK 0x3fff0000
111#define MAS6_SPID_SHIFT 16
112#define MAS6_ISIZE_MASK 0x00000f80
113#define MAS6_ISIZE_SHIFT 7
114
115#define MAS7_RPN 0xFFFFFFFF
116
117/* Bit definitions for MMUCSR0 */
118#define MMUCSR0_TLB1FI 0x00000002 /* TLB1 Flash invalidate */
119#define MMUCSR0_TLB0FI 0x00000004 /* TLB0 Flash invalidate */
120#define MMUCSR0_TLB2FI 0x00000040 /* TLB2 Flash invalidate */
121#define MMUCSR0_TLB3FI 0x00000020 /* TLB3 Flash invalidate */
122#define MMUCSR0_TLBFI (MMUCSR0_TLB0FI | MMUCSR0_TLB1FI | \
123 MMUCSR0_TLB2FI | MMUCSR0_TLB3FI)
124#define MMUCSR0_TLB0PS 0x00000780 /* TLB0 Page Size */
125#define MMUCSR0_TLB1PS 0x00007800 /* TLB1 Page Size */
126#define MMUCSR0_TLB2PS 0x00078000 /* TLB2 Page Size */
127#define MMUCSR0_TLB3PS 0x00780000 /* TLB3 Page Size */
128
129/* TLBnCFG encoding */
130#define TLBnCFG_N_ENTRY 0x00000fff /* number of entries */
131#define TLBnCFG_HES 0x00002000 /* HW select supported */
132#define TLBnCFG_IPROT 0x00008000 /* IPROT supported */
133#define TLBnCFG_GTWE 0x00010000 /* Guest can write */
134#define TLBnCFG_IND 0x00020000 /* IND entries supported */
135#define TLBnCFG_PT 0x00040000 /* Can load from page table */
136#define TLBnCFG_ASSOC 0xff000000 /* Associativity */
137
138/* TLBnPS encoding */
139#define TLBnPS_4K 0x00000004
140#define TLBnPS_8K 0x00000008
141#define TLBnPS_16K 0x00000010
142#define TLBnPS_32K 0x00000020
143#define TLBnPS_64K 0x00000040
144#define TLBnPS_128K 0x00000080
145#define TLBnPS_256K 0x00000100
146#define TLBnPS_512K 0x00000200
147#define TLBnPS_1M 0x00000400
148#define TLBnPS_2M 0x00000800
149#define TLBnPS_4M 0x00001000
150#define TLBnPS_8M 0x00002000
151#define TLBnPS_16M 0x00004000
152#define TLBnPS_32M 0x00008000
153#define TLBnPS_64M 0x00010000
154#define TLBnPS_128M 0x00020000
155#define TLBnPS_256M 0x00040000
156#define TLBnPS_512M 0x00080000
157#define TLBnPS_1G 0x00100000
158#define TLBnPS_2G 0x00200000
159#define TLBnPS_4G 0x00400000
160#define TLBnPS_8G 0x00800000
161#define TLBnPS_16G 0x01000000
162#define TLBnPS_32G 0x02000000
163#define TLBnPS_64G 0x04000000
164#define TLBnPS_128G 0x08000000
165#define TLBnPS_256G 0x10000000
166
167/* tlbilx action encoding */
168#define TLBILX_T_ALL 0
169#define TLBILX_T_TID 1
170#define TLBILX_T_FULLMATCH 3
171#define TLBILX_T_CLASS0 4
172#define TLBILX_T_CLASS1 5
173#define TLBILX_T_CLASS2 6
174#define TLBILX_T_CLASS3 7
93 175
94#ifndef __ASSEMBLY__ 176#ifndef __ASSEMBLY__
95 177
@@ -100,6 +182,34 @@ typedef struct {
100 unsigned int active; 182 unsigned int active;
101 unsigned long vdso_base; 183 unsigned long vdso_base;
102} mm_context_t; 184} mm_context_t;
185
186/* Page size definitions, common between 32 and 64-bit
187 *
188 * shift : is the "PAGE_SHIFT" value for that page size
189 * penc : is the pte encoding mask
190 *
191 */
192struct mmu_psize_def
193{
194 unsigned int shift; /* number of bits */
195 unsigned int enc; /* PTE encoding */
196};
197extern struct mmu_psize_def mmu_psize_defs[MMU_PAGE_COUNT];
198
199/* The page sizes use the same names as 64-bit hash but are
200 * constants
201 */
202#if defined(CONFIG_PPC_4K_PAGES)
203#define mmu_virtual_psize MMU_PAGE_4K
204#elif defined(CONFIG_PPC_64K_PAGES)
205#define mmu_virtual_psize MMU_PAGE_64K
206#else
207#error Unsupported page size
208#endif
209
210extern int mmu_linear_psize;
211extern int mmu_vmemmap_psize;
212
103#endif /* !__ASSEMBLY__ */ 213#endif /* !__ASSEMBLY__ */
104 214
105#endif /* _ASM_POWERPC_MMU_BOOK3E_H_ */ 215#endif /* _ASM_POWERPC_MMU_BOOK3E_H_ */
diff --git a/arch/powerpc/include/asm/mmu-hash32.h b/arch/powerpc/include/asm/mmu-hash32.h
index 16b1a1e77e64..16f513e5cbd7 100644
--- a/arch/powerpc/include/asm/mmu-hash32.h
+++ b/arch/powerpc/include/asm/mmu-hash32.h
@@ -55,21 +55,25 @@ struct ppc_bat {
55 55
56#ifndef __ASSEMBLY__ 56#ifndef __ASSEMBLY__
57 57
58/* Hardware Page Table Entry */ 58/*
59 * Hardware Page Table Entry
60 * Note that the xpn and x bitfields are used only by processors that
61 * support extended addressing; otherwise, those bits are reserved.
62 */
59struct hash_pte { 63struct hash_pte {
60 unsigned long v:1; /* Entry is valid */ 64 unsigned long v:1; /* Entry is valid */
61 unsigned long vsid:24; /* Virtual segment identifier */ 65 unsigned long vsid:24; /* Virtual segment identifier */
62 unsigned long h:1; /* Hash algorithm indicator */ 66 unsigned long h:1; /* Hash algorithm indicator */
63 unsigned long api:6; /* Abbreviated page index */ 67 unsigned long api:6; /* Abbreviated page index */
64 unsigned long rpn:20; /* Real (physical) page number */ 68 unsigned long rpn:20; /* Real (physical) page number */
65 unsigned long :3; /* Unused */ 69 unsigned long xpn:3; /* Real page number bits 0-2, optional */
66 unsigned long r:1; /* Referenced */ 70 unsigned long r:1; /* Referenced */
67 unsigned long c:1; /* Changed */ 71 unsigned long c:1; /* Changed */
68 unsigned long w:1; /* Write-thru cache mode */ 72 unsigned long w:1; /* Write-thru cache mode */
69 unsigned long i:1; /* Cache inhibited */ 73 unsigned long i:1; /* Cache inhibited */
70 unsigned long m:1; /* Memory coherence */ 74 unsigned long m:1; /* Memory coherence */
71 unsigned long g:1; /* Guarded */ 75 unsigned long g:1; /* Guarded */
72 unsigned long :1; /* Unused */ 76 unsigned long x:1; /* Real page number bit 3, optional */
73 unsigned long pp:2; /* Page protection */ 77 unsigned long pp:2; /* Page protection */
74}; 78};
75 79
@@ -80,4 +84,10 @@ typedef struct {
80 84
81#endif /* !__ASSEMBLY__ */ 85#endif /* !__ASSEMBLY__ */
82 86
87/* We happily ignore the smaller BATs on 601, we don't actually use
88 * those definitions on hash32 at the moment anyway
89 */
90#define mmu_virtual_psize MMU_PAGE_4K
91#define mmu_linear_psize MMU_PAGE_256M
92
83#endif /* _ASM_POWERPC_MMU_HASH32_H_ */ 93#endif /* _ASM_POWERPC_MMU_HASH32_H_ */
diff --git a/arch/powerpc/include/asm/mmu-hash64.h b/arch/powerpc/include/asm/mmu-hash64.h
index 98c104a09961..bebe31c2e907 100644
--- a/arch/powerpc/include/asm/mmu-hash64.h
+++ b/arch/powerpc/include/asm/mmu-hash64.h
@@ -41,6 +41,7 @@ extern char initial_stab[];
41 41
42#define SLB_NUM_BOLTED 3 42#define SLB_NUM_BOLTED 3
43#define SLB_CACHE_ENTRIES 8 43#define SLB_CACHE_ENTRIES 8
44#define SLB_MIN_SIZE 32
44 45
45/* Bits in the SLB ESID word */ 46/* Bits in the SLB ESID word */
46#define SLB_ESID_V ASM_CONST(0x0000000008000000) /* valid */ 47#define SLB_ESID_V ASM_CONST(0x0000000008000000) /* valid */
@@ -139,26 +140,6 @@ struct mmu_psize_def
139#endif /* __ASSEMBLY__ */ 140#endif /* __ASSEMBLY__ */
140 141
141/* 142/*
142 * The kernel use the constants below to index in the page sizes array.
143 * The use of fixed constants for this purpose is better for performances
144 * of the low level hash refill handlers.
145 *
146 * A non supported page size has a "shift" field set to 0
147 *
148 * Any new page size being implemented can get a new entry in here. Whether
149 * the kernel will use it or not is a different matter though. The actual page
150 * size used by hugetlbfs is not defined here and may be made variable
151 */
152
153#define MMU_PAGE_4K 0 /* 4K */
154#define MMU_PAGE_64K 1 /* 64K */
155#define MMU_PAGE_64K_AP 2 /* 64K Admixed (in a 4K segment) */
156#define MMU_PAGE_1M 3 /* 1M */
157#define MMU_PAGE_16M 4 /* 16M */
158#define MMU_PAGE_16G 5 /* 16G */
159#define MMU_PAGE_COUNT 6
160
161/*
162 * Segment sizes. 143 * Segment sizes.
163 * These are the values used by hardware in the B field of 144 * These are the values used by hardware in the B field of
164 * SLB entries and the first dword of MMU hashtable entries. 145 * SLB entries and the first dword of MMU hashtable entries.
@@ -296,6 +277,7 @@ extern void slb_flush_and_rebolt(void);
296extern void stab_initialize(unsigned long stab); 277extern void stab_initialize(unsigned long stab);
297 278
298extern void slb_vmalloc_update(void); 279extern void slb_vmalloc_update(void);
280extern void slb_set_size(u16 size);
299#endif /* __ASSEMBLY__ */ 281#endif /* __ASSEMBLY__ */
300 282
301/* 283/*
diff --git a/arch/powerpc/include/asm/mmu.h b/arch/powerpc/include/asm/mmu.h
index fb57ded592f9..7ffbb65ff7a9 100644
--- a/arch/powerpc/include/asm/mmu.h
+++ b/arch/powerpc/include/asm/mmu.h
@@ -17,6 +17,7 @@
17#define MMU_FTR_TYPE_40x ASM_CONST(0x00000004) 17#define MMU_FTR_TYPE_40x ASM_CONST(0x00000004)
18#define MMU_FTR_TYPE_44x ASM_CONST(0x00000008) 18#define MMU_FTR_TYPE_44x ASM_CONST(0x00000008)
19#define MMU_FTR_TYPE_FSL_E ASM_CONST(0x00000010) 19#define MMU_FTR_TYPE_FSL_E ASM_CONST(0x00000010)
20#define MMU_FTR_TYPE_3E ASM_CONST(0x00000020)
20 21
21/* 22/*
22 * This is individual features 23 * This is individual features
@@ -57,6 +58,15 @@
57 */ 58 */
58#define MMU_FTR_TLBIE_206 ASM_CONST(0x00400000) 59#define MMU_FTR_TLBIE_206 ASM_CONST(0x00400000)
59 60
61/* Enable use of TLB reservation. Processor should support tlbsrx.
62 * instruction and MAS0[WQ].
63 */
64#define MMU_FTR_USE_TLBRSRV ASM_CONST(0x00800000)
65
66/* Use paired MAS registers (MAS7||MAS3, etc.)
67 */
68#define MMU_FTR_USE_PAIRED_MAS ASM_CONST(0x01000000)
69
60#ifndef __ASSEMBLY__ 70#ifndef __ASSEMBLY__
61#include <asm/cputable.h> 71#include <asm/cputable.h>
62 72
@@ -73,6 +83,41 @@ extern void early_init_mmu_secondary(void);
73 83
74#endif /* !__ASSEMBLY__ */ 84#endif /* !__ASSEMBLY__ */
75 85
86/* The kernel use the constants below to index in the page sizes array.
87 * The use of fixed constants for this purpose is better for performances
88 * of the low level hash refill handlers.
89 *
90 * A non supported page size has a "shift" field set to 0
91 *
92 * Any new page size being implemented can get a new entry in here. Whether
93 * the kernel will use it or not is a different matter though. The actual page
94 * size used by hugetlbfs is not defined here and may be made variable
95 *
96 * Note: This array ended up being a false good idea as it's growing to the
97 * point where I wonder if we should replace it with something different,
98 * to think about, feedback welcome. --BenH.
99 */
100
101/* There are #define as they have to be used in assembly
102 *
103 * WARNING: If you change this list, make sure to update the array of
104 * names currently in arch/powerpc/mm/hugetlbpage.c or bad things will
105 * happen
106 */
107#define MMU_PAGE_4K 0
108#define MMU_PAGE_16K 1
109#define MMU_PAGE_64K 2
110#define MMU_PAGE_64K_AP 3 /* "Admixed pages" (hash64 only) */
111#define MMU_PAGE_256K 4
112#define MMU_PAGE_1M 5
113#define MMU_PAGE_8M 6
114#define MMU_PAGE_16M 7
115#define MMU_PAGE_256M 8
116#define MMU_PAGE_1G 9
117#define MMU_PAGE_16G 10
118#define MMU_PAGE_64G 11
119#define MMU_PAGE_COUNT 12
120
76 121
77#if defined(CONFIG_PPC_STD_MMU_64) 122#if defined(CONFIG_PPC_STD_MMU_64)
78/* 64-bit classic hash table MMU */ 123/* 64-bit classic hash table MMU */
@@ -94,5 +139,6 @@ extern void early_init_mmu_secondary(void);
94# include <asm/mmu-8xx.h> 139# include <asm/mmu-8xx.h>
95#endif 140#endif
96 141
142
97#endif /* __KERNEL__ */ 143#endif /* __KERNEL__ */
98#endif /* _ASM_POWERPC_MMU_H_ */ 144#endif /* _ASM_POWERPC_MMU_H_ */
diff --git a/arch/powerpc/include/asm/mmu_context.h b/arch/powerpc/include/asm/mmu_context.h
index b7063669f972..b34e94d94435 100644
--- a/arch/powerpc/include/asm/mmu_context.h
+++ b/arch/powerpc/include/asm/mmu_context.h
@@ -14,7 +14,6 @@
14/* 14/*
15 * Most if the context management is out of line 15 * Most if the context management is out of line
16 */ 16 */
17extern void mmu_context_init(void);
18extern int init_new_context(struct task_struct *tsk, struct mm_struct *mm); 17extern int init_new_context(struct task_struct *tsk, struct mm_struct *mm);
19extern void destroy_context(struct mm_struct *mm); 18extern void destroy_context(struct mm_struct *mm);
20 19
@@ -23,6 +22,12 @@ extern void switch_stab(struct task_struct *tsk, struct mm_struct *mm);
23extern void switch_slb(struct task_struct *tsk, struct mm_struct *mm); 22extern void switch_slb(struct task_struct *tsk, struct mm_struct *mm);
24extern void set_context(unsigned long id, pgd_t *pgd); 23extern void set_context(unsigned long id, pgd_t *pgd);
25 24
25#ifdef CONFIG_PPC_BOOK3S_64
26static inline void mmu_context_init(void) { }
27#else
28extern void mmu_context_init(void);
29#endif
30
26/* 31/*
27 * switch_mm is the entry point called from the architecture independent 32 * switch_mm is the entry point called from the architecture independent
28 * code in kernel/sched.c 33 * code in kernel/sched.c
@@ -38,6 +43,10 @@ static inline void switch_mm(struct mm_struct *prev, struct mm_struct *next,
38 tsk->thread.pgdir = next->pgd; 43 tsk->thread.pgdir = next->pgd;
39#endif /* CONFIG_PPC32 */ 44#endif /* CONFIG_PPC32 */
40 45
46 /* 64-bit Book3E keeps track of current PGD in the PACA */
47#ifdef CONFIG_PPC_BOOK3E_64
48 get_paca()->pgd = next->pgd;
49#endif
41 /* Nothing else to do if we aren't actually switching */ 50 /* Nothing else to do if we aren't actually switching */
42 if (prev == next) 51 if (prev == next)
43 return; 52 return;
@@ -84,6 +93,10 @@ static inline void activate_mm(struct mm_struct *prev, struct mm_struct *next)
84static inline void enter_lazy_tlb(struct mm_struct *mm, 93static inline void enter_lazy_tlb(struct mm_struct *mm,
85 struct task_struct *tsk) 94 struct task_struct *tsk)
86{ 95{
96 /* 64-bit Book3E keeps track of current PGD in the PACA */
97#ifdef CONFIG_PPC_BOOK3E_64
98 get_paca()->pgd = NULL;
99#endif
87} 100}
88 101
89#endif /* __KERNEL__ */ 102#endif /* __KERNEL__ */
diff --git a/arch/powerpc/include/asm/nvram.h b/arch/powerpc/include/asm/nvram.h
index efde5ac82f7b..6c587eddee59 100644
--- a/arch/powerpc/include/asm/nvram.h
+++ b/arch/powerpc/include/asm/nvram.h
@@ -107,6 +107,9 @@ extern void pmac_xpram_write(int xpaddr, u8 data);
107/* Synchronize NVRAM */ 107/* Synchronize NVRAM */
108extern void nvram_sync(void); 108extern void nvram_sync(void);
109 109
110/* Determine NVRAM size */
111extern ssize_t nvram_get_size(void);
112
110/* Normal access to NVRAM */ 113/* Normal access to NVRAM */
111extern unsigned char nvram_read_byte(int i); 114extern unsigned char nvram_read_byte(int i);
112extern void nvram_write_byte(unsigned char c, int i); 115extern void nvram_write_byte(unsigned char c, int i);
diff --git a/arch/powerpc/include/asm/paca.h b/arch/powerpc/include/asm/paca.h
index c8a3cbfe02ff..b634456ea893 100644
--- a/arch/powerpc/include/asm/paca.h
+++ b/arch/powerpc/include/asm/paca.h
@@ -14,9 +14,11 @@
14#define _ASM_POWERPC_PACA_H 14#define _ASM_POWERPC_PACA_H
15#ifdef __KERNEL__ 15#ifdef __KERNEL__
16 16
17#include <asm/types.h> 17#include <asm/types.h>
18#include <asm/lppaca.h> 18#include <asm/lppaca.h>
19#include <asm/mmu.h> 19#include <asm/mmu.h>
20#include <asm/page.h>
21#include <asm/exception-64e.h>
20 22
21register struct paca_struct *local_paca asm("r13"); 23register struct paca_struct *local_paca asm("r13");
22 24
@@ -91,6 +93,21 @@ struct paca_struct {
91 u16 slb_cache[SLB_CACHE_ENTRIES]; 93 u16 slb_cache[SLB_CACHE_ENTRIES];
92#endif /* CONFIG_PPC_STD_MMU_64 */ 94#endif /* CONFIG_PPC_STD_MMU_64 */
93 95
96#ifdef CONFIG_PPC_BOOK3E
97 pgd_t *pgd; /* Current PGD */
98 pgd_t *kernel_pgd; /* Kernel PGD */
99 u64 exgen[8] __attribute__((aligned(0x80)));
100 u64 extlb[EX_TLB_SIZE*3] __attribute__((aligned(0x80)));
101 u64 exmc[8]; /* used for machine checks */
102 u64 excrit[8]; /* used for crit interrupts */
103 u64 exdbg[8]; /* used for debug interrupts */
104
105 /* Kernel stack pointers for use by special exceptions */
106 void *mc_kstack;
107 void *crit_kstack;
108 void *dbg_kstack;
109#endif /* CONFIG_PPC_BOOK3E */
110
94 mm_context_t context; 111 mm_context_t context;
95 112
96 /* 113 /*
diff --git a/arch/powerpc/include/asm/page.h b/arch/powerpc/include/asm/page.h
index 4940662ee87e..ff24254990e1 100644
--- a/arch/powerpc/include/asm/page.h
+++ b/arch/powerpc/include/asm/page.h
@@ -139,7 +139,11 @@ extern phys_addr_t kernstart_addr;
139 * Don't compare things with KERNELBASE or PAGE_OFFSET to test for 139 * Don't compare things with KERNELBASE or PAGE_OFFSET to test for
140 * "kernelness", use is_kernel_addr() - it should do what you want. 140 * "kernelness", use is_kernel_addr() - it should do what you want.
141 */ 141 */
142#ifdef CONFIG_PPC_BOOK3E_64
143#define is_kernel_addr(x) ((x) >= 0x8000000000000000ul)
144#else
142#define is_kernel_addr(x) ((x) >= PAGE_OFFSET) 145#define is_kernel_addr(x) ((x) >= PAGE_OFFSET)
146#endif
143 147
144#ifndef __ASSEMBLY__ 148#ifndef __ASSEMBLY__
145 149
diff --git a/arch/powerpc/include/asm/page_64.h b/arch/powerpc/include/asm/page_64.h
index 5817a3b747e5..3f17b83f55a1 100644
--- a/arch/powerpc/include/asm/page_64.h
+++ b/arch/powerpc/include/asm/page_64.h
@@ -135,12 +135,22 @@ extern void slice_set_range_psize(struct mm_struct *mm, unsigned long start,
135#endif /* __ASSEMBLY__ */ 135#endif /* __ASSEMBLY__ */
136#else 136#else
137#define slice_init() 137#define slice_init()
138#ifdef CONFIG_PPC_STD_MMU_64
138#define get_slice_psize(mm, addr) ((mm)->context.user_psize) 139#define get_slice_psize(mm, addr) ((mm)->context.user_psize)
139#define slice_set_user_psize(mm, psize) \ 140#define slice_set_user_psize(mm, psize) \
140do { \ 141do { \
141 (mm)->context.user_psize = (psize); \ 142 (mm)->context.user_psize = (psize); \
142 (mm)->context.sllp = SLB_VSID_USER | mmu_psize_defs[(psize)].sllp; \ 143 (mm)->context.sllp = SLB_VSID_USER | mmu_psize_defs[(psize)].sllp; \
143} while (0) 144} while (0)
145#else /* CONFIG_PPC_STD_MMU_64 */
146#ifdef CONFIG_PPC_64K_PAGES
147#define get_slice_psize(mm, addr) MMU_PAGE_64K
148#else /* CONFIG_PPC_64K_PAGES */
149#define get_slice_psize(mm, addr) MMU_PAGE_4K
150#endif /* !CONFIG_PPC_64K_PAGES */
151#define slice_set_user_psize(mm, psize) do { BUG(); } while(0)
152#endif /* !CONFIG_PPC_STD_MMU_64 */
153
144#define slice_set_range_psize(mm, start, len, psize) \ 154#define slice_set_range_psize(mm, start, len, psize) \
145 slice_set_user_psize((mm), (psize)) 155 slice_set_user_psize((mm), (psize))
146#define slice_mm_new_context(mm) 1 156#define slice_mm_new_context(mm) 1
diff --git a/arch/powerpc/include/asm/pci-bridge.h b/arch/powerpc/include/asm/pci-bridge.h
index 4c61fa0b8d75..76e1f313a58e 100644
--- a/arch/powerpc/include/asm/pci-bridge.h
+++ b/arch/powerpc/include/asm/pci-bridge.h
@@ -77,9 +77,7 @@ struct pci_controller {
77 77
78 int first_busno; 78 int first_busno;
79 int last_busno; 79 int last_busno;
80#ifndef CONFIG_PPC64
81 int self_busno; 80 int self_busno;
82#endif
83 81
84 void __iomem *io_base_virt; 82 void __iomem *io_base_virt;
85#ifdef CONFIG_PPC64 83#ifdef CONFIG_PPC64
@@ -104,7 +102,6 @@ struct pci_controller {
104 unsigned int __iomem *cfg_addr; 102 unsigned int __iomem *cfg_addr;
105 void __iomem *cfg_data; 103 void __iomem *cfg_data;
106 104
107#ifndef CONFIG_PPC64
108 /* 105 /*
109 * Used for variants of PCI indirect handling and possible quirks: 106 * Used for variants of PCI indirect handling and possible quirks:
110 * SET_CFG_TYPE - used on 4xx or any PHB that does explicit type0/1 107 * SET_CFG_TYPE - used on 4xx or any PHB that does explicit type0/1
@@ -128,7 +125,6 @@ struct pci_controller {
128#define PPC_INDIRECT_TYPE_BIG_ENDIAN 0x00000010 125#define PPC_INDIRECT_TYPE_BIG_ENDIAN 0x00000010
129#define PPC_INDIRECT_TYPE_BROKEN_MRM 0x00000020 126#define PPC_INDIRECT_TYPE_BROKEN_MRM 0x00000020
130 u32 indirect_type; 127 u32 indirect_type;
131#endif /* !CONFIG_PPC64 */
132 /* Currently, we limit ourselves to 1 IO range and 3 mem 128 /* Currently, we limit ourselves to 1 IO range and 3 mem
133 * ranges since the common pci_bus structure can't handle more 129 * ranges since the common pci_bus structure can't handle more
134 */ 130 */
@@ -146,21 +142,6 @@ struct pci_controller {
146#endif /* CONFIG_PPC64 */ 142#endif /* CONFIG_PPC64 */
147}; 143};
148 144
149#ifndef CONFIG_PPC64
150
151static inline struct pci_controller *pci_bus_to_host(const struct pci_bus *bus)
152{
153 return bus->sysdata;
154}
155
156static inline int isa_vaddr_is_ioport(void __iomem *address)
157{
158 /* No specific ISA handling on ppc32 at this stage, it
159 * all goes through PCI
160 */
161 return 0;
162}
163
164/* These are used for config access before all the PCI probing 145/* These are used for config access before all the PCI probing
165 has been done. */ 146 has been done. */
166extern int early_read_config_byte(struct pci_controller *hose, int bus, 147extern int early_read_config_byte(struct pci_controller *hose, int bus,
@@ -182,6 +163,22 @@ extern int early_find_capability(struct pci_controller *hose, int bus,
182extern void setup_indirect_pci(struct pci_controller* hose, 163extern void setup_indirect_pci(struct pci_controller* hose,
183 resource_size_t cfg_addr, 164 resource_size_t cfg_addr,
184 resource_size_t cfg_data, u32 flags); 165 resource_size_t cfg_data, u32 flags);
166
167#ifndef CONFIG_PPC64
168
169static inline struct pci_controller *pci_bus_to_host(const struct pci_bus *bus)
170{
171 return bus->sysdata;
172}
173
174static inline int isa_vaddr_is_ioport(void __iomem *address)
175{
176 /* No specific ISA handling on ppc32 at this stage, it
177 * all goes through PCI
178 */
179 return 0;
180}
181
185#else /* CONFIG_PPC64 */ 182#else /* CONFIG_PPC64 */
186 183
187/* 184/*
@@ -284,11 +281,6 @@ static inline int isa_vaddr_is_ioport(void __iomem *address)
284extern int pcibios_unmap_io_space(struct pci_bus *bus); 281extern int pcibios_unmap_io_space(struct pci_bus *bus);
285extern int pcibios_map_io_space(struct pci_bus *bus); 282extern int pcibios_map_io_space(struct pci_bus *bus);
286 283
287/* Return values for ppc_md.pci_probe_mode function */
288#define PCI_PROBE_NONE -1 /* Don't look at this bus at all */
289#define PCI_PROBE_NORMAL 0 /* Do normal PCI probing */
290#define PCI_PROBE_DEVTREE 1 /* Instantiate from device tree */
291
292#ifdef CONFIG_NUMA 284#ifdef CONFIG_NUMA
293#define PHB_SET_NODE(PHB, NODE) ((PHB)->node = (NODE)) 285#define PHB_SET_NODE(PHB, NODE) ((PHB)->node = (NODE))
294#else 286#else
diff --git a/arch/powerpc/include/asm/pci.h b/arch/powerpc/include/asm/pci.h
index d9483c504d2d..b5ea626eea2d 100644
--- a/arch/powerpc/include/asm/pci.h
+++ b/arch/powerpc/include/asm/pci.h
@@ -22,6 +22,11 @@
22 22
23#include <asm-generic/pci-dma-compat.h> 23#include <asm-generic/pci-dma-compat.h>
24 24
25/* Return values for ppc_md.pci_probe_mode function */
26#define PCI_PROBE_NONE -1 /* Don't look at this bus at all */
27#define PCI_PROBE_NORMAL 0 /* Do normal PCI probing */
28#define PCI_PROBE_DEVTREE 1 /* Instantiate from device tree */
29
25#define PCIBIOS_MIN_IO 0x1000 30#define PCIBIOS_MIN_IO 0x1000
26#define PCIBIOS_MIN_MEM 0x10000000 31#define PCIBIOS_MIN_MEM 0x10000000
27 32
@@ -40,7 +45,6 @@ struct pci_dev;
40 */ 45 */
41#define pcibios_assign_all_busses() \ 46#define pcibios_assign_all_busses() \
42 (ppc_pci_has_flag(PPC_PCI_REASSIGN_ALL_BUS)) 47 (ppc_pci_has_flag(PPC_PCI_REASSIGN_ALL_BUS))
43#define pcibios_scan_all_fns(a, b) 0
44 48
45static inline void pcibios_set_master(struct pci_dev *dev) 49static inline void pcibios_set_master(struct pci_dev *dev)
46{ 50{
@@ -61,8 +65,8 @@ static inline int pci_get_legacy_ide_irq(struct pci_dev *dev, int channel)
61} 65}
62 66
63#ifdef CONFIG_PCI 67#ifdef CONFIG_PCI
64extern void set_pci_dma_ops(struct dma_mapping_ops *dma_ops); 68extern void set_pci_dma_ops(struct dma_map_ops *dma_ops);
65extern struct dma_mapping_ops *get_pci_dma_ops(void); 69extern struct dma_map_ops *get_pci_dma_ops(void);
66#else /* CONFIG_PCI */ 70#else /* CONFIG_PCI */
67#define set_pci_dma_ops(d) 71#define set_pci_dma_ops(d)
68#define get_pci_dma_ops() NULL 72#define get_pci_dma_ops() NULL
@@ -228,6 +232,8 @@ extern void pci_resource_to_user(const struct pci_dev *dev, int bar,
228 232
229extern void pcibios_setup_bus_devices(struct pci_bus *bus); 233extern void pcibios_setup_bus_devices(struct pci_bus *bus);
230extern void pcibios_setup_bus_self(struct pci_bus *bus); 234extern void pcibios_setup_bus_self(struct pci_bus *bus);
235extern void pcibios_setup_phb_io_space(struct pci_controller *hose);
236extern void pcibios_scan_phb(struct pci_controller *hose, void *sysdata);
231 237
232#endif /* __KERNEL__ */ 238#endif /* __KERNEL__ */
233#endif /* __ASM_POWERPC_PCI_H */ 239#endif /* __ASM_POWERPC_PCI_H */
diff --git a/arch/powerpc/include/asm/pgalloc.h b/arch/powerpc/include/asm/pgalloc.h
index 1730e5e298d6..f2e812de7c3c 100644
--- a/arch/powerpc/include/asm/pgalloc.h
+++ b/arch/powerpc/include/asm/pgalloc.h
@@ -4,6 +4,15 @@
4 4
5#include <linux/mm.h> 5#include <linux/mm.h>
6 6
7#ifdef CONFIG_PPC_BOOK3E
8extern void tlb_flush_pgtable(struct mmu_gather *tlb, unsigned long address);
9#else /* CONFIG_PPC_BOOK3E */
10static inline void tlb_flush_pgtable(struct mmu_gather *tlb,
11 unsigned long address)
12{
13}
14#endif /* !CONFIG_PPC_BOOK3E */
15
7static inline void pte_free_kernel(struct mm_struct *mm, pte_t *pte) 16static inline void pte_free_kernel(struct mm_struct *mm, pte_t *pte)
8{ 17{
9 free_page((unsigned long)pte); 18 free_page((unsigned long)pte);
@@ -19,7 +28,12 @@ typedef struct pgtable_free {
19 unsigned long val; 28 unsigned long val;
20} pgtable_free_t; 29} pgtable_free_t;
21 30
22#define PGF_CACHENUM_MASK 0x7 31/* This needs to be big enough to allow for MMU_PAGE_COUNT + 2 to be stored
32 * and small enough to fit in the low bits of any naturally aligned page
33 * table cache entry. Arbitrarily set to 0x1f, that should give us some
34 * room to grow
35 */
36#define PGF_CACHENUM_MASK 0x1f
23 37
24static inline pgtable_free_t pgtable_free_cache(void *p, int cachenum, 38static inline pgtable_free_t pgtable_free_cache(void *p, int cachenum,
25 unsigned long mask) 39 unsigned long mask)
@@ -35,19 +49,27 @@ static inline pgtable_free_t pgtable_free_cache(void *p, int cachenum,
35#include <asm/pgalloc-32.h> 49#include <asm/pgalloc-32.h>
36#endif 50#endif
37 51
38extern void pgtable_free_tlb(struct mmu_gather *tlb, pgtable_free_t pgf);
39
40#ifdef CONFIG_SMP 52#ifdef CONFIG_SMP
41#define __pte_free_tlb(tlb,ptepage,address) \ 53extern void pgtable_free_tlb(struct mmu_gather *tlb, pgtable_free_t pgf);
42do { \ 54extern void pte_free_finish(void);
43 pgtable_page_dtor(ptepage); \ 55#else /* CONFIG_SMP */
44 pgtable_free_tlb(tlb, pgtable_free_cache(page_address(ptepage), \ 56static inline void pgtable_free_tlb(struct mmu_gather *tlb, pgtable_free_t pgf)
45 PTE_NONCACHE_NUM, PTE_TABLE_SIZE-1)); \ 57{
46} while (0) 58 pgtable_free(pgf);
47#else 59}
48#define __pte_free_tlb(tlb, pte, address) pte_free((tlb)->mm, (pte)) 60static inline void pte_free_finish(void) { }
49#endif 61#endif /* !CONFIG_SMP */
50 62
63static inline void __pte_free_tlb(struct mmu_gather *tlb, struct page *ptepage,
64 unsigned long address)
65{
66 pgtable_free_t pgf = pgtable_free_cache(page_address(ptepage),
67 PTE_NONCACHE_NUM,
68 PTE_TABLE_SIZE-1);
69 tlb_flush_pgtable(tlb, address);
70 pgtable_page_dtor(ptepage);
71 pgtable_free_tlb(tlb, pgf);
72}
51 73
52#endif /* __KERNEL__ */ 74#endif /* __KERNEL__ */
53#endif /* _ASM_POWERPC_PGALLOC_H */ 75#endif /* _ASM_POWERPC_PGALLOC_H */
diff --git a/arch/powerpc/include/asm/pgtable-ppc32.h b/arch/powerpc/include/asm/pgtable-ppc32.h
index c9ff9d75990e..55646adfa843 100644
--- a/arch/powerpc/include/asm/pgtable-ppc32.h
+++ b/arch/powerpc/include/asm/pgtable-ppc32.h
@@ -111,6 +111,8 @@ extern int icache_44x_need_flush;
111#include <asm/pte-40x.h> 111#include <asm/pte-40x.h>
112#elif defined(CONFIG_44x) 112#elif defined(CONFIG_44x)
113#include <asm/pte-44x.h> 113#include <asm/pte-44x.h>
114#elif defined(CONFIG_FSL_BOOKE) && defined(CONFIG_PTE_64BIT)
115#include <asm/pte-book3e.h>
114#elif defined(CONFIG_FSL_BOOKE) 116#elif defined(CONFIG_FSL_BOOKE)
115#include <asm/pte-fsl-booke.h> 117#include <asm/pte-fsl-booke.h>
116#elif defined(CONFIG_8xx) 118#elif defined(CONFIG_8xx)
@@ -186,7 +188,7 @@ static inline unsigned long pte_update(pte_t *p,
186#endif /* !PTE_ATOMIC_UPDATES */ 188#endif /* !PTE_ATOMIC_UPDATES */
187 189
188#ifdef CONFIG_44x 190#ifdef CONFIG_44x
189 if ((old & _PAGE_USER) && (old & _PAGE_HWEXEC)) 191 if ((old & _PAGE_USER) && (old & _PAGE_EXEC))
190 icache_44x_need_flush = 1; 192 icache_44x_need_flush = 1;
191#endif 193#endif
192 return old; 194 return old;
@@ -217,7 +219,7 @@ static inline unsigned long long pte_update(pte_t *p,
217#endif /* !PTE_ATOMIC_UPDATES */ 219#endif /* !PTE_ATOMIC_UPDATES */
218 220
219#ifdef CONFIG_44x 221#ifdef CONFIG_44x
220 if ((old & _PAGE_USER) && (old & _PAGE_HWEXEC)) 222 if ((old & _PAGE_USER) && (old & _PAGE_EXEC))
221 icache_44x_need_flush = 1; 223 icache_44x_need_flush = 1;
222#endif 224#endif
223 return old; 225 return old;
@@ -267,8 +269,7 @@ static inline void huge_ptep_set_wrprotect(struct mm_struct *mm,
267static inline void __ptep_set_access_flags(pte_t *ptep, pte_t entry) 269static inline void __ptep_set_access_flags(pte_t *ptep, pte_t entry)
268{ 270{
269 unsigned long bits = pte_val(entry) & 271 unsigned long bits = pte_val(entry) &
270 (_PAGE_DIRTY | _PAGE_ACCESSED | _PAGE_RW | 272 (_PAGE_DIRTY | _PAGE_ACCESSED | _PAGE_RW | _PAGE_EXEC);
271 _PAGE_HWEXEC | _PAGE_EXEC);
272 pte_update(ptep, 0, bits); 273 pte_update(ptep, 0, bits);
273} 274}
274 275
diff --git a/arch/powerpc/include/asm/pgtable-ppc64-64k.h b/arch/powerpc/include/asm/pgtable-ppc64-64k.h
index 6cc085b945a5..90533ddcd703 100644
--- a/arch/powerpc/include/asm/pgtable-ppc64-64k.h
+++ b/arch/powerpc/include/asm/pgtable-ppc64-64k.h
@@ -10,10 +10,10 @@
10#define PGD_INDEX_SIZE 4 10#define PGD_INDEX_SIZE 4
11 11
12#ifndef __ASSEMBLY__ 12#ifndef __ASSEMBLY__
13
14#define PTE_TABLE_SIZE (sizeof(real_pte_t) << PTE_INDEX_SIZE) 13#define PTE_TABLE_SIZE (sizeof(real_pte_t) << PTE_INDEX_SIZE)
15#define PMD_TABLE_SIZE (sizeof(pmd_t) << PMD_INDEX_SIZE) 14#define PMD_TABLE_SIZE (sizeof(pmd_t) << PMD_INDEX_SIZE)
16#define PGD_TABLE_SIZE (sizeof(pgd_t) << PGD_INDEX_SIZE) 15#define PGD_TABLE_SIZE (sizeof(pgd_t) << PGD_INDEX_SIZE)
16#endif /* __ASSEMBLY__ */
17 17
18#define PTRS_PER_PTE (1 << PTE_INDEX_SIZE) 18#define PTRS_PER_PTE (1 << PTE_INDEX_SIZE)
19#define PTRS_PER_PMD (1 << PMD_INDEX_SIZE) 19#define PTRS_PER_PMD (1 << PMD_INDEX_SIZE)
@@ -32,8 +32,6 @@
32#define PGDIR_SIZE (1UL << PGDIR_SHIFT) 32#define PGDIR_SIZE (1UL << PGDIR_SHIFT)
33#define PGDIR_MASK (~(PGDIR_SIZE-1)) 33#define PGDIR_MASK (~(PGDIR_SIZE-1))
34 34
35#endif /* __ASSEMBLY__ */
36
37/* Bits to mask out from a PMD to get to the PTE page */ 35/* Bits to mask out from a PMD to get to the PTE page */
38#define PMD_MASKED_BITS 0x1ff 36#define PMD_MASKED_BITS 0x1ff
39/* Bits to mask out from a PGD/PUD to get to the PMD page */ 37/* Bits to mask out from a PGD/PUD to get to the PMD page */
diff --git a/arch/powerpc/include/asm/pgtable-ppc64.h b/arch/powerpc/include/asm/pgtable-ppc64.h
index 8cd083c61503..806abe7a3fa5 100644
--- a/arch/powerpc/include/asm/pgtable-ppc64.h
+++ b/arch/powerpc/include/asm/pgtable-ppc64.h
@@ -5,11 +5,6 @@
5 * the ppc64 hashed page table. 5 * the ppc64 hashed page table.
6 */ 6 */
7 7
8#ifndef __ASSEMBLY__
9#include <linux/stddef.h>
10#include <asm/tlbflush.h>
11#endif /* __ASSEMBLY__ */
12
13#ifdef CONFIG_PPC_64K_PAGES 8#ifdef CONFIG_PPC_64K_PAGES
14#include <asm/pgtable-ppc64-64k.h> 9#include <asm/pgtable-ppc64-64k.h>
15#else 10#else
@@ -38,26 +33,47 @@
38#endif 33#endif
39 34
40/* 35/*
41 * Define the address range of the vmalloc VM area. 36 * Define the address range of the kernel non-linear virtual area
37 */
38
39#ifdef CONFIG_PPC_BOOK3E
40#define KERN_VIRT_START ASM_CONST(0x8000000000000000)
41#else
42#define KERN_VIRT_START ASM_CONST(0xD000000000000000)
43#endif
44#define KERN_VIRT_SIZE PGTABLE_RANGE
45
46/*
47 * The vmalloc space starts at the beginning of that region, and
48 * occupies half of it on hash CPUs and a quarter of it on Book3E
49 * (we keep a quarter for the virtual memmap)
42 */ 50 */
43#define VMALLOC_START ASM_CONST(0xD000000000000000) 51#define VMALLOC_START KERN_VIRT_START
44#define VMALLOC_SIZE (PGTABLE_RANGE >> 1) 52#ifdef CONFIG_PPC_BOOK3E
45#define VMALLOC_END (VMALLOC_START + VMALLOC_SIZE) 53#define VMALLOC_SIZE (KERN_VIRT_SIZE >> 2)
54#else
55#define VMALLOC_SIZE (KERN_VIRT_SIZE >> 1)
56#endif
57#define VMALLOC_END (VMALLOC_START + VMALLOC_SIZE)
46 58
47/* 59/*
48 * Define the address ranges for MMIO and IO space : 60 * The second half of the kernel virtual space is used for IO mappings,
61 * it's itself carved into the PIO region (ISA and PHB IO space) and
62 * the ioremap space
49 * 63 *
50 * ISA_IO_BASE = VMALLOC_END, 64K reserved area 64 * ISA_IO_BASE = KERN_IO_START, 64K reserved area
51 * PHB_IO_BASE = ISA_IO_BASE + 64K to ISA_IO_BASE + 2G, PHB IO spaces 65 * PHB_IO_BASE = ISA_IO_BASE + 64K to ISA_IO_BASE + 2G, PHB IO spaces
52 * IOREMAP_BASE = ISA_IO_BASE + 2G to VMALLOC_START + PGTABLE_RANGE 66 * IOREMAP_BASE = ISA_IO_BASE + 2G to VMALLOC_START + PGTABLE_RANGE
53 */ 67 */
68#define KERN_IO_START (KERN_VIRT_START + (KERN_VIRT_SIZE >> 1))
54#define FULL_IO_SIZE 0x80000000ul 69#define FULL_IO_SIZE 0x80000000ul
55#define ISA_IO_BASE (VMALLOC_END) 70#define ISA_IO_BASE (KERN_IO_START)
56#define ISA_IO_END (VMALLOC_END + 0x10000ul) 71#define ISA_IO_END (KERN_IO_START + 0x10000ul)
57#define PHB_IO_BASE (ISA_IO_END) 72#define PHB_IO_BASE (ISA_IO_END)
58#define PHB_IO_END (VMALLOC_END + FULL_IO_SIZE) 73#define PHB_IO_END (KERN_IO_START + FULL_IO_SIZE)
59#define IOREMAP_BASE (PHB_IO_END) 74#define IOREMAP_BASE (PHB_IO_END)
60#define IOREMAP_END (VMALLOC_START + PGTABLE_RANGE) 75#define IOREMAP_END (KERN_VIRT_START + KERN_VIRT_SIZE)
76
61 77
62/* 78/*
63 * Region IDs 79 * Region IDs
@@ -68,23 +84,32 @@
68 84
69#define VMALLOC_REGION_ID (REGION_ID(VMALLOC_START)) 85#define VMALLOC_REGION_ID (REGION_ID(VMALLOC_START))
70#define KERNEL_REGION_ID (REGION_ID(PAGE_OFFSET)) 86#define KERNEL_REGION_ID (REGION_ID(PAGE_OFFSET))
71#define VMEMMAP_REGION_ID (0xfUL) 87#define VMEMMAP_REGION_ID (0xfUL) /* Server only */
72#define USER_REGION_ID (0UL) 88#define USER_REGION_ID (0UL)
73 89
74/* 90/*
75 * Defines the address of the vmemap area, in its own region 91 * Defines the address of the vmemap area, in its own region on
92 * hash table CPUs and after the vmalloc space on Book3E
76 */ 93 */
94#ifdef CONFIG_PPC_BOOK3E
95#define VMEMMAP_BASE VMALLOC_END
96#define VMEMMAP_END KERN_IO_START
97#else
77#define VMEMMAP_BASE (VMEMMAP_REGION_ID << REGION_SHIFT) 98#define VMEMMAP_BASE (VMEMMAP_REGION_ID << REGION_SHIFT)
99#endif
78#define vmemmap ((struct page *)VMEMMAP_BASE) 100#define vmemmap ((struct page *)VMEMMAP_BASE)
79 101
80 102
81/* 103/*
82 * Include the PTE bits definitions 104 * Include the PTE bits definitions
83 */ 105 */
106#ifdef CONFIG_PPC_BOOK3S
84#include <asm/pte-hash64.h> 107#include <asm/pte-hash64.h>
108#else
109#include <asm/pte-book3e.h>
110#endif
85#include <asm/pte-common.h> 111#include <asm/pte-common.h>
86 112
87
88#ifdef CONFIG_PPC_MM_SLICES 113#ifdef CONFIG_PPC_MM_SLICES
89#define HAVE_ARCH_UNMAPPED_AREA 114#define HAVE_ARCH_UNMAPPED_AREA
90#define HAVE_ARCH_UNMAPPED_AREA_TOPDOWN 115#define HAVE_ARCH_UNMAPPED_AREA_TOPDOWN
@@ -92,6 +117,9 @@
92 117
93#ifndef __ASSEMBLY__ 118#ifndef __ASSEMBLY__
94 119
120#include <linux/stddef.h>
121#include <asm/tlbflush.h>
122
95/* 123/*
96 * This is the default implementation of various PTE accessors, it's 124 * This is the default implementation of various PTE accessors, it's
97 * used in all cases except Book3S with 64K pages where we have a 125 * used in all cases except Book3S with 64K pages where we have a
@@ -285,8 +313,7 @@ static inline void pte_clear(struct mm_struct *mm, unsigned long addr,
285static inline void __ptep_set_access_flags(pte_t *ptep, pte_t entry) 313static inline void __ptep_set_access_flags(pte_t *ptep, pte_t entry)
286{ 314{
287 unsigned long bits = pte_val(entry) & 315 unsigned long bits = pte_val(entry) &
288 (_PAGE_DIRTY | _PAGE_ACCESSED | _PAGE_RW | 316 (_PAGE_DIRTY | _PAGE_ACCESSED | _PAGE_RW | _PAGE_EXEC);
289 _PAGE_EXEC | _PAGE_HWEXEC);
290 317
291#ifdef PTE_ATOMIC_UPDATES 318#ifdef PTE_ATOMIC_UPDATES
292 unsigned long old, tmp; 319 unsigned long old, tmp;
diff --git a/arch/powerpc/include/asm/pmc.h b/arch/powerpc/include/asm/pmc.h
index d6a616a1b3ea..ccc68b50d05d 100644
--- a/arch/powerpc/include/asm/pmc.h
+++ b/arch/powerpc/include/asm/pmc.h
@@ -27,10 +27,22 @@ extern perf_irq_t perf_irq;
27 27
28int reserve_pmc_hardware(perf_irq_t new_perf_irq); 28int reserve_pmc_hardware(perf_irq_t new_perf_irq);
29void release_pmc_hardware(void); 29void release_pmc_hardware(void);
30void ppc_enable_pmcs(void);
30 31
31#ifdef CONFIG_PPC64 32#ifdef CONFIG_PPC64
32void power4_enable_pmcs(void); 33#include <asm/lppaca.h>
33void pasemi_enable_pmcs(void); 34
35static inline void ppc_set_pmu_inuse(int inuse)
36{
37 get_lppaca()->pmcregs_in_use = inuse;
38}
39
40extern void power4_enable_pmcs(void);
41
42#else /* CONFIG_PPC64 */
43
44static inline void ppc_set_pmu_inuse(int inuse) { }
45
34#endif 46#endif
35 47
36#endif /* __KERNEL__ */ 48#endif /* __KERNEL__ */
diff --git a/arch/powerpc/include/asm/ppc-opcode.h b/arch/powerpc/include/asm/ppc-opcode.h
index b74f16d45cb4..ef9aa84cac5a 100644
--- a/arch/powerpc/include/asm/ppc-opcode.h
+++ b/arch/powerpc/include/asm/ppc-opcode.h
@@ -48,6 +48,8 @@
48#define PPC_INST_TLBIE 0x7c000264 48#define PPC_INST_TLBIE 0x7c000264
49#define PPC_INST_TLBILX 0x7c000024 49#define PPC_INST_TLBILX 0x7c000024
50#define PPC_INST_WAIT 0x7c00007c 50#define PPC_INST_WAIT 0x7c00007c
51#define PPC_INST_TLBIVAX 0x7c000624
52#define PPC_INST_TLBSRX_DOT 0x7c0006a5
51 53
52/* macros to insert fields into opcodes */ 54/* macros to insert fields into opcodes */
53#define __PPC_RA(a) (((a) & 0x1f) << 16) 55#define __PPC_RA(a) (((a) & 0x1f) << 16)
@@ -76,6 +78,10 @@
76 __PPC_WC(w)) 78 __PPC_WC(w))
77#define PPC_TLBIE(lp,a) stringify_in_c(.long PPC_INST_TLBIE | \ 79#define PPC_TLBIE(lp,a) stringify_in_c(.long PPC_INST_TLBIE | \
78 __PPC_RB(a) | __PPC_RS(lp)) 80 __PPC_RB(a) | __PPC_RS(lp))
81#define PPC_TLBSRX_DOT(a,b) stringify_in_c(.long PPC_INST_TLBSRX_DOT | \
82 __PPC_RA(a) | __PPC_RB(b))
83#define PPC_TLBIVAX(a,b) stringify_in_c(.long PPC_INST_TLBIVAX | \
84 __PPC_RA(a) | __PPC_RB(b))
79 85
80/* 86/*
81 * Define what the VSX XX1 form instructions will look like, then add 87 * Define what the VSX XX1 form instructions will look like, then add
diff --git a/arch/powerpc/include/asm/ppc-pci.h b/arch/powerpc/include/asm/ppc-pci.h
index 854ab713f56c..2828f9d0f66d 100644
--- a/arch/powerpc/include/asm/ppc-pci.h
+++ b/arch/powerpc/include/asm/ppc-pci.h
@@ -39,7 +39,6 @@ void *traverse_pci_devices(struct device_node *start, traverse_func pre,
39 39
40extern void pci_devs_phb_init(void); 40extern void pci_devs_phb_init(void);
41extern void pci_devs_phb_init_dynamic(struct pci_controller *phb); 41extern void pci_devs_phb_init_dynamic(struct pci_controller *phb);
42extern void scan_phb(struct pci_controller *hose);
43 42
44/* From rtas_pci.h */ 43/* From rtas_pci.h */
45extern void init_pci_config_tokens (void); 44extern void init_pci_config_tokens (void);
diff --git a/arch/powerpc/include/asm/ppc_asm.h b/arch/powerpc/include/asm/ppc_asm.h
index f9729529c20d..498fe09263d3 100644
--- a/arch/powerpc/include/asm/ppc_asm.h
+++ b/arch/powerpc/include/asm/ppc_asm.h
@@ -98,13 +98,13 @@ END_FTR_SECTION_IFCLR(CPU_FTR_PURR); \
98#define REST_16FPRS(n, base) REST_8FPRS(n, base); REST_8FPRS(n+8, base) 98#define REST_16FPRS(n, base) REST_8FPRS(n, base); REST_8FPRS(n+8, base)
99#define REST_32FPRS(n, base) REST_16FPRS(n, base); REST_16FPRS(n+16, base) 99#define REST_32FPRS(n, base) REST_16FPRS(n, base); REST_16FPRS(n+16, base)
100 100
101#define SAVE_VR(n,b,base) li b,THREAD_VR0+(16*(n)); stvx n,b,base 101#define SAVE_VR(n,b,base) li b,THREAD_VR0+(16*(n)); stvx n,base,b
102#define SAVE_2VRS(n,b,base) SAVE_VR(n,b,base); SAVE_VR(n+1,b,base) 102#define SAVE_2VRS(n,b,base) SAVE_VR(n,b,base); SAVE_VR(n+1,b,base)
103#define SAVE_4VRS(n,b,base) SAVE_2VRS(n,b,base); SAVE_2VRS(n+2,b,base) 103#define SAVE_4VRS(n,b,base) SAVE_2VRS(n,b,base); SAVE_2VRS(n+2,b,base)
104#define SAVE_8VRS(n,b,base) SAVE_4VRS(n,b,base); SAVE_4VRS(n+4,b,base) 104#define SAVE_8VRS(n,b,base) SAVE_4VRS(n,b,base); SAVE_4VRS(n+4,b,base)
105#define SAVE_16VRS(n,b,base) SAVE_8VRS(n,b,base); SAVE_8VRS(n+8,b,base) 105#define SAVE_16VRS(n,b,base) SAVE_8VRS(n,b,base); SAVE_8VRS(n+8,b,base)
106#define SAVE_32VRS(n,b,base) SAVE_16VRS(n,b,base); SAVE_16VRS(n+16,b,base) 106#define SAVE_32VRS(n,b,base) SAVE_16VRS(n,b,base); SAVE_16VRS(n+16,b,base)
107#define REST_VR(n,b,base) li b,THREAD_VR0+(16*(n)); lvx n,b,base 107#define REST_VR(n,b,base) li b,THREAD_VR0+(16*(n)); lvx n,base,b
108#define REST_2VRS(n,b,base) REST_VR(n,b,base); REST_VR(n+1,b,base) 108#define REST_2VRS(n,b,base) REST_VR(n,b,base); REST_VR(n+1,b,base)
109#define REST_4VRS(n,b,base) REST_2VRS(n,b,base); REST_2VRS(n+2,b,base) 109#define REST_4VRS(n,b,base) REST_2VRS(n,b,base); REST_2VRS(n+2,b,base)
110#define REST_8VRS(n,b,base) REST_4VRS(n,b,base); REST_4VRS(n+4,b,base) 110#define REST_8VRS(n,b,base) REST_4VRS(n,b,base); REST_4VRS(n+4,b,base)
@@ -112,26 +112,26 @@ END_FTR_SECTION_IFCLR(CPU_FTR_PURR); \
112#define REST_32VRS(n,b,base) REST_16VRS(n,b,base); REST_16VRS(n+16,b,base) 112#define REST_32VRS(n,b,base) REST_16VRS(n,b,base); REST_16VRS(n+16,b,base)
113 113
114/* Save the lower 32 VSRs in the thread VSR region */ 114/* Save the lower 32 VSRs in the thread VSR region */
115#define SAVE_VSR(n,b,base) li b,THREAD_VSR0+(16*(n)); STXVD2X(n,b,base) 115#define SAVE_VSR(n,b,base) li b,THREAD_VSR0+(16*(n)); STXVD2X(n,base,b)
116#define SAVE_2VSRS(n,b,base) SAVE_VSR(n,b,base); SAVE_VSR(n+1,b,base) 116#define SAVE_2VSRS(n,b,base) SAVE_VSR(n,b,base); SAVE_VSR(n+1,b,base)
117#define SAVE_4VSRS(n,b,base) SAVE_2VSRS(n,b,base); SAVE_2VSRS(n+2,b,base) 117#define SAVE_4VSRS(n,b,base) SAVE_2VSRS(n,b,base); SAVE_2VSRS(n+2,b,base)
118#define SAVE_8VSRS(n,b,base) SAVE_4VSRS(n,b,base); SAVE_4VSRS(n+4,b,base) 118#define SAVE_8VSRS(n,b,base) SAVE_4VSRS(n,b,base); SAVE_4VSRS(n+4,b,base)
119#define SAVE_16VSRS(n,b,base) SAVE_8VSRS(n,b,base); SAVE_8VSRS(n+8,b,base) 119#define SAVE_16VSRS(n,b,base) SAVE_8VSRS(n,b,base); SAVE_8VSRS(n+8,b,base)
120#define SAVE_32VSRS(n,b,base) SAVE_16VSRS(n,b,base); SAVE_16VSRS(n+16,b,base) 120#define SAVE_32VSRS(n,b,base) SAVE_16VSRS(n,b,base); SAVE_16VSRS(n+16,b,base)
121#define REST_VSR(n,b,base) li b,THREAD_VSR0+(16*(n)); LXVD2X(n,b,base) 121#define REST_VSR(n,b,base) li b,THREAD_VSR0+(16*(n)); LXVD2X(n,base,b)
122#define REST_2VSRS(n,b,base) REST_VSR(n,b,base); REST_VSR(n+1,b,base) 122#define REST_2VSRS(n,b,base) REST_VSR(n,b,base); REST_VSR(n+1,b,base)
123#define REST_4VSRS(n,b,base) REST_2VSRS(n,b,base); REST_2VSRS(n+2,b,base) 123#define REST_4VSRS(n,b,base) REST_2VSRS(n,b,base); REST_2VSRS(n+2,b,base)
124#define REST_8VSRS(n,b,base) REST_4VSRS(n,b,base); REST_4VSRS(n+4,b,base) 124#define REST_8VSRS(n,b,base) REST_4VSRS(n,b,base); REST_4VSRS(n+4,b,base)
125#define REST_16VSRS(n,b,base) REST_8VSRS(n,b,base); REST_8VSRS(n+8,b,base) 125#define REST_16VSRS(n,b,base) REST_8VSRS(n,b,base); REST_8VSRS(n+8,b,base)
126#define REST_32VSRS(n,b,base) REST_16VSRS(n,b,base); REST_16VSRS(n+16,b,base) 126#define REST_32VSRS(n,b,base) REST_16VSRS(n,b,base); REST_16VSRS(n+16,b,base)
127/* Save the upper 32 VSRs (32-63) in the thread VSX region (0-31) */ 127/* Save the upper 32 VSRs (32-63) in the thread VSX region (0-31) */
128#define SAVE_VSRU(n,b,base) li b,THREAD_VR0+(16*(n)); STXVD2X(n+32,b,base) 128#define SAVE_VSRU(n,b,base) li b,THREAD_VR0+(16*(n)); STXVD2X(n+32,base,b)
129#define SAVE_2VSRSU(n,b,base) SAVE_VSRU(n,b,base); SAVE_VSRU(n+1,b,base) 129#define SAVE_2VSRSU(n,b,base) SAVE_VSRU(n,b,base); SAVE_VSRU(n+1,b,base)
130#define SAVE_4VSRSU(n,b,base) SAVE_2VSRSU(n,b,base); SAVE_2VSRSU(n+2,b,base) 130#define SAVE_4VSRSU(n,b,base) SAVE_2VSRSU(n,b,base); SAVE_2VSRSU(n+2,b,base)
131#define SAVE_8VSRSU(n,b,base) SAVE_4VSRSU(n,b,base); SAVE_4VSRSU(n+4,b,base) 131#define SAVE_8VSRSU(n,b,base) SAVE_4VSRSU(n,b,base); SAVE_4VSRSU(n+4,b,base)
132#define SAVE_16VSRSU(n,b,base) SAVE_8VSRSU(n,b,base); SAVE_8VSRSU(n+8,b,base) 132#define SAVE_16VSRSU(n,b,base) SAVE_8VSRSU(n,b,base); SAVE_8VSRSU(n+8,b,base)
133#define SAVE_32VSRSU(n,b,base) SAVE_16VSRSU(n,b,base); SAVE_16VSRSU(n+16,b,base) 133#define SAVE_32VSRSU(n,b,base) SAVE_16VSRSU(n,b,base); SAVE_16VSRSU(n+16,b,base)
134#define REST_VSRU(n,b,base) li b,THREAD_VR0+(16*(n)); LXVD2X(n+32,b,base) 134#define REST_VSRU(n,b,base) li b,THREAD_VR0+(16*(n)); LXVD2X(n+32,base,b)
135#define REST_2VSRSU(n,b,base) REST_VSRU(n,b,base); REST_VSRU(n+1,b,base) 135#define REST_2VSRSU(n,b,base) REST_VSRU(n,b,base); REST_VSRU(n+1,b,base)
136#define REST_4VSRSU(n,b,base) REST_2VSRSU(n,b,base); REST_2VSRSU(n+2,b,base) 136#define REST_4VSRSU(n,b,base) REST_2VSRSU(n,b,base); REST_2VSRSU(n+2,b,base)
137#define REST_8VSRSU(n,b,base) REST_4VSRSU(n,b,base); REST_4VSRSU(n+4,b,base) 137#define REST_8VSRSU(n,b,base) REST_4VSRSU(n,b,base); REST_4VSRSU(n+4,b,base)
@@ -375,8 +375,15 @@ END_FTR_SECTION_IFCLR(CPU_FTR_601)
375#define PPC440EP_ERR42 375#define PPC440EP_ERR42
376#endif 376#endif
377 377
378 378/*
379#if defined(CONFIG_BOOKE) 379 * toreal/fromreal/tophys/tovirt macros. 32-bit BookE makes them
380 * keep the address intact to be compatible with code shared with
381 * 32-bit classic.
382 *
383 * On the other hand, I find it useful to have them behave as expected
384 * by their name (ie always do the addition) on 64-bit BookE
385 */
386#if defined(CONFIG_BOOKE) && !defined(CONFIG_PPC64)
380#define toreal(rd) 387#define toreal(rd)
381#define fromreal(rd) 388#define fromreal(rd)
382 389
@@ -426,10 +433,9 @@ END_FTR_SECTION_IFCLR(CPU_FTR_601)
426 .previous 433 .previous
427#endif 434#endif
428 435
429#ifdef CONFIG_PPC64 436#ifdef CONFIG_PPC_BOOK3S_64
430#define RFI rfid 437#define RFI rfid
431#define MTMSRD(r) mtmsrd r 438#define MTMSRD(r) mtmsrd r
432
433#else 439#else
434#define FIX_SRR1(ra, rb) 440#define FIX_SRR1(ra, rb)
435#ifndef CONFIG_40x 441#ifndef CONFIG_40x
diff --git a/arch/powerpc/include/asm/pte-40x.h b/arch/powerpc/include/asm/pte-40x.h
index 07630faae029..6c3e1f4378d4 100644
--- a/arch/powerpc/include/asm/pte-40x.h
+++ b/arch/powerpc/include/asm/pte-40x.h
@@ -46,7 +46,7 @@
46#define _PAGE_RW 0x040 /* software: Writes permitted */ 46#define _PAGE_RW 0x040 /* software: Writes permitted */
47#define _PAGE_DIRTY 0x080 /* software: dirty page */ 47#define _PAGE_DIRTY 0x080 /* software: dirty page */
48#define _PAGE_HWWRITE 0x100 /* hardware: Dirty & RW, set in exception */ 48#define _PAGE_HWWRITE 0x100 /* hardware: Dirty & RW, set in exception */
49#define _PAGE_HWEXEC 0x200 /* hardware: EX permission */ 49#define _PAGE_EXEC 0x200 /* hardware: EX permission */
50#define _PAGE_ACCESSED 0x400 /* software: R: page referenced */ 50#define _PAGE_ACCESSED 0x400 /* software: R: page referenced */
51 51
52#define _PMD_PRESENT 0x400 /* PMD points to page of PTEs */ 52#define _PMD_PRESENT 0x400 /* PMD points to page of PTEs */
diff --git a/arch/powerpc/include/asm/pte-44x.h b/arch/powerpc/include/asm/pte-44x.h
index 37e98bcf83e0..4192b9bad901 100644
--- a/arch/powerpc/include/asm/pte-44x.h
+++ b/arch/powerpc/include/asm/pte-44x.h
@@ -78,7 +78,7 @@
78#define _PAGE_PRESENT 0x00000001 /* S: PTE valid */ 78#define _PAGE_PRESENT 0x00000001 /* S: PTE valid */
79#define _PAGE_RW 0x00000002 /* S: Write permission */ 79#define _PAGE_RW 0x00000002 /* S: Write permission */
80#define _PAGE_FILE 0x00000004 /* S: nonlinear file mapping */ 80#define _PAGE_FILE 0x00000004 /* S: nonlinear file mapping */
81#define _PAGE_HWEXEC 0x00000004 /* H: Execute permission */ 81#define _PAGE_EXEC 0x00000004 /* H: Execute permission */
82#define _PAGE_ACCESSED 0x00000008 /* S: Page referenced */ 82#define _PAGE_ACCESSED 0x00000008 /* S: Page referenced */
83#define _PAGE_DIRTY 0x00000010 /* S: Page dirty */ 83#define _PAGE_DIRTY 0x00000010 /* S: Page dirty */
84#define _PAGE_SPECIAL 0x00000020 /* S: Special page */ 84#define _PAGE_SPECIAL 0x00000020 /* S: Special page */
diff --git a/arch/powerpc/include/asm/pte-8xx.h b/arch/powerpc/include/asm/pte-8xx.h
index 8c6e31251034..94e979718dcf 100644
--- a/arch/powerpc/include/asm/pte-8xx.h
+++ b/arch/powerpc/include/asm/pte-8xx.h
@@ -36,7 +36,6 @@
36/* These five software bits must be masked out when the entry is loaded 36/* These five software bits must be masked out when the entry is loaded
37 * into the TLB. 37 * into the TLB.
38 */ 38 */
39#define _PAGE_EXEC 0x0008 /* software: i-cache coherency required */
40#define _PAGE_GUARDED 0x0010 /* software: guarded access */ 39#define _PAGE_GUARDED 0x0010 /* software: guarded access */
41#define _PAGE_DIRTY 0x0020 /* software: page changed */ 40#define _PAGE_DIRTY 0x0020 /* software: page changed */
42#define _PAGE_RW 0x0040 /* software: user write access allowed */ 41#define _PAGE_RW 0x0040 /* software: user write access allowed */
diff --git a/arch/powerpc/include/asm/pte-book3e.h b/arch/powerpc/include/asm/pte-book3e.h
new file mode 100644
index 000000000000..082d515930a2
--- /dev/null
+++ b/arch/powerpc/include/asm/pte-book3e.h
@@ -0,0 +1,84 @@
1#ifndef _ASM_POWERPC_PTE_BOOK3E_H
2#define _ASM_POWERPC_PTE_BOOK3E_H
3#ifdef __KERNEL__
4
5/* PTE bit definitions for processors compliant to the Book3E
6 * architecture 2.06 or later. The position of the PTE bits
7 * matches the HW definition of the optional Embedded Page Table
8 * category.
9 */
10
11/* Architected bits */
12#define _PAGE_PRESENT 0x000001 /* software: pte contains a translation */
13#define _PAGE_FILE 0x000002 /* (!present only) software: pte holds file offset */
14#define _PAGE_SW1 0x000002
15#define _PAGE_BAP_SR 0x000004
16#define _PAGE_BAP_UR 0x000008
17#define _PAGE_BAP_SW 0x000010
18#define _PAGE_BAP_UW 0x000020
19#define _PAGE_BAP_SX 0x000040
20#define _PAGE_BAP_UX 0x000080
21#define _PAGE_PSIZE_MSK 0x000f00
22#define _PAGE_PSIZE_4K 0x000200
23#define _PAGE_PSIZE_8K 0x000300
24#define _PAGE_PSIZE_16K 0x000400
25#define _PAGE_PSIZE_32K 0x000500
26#define _PAGE_PSIZE_64K 0x000600
27#define _PAGE_PSIZE_128K 0x000700
28#define _PAGE_PSIZE_256K 0x000800
29#define _PAGE_PSIZE_512K 0x000900
30#define _PAGE_PSIZE_1M 0x000a00
31#define _PAGE_PSIZE_2M 0x000b00
32#define _PAGE_PSIZE_4M 0x000c00
33#define _PAGE_PSIZE_8M 0x000d00
34#define _PAGE_PSIZE_16M 0x000e00
35#define _PAGE_PSIZE_32M 0x000f00
36#define _PAGE_DIRTY 0x001000 /* C: page changed */
37#define _PAGE_SW0 0x002000
38#define _PAGE_U3 0x004000
39#define _PAGE_U2 0x008000
40#define _PAGE_U1 0x010000
41#define _PAGE_U0 0x020000
42#define _PAGE_ACCESSED 0x040000
43#define _PAGE_LENDIAN 0x080000
44#define _PAGE_GUARDED 0x100000
45#define _PAGE_COHERENT 0x200000 /* M: enforce memory coherence */
46#define _PAGE_NO_CACHE 0x400000 /* I: cache inhibit */
47#define _PAGE_WRITETHRU 0x800000 /* W: cache write-through */
48
49/* "Higher level" linux bit combinations */
50#define _PAGE_EXEC _PAGE_BAP_UX /* .. and was cache cleaned */
51#define _PAGE_RW (_PAGE_BAP_SW | _PAGE_BAP_UW) /* User write permission */
52#define _PAGE_KERNEL_RW (_PAGE_BAP_SW | _PAGE_BAP_SR | _PAGE_DIRTY)
53#define _PAGE_KERNEL_RO (_PAGE_BAP_SR)
54#define _PAGE_KERNEL_RWX (_PAGE_BAP_SW | _PAGE_BAP_SR | _PAGE_DIRTY | _PAGE_BAP_SX)
55#define _PAGE_KERNEL_ROX (_PAGE_BAP_SR | _PAGE_BAP_SX)
56#define _PAGE_USER (_PAGE_BAP_UR | _PAGE_BAP_SR) /* Can be read */
57
58#define _PAGE_HASHPTE 0
59#define _PAGE_BUSY 0
60
61#define _PAGE_SPECIAL _PAGE_SW0
62
63/* Flags to be preserved on PTE modifications */
64#define _PAGE_HPTEFLAGS _PAGE_BUSY
65
66/* Base page size */
67#ifdef CONFIG_PPC_64K_PAGES
68#define _PAGE_PSIZE _PAGE_PSIZE_64K
69#define PTE_RPN_SHIFT (28)
70#else
71#define _PAGE_PSIZE _PAGE_PSIZE_4K
72#define PTE_RPN_SHIFT (24)
73#endif
74
75/* On 32-bit, we never clear the top part of the PTE */
76#ifdef CONFIG_PPC32
77#define _PTE_NONE_MASK 0xffffffff00000000ULL
78#define _PMD_PRESENT 0
79#define _PMD_PRESENT_MASK (PAGE_MASK)
80#define _PMD_BAD (~PAGE_MASK)
81#endif
82
83#endif /* __KERNEL__ */
84#endif /* _ASM_POWERPC_PTE_FSL_BOOKE_H */
diff --git a/arch/powerpc/include/asm/pte-common.h b/arch/powerpc/include/asm/pte-common.h
index a7e210b6b48c..c3b65076a263 100644
--- a/arch/powerpc/include/asm/pte-common.h
+++ b/arch/powerpc/include/asm/pte-common.h
@@ -13,9 +13,6 @@
13#ifndef _PAGE_HWWRITE 13#ifndef _PAGE_HWWRITE
14#define _PAGE_HWWRITE 0 14#define _PAGE_HWWRITE 0
15#endif 15#endif
16#ifndef _PAGE_HWEXEC
17#define _PAGE_HWEXEC 0
18#endif
19#ifndef _PAGE_EXEC 16#ifndef _PAGE_EXEC
20#define _PAGE_EXEC 0 17#define _PAGE_EXEC 0
21#endif 18#endif
@@ -34,6 +31,9 @@
34#ifndef _PAGE_4K_PFN 31#ifndef _PAGE_4K_PFN
35#define _PAGE_4K_PFN 0 32#define _PAGE_4K_PFN 0
36#endif 33#endif
34#ifndef _PAGE_SAO
35#define _PAGE_SAO 0
36#endif
37#ifndef _PAGE_PSIZE 37#ifndef _PAGE_PSIZE
38#define _PAGE_PSIZE 0 38#define _PAGE_PSIZE 0
39#endif 39#endif
@@ -45,10 +45,16 @@
45#define PMD_PAGE_SIZE(pmd) bad_call_to_PMD_PAGE_SIZE() 45#define PMD_PAGE_SIZE(pmd) bad_call_to_PMD_PAGE_SIZE()
46#endif 46#endif
47#ifndef _PAGE_KERNEL_RO 47#ifndef _PAGE_KERNEL_RO
48#define _PAGE_KERNEL_RO 0 48#define _PAGE_KERNEL_RO 0
49#endif
50#ifndef _PAGE_KERNEL_ROX
51#define _PAGE_KERNEL_ROX (_PAGE_EXEC)
49#endif 52#endif
50#ifndef _PAGE_KERNEL_RW 53#ifndef _PAGE_KERNEL_RW
51#define _PAGE_KERNEL_RW (_PAGE_DIRTY | _PAGE_RW | _PAGE_HWWRITE) 54#define _PAGE_KERNEL_RW (_PAGE_DIRTY | _PAGE_RW | _PAGE_HWWRITE)
55#endif
56#ifndef _PAGE_KERNEL_RWX
57#define _PAGE_KERNEL_RWX (_PAGE_DIRTY | _PAGE_RW | _PAGE_HWWRITE | _PAGE_EXEC)
52#endif 58#endif
53#ifndef _PAGE_HPTEFLAGS 59#ifndef _PAGE_HPTEFLAGS
54#define _PAGE_HPTEFLAGS _PAGE_HASHPTE 60#define _PAGE_HPTEFLAGS _PAGE_HASHPTE
@@ -93,8 +99,7 @@ extern unsigned long bad_call_to_PMD_PAGE_SIZE(void);
93#define PAGE_PROT_BITS (_PAGE_GUARDED | _PAGE_COHERENT | _PAGE_NO_CACHE | \ 99#define PAGE_PROT_BITS (_PAGE_GUARDED | _PAGE_COHERENT | _PAGE_NO_CACHE | \
94 _PAGE_WRITETHRU | _PAGE_ENDIAN | _PAGE_4K_PFN | \ 100 _PAGE_WRITETHRU | _PAGE_ENDIAN | _PAGE_4K_PFN | \
95 _PAGE_USER | _PAGE_ACCESSED | \ 101 _PAGE_USER | _PAGE_ACCESSED | \
96 _PAGE_RW | _PAGE_HWWRITE | _PAGE_DIRTY | \ 102 _PAGE_RW | _PAGE_HWWRITE | _PAGE_DIRTY | _PAGE_EXEC)
97 _PAGE_EXEC | _PAGE_HWEXEC)
98 103
99/* 104/*
100 * We define 2 sets of base prot bits, one for basic pages (ie, 105 * We define 2 sets of base prot bits, one for basic pages (ie,
@@ -151,11 +156,9 @@ extern unsigned long bad_call_to_PMD_PAGE_SIZE(void);
151 _PAGE_NO_CACHE) 156 _PAGE_NO_CACHE)
152#define PAGE_KERNEL_NCG __pgprot(_PAGE_BASE_NC | _PAGE_KERNEL_RW | \ 157#define PAGE_KERNEL_NCG __pgprot(_PAGE_BASE_NC | _PAGE_KERNEL_RW | \
153 _PAGE_NO_CACHE | _PAGE_GUARDED) 158 _PAGE_NO_CACHE | _PAGE_GUARDED)
154#define PAGE_KERNEL_X __pgprot(_PAGE_BASE | _PAGE_KERNEL_RW | _PAGE_EXEC | \ 159#define PAGE_KERNEL_X __pgprot(_PAGE_BASE | _PAGE_KERNEL_RWX)
155 _PAGE_HWEXEC)
156#define PAGE_KERNEL_RO __pgprot(_PAGE_BASE | _PAGE_KERNEL_RO) 160#define PAGE_KERNEL_RO __pgprot(_PAGE_BASE | _PAGE_KERNEL_RO)
157#define PAGE_KERNEL_ROX __pgprot(_PAGE_BASE | _PAGE_KERNEL_RO | _PAGE_EXEC | \ 161#define PAGE_KERNEL_ROX __pgprot(_PAGE_BASE | _PAGE_KERNEL_ROX)
158 _PAGE_HWEXEC)
159 162
160/* Protection used for kernel text. We want the debuggers to be able to 163/* Protection used for kernel text. We want the debuggers to be able to
161 * set breakpoints anywhere, so don't write protect the kernel text 164 * set breakpoints anywhere, so don't write protect the kernel text
diff --git a/arch/powerpc/include/asm/pte-fsl-booke.h b/arch/powerpc/include/asm/pte-fsl-booke.h
index 10820f58acf5..2c12be5f677a 100644
--- a/arch/powerpc/include/asm/pte-fsl-booke.h
+++ b/arch/powerpc/include/asm/pte-fsl-booke.h
@@ -23,7 +23,7 @@
23#define _PAGE_FILE 0x00002 /* S: when !present: nonlinear file mapping */ 23#define _PAGE_FILE 0x00002 /* S: when !present: nonlinear file mapping */
24#define _PAGE_RW 0x00004 /* S: Write permission (SW) */ 24#define _PAGE_RW 0x00004 /* S: Write permission (SW) */
25#define _PAGE_DIRTY 0x00008 /* S: Page dirty */ 25#define _PAGE_DIRTY 0x00008 /* S: Page dirty */
26#define _PAGE_HWEXEC 0x00010 /* H: SX permission */ 26#define _PAGE_EXEC 0x00010 /* H: SX permission */
27#define _PAGE_ACCESSED 0x00020 /* S: Page referenced */ 27#define _PAGE_ACCESSED 0x00020 /* S: Page referenced */
28 28
29#define _PAGE_ENDIAN 0x00040 /* H: E bit */ 29#define _PAGE_ENDIAN 0x00040 /* H: E bit */
@@ -33,13 +33,6 @@
33#define _PAGE_WRITETHRU 0x00400 /* H: W bit */ 33#define _PAGE_WRITETHRU 0x00400 /* H: W bit */
34#define _PAGE_SPECIAL 0x00800 /* S: Special page */ 34#define _PAGE_SPECIAL 0x00800 /* S: Special page */
35 35
36#ifdef CONFIG_PTE_64BIT
37/* ERPN in a PTE never gets cleared, ignore it */
38#define _PTE_NONE_MASK 0xffffffffffff0000ULL
39/* We extend the size of the PTE flags area when using 64-bit PTEs */
40#define PTE_RPN_SHIFT (PAGE_SHIFT + 8)
41#endif
42
43#define _PMD_PRESENT 0 36#define _PMD_PRESENT 0
44#define _PMD_PRESENT_MASK (PAGE_MASK) 37#define _PMD_PRESENT_MASK (PAGE_MASK)
45#define _PMD_BAD (~PAGE_MASK) 38#define _PMD_BAD (~PAGE_MASK)
diff --git a/arch/powerpc/include/asm/pte-hash32.h b/arch/powerpc/include/asm/pte-hash32.h
index 16e571c7f9ef..4aad4132d0a8 100644
--- a/arch/powerpc/include/asm/pte-hash32.h
+++ b/arch/powerpc/include/asm/pte-hash32.h
@@ -26,7 +26,6 @@
26#define _PAGE_WRITETHRU 0x040 /* W: cache write-through */ 26#define _PAGE_WRITETHRU 0x040 /* W: cache write-through */
27#define _PAGE_DIRTY 0x080 /* C: page changed */ 27#define _PAGE_DIRTY 0x080 /* C: page changed */
28#define _PAGE_ACCESSED 0x100 /* R: page referenced */ 28#define _PAGE_ACCESSED 0x100 /* R: page referenced */
29#define _PAGE_EXEC 0x200 /* software: i-cache coherency required */
30#define _PAGE_RW 0x400 /* software: user write access allowed */ 29#define _PAGE_RW 0x400 /* software: user write access allowed */
31#define _PAGE_SPECIAL 0x800 /* software: Special page */ 30#define _PAGE_SPECIAL 0x800 /* software: Special page */
32 31
diff --git a/arch/powerpc/include/asm/reg.h b/arch/powerpc/include/asm/reg.h
index 1170267736d3..6315edc205d8 100644
--- a/arch/powerpc/include/asm/reg.h
+++ b/arch/powerpc/include/asm/reg.h
@@ -98,19 +98,15 @@
98#define MSR_RI __MASK(MSR_RI_LG) /* Recoverable Exception */ 98#define MSR_RI __MASK(MSR_RI_LG) /* Recoverable Exception */
99#define MSR_LE __MASK(MSR_LE_LG) /* Little Endian */ 99#define MSR_LE __MASK(MSR_LE_LG) /* Little Endian */
100 100
101#ifdef CONFIG_PPC64 101#if defined(CONFIG_PPC_BOOK3S_64)
102/* Server variant */
102#define MSR_ MSR_ME | MSR_RI | MSR_IR | MSR_DR | MSR_ISF |MSR_HV 103#define MSR_ MSR_ME | MSR_RI | MSR_IR | MSR_DR | MSR_ISF |MSR_HV
103#define MSR_KERNEL MSR_ | MSR_SF 104#define MSR_KERNEL MSR_ | MSR_SF
104
105#define MSR_USER32 MSR_ | MSR_PR | MSR_EE 105#define MSR_USER32 MSR_ | MSR_PR | MSR_EE
106#define MSR_USER64 MSR_USER32 | MSR_SF 106#define MSR_USER64 MSR_USER32 | MSR_SF
107 107#elif defined(CONFIG_PPC_BOOK3S_32) || defined(CONFIG_8xx)
108#else /* 32-bit */
109/* Default MSR for kernel mode. */ 108/* Default MSR for kernel mode. */
110#ifndef MSR_KERNEL /* reg_booke.h also defines this */
111#define MSR_KERNEL (MSR_ME|MSR_RI|MSR_IR|MSR_DR) 109#define MSR_KERNEL (MSR_ME|MSR_RI|MSR_IR|MSR_DR)
112#endif
113
114#define MSR_USER (MSR_KERNEL|MSR_PR|MSR_EE) 110#define MSR_USER (MSR_KERNEL|MSR_PR|MSR_EE)
115#endif 111#endif
116 112
@@ -646,6 +642,137 @@
646#endif 642#endif
647 643
648/* 644/*
645 * SPRG usage:
646 *
647 * All 64-bit:
648 * - SPRG1 stores PACA pointer
649 *
650 * 64-bit server:
651 * - SPRG0 unused (reserved for HV on Power4)
652 * - SPRG2 scratch for exception vectors
653 * - SPRG3 unused (user visible)
654 *
655 * 64-bit embedded
656 * - SPRG0 generic exception scratch
657 * - SPRG2 TLB exception stack
658 * - SPRG3 unused (user visible)
659 * - SPRG4 unused (user visible)
660 * - SPRG6 TLB miss scratch (user visible, sorry !)
661 * - SPRG7 critical exception scratch
662 * - SPRG8 machine check exception scratch
663 * - SPRG9 debug exception scratch
664 *
665 * All 32-bit:
666 * - SPRG3 current thread_info pointer
667 * (virtual on BookE, physical on others)
668 *
669 * 32-bit classic:
670 * - SPRG0 scratch for exception vectors
671 * - SPRG1 scratch for exception vectors
672 * - SPRG2 indicator that we are in RTAS
673 * - SPRG4 (603 only) pseudo TLB LRU data
674 *
675 * 32-bit 40x:
676 * - SPRG0 scratch for exception vectors
677 * - SPRG1 scratch for exception vectors
678 * - SPRG2 scratch for exception vectors
679 * - SPRG4 scratch for exception vectors (not 403)
680 * - SPRG5 scratch for exception vectors (not 403)
681 * - SPRG6 scratch for exception vectors (not 403)
682 * - SPRG7 scratch for exception vectors (not 403)
683 *
684 * 32-bit 440 and FSL BookE:
685 * - SPRG0 scratch for exception vectors
686 * - SPRG1 scratch for exception vectors (*)
687 * - SPRG2 scratch for crit interrupts handler
688 * - SPRG4 scratch for exception vectors
689 * - SPRG5 scratch for exception vectors
690 * - SPRG6 scratch for machine check handler
691 * - SPRG7 scratch for exception vectors
692 * - SPRG9 scratch for debug vectors (e500 only)
693 *
694 * Additionally, BookE separates "read" and "write"
695 * of those registers. That allows to use the userspace
696 * readable variant for reads, which can avoid a fault
697 * with KVM type virtualization.
698 *
699 * (*) Under KVM, the host SPRG1 is used to point to
700 * the current VCPU data structure
701 *
702 * 32-bit 8xx:
703 * - SPRG0 scratch for exception vectors
704 * - SPRG1 scratch for exception vectors
705 * - SPRG2 apparently unused but initialized
706 *
707 */
708#ifdef CONFIG_PPC64
709#define SPRN_SPRG_PACA SPRN_SPRG1
710#else
711#define SPRN_SPRG_THREAD SPRN_SPRG3
712#endif
713
714#ifdef CONFIG_PPC_BOOK3S_64
715#define SPRN_SPRG_SCRATCH0 SPRN_SPRG2
716#endif
717
718#ifdef CONFIG_PPC_BOOK3E_64
719#define SPRN_SPRG_MC_SCRATCH SPRN_SPRG8
720#define SPRN_SPRG_CRIT_SCRATCH SPRN_SPRG7
721#define SPRN_SPRG_DBG_SCRATCH SPRN_SPRG9
722#define SPRN_SPRG_TLB_EXFRAME SPRN_SPRG2
723#define SPRN_SPRG_TLB_SCRATCH SPRN_SPRG6
724#define SPRN_SPRG_GEN_SCRATCH SPRN_SPRG0
725#endif
726
727#ifdef CONFIG_PPC_BOOK3S_32
728#define SPRN_SPRG_SCRATCH0 SPRN_SPRG0
729#define SPRN_SPRG_SCRATCH1 SPRN_SPRG1
730#define SPRN_SPRG_RTAS SPRN_SPRG2
731#define SPRN_SPRG_603_LRU SPRN_SPRG4
732#endif
733
734#ifdef CONFIG_40x
735#define SPRN_SPRG_SCRATCH0 SPRN_SPRG0
736#define SPRN_SPRG_SCRATCH1 SPRN_SPRG1
737#define SPRN_SPRG_SCRATCH2 SPRN_SPRG2
738#define SPRN_SPRG_SCRATCH3 SPRN_SPRG4
739#define SPRN_SPRG_SCRATCH4 SPRN_SPRG5
740#define SPRN_SPRG_SCRATCH5 SPRN_SPRG6
741#define SPRN_SPRG_SCRATCH6 SPRN_SPRG7
742#endif
743
744#ifdef CONFIG_BOOKE
745#define SPRN_SPRG_RSCRATCH0 SPRN_SPRG0
746#define SPRN_SPRG_WSCRATCH0 SPRN_SPRG0
747#define SPRN_SPRG_RSCRATCH1 SPRN_SPRG1
748#define SPRN_SPRG_WSCRATCH1 SPRN_SPRG1
749#define SPRN_SPRG_RSCRATCH_CRIT SPRN_SPRG2
750#define SPRN_SPRG_WSCRATCH_CRIT SPRN_SPRG2
751#define SPRN_SPRG_RSCRATCH2 SPRN_SPRG4R
752#define SPRN_SPRG_WSCRATCH2 SPRN_SPRG4W
753#define SPRN_SPRG_RSCRATCH3 SPRN_SPRG5R
754#define SPRN_SPRG_WSCRATCH3 SPRN_SPRG5W
755#define SPRN_SPRG_RSCRATCH_MC SPRN_SPRG6R
756#define SPRN_SPRG_WSCRATCH_MC SPRN_SPRG6W
757#define SPRN_SPRG_RSCRATCH4 SPRN_SPRG7R
758#define SPRN_SPRG_WSCRATCH4 SPRN_SPRG7W
759#ifdef CONFIG_E200
760#define SPRN_SPRG_RSCRATCH_DBG SPRN_SPRG6R
761#define SPRN_SPRG_WSCRATCH_DBG SPRN_SPRG6W
762#else
763#define SPRN_SPRG_RSCRATCH_DBG SPRN_SPRG9
764#define SPRN_SPRG_WSCRATCH_DBG SPRN_SPRG9
765#endif
766#define SPRN_SPRG_RVCPU SPRN_SPRG1
767#define SPRN_SPRG_WVCPU SPRN_SPRG1
768#endif
769
770#ifdef CONFIG_8xx
771#define SPRN_SPRG_SCRATCH0 SPRN_SPRG0
772#define SPRN_SPRG_SCRATCH1 SPRN_SPRG1
773#endif
774
775/*
649 * An mtfsf instruction with the L bit set. On CPUs that support this a 776 * An mtfsf instruction with the L bit set. On CPUs that support this a
650 * full 64bits of FPSCR is restored and on other CPUs the L bit is ignored. 777 * full 64bits of FPSCR is restored and on other CPUs the L bit is ignored.
651 * 778 *
diff --git a/arch/powerpc/include/asm/reg_booke.h b/arch/powerpc/include/asm/reg_booke.h
index 6bcf364cbb2f..3bf783505528 100644
--- a/arch/powerpc/include/asm/reg_booke.h
+++ b/arch/powerpc/include/asm/reg_booke.h
@@ -18,18 +18,26 @@
18#define MSR_IS MSR_IR /* Instruction Space */ 18#define MSR_IS MSR_IR /* Instruction Space */
19#define MSR_DS MSR_DR /* Data Space */ 19#define MSR_DS MSR_DR /* Data Space */
20#define MSR_PMM (1<<2) /* Performance monitor mark bit */ 20#define MSR_PMM (1<<2) /* Performance monitor mark bit */
21#define MSR_CM (1<<31) /* Computation Mode (0=32-bit, 1=64-bit) */
21 22
22/* Default MSR for kernel mode. */ 23#if defined(CONFIG_PPC_BOOK3E_64)
23#if defined (CONFIG_40x) 24#define MSR_ MSR_ME | MSR_CE
25#define MSR_KERNEL MSR_ | MSR_CM
26#define MSR_USER32 MSR_ | MSR_PR | MSR_EE
27#define MSR_USER64 MSR_USER32 | MSR_CM
28#elif defined (CONFIG_40x)
24#define MSR_KERNEL (MSR_ME|MSR_RI|MSR_IR|MSR_DR|MSR_CE) 29#define MSR_KERNEL (MSR_ME|MSR_RI|MSR_IR|MSR_DR|MSR_CE)
25#elif defined(CONFIG_BOOKE) 30#define MSR_USER (MSR_KERNEL|MSR_PR|MSR_EE)
31#else
26#define MSR_KERNEL (MSR_ME|MSR_RI|MSR_CE) 32#define MSR_KERNEL (MSR_ME|MSR_RI|MSR_CE)
33#define MSR_USER (MSR_KERNEL|MSR_PR|MSR_EE)
27#endif 34#endif
28 35
29/* Special Purpose Registers (SPRNs)*/ 36/* Special Purpose Registers (SPRNs)*/
30#define SPRN_DECAR 0x036 /* Decrementer Auto Reload Register */ 37#define SPRN_DECAR 0x036 /* Decrementer Auto Reload Register */
31#define SPRN_IVPR 0x03F /* Interrupt Vector Prefix Register */ 38#define SPRN_IVPR 0x03F /* Interrupt Vector Prefix Register */
32#define SPRN_USPRG0 0x100 /* User Special Purpose Register General 0 */ 39#define SPRN_USPRG0 0x100 /* User Special Purpose Register General 0 */
40#define SPRN_SPRG3R 0x103 /* Special Purpose Register General 3 Read */
33#define SPRN_SPRG4R 0x104 /* Special Purpose Register General 4 Read */ 41#define SPRN_SPRG4R 0x104 /* Special Purpose Register General 4 Read */
34#define SPRN_SPRG5R 0x105 /* Special Purpose Register General 5 Read */ 42#define SPRN_SPRG5R 0x105 /* Special Purpose Register General 5 Read */
35#define SPRN_SPRG6R 0x106 /* Special Purpose Register General 6 Read */ 43#define SPRN_SPRG6R 0x106 /* Special Purpose Register General 6 Read */
@@ -38,11 +46,18 @@
38#define SPRN_SPRG5W 0x115 /* Special Purpose Register General 5 Write */ 46#define SPRN_SPRG5W 0x115 /* Special Purpose Register General 5 Write */
39#define SPRN_SPRG6W 0x116 /* Special Purpose Register General 6 Write */ 47#define SPRN_SPRG6W 0x116 /* Special Purpose Register General 6 Write */
40#define SPRN_SPRG7W 0x117 /* Special Purpose Register General 7 Write */ 48#define SPRN_SPRG7W 0x117 /* Special Purpose Register General 7 Write */
49#define SPRN_EPCR 0x133 /* Embedded Processor Control Register */
41#define SPRN_DBCR2 0x136 /* Debug Control Register 2 */ 50#define SPRN_DBCR2 0x136 /* Debug Control Register 2 */
42#define SPRN_IAC3 0x13A /* Instruction Address Compare 3 */ 51#define SPRN_IAC3 0x13A /* Instruction Address Compare 3 */
43#define SPRN_IAC4 0x13B /* Instruction Address Compare 4 */ 52#define SPRN_IAC4 0x13B /* Instruction Address Compare 4 */
44#define SPRN_DVC1 0x13E /* Data Value Compare Register 1 */ 53#define SPRN_DVC1 0x13E /* Data Value Compare Register 1 */
45#define SPRN_DVC2 0x13F /* Data Value Compare Register 2 */ 54#define SPRN_DVC2 0x13F /* Data Value Compare Register 2 */
55#define SPRN_MAS8 0x155 /* MMU Assist Register 8 */
56#define SPRN_TLB0PS 0x158 /* TLB 0 Page Size Register */
57#define SPRN_MAS5_MAS6 0x15c /* MMU Assist Register 5 || 6 */
58#define SPRN_MAS8_MAS1 0x15d /* MMU Assist Register 8 || 1 */
59#define SPRN_MAS7_MAS3 0x174 /* MMU Assist Register 7 || 3 */
60#define SPRN_MAS0_MAS1 0x175 /* MMU Assist Register 0 || 1 */
46#define SPRN_IVOR0 0x190 /* Interrupt Vector Offset Register 0 */ 61#define SPRN_IVOR0 0x190 /* Interrupt Vector Offset Register 0 */
47#define SPRN_IVOR1 0x191 /* Interrupt Vector Offset Register 1 */ 62#define SPRN_IVOR1 0x191 /* Interrupt Vector Offset Register 1 */
48#define SPRN_IVOR2 0x192 /* Interrupt Vector Offset Register 2 */ 63#define SPRN_IVOR2 0x192 /* Interrupt Vector Offset Register 2 */
@@ -93,6 +108,8 @@
93#define SPRN_PID2 0x27A /* Process ID Register 2 */ 108#define SPRN_PID2 0x27A /* Process ID Register 2 */
94#define SPRN_TLB0CFG 0x2B0 /* TLB 0 Config Register */ 109#define SPRN_TLB0CFG 0x2B0 /* TLB 0 Config Register */
95#define SPRN_TLB1CFG 0x2B1 /* TLB 1 Config Register */ 110#define SPRN_TLB1CFG 0x2B1 /* TLB 1 Config Register */
111#define SPRN_TLB2CFG 0x2B2 /* TLB 2 Config Register */
112#define SPRN_TLB3CFG 0x2B3 /* TLB 3 Config Register */
96#define SPRN_EPR 0x2BE /* External Proxy Register */ 113#define SPRN_EPR 0x2BE /* External Proxy Register */
97#define SPRN_CCR1 0x378 /* Core Configuration Register 1 */ 114#define SPRN_CCR1 0x378 /* Core Configuration Register 1 */
98#define SPRN_ZPR 0x3B0 /* Zone Protection Register (40x) */ 115#define SPRN_ZPR 0x3B0 /* Zone Protection Register (40x) */
@@ -415,16 +432,31 @@
415#define L2CSR0_L2LOA 0x00000080 /* L2 Cache Lock Overflow Allocate */ 432#define L2CSR0_L2LOA 0x00000080 /* L2 Cache Lock Overflow Allocate */
416#define L2CSR0_L2LO 0x00000020 /* L2 Cache Lock Overflow */ 433#define L2CSR0_L2LO 0x00000020 /* L2 Cache Lock Overflow */
417 434
418/* Bit definitions for MMUCSR0 */
419#define MMUCSR0_TLB1FI 0x00000002 /* TLB1 Flash invalidate */
420#define MMUCSR0_TLB0FI 0x00000004 /* TLB0 Flash invalidate */
421#define MMUCSR0_TLB2FI 0x00000040 /* TLB2 Flash invalidate */
422#define MMUCSR0_TLB3FI 0x00000020 /* TLB3 Flash invalidate */
423
424/* Bit definitions for SGR. */ 435/* Bit definitions for SGR. */
425#define SGR_NORMAL 0 /* Speculative fetching allowed. */ 436#define SGR_NORMAL 0 /* Speculative fetching allowed. */
426#define SGR_GUARDED 1 /* Speculative fetching disallowed. */ 437#define SGR_GUARDED 1 /* Speculative fetching disallowed. */
427 438
439/* Bit definitions for EPCR */
440#define SPRN_EPCR_EXTGS 0x80000000 /* External Input interrupt
441 * directed to Guest state */
442#define SPRN_EPCR_DTLBGS 0x40000000 /* Data TLB Error interrupt
443 * directed to guest state */
444#define SPRN_EPCR_ITLBGS 0x20000000 /* Instr. TLB error interrupt
445 * directed to guest state */
446#define SPRN_EPCR_DSIGS 0x10000000 /* Data Storage interrupt
447 * directed to guest state */
448#define SPRN_EPCR_ISIGS 0x08000000 /* Instr. Storage interrupt
449 * directed to guest state */
450#define SPRN_EPCR_DUVD 0x04000000 /* Disable Hypervisor Debug */
451#define SPRN_EPCR_ICM 0x02000000 /* Interrupt computation mode
452 * (copied to MSR:CM on intr) */
453#define SPRN_EPCR_GICM 0x01000000 /* Guest Interrupt Comp. mode */
454#define SPRN_EPCR_DGTMI 0x00800000 /* Disable TLB Guest Management
455 * instructions */
456#define SPRN_EPCR_DMIUH 0x00400000 /* Disable MAS Interrupt updates
457 * for hypervisor */
458
459
428/* 460/*
429 * The IBM-403 is an even more odd special case, as it is much 461 * The IBM-403 is an even more odd special case, as it is much
430 * older than the IBM-405 series. We put these down here incase someone 462 * older than the IBM-405 series. We put these down here incase someone
diff --git a/arch/powerpc/include/asm/setup.h b/arch/powerpc/include/asm/setup.h
index 817fac0a0714..dae19342f0b9 100644
--- a/arch/powerpc/include/asm/setup.h
+++ b/arch/powerpc/include/asm/setup.h
@@ -1,6 +1,6 @@
1#ifndef _ASM_POWERPC_SETUP_H 1#ifndef _ASM_POWERPC_SETUP_H
2#define _ASM_POWERPC_SETUP_H 2#define _ASM_POWERPC_SETUP_H
3 3
4#define COMMAND_LINE_SIZE 512 4#include <asm-generic/setup.h>
5 5
6#endif /* _ASM_POWERPC_SETUP_H */ 6#endif /* _ASM_POWERPC_SETUP_H */
diff --git a/arch/powerpc/include/asm/smp.h b/arch/powerpc/include/asm/smp.h
index c25f73d1d842..c0d3b8af9319 100644
--- a/arch/powerpc/include/asm/smp.h
+++ b/arch/powerpc/include/asm/smp.h
@@ -148,6 +148,16 @@ extern struct smp_ops_t *smp_ops;
148extern void arch_send_call_function_single_ipi(int cpu); 148extern void arch_send_call_function_single_ipi(int cpu);
149extern void arch_send_call_function_ipi(cpumask_t mask); 149extern void arch_send_call_function_ipi(cpumask_t mask);
150 150
151/* Definitions relative to the secondary CPU spin loop
152 * and entry point. Not all of them exist on both 32 and
153 * 64-bit but defining them all here doesn't harm
154 */
155extern void generic_secondary_smp_init(void);
156extern void generic_secondary_thread_init(void);
157extern unsigned long __secondary_hold_spinloop;
158extern unsigned long __secondary_hold_acknowledge;
159extern char __secondary_hold;
160
151#endif /* __ASSEMBLY__ */ 161#endif /* __ASSEMBLY__ */
152 162
153#endif /* __KERNEL__ */ 163#endif /* __KERNEL__ */
diff --git a/arch/powerpc/include/asm/swiotlb.h b/arch/powerpc/include/asm/swiotlb.h
index 30891d6e2bc1..8979d4cd3d70 100644
--- a/arch/powerpc/include/asm/swiotlb.h
+++ b/arch/powerpc/include/asm/swiotlb.h
@@ -13,15 +13,13 @@
13 13
14#include <linux/swiotlb.h> 14#include <linux/swiotlb.h>
15 15
16extern struct dma_mapping_ops swiotlb_dma_ops; 16extern struct dma_map_ops swiotlb_dma_ops;
17extern struct dma_mapping_ops swiotlb_pci_dma_ops;
18
19int swiotlb_arch_address_needs_mapping(struct device *, dma_addr_t,
20 size_t size);
21 17
22static inline void dma_mark_clean(void *addr, size_t size) {} 18static inline void dma_mark_clean(void *addr, size_t size) {}
23 19
24extern unsigned int ppc_swiotlb_enable; 20extern unsigned int ppc_swiotlb_enable;
25int __init swiotlb_setup_bus_notifier(void); 21int __init swiotlb_setup_bus_notifier(void);
26 22
23extern void pci_dma_dev_setup_swiotlb(struct pci_dev *pdev);
24
27#endif /* __ASM_SWIOTLB_H */ 25#endif /* __ASM_SWIOTLB_H */
diff --git a/arch/powerpc/include/asm/systbl.h b/arch/powerpc/include/asm/systbl.h
index 370600ca2765..ed24bd92fe49 100644
--- a/arch/powerpc/include/asm/systbl.h
+++ b/arch/powerpc/include/asm/systbl.h
@@ -95,8 +95,8 @@ SYSCALL(reboot)
95SYSX(sys_ni_syscall,compat_sys_old_readdir,sys_old_readdir) 95SYSX(sys_ni_syscall,compat_sys_old_readdir,sys_old_readdir)
96SYSCALL_SPU(mmap) 96SYSCALL_SPU(mmap)
97SYSCALL_SPU(munmap) 97SYSCALL_SPU(munmap)
98SYSCALL_SPU(truncate) 98COMPAT_SYS_SPU(truncate)
99SYSCALL_SPU(ftruncate) 99COMPAT_SYS_SPU(ftruncate)
100SYSCALL_SPU(fchmod) 100SYSCALL_SPU(fchmod)
101SYSCALL_SPU(fchown) 101SYSCALL_SPU(fchown)
102COMPAT_SYS_SPU(getpriority) 102COMPAT_SYS_SPU(getpriority)
diff --git a/arch/powerpc/include/asm/tlb.h b/arch/powerpc/include/asm/tlb.h
index e20ff7541f36..e2b428b0f7ba 100644
--- a/arch/powerpc/include/asm/tlb.h
+++ b/arch/powerpc/include/asm/tlb.h
@@ -25,57 +25,25 @@
25 25
26#include <linux/pagemap.h> 26#include <linux/pagemap.h>
27 27
28struct mmu_gather;
29
30#define tlb_start_vma(tlb, vma) do { } while (0) 28#define tlb_start_vma(tlb, vma) do { } while (0)
31#define tlb_end_vma(tlb, vma) do { } while (0) 29#define tlb_end_vma(tlb, vma) do { } while (0)
32 30
33#if !defined(CONFIG_PPC_STD_MMU)
34
35#define tlb_flush(tlb) flush_tlb_mm((tlb)->mm)
36
37#elif defined(__powerpc64__)
38
39extern void pte_free_finish(void);
40
41static inline void tlb_flush(struct mmu_gather *tlb)
42{
43 struct ppc64_tlb_batch *tlbbatch = &__get_cpu_var(ppc64_tlb_batch);
44
45 /* If there's a TLB batch pending, then we must flush it because the
46 * pages are going to be freed and we really don't want to have a CPU
47 * access a freed page because it has a stale TLB
48 */
49 if (tlbbatch->index)
50 __flush_tlb_pending(tlbbatch);
51
52 pte_free_finish();
53}
54
55#else
56
57extern void tlb_flush(struct mmu_gather *tlb); 31extern void tlb_flush(struct mmu_gather *tlb);
58 32
59#endif
60
61/* Get the generic bits... */ 33/* Get the generic bits... */
62#include <asm-generic/tlb.h> 34#include <asm-generic/tlb.h>
63 35
64#if !defined(CONFIG_PPC_STD_MMU) || defined(__powerpc64__)
65
66#define __tlb_remove_tlb_entry(tlb, pte, address) do { } while (0)
67
68#else
69extern void flush_hash_entry(struct mm_struct *mm, pte_t *ptep, 36extern void flush_hash_entry(struct mm_struct *mm, pte_t *ptep,
70 unsigned long address); 37 unsigned long address);
71 38
72static inline void __tlb_remove_tlb_entry(struct mmu_gather *tlb, pte_t *ptep, 39static inline void __tlb_remove_tlb_entry(struct mmu_gather *tlb, pte_t *ptep,
73 unsigned long address) 40 unsigned long address)
74{ 41{
42#ifdef CONFIG_PPC_STD_MMU_32
75 if (pte_val(*ptep) & _PAGE_HASHPTE) 43 if (pte_val(*ptep) & _PAGE_HASHPTE)
76 flush_hash_entry(tlb->mm, ptep, address); 44 flush_hash_entry(tlb->mm, ptep, address);
45#endif
77} 46}
78 47
79#endif
80#endif /* __KERNEL__ */ 48#endif /* __KERNEL__ */
81#endif /* __ASM_POWERPC_TLB_H */ 49#endif /* __ASM_POWERPC_TLB_H */
diff --git a/arch/powerpc/include/asm/tlbflush.h b/arch/powerpc/include/asm/tlbflush.h
index abbe3419d1dd..d50a380b2b6f 100644
--- a/arch/powerpc/include/asm/tlbflush.h
+++ b/arch/powerpc/include/asm/tlbflush.h
@@ -6,7 +6,7 @@
6 * 6 *
7 * - flush_tlb_mm(mm) flushes the specified mm context TLB's 7 * - flush_tlb_mm(mm) flushes the specified mm context TLB's
8 * - flush_tlb_page(vma, vmaddr) flushes one page 8 * - flush_tlb_page(vma, vmaddr) flushes one page
9 * - local_flush_tlb_mm(mm) flushes the specified mm context on 9 * - local_flush_tlb_mm(mm, full) flushes the specified mm context on
10 * the local processor 10 * the local processor
11 * - local_flush_tlb_page(vma, vmaddr) flushes one page on the local processor 11 * - local_flush_tlb_page(vma, vmaddr) flushes one page on the local processor
12 * - flush_tlb_page_nohash(vma, vmaddr) flushes one page if SW loaded TLB 12 * - flush_tlb_page_nohash(vma, vmaddr) flushes one page if SW loaded TLB
@@ -29,7 +29,8 @@
29 * specific tlbie's 29 * specific tlbie's
30 */ 30 */
31 31
32#include <linux/mm.h> 32struct vm_area_struct;
33struct mm_struct;
33 34
34#define MMU_NO_CONTEXT ((unsigned int)-1) 35#define MMU_NO_CONTEXT ((unsigned int)-1)
35 36
@@ -40,12 +41,18 @@ extern void flush_tlb_kernel_range(unsigned long start, unsigned long end);
40extern void local_flush_tlb_mm(struct mm_struct *mm); 41extern void local_flush_tlb_mm(struct mm_struct *mm);
41extern void local_flush_tlb_page(struct vm_area_struct *vma, unsigned long vmaddr); 42extern void local_flush_tlb_page(struct vm_area_struct *vma, unsigned long vmaddr);
42 43
44extern void __local_flush_tlb_page(struct mm_struct *mm, unsigned long vmaddr,
45 int tsize, int ind);
46
43#ifdef CONFIG_SMP 47#ifdef CONFIG_SMP
44extern void flush_tlb_mm(struct mm_struct *mm); 48extern void flush_tlb_mm(struct mm_struct *mm);
45extern void flush_tlb_page(struct vm_area_struct *vma, unsigned long vmaddr); 49extern void flush_tlb_page(struct vm_area_struct *vma, unsigned long vmaddr);
50extern void __flush_tlb_page(struct mm_struct *mm, unsigned long vmaddr,
51 int tsize, int ind);
46#else 52#else
47#define flush_tlb_mm(mm) local_flush_tlb_mm(mm) 53#define flush_tlb_mm(mm) local_flush_tlb_mm(mm)
48#define flush_tlb_page(vma,addr) local_flush_tlb_page(vma,addr) 54#define flush_tlb_page(vma,addr) local_flush_tlb_page(vma,addr)
55#define __flush_tlb_page(mm,addr,p,i) __local_flush_tlb_page(mm,addr,p,i)
49#endif 56#endif
50#define flush_tlb_page_nohash(vma,addr) flush_tlb_page(vma,addr) 57#define flush_tlb_page_nohash(vma,addr) flush_tlb_page(vma,addr)
51 58
diff --git a/arch/powerpc/include/asm/topology.h b/arch/powerpc/include/asm/topology.h
index 054a16d68082..394edcbcce71 100644
--- a/arch/powerpc/include/asm/topology.h
+++ b/arch/powerpc/include/asm/topology.h
@@ -57,14 +57,13 @@ static inline int pcibus_to_node(struct pci_bus *bus)
57 .cache_nice_tries = 1, \ 57 .cache_nice_tries = 1, \
58 .busy_idx = 3, \ 58 .busy_idx = 3, \
59 .idle_idx = 1, \ 59 .idle_idx = 1, \
60 .newidle_idx = 2, \ 60 .newidle_idx = 0, \
61 .wake_idx = 1, \ 61 .wake_idx = 0, \
62 .flags = SD_LOAD_BALANCE \ 62 .flags = SD_LOAD_BALANCE \
63 | SD_BALANCE_EXEC \ 63 | SD_BALANCE_EXEC \
64 | SD_BALANCE_FORK \
64 | SD_BALANCE_NEWIDLE \ 65 | SD_BALANCE_NEWIDLE \
65 | SD_WAKE_IDLE \ 66 | SD_SERIALIZE, \
66 | SD_SERIALIZE \
67 | SD_WAKE_BALANCE, \
68 .last_balance = jiffies, \ 67 .last_balance = jiffies, \
69 .balance_interval = 1, \ 68 .balance_interval = 1, \
70 .nr_balance_failed = 0, \ 69 .nr_balance_failed = 0, \
diff --git a/arch/powerpc/include/asm/vdso.h b/arch/powerpc/include/asm/vdso.h
index 26fc449bd989..dc0419b66f17 100644
--- a/arch/powerpc/include/asm/vdso.h
+++ b/arch/powerpc/include/asm/vdso.h
@@ -7,9 +7,8 @@
7#define VDSO32_LBASE 0x100000 7#define VDSO32_LBASE 0x100000
8#define VDSO64_LBASE 0x100000 8#define VDSO64_LBASE 0x100000
9 9
10/* Default map addresses */ 10/* Default map addresses for 32bit vDSO */
11#define VDSO32_MBASE VDSO32_LBASE 11#define VDSO32_MBASE VDSO32_LBASE
12#define VDSO64_MBASE VDSO64_LBASE
13 12
14#define VDSO_VERSION_STRING LINUX_2.6.15 13#define VDSO_VERSION_STRING LINUX_2.6.15
15 14
diff --git a/arch/powerpc/kernel/Makefile b/arch/powerpc/kernel/Makefile
index 9619285f64e8..569f79ccd310 100644
--- a/arch/powerpc/kernel/Makefile
+++ b/arch/powerpc/kernel/Makefile
@@ -33,10 +33,10 @@ obj-y := cputable.o ptrace.o syscalls.o \
33obj-y += vdso32/ 33obj-y += vdso32/
34obj-$(CONFIG_PPC64) += setup_64.o sys_ppc32.o \ 34obj-$(CONFIG_PPC64) += setup_64.o sys_ppc32.o \
35 signal_64.o ptrace32.o \ 35 signal_64.o ptrace32.o \
36 paca.o cpu_setup_ppc970.o \ 36 paca.o nvram_64.o firmware.o
37 cpu_setup_pa6t.o \ 37obj-$(CONFIG_PPC_BOOK3S_64) += cpu_setup_ppc970.o cpu_setup_pa6t.o
38 firmware.o nvram_64.o
39obj64-$(CONFIG_RELOCATABLE) += reloc_64.o 38obj64-$(CONFIG_RELOCATABLE) += reloc_64.o
39obj-$(CONFIG_PPC_BOOK3E_64) += exceptions-64e.o
40obj-$(CONFIG_PPC64) += vdso64/ 40obj-$(CONFIG_PPC64) += vdso64/
41obj-$(CONFIG_ALTIVEC) += vecemu.o 41obj-$(CONFIG_ALTIVEC) += vecemu.o
42obj-$(CONFIG_PPC_970_NAP) += idle_power4.o 42obj-$(CONFIG_PPC_970_NAP) += idle_power4.o
@@ -63,8 +63,8 @@ obj-$(CONFIG_MODULES) += module.o module_$(CONFIG_WORD_SIZE).o
63obj-$(CONFIG_44x) += cpu_setup_44x.o 63obj-$(CONFIG_44x) += cpu_setup_44x.o
64obj-$(CONFIG_FSL_BOOKE) += cpu_setup_fsl_booke.o dbell.o 64obj-$(CONFIG_FSL_BOOKE) += cpu_setup_fsl_booke.o dbell.o
65 65
66extra-$(CONFIG_PPC_STD_MMU) := head_32.o 66extra-y := head_$(CONFIG_WORD_SIZE).o
67extra-$(CONFIG_PPC64) := head_64.o 67extra-$(CONFIG_PPC_BOOK3E_32) := head_new_booke.o
68extra-$(CONFIG_40x) := head_40x.o 68extra-$(CONFIG_40x) := head_40x.o
69extra-$(CONFIG_44x) := head_44x.o 69extra-$(CONFIG_44x) := head_44x.o
70extra-$(CONFIG_FSL_BOOKE) := head_fsl_booke.o 70extra-$(CONFIG_FSL_BOOKE) := head_fsl_booke.o
@@ -88,7 +88,7 @@ obj-$(CONFIG_SWIOTLB) += dma-swiotlb.o
88 88
89pci64-$(CONFIG_PPC64) += pci_dn.o isa-bridge.o 89pci64-$(CONFIG_PPC64) += pci_dn.o isa-bridge.o
90obj-$(CONFIG_PCI) += pci_$(CONFIG_WORD_SIZE).o $(pci64-y) \ 90obj-$(CONFIG_PCI) += pci_$(CONFIG_WORD_SIZE).o $(pci64-y) \
91 pci-common.o 91 pci-common.o pci_of_scan.o
92obj-$(CONFIG_PCI_MSI) += msi.o 92obj-$(CONFIG_PCI_MSI) += msi.o
93obj-$(CONFIG_KEXEC) += machine_kexec.o crash.o \ 93obj-$(CONFIG_KEXEC) += machine_kexec.o crash.o \
94 machine_kexec_$(CONFIG_WORD_SIZE).o 94 machine_kexec_$(CONFIG_WORD_SIZE).o
@@ -115,6 +115,13 @@ ifneq ($(CONFIG_XMON)$(CONFIG_KEXEC),)
115obj-y += ppc_save_regs.o 115obj-y += ppc_save_regs.o
116endif 116endif
117 117
118# Disable GCOV in odd or sensitive code
119GCOV_PROFILE_prom_init.o := n
120GCOV_PROFILE_ftrace.o := n
121GCOV_PROFILE_machine_kexec_64.o := n
122GCOV_PROFILE_machine_kexec_32.o := n
123GCOV_PROFILE_kprobes.o := n
124
118extra-$(CONFIG_PPC_FPU) += fpu.o 125extra-$(CONFIG_PPC_FPU) += fpu.o
119extra-$(CONFIG_ALTIVEC) += vector.o 126extra-$(CONFIG_ALTIVEC) += vector.o
120extra-$(CONFIG_PPC64) += entry_64.o 127extra-$(CONFIG_PPC64) += entry_64.o
diff --git a/arch/powerpc/kernel/asm-offsets.c b/arch/powerpc/kernel/asm-offsets.c
index 197b15646eeb..f0df285f0f87 100644
--- a/arch/powerpc/kernel/asm-offsets.c
+++ b/arch/powerpc/kernel/asm-offsets.c
@@ -52,9 +52,11 @@
52#include <linux/kvm_host.h> 52#include <linux/kvm_host.h>
53#endif 53#endif
54 54
55#ifdef CONFIG_PPC32
55#if defined(CONFIG_BOOKE) || defined(CONFIG_40x) 56#if defined(CONFIG_BOOKE) || defined(CONFIG_40x)
56#include "head_booke.h" 57#include "head_booke.h"
57#endif 58#endif
59#endif
58 60
59#if defined(CONFIG_FSL_BOOKE) 61#if defined(CONFIG_FSL_BOOKE)
60#include "../mm/mmu_decl.h" 62#include "../mm/mmu_decl.h"
@@ -140,6 +142,20 @@ int main(void)
140 context.high_slices_psize)); 142 context.high_slices_psize));
141 DEFINE(MMUPSIZEDEFSIZE, sizeof(struct mmu_psize_def)); 143 DEFINE(MMUPSIZEDEFSIZE, sizeof(struct mmu_psize_def));
142#endif /* CONFIG_PPC_MM_SLICES */ 144#endif /* CONFIG_PPC_MM_SLICES */
145
146#ifdef CONFIG_PPC_BOOK3E
147 DEFINE(PACAPGD, offsetof(struct paca_struct, pgd));
148 DEFINE(PACA_KERNELPGD, offsetof(struct paca_struct, kernel_pgd));
149 DEFINE(PACA_EXGEN, offsetof(struct paca_struct, exgen));
150 DEFINE(PACA_EXTLB, offsetof(struct paca_struct, extlb));
151 DEFINE(PACA_EXMC, offsetof(struct paca_struct, exmc));
152 DEFINE(PACA_EXCRIT, offsetof(struct paca_struct, excrit));
153 DEFINE(PACA_EXDBG, offsetof(struct paca_struct, exdbg));
154 DEFINE(PACA_MC_STACK, offsetof(struct paca_struct, mc_kstack));
155 DEFINE(PACA_CRIT_STACK, offsetof(struct paca_struct, crit_kstack));
156 DEFINE(PACA_DBG_STACK, offsetof(struct paca_struct, dbg_kstack));
157#endif /* CONFIG_PPC_BOOK3E */
158
143#ifdef CONFIG_PPC_STD_MMU_64 159#ifdef CONFIG_PPC_STD_MMU_64
144 DEFINE(PACASTABREAL, offsetof(struct paca_struct, stab_real)); 160 DEFINE(PACASTABREAL, offsetof(struct paca_struct, stab_real));
145 DEFINE(PACASTABVIRT, offsetof(struct paca_struct, stab_addr)); 161 DEFINE(PACASTABVIRT, offsetof(struct paca_struct, stab_addr));
@@ -262,6 +278,7 @@ int main(void)
262 DEFINE(_SRR1, STACK_FRAME_OVERHEAD+sizeof(struct pt_regs)+8); 278 DEFINE(_SRR1, STACK_FRAME_OVERHEAD+sizeof(struct pt_regs)+8);
263#endif /* CONFIG_PPC64 */ 279#endif /* CONFIG_PPC64 */
264 280
281#if defined(CONFIG_PPC32)
265#if defined(CONFIG_BOOKE) || defined(CONFIG_40x) 282#if defined(CONFIG_BOOKE) || defined(CONFIG_40x)
266 DEFINE(EXC_LVL_SIZE, STACK_EXC_LVL_FRAME_SIZE); 283 DEFINE(EXC_LVL_SIZE, STACK_EXC_LVL_FRAME_SIZE);
267 DEFINE(MAS0, STACK_INT_FRAME_SIZE+offsetof(struct exception_regs, mas0)); 284 DEFINE(MAS0, STACK_INT_FRAME_SIZE+offsetof(struct exception_regs, mas0));
@@ -280,7 +297,7 @@ int main(void)
280 DEFINE(_DSRR1, STACK_INT_FRAME_SIZE+offsetof(struct exception_regs, dsrr1)); 297 DEFINE(_DSRR1, STACK_INT_FRAME_SIZE+offsetof(struct exception_regs, dsrr1));
281 DEFINE(SAVED_KSP_LIMIT, STACK_INT_FRAME_SIZE+offsetof(struct exception_regs, saved_ksp_limit)); 298 DEFINE(SAVED_KSP_LIMIT, STACK_INT_FRAME_SIZE+offsetof(struct exception_regs, saved_ksp_limit));
282#endif 299#endif
283 300#endif
284 DEFINE(CLONE_VM, CLONE_VM); 301 DEFINE(CLONE_VM, CLONE_VM);
285 DEFINE(CLONE_UNTRACED, CLONE_UNTRACED); 302 DEFINE(CLONE_UNTRACED, CLONE_UNTRACED);
286 303
diff --git a/arch/powerpc/kernel/cpu_setup_6xx.S b/arch/powerpc/kernel/cpu_setup_6xx.S
index 1e9949e68856..55cba4a8a959 100644
--- a/arch/powerpc/kernel/cpu_setup_6xx.S
+++ b/arch/powerpc/kernel/cpu_setup_6xx.S
@@ -21,7 +21,7 @@ _GLOBAL(__setup_cpu_603)
21 mflr r4 21 mflr r4
22BEGIN_MMU_FTR_SECTION 22BEGIN_MMU_FTR_SECTION
23 li r10,0 23 li r10,0
24 mtspr SPRN_SPRG4,r10 /* init SW LRU tracking */ 24 mtspr SPRN_SPRG_603_LRU,r10 /* init SW LRU tracking */
25END_MMU_FTR_SECTION_IFSET(MMU_FTR_NEED_DTLB_SW_LRU) 25END_MMU_FTR_SECTION_IFSET(MMU_FTR_NEED_DTLB_SW_LRU)
26BEGIN_FTR_SECTION 26BEGIN_FTR_SECTION
27 bl __init_fpu_registers 27 bl __init_fpu_registers
diff --git a/arch/powerpc/kernel/cputable.c b/arch/powerpc/kernel/cputable.c
index 4a24a2fc4574..0b9c9135922e 100644
--- a/arch/powerpc/kernel/cputable.c
+++ b/arch/powerpc/kernel/cputable.c
@@ -89,11 +89,15 @@ extern void __restore_cpu_power7(void);
89#define COMMON_USER_PA6T (COMMON_USER_PPC64 | PPC_FEATURE_PA6T |\ 89#define COMMON_USER_PA6T (COMMON_USER_PPC64 | PPC_FEATURE_PA6T |\
90 PPC_FEATURE_TRUE_LE | \ 90 PPC_FEATURE_TRUE_LE | \
91 PPC_FEATURE_HAS_ALTIVEC_COMP) 91 PPC_FEATURE_HAS_ALTIVEC_COMP)
92#ifdef CONFIG_PPC_BOOK3E_64
93#define COMMON_USER_BOOKE (COMMON_USER_PPC64 | PPC_FEATURE_BOOKE)
94#else
92#define COMMON_USER_BOOKE (PPC_FEATURE_32 | PPC_FEATURE_HAS_MMU | \ 95#define COMMON_USER_BOOKE (PPC_FEATURE_32 | PPC_FEATURE_HAS_MMU | \
93 PPC_FEATURE_BOOKE) 96 PPC_FEATURE_BOOKE)
97#endif
94 98
95static struct cpu_spec __initdata cpu_specs[] = { 99static struct cpu_spec __initdata cpu_specs[] = {
96#ifdef CONFIG_PPC64 100#ifdef CONFIG_PPC_BOOK3S_64
97 { /* Power3 */ 101 { /* Power3 */
98 .pvr_mask = 0xffff0000, 102 .pvr_mask = 0xffff0000,
99 .pvr_value = 0x00400000, 103 .pvr_value = 0x00400000,
@@ -508,7 +512,8 @@ static struct cpu_spec __initdata cpu_specs[] = {
508 .machine_check = machine_check_generic, 512 .machine_check = machine_check_generic,
509 .platform = "power4", 513 .platform = "power4",
510 } 514 }
511#endif /* CONFIG_PPC64 */ 515#endif /* CONFIG_PPC_BOOK3S_64 */
516
512#ifdef CONFIG_PPC32 517#ifdef CONFIG_PPC32
513#if CLASSIC_PPC 518#if CLASSIC_PPC
514 { /* 601 */ 519 { /* 601 */
@@ -1630,7 +1635,7 @@ static struct cpu_spec __initdata cpu_specs[] = {
1630 .platform = "ppc440", 1635 .platform = "ppc440",
1631 }, 1636 },
1632 { /* 460EX */ 1637 { /* 460EX */
1633 .pvr_mask = 0xffff0002, 1638 .pvr_mask = 0xffff0006,
1634 .pvr_value = 0x13020002, 1639 .pvr_value = 0x13020002,
1635 .cpu_name = "460EX", 1640 .cpu_name = "460EX",
1636 .cpu_features = CPU_FTRS_440x6, 1641 .cpu_features = CPU_FTRS_440x6,
@@ -1642,8 +1647,21 @@ static struct cpu_spec __initdata cpu_specs[] = {
1642 .machine_check = machine_check_440A, 1647 .machine_check = machine_check_440A,
1643 .platform = "ppc440", 1648 .platform = "ppc440",
1644 }, 1649 },
1650 { /* 460EX Rev B */
1651 .pvr_mask = 0xffff0007,
1652 .pvr_value = 0x13020004,
1653 .cpu_name = "460EX Rev. B",
1654 .cpu_features = CPU_FTRS_440x6,
1655 .cpu_user_features = COMMON_USER_BOOKE | PPC_FEATURE_HAS_FPU,
1656 .mmu_features = MMU_FTR_TYPE_44x,
1657 .icache_bsize = 32,
1658 .dcache_bsize = 32,
1659 .cpu_setup = __setup_cpu_460ex,
1660 .machine_check = machine_check_440A,
1661 .platform = "ppc440",
1662 },
1645 { /* 460GT */ 1663 { /* 460GT */
1646 .pvr_mask = 0xffff0002, 1664 .pvr_mask = 0xffff0006,
1647 .pvr_value = 0x13020000, 1665 .pvr_value = 0x13020000,
1648 .cpu_name = "460GT", 1666 .cpu_name = "460GT",
1649 .cpu_features = CPU_FTRS_440x6, 1667 .cpu_features = CPU_FTRS_440x6,
@@ -1655,6 +1673,19 @@ static struct cpu_spec __initdata cpu_specs[] = {
1655 .machine_check = machine_check_440A, 1673 .machine_check = machine_check_440A,
1656 .platform = "ppc440", 1674 .platform = "ppc440",
1657 }, 1675 },
1676 { /* 460GT Rev B */
1677 .pvr_mask = 0xffff0007,
1678 .pvr_value = 0x13020005,
1679 .cpu_name = "460GT Rev. B",
1680 .cpu_features = CPU_FTRS_440x6,
1681 .cpu_user_features = COMMON_USER_BOOKE | PPC_FEATURE_HAS_FPU,
1682 .mmu_features = MMU_FTR_TYPE_44x,
1683 .icache_bsize = 32,
1684 .dcache_bsize = 32,
1685 .cpu_setup = __setup_cpu_460gt,
1686 .machine_check = machine_check_440A,
1687 .platform = "ppc440",
1688 },
1658 { /* 460SX */ 1689 { /* 460SX */
1659 .pvr_mask = 0xffffff00, 1690 .pvr_mask = 0xffffff00,
1660 .pvr_value = 0x13541800, 1691 .pvr_value = 0x13541800,
@@ -1797,6 +1828,29 @@ static struct cpu_spec __initdata cpu_specs[] = {
1797 } 1828 }
1798#endif /* CONFIG_E500 */ 1829#endif /* CONFIG_E500 */
1799#endif /* CONFIG_PPC32 */ 1830#endif /* CONFIG_PPC32 */
1831
1832#ifdef CONFIG_PPC_BOOK3E_64
1833 { /* This is a default entry to get going, to be replaced by
1834 * a real one at some stage
1835 */
1836#define CPU_FTRS_BASE_BOOK3E (CPU_FTR_USE_TB | \
1837 CPU_FTR_PPCAS_ARCH_V2 | CPU_FTR_SMT | \
1838 CPU_FTR_NODSISRALIGN | CPU_FTR_NOEXECUTE)
1839 .pvr_mask = 0x00000000,
1840 .pvr_value = 0x00000000,
1841 .cpu_name = "Book3E",
1842 .cpu_features = CPU_FTRS_BASE_BOOK3E,
1843 .cpu_user_features = COMMON_USER_PPC64,
1844 .mmu_features = MMU_FTR_TYPE_3E | MMU_FTR_USE_TLBILX |
1845 MMU_FTR_USE_TLBIVAX_BCAST |
1846 MMU_FTR_LOCK_BCAST_INVAL,
1847 .icache_bsize = 64,
1848 .dcache_bsize = 64,
1849 .num_pmcs = 0,
1850 .machine_check = machine_check_generic,
1851 .platform = "power6",
1852 },
1853#endif
1800}; 1854};
1801 1855
1802static struct cpu_spec the_cpu_spec; 1856static struct cpu_spec the_cpu_spec;
diff --git a/arch/powerpc/kernel/dma-iommu.c b/arch/powerpc/kernel/dma-iommu.c
index 2983adac8cc3..87ddb3fb948c 100644
--- a/arch/powerpc/kernel/dma-iommu.c
+++ b/arch/powerpc/kernel/dma-iommu.c
@@ -89,7 +89,7 @@ static int dma_iommu_dma_supported(struct device *dev, u64 mask)
89 return 1; 89 return 1;
90} 90}
91 91
92struct dma_mapping_ops dma_iommu_ops = { 92struct dma_map_ops dma_iommu_ops = {
93 .alloc_coherent = dma_iommu_alloc_coherent, 93 .alloc_coherent = dma_iommu_alloc_coherent,
94 .free_coherent = dma_iommu_free_coherent, 94 .free_coherent = dma_iommu_free_coherent,
95 .map_sg = dma_iommu_map_sg, 95 .map_sg = dma_iommu_map_sg,
diff --git a/arch/powerpc/kernel/dma-swiotlb.c b/arch/powerpc/kernel/dma-swiotlb.c
index e8a57de85bcf..e96cbbd9b449 100644
--- a/arch/powerpc/kernel/dma-swiotlb.c
+++ b/arch/powerpc/kernel/dma-swiotlb.c
@@ -25,33 +25,13 @@ int swiotlb __read_mostly;
25unsigned int ppc_swiotlb_enable; 25unsigned int ppc_swiotlb_enable;
26 26
27/* 27/*
28 * Determine if an address is reachable by a pci device, or if we must bounce.
29 */
30static int
31swiotlb_pci_addr_needs_map(struct device *hwdev, dma_addr_t addr, size_t size)
32{
33 dma_addr_t max;
34 struct pci_controller *hose;
35 struct pci_dev *pdev = to_pci_dev(hwdev);
36
37 hose = pci_bus_to_host(pdev->bus);
38 max = hose->dma_window_base_cur + hose->dma_window_size;
39
40 /* check that we're within mapped pci window space */
41 if ((addr + size > max) | (addr < hose->dma_window_base_cur))
42 return 1;
43
44 return 0;
45}
46
47/*
48 * At the moment, all platforms that use this code only require 28 * At the moment, all platforms that use this code only require
49 * swiotlb to be used if we're operating on HIGHMEM. Since 29 * swiotlb to be used if we're operating on HIGHMEM. Since
50 * we don't ever call anything other than map_sg, unmap_sg, 30 * we don't ever call anything other than map_sg, unmap_sg,
51 * map_page, and unmap_page on highmem, use normal dma_ops 31 * map_page, and unmap_page on highmem, use normal dma_ops
52 * for everything else. 32 * for everything else.
53 */ 33 */
54struct dma_mapping_ops swiotlb_dma_ops = { 34struct dma_map_ops swiotlb_dma_ops = {
55 .alloc_coherent = dma_direct_alloc_coherent, 35 .alloc_coherent = dma_direct_alloc_coherent,
56 .free_coherent = dma_direct_free_coherent, 36 .free_coherent = dma_direct_free_coherent,
57 .map_sg = swiotlb_map_sg_attrs, 37 .map_sg = swiotlb_map_sg_attrs,
@@ -62,33 +42,34 @@ struct dma_mapping_ops swiotlb_dma_ops = {
62 .sync_single_range_for_cpu = swiotlb_sync_single_range_for_cpu, 42 .sync_single_range_for_cpu = swiotlb_sync_single_range_for_cpu,
63 .sync_single_range_for_device = swiotlb_sync_single_range_for_device, 43 .sync_single_range_for_device = swiotlb_sync_single_range_for_device,
64 .sync_sg_for_cpu = swiotlb_sync_sg_for_cpu, 44 .sync_sg_for_cpu = swiotlb_sync_sg_for_cpu,
65 .sync_sg_for_device = swiotlb_sync_sg_for_device 45 .sync_sg_for_device = swiotlb_sync_sg_for_device,
46 .mapping_error = swiotlb_dma_mapping_error,
66}; 47};
67 48
68struct dma_mapping_ops swiotlb_pci_dma_ops = { 49void pci_dma_dev_setup_swiotlb(struct pci_dev *pdev)
69 .alloc_coherent = dma_direct_alloc_coherent, 50{
70 .free_coherent = dma_direct_free_coherent, 51 struct pci_controller *hose;
71 .map_sg = swiotlb_map_sg_attrs, 52 struct dev_archdata *sd;
72 .unmap_sg = swiotlb_unmap_sg_attrs, 53
73 .dma_supported = swiotlb_dma_supported, 54 hose = pci_bus_to_host(pdev->bus);
74 .map_page = swiotlb_map_page, 55 sd = &pdev->dev.archdata;
75 .unmap_page = swiotlb_unmap_page, 56 sd->max_direct_dma_addr =
76 .addr_needs_map = swiotlb_pci_addr_needs_map, 57 hose->dma_window_base_cur + hose->dma_window_size;
77 .sync_single_range_for_cpu = swiotlb_sync_single_range_for_cpu, 58}
78 .sync_single_range_for_device = swiotlb_sync_single_range_for_device,
79 .sync_sg_for_cpu = swiotlb_sync_sg_for_cpu,
80 .sync_sg_for_device = swiotlb_sync_sg_for_device
81};
82 59
83static int ppc_swiotlb_bus_notify(struct notifier_block *nb, 60static int ppc_swiotlb_bus_notify(struct notifier_block *nb,
84 unsigned long action, void *data) 61 unsigned long action, void *data)
85{ 62{
86 struct device *dev = data; 63 struct device *dev = data;
64 struct dev_archdata *sd;
87 65
88 /* We are only intereted in device addition */ 66 /* We are only intereted in device addition */
89 if (action != BUS_NOTIFY_ADD_DEVICE) 67 if (action != BUS_NOTIFY_ADD_DEVICE)
90 return 0; 68 return 0;
91 69
70 sd = &dev->archdata;
71 sd->max_direct_dma_addr = 0;
72
92 /* May need to bounce if the device can't address all of DRAM */ 73 /* May need to bounce if the device can't address all of DRAM */
93 if (dma_get_mask(dev) < lmb_end_of_DRAM()) 74 if (dma_get_mask(dev) < lmb_end_of_DRAM())
94 set_dma_ops(dev, &swiotlb_dma_ops); 75 set_dma_ops(dev, &swiotlb_dma_ops);
diff --git a/arch/powerpc/kernel/dma.c b/arch/powerpc/kernel/dma.c
index ccf129d47d84..21b784d7e7d0 100644
--- a/arch/powerpc/kernel/dma.c
+++ b/arch/powerpc/kernel/dma.c
@@ -7,6 +7,7 @@
7 7
8#include <linux/device.h> 8#include <linux/device.h>
9#include <linux/dma-mapping.h> 9#include <linux/dma-mapping.h>
10#include <linux/dma-debug.h>
10#include <linux/lmb.h> 11#include <linux/lmb.h>
11#include <asm/bug.h> 12#include <asm/bug.h>
12#include <asm/abs_addr.h> 13#include <asm/abs_addr.h>
@@ -140,7 +141,7 @@ static inline void dma_direct_sync_single_range(struct device *dev,
140} 141}
141#endif 142#endif
142 143
143struct dma_mapping_ops dma_direct_ops = { 144struct dma_map_ops dma_direct_ops = {
144 .alloc_coherent = dma_direct_alloc_coherent, 145 .alloc_coherent = dma_direct_alloc_coherent,
145 .free_coherent = dma_direct_free_coherent, 146 .free_coherent = dma_direct_free_coherent,
146 .map_sg = dma_direct_map_sg, 147 .map_sg = dma_direct_map_sg,
@@ -156,3 +157,13 @@ struct dma_mapping_ops dma_direct_ops = {
156#endif 157#endif
157}; 158};
158EXPORT_SYMBOL(dma_direct_ops); 159EXPORT_SYMBOL(dma_direct_ops);
160
161#define PREALLOC_DMA_DEBUG_ENTRIES (1 << 16)
162
163static int __init dma_init(void)
164{
165 dma_debug_init(PREALLOC_DMA_DEBUG_ENTRIES);
166
167 return 0;
168}
169fs_initcall(dma_init);
diff --git a/arch/powerpc/kernel/entry_32.S b/arch/powerpc/kernel/entry_32.S
index 3cadba60a4b6..1175a8539e6c 100644
--- a/arch/powerpc/kernel/entry_32.S
+++ b/arch/powerpc/kernel/entry_32.S
@@ -88,7 +88,7 @@ crit_transfer_to_handler:
88 mfspr r0,SPRN_SRR1 88 mfspr r0,SPRN_SRR1
89 stw r0,_SRR1(r11) 89 stw r0,_SRR1(r11)
90 90
91 mfspr r8,SPRN_SPRG3 91 mfspr r8,SPRN_SPRG_THREAD
92 lwz r0,KSP_LIMIT(r8) 92 lwz r0,KSP_LIMIT(r8)
93 stw r0,SAVED_KSP_LIMIT(r11) 93 stw r0,SAVED_KSP_LIMIT(r11)
94 rlwimi r0,r1,0,0,(31-THREAD_SHIFT) 94 rlwimi r0,r1,0,0,(31-THREAD_SHIFT)
@@ -108,7 +108,7 @@ crit_transfer_to_handler:
108 mfspr r0,SPRN_SRR1 108 mfspr r0,SPRN_SRR1
109 stw r0,crit_srr1@l(0) 109 stw r0,crit_srr1@l(0)
110 110
111 mfspr r8,SPRN_SPRG3 111 mfspr r8,SPRN_SPRG_THREAD
112 lwz r0,KSP_LIMIT(r8) 112 lwz r0,KSP_LIMIT(r8)
113 stw r0,saved_ksp_limit@l(0) 113 stw r0,saved_ksp_limit@l(0)
114 rlwimi r0,r1,0,0,(31-THREAD_SHIFT) 114 rlwimi r0,r1,0,0,(31-THREAD_SHIFT)
@@ -138,7 +138,7 @@ transfer_to_handler:
138 mfspr r2,SPRN_XER 138 mfspr r2,SPRN_XER
139 stw r12,_CTR(r11) 139 stw r12,_CTR(r11)
140 stw r2,_XER(r11) 140 stw r2,_XER(r11)
141 mfspr r12,SPRN_SPRG3 141 mfspr r12,SPRN_SPRG_THREAD
142 addi r2,r12,-THREAD 142 addi r2,r12,-THREAD
143 tovirt(r2,r2) /* set r2 to current */ 143 tovirt(r2,r2) /* set r2 to current */
144 beq 2f /* if from user, fix up THREAD.regs */ 144 beq 2f /* if from user, fix up THREAD.regs */
@@ -680,7 +680,7 @@ END_FTR_SECTION_IFSET(CPU_FTR_SPE)
680 680
681 tophys(r0,r4) 681 tophys(r0,r4)
682 CLR_TOP32(r0) 682 CLR_TOP32(r0)
683 mtspr SPRN_SPRG3,r0 /* Update current THREAD phys addr */ 683 mtspr SPRN_SPRG_THREAD,r0 /* Update current THREAD phys addr */
684 lwz r1,KSP(r4) /* Load new stack pointer */ 684 lwz r1,KSP(r4) /* Load new stack pointer */
685 685
686 /* save the old current 'last' for return value */ 686 /* save the old current 'last' for return value */
@@ -1057,7 +1057,7 @@ exc_exit_restart_end:
1057#ifdef CONFIG_40x 1057#ifdef CONFIG_40x
1058 .globl ret_from_crit_exc 1058 .globl ret_from_crit_exc
1059ret_from_crit_exc: 1059ret_from_crit_exc:
1060 mfspr r9,SPRN_SPRG3 1060 mfspr r9,SPRN_SPRG_THREAD
1061 lis r10,saved_ksp_limit@ha; 1061 lis r10,saved_ksp_limit@ha;
1062 lwz r10,saved_ksp_limit@l(r10); 1062 lwz r10,saved_ksp_limit@l(r10);
1063 tovirt(r9,r9); 1063 tovirt(r9,r9);
@@ -1074,7 +1074,7 @@ ret_from_crit_exc:
1074#ifdef CONFIG_BOOKE 1074#ifdef CONFIG_BOOKE
1075 .globl ret_from_crit_exc 1075 .globl ret_from_crit_exc
1076ret_from_crit_exc: 1076ret_from_crit_exc:
1077 mfspr r9,SPRN_SPRG3 1077 mfspr r9,SPRN_SPRG_THREAD
1078 lwz r10,SAVED_KSP_LIMIT(r1) 1078 lwz r10,SAVED_KSP_LIMIT(r1)
1079 stw r10,KSP_LIMIT(r9) 1079 stw r10,KSP_LIMIT(r9)
1080 RESTORE_xSRR(SRR0,SRR1); 1080 RESTORE_xSRR(SRR0,SRR1);
@@ -1083,7 +1083,7 @@ ret_from_crit_exc:
1083 1083
1084 .globl ret_from_debug_exc 1084 .globl ret_from_debug_exc
1085ret_from_debug_exc: 1085ret_from_debug_exc:
1086 mfspr r9,SPRN_SPRG3 1086 mfspr r9,SPRN_SPRG_THREAD
1087 lwz r10,SAVED_KSP_LIMIT(r1) 1087 lwz r10,SAVED_KSP_LIMIT(r1)
1088 stw r10,KSP_LIMIT(r9) 1088 stw r10,KSP_LIMIT(r9)
1089 lwz r9,THREAD_INFO-THREAD(r9) 1089 lwz r9,THREAD_INFO-THREAD(r9)
@@ -1097,7 +1097,7 @@ ret_from_debug_exc:
1097 1097
1098 .globl ret_from_mcheck_exc 1098 .globl ret_from_mcheck_exc
1099ret_from_mcheck_exc: 1099ret_from_mcheck_exc:
1100 mfspr r9,SPRN_SPRG3 1100 mfspr r9,SPRN_SPRG_THREAD
1101 lwz r10,SAVED_KSP_LIMIT(r1) 1101 lwz r10,SAVED_KSP_LIMIT(r1)
1102 stw r10,KSP_LIMIT(r9) 1102 stw r10,KSP_LIMIT(r9)
1103 RESTORE_xSRR(SRR0,SRR1); 1103 RESTORE_xSRR(SRR0,SRR1);
@@ -1255,7 +1255,7 @@ _GLOBAL(enter_rtas)
1255 MTMSRD(r0) /* don't get trashed */ 1255 MTMSRD(r0) /* don't get trashed */
1256 li r9,MSR_KERNEL & ~(MSR_IR|MSR_DR) 1256 li r9,MSR_KERNEL & ~(MSR_IR|MSR_DR)
1257 mtlr r6 1257 mtlr r6
1258 mtspr SPRN_SPRG2,r7 1258 mtspr SPRN_SPRG_RTAS,r7
1259 mtspr SPRN_SRR0,r8 1259 mtspr SPRN_SRR0,r8
1260 mtspr SPRN_SRR1,r9 1260 mtspr SPRN_SRR1,r9
1261 RFI 1261 RFI
@@ -1265,7 +1265,7 @@ _GLOBAL(enter_rtas)
1265 FIX_SRR1(r9,r0) 1265 FIX_SRR1(r9,r0)
1266 addi r1,r1,INT_FRAME_SIZE 1266 addi r1,r1,INT_FRAME_SIZE
1267 li r0,0 1267 li r0,0
1268 mtspr SPRN_SPRG2,r0 1268 mtspr SPRN_SPRG_RTAS,r0
1269 mtspr SPRN_SRR0,r8 1269 mtspr SPRN_SRR0,r8
1270 mtspr SPRN_SRR1,r9 1270 mtspr SPRN_SRR1,r9
1271 RFI /* return to caller */ 1271 RFI /* return to caller */
diff --git a/arch/powerpc/kernel/entry_64.S b/arch/powerpc/kernel/entry_64.S
index 43e073477c34..66bcda34a6bb 100644
--- a/arch/powerpc/kernel/entry_64.S
+++ b/arch/powerpc/kernel/entry_64.S
@@ -120,9 +120,15 @@ BEGIN_FW_FTR_SECTION
1202: 1202:
121END_FW_FTR_SECTION_IFSET(FW_FEATURE_ISERIES) 121END_FW_FTR_SECTION_IFSET(FW_FEATURE_ISERIES)
122#endif /* CONFIG_PPC_ISERIES */ 122#endif /* CONFIG_PPC_ISERIES */
123
124 /* Hard enable interrupts */
125#ifdef CONFIG_PPC_BOOK3E
126 wrteei 1
127#else
123 mfmsr r11 128 mfmsr r11
124 ori r11,r11,MSR_EE 129 ori r11,r11,MSR_EE
125 mtmsrd r11,1 130 mtmsrd r11,1
131#endif /* CONFIG_PPC_BOOK3E */
126 132
127#ifdef SHOW_SYSCALLS 133#ifdef SHOW_SYSCALLS
128 bl .do_show_syscall 134 bl .do_show_syscall
@@ -168,15 +174,25 @@ syscall_exit:
168#endif 174#endif
169 clrrdi r12,r1,THREAD_SHIFT 175 clrrdi r12,r1,THREAD_SHIFT
170 176
171 /* disable interrupts so current_thread_info()->flags can't change,
172 and so that we don't get interrupted after loading SRR0/1. */
173 ld r8,_MSR(r1) 177 ld r8,_MSR(r1)
178#ifdef CONFIG_PPC_BOOK3S
179 /* No MSR:RI on BookE */
174 andi. r10,r8,MSR_RI 180 andi. r10,r8,MSR_RI
175 beq- unrecov_restore 181 beq- unrecov_restore
182#endif
183
184 /* Disable interrupts so current_thread_info()->flags can't change,
185 * and so that we don't get interrupted after loading SRR0/1.
186 */
187#ifdef CONFIG_PPC_BOOK3E
188 wrteei 0
189#else
176 mfmsr r10 190 mfmsr r10
177 rldicl r10,r10,48,1 191 rldicl r10,r10,48,1
178 rotldi r10,r10,16 192 rotldi r10,r10,16
179 mtmsrd r10,1 193 mtmsrd r10,1
194#endif /* CONFIG_PPC_BOOK3E */
195
180 ld r9,TI_FLAGS(r12) 196 ld r9,TI_FLAGS(r12)
181 li r11,-_LAST_ERRNO 197 li r11,-_LAST_ERRNO
182 andi. r0,r9,(_TIF_SYSCALL_T_OR_A|_TIF_SINGLESTEP|_TIF_USER_WORK_MASK|_TIF_PERSYSCALL_MASK) 198 andi. r0,r9,(_TIF_SYSCALL_T_OR_A|_TIF_SINGLESTEP|_TIF_USER_WORK_MASK|_TIF_PERSYSCALL_MASK)
@@ -194,9 +210,13 @@ syscall_error_cont:
194 * userspace and we take an exception after restoring r13, 210 * userspace and we take an exception after restoring r13,
195 * we end up corrupting the userspace r13 value. 211 * we end up corrupting the userspace r13 value.
196 */ 212 */
213#ifdef CONFIG_PPC_BOOK3S
214 /* No MSR:RI on BookE */
197 li r12,MSR_RI 215 li r12,MSR_RI
198 andc r11,r10,r12 216 andc r11,r10,r12
199 mtmsrd r11,1 /* clear MSR.RI */ 217 mtmsrd r11,1 /* clear MSR.RI */
218#endif /* CONFIG_PPC_BOOK3S */
219
200 beq- 1f 220 beq- 1f
201 ACCOUNT_CPU_USER_EXIT(r11, r12) 221 ACCOUNT_CPU_USER_EXIT(r11, r12)
202 ld r13,GPR13(r1) /* only restore r13 if returning to usermode */ 222 ld r13,GPR13(r1) /* only restore r13 if returning to usermode */
@@ -206,7 +226,7 @@ syscall_error_cont:
206 mtcr r5 226 mtcr r5
207 mtspr SPRN_SRR0,r7 227 mtspr SPRN_SRR0,r7
208 mtspr SPRN_SRR1,r8 228 mtspr SPRN_SRR1,r8
209 rfid 229 RFI
210 b . /* prevent speculative execution */ 230 b . /* prevent speculative execution */
211 231
212syscall_error: 232syscall_error:
@@ -276,9 +296,13 @@ syscall_exit_work:
276 beq .ret_from_except_lite 296 beq .ret_from_except_lite
277 297
278 /* Re-enable interrupts */ 298 /* Re-enable interrupts */
299#ifdef CONFIG_PPC_BOOK3E
300 wrteei 1
301#else
279 mfmsr r10 302 mfmsr r10
280 ori r10,r10,MSR_EE 303 ori r10,r10,MSR_EE
281 mtmsrd r10,1 304 mtmsrd r10,1
305#endif /* CONFIG_PPC_BOOK3E */
282 306
283 bl .save_nvgprs 307 bl .save_nvgprs
284 addi r3,r1,STACK_FRAME_OVERHEAD 308 addi r3,r1,STACK_FRAME_OVERHEAD
@@ -380,7 +404,7 @@ END_FTR_SECTION_IFSET(CPU_FTR_ALTIVEC)
380 and. r0,r0,r22 404 and. r0,r0,r22
381 beq+ 1f 405 beq+ 1f
382 andc r22,r22,r0 406 andc r22,r22,r0
383 mtmsrd r22 407 MTMSRD(r22)
384 isync 408 isync
3851: std r20,_NIP(r1) 4091: std r20,_NIP(r1)
386 mfcr r23 410 mfcr r23
@@ -399,6 +423,7 @@ END_FTR_SECTION_IFSET(CPU_FTR_ALTIVEC)
399 std r6,PACACURRENT(r13) /* Set new 'current' */ 423 std r6,PACACURRENT(r13) /* Set new 'current' */
400 424
401 ld r8,KSP(r4) /* new stack pointer */ 425 ld r8,KSP(r4) /* new stack pointer */
426#ifdef CONFIG_PPC_BOOK3S
402BEGIN_FTR_SECTION 427BEGIN_FTR_SECTION
403 BEGIN_FTR_SECTION_NESTED(95) 428 BEGIN_FTR_SECTION_NESTED(95)
404 clrrdi r6,r8,28 /* get its ESID */ 429 clrrdi r6,r8,28 /* get its ESID */
@@ -445,8 +470,9 @@ END_FTR_SECTION_IFSET(CPU_FTR_1T_SEGMENT)
445 slbie r6 /* Workaround POWER5 < DD2.1 issue */ 470 slbie r6 /* Workaround POWER5 < DD2.1 issue */
446 slbmte r7,r0 471 slbmte r7,r0
447 isync 472 isync
448
4492: 4732:
474#endif /* !CONFIG_PPC_BOOK3S */
475
450 clrrdi r7,r8,THREAD_SHIFT /* base of new stack */ 476 clrrdi r7,r8,THREAD_SHIFT /* base of new stack */
451 /* Note: this uses SWITCH_FRAME_SIZE rather than INT_FRAME_SIZE 477 /* Note: this uses SWITCH_FRAME_SIZE rather than INT_FRAME_SIZE
452 because we don't need to leave the 288-byte ABI gap at the 478 because we don't need to leave the 288-byte ABI gap at the
@@ -490,10 +516,14 @@ _GLOBAL(ret_from_except_lite)
490 * can't change between when we test it and when we return 516 * can't change between when we test it and when we return
491 * from the interrupt. 517 * from the interrupt.
492 */ 518 */
519#ifdef CONFIG_PPC_BOOK3E
520 wrteei 0
521#else
493 mfmsr r10 /* Get current interrupt state */ 522 mfmsr r10 /* Get current interrupt state */
494 rldicl r9,r10,48,1 /* clear MSR_EE */ 523 rldicl r9,r10,48,1 /* clear MSR_EE */
495 rotldi r9,r9,16 524 rotldi r9,r9,16
496 mtmsrd r9,1 /* Update machine state */ 525 mtmsrd r9,1 /* Update machine state */
526#endif /* CONFIG_PPC_BOOK3E */
497 527
498#ifdef CONFIG_PREEMPT 528#ifdef CONFIG_PREEMPT
499 clrrdi r9,r1,THREAD_SHIFT /* current_thread_info() */ 529 clrrdi r9,r1,THREAD_SHIFT /* current_thread_info() */
@@ -540,6 +570,9 @@ ALT_FW_FTR_SECTION_END_IFCLR(FW_FEATURE_ISERIES)
540 rldicl r4,r3,49,63 /* r0 = (r3 >> 15) & 1 */ 570 rldicl r4,r3,49,63 /* r0 = (r3 >> 15) & 1 */
541 stb r4,PACAHARDIRQEN(r13) 571 stb r4,PACAHARDIRQEN(r13)
542 572
573#ifdef CONFIG_PPC_BOOK3E
574 b .exception_return_book3e
575#else
543 ld r4,_CTR(r1) 576 ld r4,_CTR(r1)
544 ld r0,_LINK(r1) 577 ld r0,_LINK(r1)
545 mtctr r4 578 mtctr r4
@@ -588,6 +621,8 @@ ALT_FW_FTR_SECTION_END_IFCLR(FW_FEATURE_ISERIES)
588 rfid 621 rfid
589 b . /* prevent speculative execution */ 622 b . /* prevent speculative execution */
590 623
624#endif /* CONFIG_PPC_BOOK3E */
625
591iseries_check_pending_irqs: 626iseries_check_pending_irqs:
592#ifdef CONFIG_PPC_ISERIES 627#ifdef CONFIG_PPC_ISERIES
593 ld r5,SOFTE(r1) 628 ld r5,SOFTE(r1)
@@ -638,6 +673,11 @@ do_work:
638 li r0,1 673 li r0,1
639 stb r0,PACASOFTIRQEN(r13) 674 stb r0,PACASOFTIRQEN(r13)
640 stb r0,PACAHARDIRQEN(r13) 675 stb r0,PACAHARDIRQEN(r13)
676#ifdef CONFIG_PPC_BOOK3E
677 wrteei 1
678 bl .preempt_schedule
679 wrteei 0
680#else
641 ori r10,r10,MSR_EE 681 ori r10,r10,MSR_EE
642 mtmsrd r10,1 /* reenable interrupts */ 682 mtmsrd r10,1 /* reenable interrupts */
643 bl .preempt_schedule 683 bl .preempt_schedule
@@ -646,6 +686,7 @@ do_work:
646 rldicl r10,r10,48,1 /* disable interrupts again */ 686 rldicl r10,r10,48,1 /* disable interrupts again */
647 rotldi r10,r10,16 687 rotldi r10,r10,16
648 mtmsrd r10,1 688 mtmsrd r10,1
689#endif /* CONFIG_PPC_BOOK3E */
649 ld r4,TI_FLAGS(r9) 690 ld r4,TI_FLAGS(r9)
650 andi. r0,r4,_TIF_NEED_RESCHED 691 andi. r0,r4,_TIF_NEED_RESCHED
651 bne 1b 692 bne 1b
@@ -654,8 +695,12 @@ do_work:
654user_work: 695user_work:
655#endif 696#endif
656 /* Enable interrupts */ 697 /* Enable interrupts */
698#ifdef CONFIG_PPC_BOOK3E
699 wrteei 1
700#else
657 ori r10,r10,MSR_EE 701 ori r10,r10,MSR_EE
658 mtmsrd r10,1 702 mtmsrd r10,1
703#endif /* CONFIG_PPC_BOOK3E */
659 704
660 andi. r0,r4,_TIF_NEED_RESCHED 705 andi. r0,r4,_TIF_NEED_RESCHED
661 beq 1f 706 beq 1f
@@ -762,7 +807,7 @@ _GLOBAL(enter_rtas)
762 807
763_STATIC(rtas_return_loc) 808_STATIC(rtas_return_loc)
764 /* relocation is off at this point */ 809 /* relocation is off at this point */
765 mfspr r4,SPRN_SPRG3 /* Get PACA */ 810 mfspr r4,SPRN_SPRG_PACA /* Get PACA */
766 clrldi r4,r4,2 /* convert to realmode address */ 811 clrldi r4,r4,2 /* convert to realmode address */
767 812
768 bcl 20,31,$+4 813 bcl 20,31,$+4
@@ -793,7 +838,7 @@ _STATIC(rtas_restore_regs)
793 REST_8GPRS(14, r1) /* Restore the non-volatiles */ 838 REST_8GPRS(14, r1) /* Restore the non-volatiles */
794 REST_10GPRS(22, r1) /* ditto */ 839 REST_10GPRS(22, r1) /* ditto */
795 840
796 mfspr r13,SPRN_SPRG3 841 mfspr r13,SPRN_SPRG_PACA
797 842
798 ld r4,_CCR(r1) 843 ld r4,_CCR(r1)
799 mtcr r4 844 mtcr r4
@@ -823,33 +868,24 @@ _GLOBAL(enter_prom)
823 * of all registers that it saves. We therefore save those registers 868 * of all registers that it saves. We therefore save those registers
824 * PROM might touch to the stack. (r0, r3-r13 are caller saved) 869 * PROM might touch to the stack. (r0, r3-r13 are caller saved)
825 */ 870 */
826 SAVE_8GPRS(2, r1) 871 SAVE_GPR(2, r1)
827 SAVE_GPR(13, r1) 872 SAVE_GPR(13, r1)
828 SAVE_8GPRS(14, r1) 873 SAVE_8GPRS(14, r1)
829 SAVE_10GPRS(22, r1) 874 SAVE_10GPRS(22, r1)
830 mfcr r4 875 mfcr r10
831 std r4,_CCR(r1)
832 mfctr r5
833 std r5,_CTR(r1)
834 mfspr r6,SPRN_XER
835 std r6,_XER(r1)
836 mfdar r7
837 std r7,_DAR(r1)
838 mfdsisr r8
839 std r8,_DSISR(r1)
840 mfsrr0 r9
841 std r9,_SRR0(r1)
842 mfsrr1 r10
843 std r10,_SRR1(r1)
844 mfmsr r11 876 mfmsr r11
877 std r10,_CCR(r1)
845 std r11,_MSR(r1) 878 std r11,_MSR(r1)
846 879
847 /* Get the PROM entrypoint */ 880 /* Get the PROM entrypoint */
848 ld r0,GPR4(r1) 881 mtlr r4
849 mtlr r0
850 882
851 /* Switch MSR to 32 bits mode 883 /* Switch MSR to 32 bits mode
852 */ 884 */
885#ifdef CONFIG_PPC_BOOK3E
886 rlwinm r11,r11,0,1,31
887 mtmsr r11
888#else /* CONFIG_PPC_BOOK3E */
853 mfmsr r11 889 mfmsr r11
854 li r12,1 890 li r12,1
855 rldicr r12,r12,MSR_SF_LG,(63-MSR_SF_LG) 891 rldicr r12,r12,MSR_SF_LG,(63-MSR_SF_LG)
@@ -858,10 +894,10 @@ _GLOBAL(enter_prom)
858 rldicr r12,r12,MSR_ISF_LG,(63-MSR_ISF_LG) 894 rldicr r12,r12,MSR_ISF_LG,(63-MSR_ISF_LG)
859 andc r11,r11,r12 895 andc r11,r11,r12
860 mtmsrd r11 896 mtmsrd r11
897#endif /* CONFIG_PPC_BOOK3E */
861 isync 898 isync
862 899
863 /* Restore arguments & enter PROM here... */ 900 /* Enter PROM here... */
864 ld r3,GPR3(r1)
865 blrl 901 blrl
866 902
867 /* Just make sure that r1 top 32 bits didn't get 903 /* Just make sure that r1 top 32 bits didn't get
@@ -871,7 +907,7 @@ _GLOBAL(enter_prom)
871 907
872 /* Restore the MSR (back to 64 bits) */ 908 /* Restore the MSR (back to 64 bits) */
873 ld r0,_MSR(r1) 909 ld r0,_MSR(r1)
874 mtmsrd r0 910 MTMSRD(r0)
875 isync 911 isync
876 912
877 /* Restore other registers */ 913 /* Restore other registers */
@@ -881,18 +917,6 @@ _GLOBAL(enter_prom)
881 REST_10GPRS(22, r1) 917 REST_10GPRS(22, r1)
882 ld r4,_CCR(r1) 918 ld r4,_CCR(r1)
883 mtcr r4 919 mtcr r4
884 ld r5,_CTR(r1)
885 mtctr r5
886 ld r6,_XER(r1)
887 mtspr SPRN_XER,r6
888 ld r7,_DAR(r1)
889 mtdar r7
890 ld r8,_DSISR(r1)
891 mtdsisr r8
892 ld r9,_SRR0(r1)
893 mtsrr0 r9
894 ld r10,_SRR1(r1)
895 mtsrr1 r10
896 920
897 addi r1,r1,PROM_FRAME_SIZE 921 addi r1,r1,PROM_FRAME_SIZE
898 ld r0,16(r1) 922 ld r0,16(r1)
diff --git a/arch/powerpc/kernel/exceptions-64e.S b/arch/powerpc/kernel/exceptions-64e.S
new file mode 100644
index 000000000000..9048f96237f6
--- /dev/null
+++ b/arch/powerpc/kernel/exceptions-64e.S
@@ -0,0 +1,1001 @@
1/*
2 * Boot code and exception vectors for Book3E processors
3 *
4 * Copyright (C) 2007 Ben. Herrenschmidt (benh@kernel.crashing.org), IBM Corp.
5 *
6 * This program is free software; you can redistribute it and/or
7 * modify it under the terms of the GNU General Public License
8 * as published by the Free Software Foundation; either version
9 * 2 of the License, or (at your option) any later version.
10 */
11
12#include <linux/threads.h>
13#include <asm/reg.h>
14#include <asm/page.h>
15#include <asm/ppc_asm.h>
16#include <asm/asm-offsets.h>
17#include <asm/cputable.h>
18#include <asm/setup.h>
19#include <asm/thread_info.h>
20#include <asm/reg.h>
21#include <asm/exception-64e.h>
22#include <asm/bug.h>
23#include <asm/irqflags.h>
24#include <asm/ptrace.h>
25#include <asm/ppc-opcode.h>
26#include <asm/mmu.h>
27
28/* XXX This will ultimately add space for a special exception save
29 * structure used to save things like SRR0/SRR1, SPRGs, MAS, etc...
30 * when taking special interrupts. For now we don't support that,
31 * special interrupts from within a non-standard level will probably
32 * blow you up
33 */
34#define SPECIAL_EXC_FRAME_SIZE INT_FRAME_SIZE
35
36/* Exception prolog code for all exceptions */
37#define EXCEPTION_PROLOG(n, type, addition) \
38 mtspr SPRN_SPRG_##type##_SCRATCH,r13; /* get spare registers */ \
39 mfspr r13,SPRN_SPRG_PACA; /* get PACA */ \
40 std r10,PACA_EX##type+EX_R10(r13); \
41 std r11,PACA_EX##type+EX_R11(r13); \
42 mfcr r10; /* save CR */ \
43 addition; /* additional code for that exc. */ \
44 std r1,PACA_EX##type+EX_R1(r13); /* save old r1 in the PACA */ \
45 stw r10,PACA_EX##type+EX_CR(r13); /* save old CR in the PACA */ \
46 mfspr r11,SPRN_##type##_SRR1;/* what are we coming from */ \
47 type##_SET_KSTACK; /* get special stack if necessary */\
48 andi. r10,r11,MSR_PR; /* save stack pointer */ \
49 beq 1f; /* branch around if supervisor */ \
50 ld r1,PACAKSAVE(r13); /* get kernel stack coming from usr */\
511: cmpdi cr1,r1,0; /* check if SP makes sense */ \
52 bge- cr1,exc_##n##_bad_stack;/* bad stack (TODO: out of line) */ \
53 mfspr r10,SPRN_##type##_SRR0; /* read SRR0 before touching stack */
54
55/* Exception type-specific macros */
56#define GEN_SET_KSTACK \
57 subi r1,r1,INT_FRAME_SIZE; /* alloc frame on kernel stack */
58#define SPRN_GEN_SRR0 SPRN_SRR0
59#define SPRN_GEN_SRR1 SPRN_SRR1
60
61#define CRIT_SET_KSTACK \
62 ld r1,PACA_CRIT_STACK(r13); \
63 subi r1,r1,SPECIAL_EXC_FRAME_SIZE;
64#define SPRN_CRIT_SRR0 SPRN_CSRR0
65#define SPRN_CRIT_SRR1 SPRN_CSRR1
66
67#define DBG_SET_KSTACK \
68 ld r1,PACA_DBG_STACK(r13); \
69 subi r1,r1,SPECIAL_EXC_FRAME_SIZE;
70#define SPRN_DBG_SRR0 SPRN_DSRR0
71#define SPRN_DBG_SRR1 SPRN_DSRR1
72
73#define MC_SET_KSTACK \
74 ld r1,PACA_MC_STACK(r13); \
75 subi r1,r1,SPECIAL_EXC_FRAME_SIZE;
76#define SPRN_MC_SRR0 SPRN_MCSRR0
77#define SPRN_MC_SRR1 SPRN_MCSRR1
78
79#define NORMAL_EXCEPTION_PROLOG(n, addition) \
80 EXCEPTION_PROLOG(n, GEN, addition##_GEN)
81
82#define CRIT_EXCEPTION_PROLOG(n, addition) \
83 EXCEPTION_PROLOG(n, CRIT, addition##_CRIT)
84
85#define DBG_EXCEPTION_PROLOG(n, addition) \
86 EXCEPTION_PROLOG(n, DBG, addition##_DBG)
87
88#define MC_EXCEPTION_PROLOG(n, addition) \
89 EXCEPTION_PROLOG(n, MC, addition##_MC)
90
91
92/* Variants of the "addition" argument for the prolog
93 */
94#define PROLOG_ADDITION_NONE_GEN
95#define PROLOG_ADDITION_NONE_CRIT
96#define PROLOG_ADDITION_NONE_DBG
97#define PROLOG_ADDITION_NONE_MC
98
99#define PROLOG_ADDITION_MASKABLE_GEN \
100 lbz r11,PACASOFTIRQEN(r13); /* are irqs soft-disabled ? */ \
101 cmpwi cr0,r11,0; /* yes -> go out of line */ \
102 beq masked_interrupt_book3e;
103
104#define PROLOG_ADDITION_2REGS_GEN \
105 std r14,PACA_EXGEN+EX_R14(r13); \
106 std r15,PACA_EXGEN+EX_R15(r13)
107
108#define PROLOG_ADDITION_1REG_GEN \
109 std r14,PACA_EXGEN+EX_R14(r13);
110
111#define PROLOG_ADDITION_2REGS_CRIT \
112 std r14,PACA_EXCRIT+EX_R14(r13); \
113 std r15,PACA_EXCRIT+EX_R15(r13)
114
115#define PROLOG_ADDITION_2REGS_DBG \
116 std r14,PACA_EXDBG+EX_R14(r13); \
117 std r15,PACA_EXDBG+EX_R15(r13)
118
119#define PROLOG_ADDITION_2REGS_MC \
120 std r14,PACA_EXMC+EX_R14(r13); \
121 std r15,PACA_EXMC+EX_R15(r13)
122
123/* Core exception code for all exceptions except TLB misses.
124 * XXX: Needs to make SPRN_SPRG_GEN depend on exception type
125 */
126#define EXCEPTION_COMMON(n, excf, ints) \
127 std r0,GPR0(r1); /* save r0 in stackframe */ \
128 std r2,GPR2(r1); /* save r2 in stackframe */ \
129 SAVE_4GPRS(3, r1); /* save r3 - r6 in stackframe */ \
130 SAVE_2GPRS(7, r1); /* save r7, r8 in stackframe */ \
131 std r9,GPR9(r1); /* save r9 in stackframe */ \
132 std r10,_NIP(r1); /* save SRR0 to stackframe */ \
133 std r11,_MSR(r1); /* save SRR1 to stackframe */ \
134 ACCOUNT_CPU_USER_ENTRY(r10,r11);/* accounting (uses cr0+eq) */ \
135 ld r3,excf+EX_R10(r13); /* get back r10 */ \
136 ld r4,excf+EX_R11(r13); /* get back r11 */ \
137 mfspr r5,SPRN_SPRG_GEN_SCRATCH;/* get back r13 */ \
138 std r12,GPR12(r1); /* save r12 in stackframe */ \
139 ld r2,PACATOC(r13); /* get kernel TOC into r2 */ \
140 mflr r6; /* save LR in stackframe */ \
141 mfctr r7; /* save CTR in stackframe */ \
142 mfspr r8,SPRN_XER; /* save XER in stackframe */ \
143 ld r9,excf+EX_R1(r13); /* load orig r1 back from PACA */ \
144 lwz r10,excf+EX_CR(r13); /* load orig CR back from PACA */ \
145 lbz r11,PACASOFTIRQEN(r13); /* get current IRQ softe */ \
146 ld r12,exception_marker@toc(r2); \
147 li r0,0; \
148 std r3,GPR10(r1); /* save r10 to stackframe */ \
149 std r4,GPR11(r1); /* save r11 to stackframe */ \
150 std r5,GPR13(r1); /* save it to stackframe */ \
151 std r6,_LINK(r1); \
152 std r7,_CTR(r1); \
153 std r8,_XER(r1); \
154 li r3,(n)+1; /* indicate partial regs in trap */ \
155 std r9,0(r1); /* store stack frame back link */ \
156 std r10,_CCR(r1); /* store orig CR in stackframe */ \
157 std r9,GPR1(r1); /* store stack frame back link */ \
158 std r11,SOFTE(r1); /* and save it to stackframe */ \
159 std r12,STACK_FRAME_OVERHEAD-16(r1); /* mark the frame */ \
160 std r3,_TRAP(r1); /* set trap number */ \
161 std r0,RESULT(r1); /* clear regs->result */ \
162 ints;
163
164/* Variants for the "ints" argument */
165#define INTS_KEEP
166#define INTS_DISABLE_SOFT \
167 stb r0,PACASOFTIRQEN(r13); /* mark interrupts soft-disabled */ \
168 TRACE_DISABLE_INTS;
169#define INTS_DISABLE_HARD \
170 stb r0,PACAHARDIRQEN(r13); /* and hard disabled */
171#define INTS_DISABLE_ALL \
172 INTS_DISABLE_SOFT \
173 INTS_DISABLE_HARD
174
175/* This is called by exceptions that used INTS_KEEP (that is did not clear
176 * neither soft nor hard IRQ indicators in the PACA. This will restore MSR:EE
177 * to it's previous value
178 *
179 * XXX In the long run, we may want to open-code it in order to separate the
180 * load from the wrtee, thus limiting the latency caused by the dependency
181 * but at this point, I'll favor code clarity until we have a near to final
182 * implementation
183 */
184#define INTS_RESTORE_HARD \
185 ld r11,_MSR(r1); \
186 wrtee r11;
187
188/* XXX FIXME: Restore r14/r15 when necessary */
189#define BAD_STACK_TRAMPOLINE(n) \
190exc_##n##_bad_stack: \
191 li r1,(n); /* get exception number */ \
192 sth r1,PACA_TRAP_SAVE(r13); /* store trap */ \
193 b bad_stack_book3e; /* bad stack error */
194
195#define EXCEPTION_STUB(loc, label) \
196 . = interrupt_base_book3e + loc; \
197 nop; /* To make debug interrupts happy */ \
198 b exc_##label##_book3e;
199
200#define ACK_NONE(r)
201#define ACK_DEC(r) \
202 lis r,TSR_DIS@h; \
203 mtspr SPRN_TSR,r
204#define ACK_FIT(r) \
205 lis r,TSR_FIS@h; \
206 mtspr SPRN_TSR,r
207
208#define MASKABLE_EXCEPTION(trapnum, label, hdlr, ack) \
209 START_EXCEPTION(label); \
210 NORMAL_EXCEPTION_PROLOG(trapnum, PROLOG_ADDITION_MASKABLE) \
211 EXCEPTION_COMMON(trapnum, PACA_EXGEN, INTS_DISABLE_ALL) \
212 ack(r8); \
213 addi r3,r1,STACK_FRAME_OVERHEAD; \
214 bl hdlr; \
215 b .ret_from_except_lite;
216
217/* This value is used to mark exception frames on the stack. */
218 .section ".toc","aw"
219exception_marker:
220 .tc ID_EXC_MARKER[TC],STACK_FRAME_REGS_MARKER
221
222
223/*
224 * And here we have the exception vectors !
225 */
226
227 .text
228 .balign 0x1000
229 .globl interrupt_base_book3e
230interrupt_base_book3e: /* fake trap */
231 /* Note: If real debug exceptions are supported by the HW, the vector
232 * below will have to be patched up to point to an appropriate handler
233 */
234 EXCEPTION_STUB(0x000, machine_check) /* 0x0200 */
235 EXCEPTION_STUB(0x020, critical_input) /* 0x0580 */
236 EXCEPTION_STUB(0x040, debug_crit) /* 0x0d00 */
237 EXCEPTION_STUB(0x060, data_storage) /* 0x0300 */
238 EXCEPTION_STUB(0x080, instruction_storage) /* 0x0400 */
239 EXCEPTION_STUB(0x0a0, external_input) /* 0x0500 */
240 EXCEPTION_STUB(0x0c0, alignment) /* 0x0600 */
241 EXCEPTION_STUB(0x0e0, program) /* 0x0700 */
242 EXCEPTION_STUB(0x100, fp_unavailable) /* 0x0800 */
243 EXCEPTION_STUB(0x120, system_call) /* 0x0c00 */
244 EXCEPTION_STUB(0x140, ap_unavailable) /* 0x0f20 */
245 EXCEPTION_STUB(0x160, decrementer) /* 0x0900 */
246 EXCEPTION_STUB(0x180, fixed_interval) /* 0x0980 */
247 EXCEPTION_STUB(0x1a0, watchdog) /* 0x09f0 */
248 EXCEPTION_STUB(0x1c0, data_tlb_miss)
249 EXCEPTION_STUB(0x1e0, instruction_tlb_miss)
250
251#if 0
252 EXCEPTION_STUB(0x280, processor_doorbell)
253 EXCEPTION_STUB(0x220, processor_doorbell_crit)
254#endif
255 .globl interrupt_end_book3e
256interrupt_end_book3e:
257
258/* Critical Input Interrupt */
259 START_EXCEPTION(critical_input);
260 CRIT_EXCEPTION_PROLOG(0x100, PROLOG_ADDITION_NONE)
261// EXCEPTION_COMMON(0x100, PACA_EXCRIT, INTS_DISABLE_ALL)
262// bl special_reg_save_crit
263// addi r3,r1,STACK_FRAME_OVERHEAD
264// bl .critical_exception
265// b ret_from_crit_except
266 b .
267
268/* Machine Check Interrupt */
269 START_EXCEPTION(machine_check);
270 CRIT_EXCEPTION_PROLOG(0x200, PROLOG_ADDITION_NONE)
271// EXCEPTION_COMMON(0x200, PACA_EXMC, INTS_DISABLE_ALL)
272// bl special_reg_save_mc
273// addi r3,r1,STACK_FRAME_OVERHEAD
274// bl .machine_check_exception
275// b ret_from_mc_except
276 b .
277
278/* Data Storage Interrupt */
279 START_EXCEPTION(data_storage)
280 NORMAL_EXCEPTION_PROLOG(0x300, PROLOG_ADDITION_2REGS)
281 mfspr r14,SPRN_DEAR
282 mfspr r15,SPRN_ESR
283 EXCEPTION_COMMON(0x300, PACA_EXGEN, INTS_KEEP)
284 b storage_fault_common
285
286/* Instruction Storage Interrupt */
287 START_EXCEPTION(instruction_storage);
288 NORMAL_EXCEPTION_PROLOG(0x400, PROLOG_ADDITION_2REGS)
289 li r15,0
290 mr r14,r10
291 EXCEPTION_COMMON(0x400, PACA_EXGEN, INTS_KEEP)
292 b storage_fault_common
293
294/* External Input Interrupt */
295 MASKABLE_EXCEPTION(0x500, external_input, .do_IRQ, ACK_NONE)
296
297/* Alignment */
298 START_EXCEPTION(alignment);
299 NORMAL_EXCEPTION_PROLOG(0x600, PROLOG_ADDITION_2REGS)
300 mfspr r14,SPRN_DEAR
301 mfspr r15,SPRN_ESR
302 EXCEPTION_COMMON(0x600, PACA_EXGEN, INTS_KEEP)
303 b alignment_more /* no room, go out of line */
304
305/* Program Interrupt */
306 START_EXCEPTION(program);
307 NORMAL_EXCEPTION_PROLOG(0x700, PROLOG_ADDITION_1REG)
308 mfspr r14,SPRN_ESR
309 EXCEPTION_COMMON(0x700, PACA_EXGEN, INTS_DISABLE_SOFT)
310 std r14,_DSISR(r1)
311 addi r3,r1,STACK_FRAME_OVERHEAD
312 ld r14,PACA_EXGEN+EX_R14(r13)
313 bl .save_nvgprs
314 INTS_RESTORE_HARD
315 bl .program_check_exception
316 b .ret_from_except
317
318/* Floating Point Unavailable Interrupt */
319 START_EXCEPTION(fp_unavailable);
320 NORMAL_EXCEPTION_PROLOG(0x800, PROLOG_ADDITION_NONE)
321 /* we can probably do a shorter exception entry for that one... */
322 EXCEPTION_COMMON(0x800, PACA_EXGEN, INTS_KEEP)
323 bne 1f /* if from user, just load it up */
324 bl .save_nvgprs
325 addi r3,r1,STACK_FRAME_OVERHEAD
326 INTS_RESTORE_HARD
327 bl .kernel_fp_unavailable_exception
328 BUG_OPCODE
3291: ld r12,_MSR(r1)
330 bl .load_up_fpu
331 b fast_exception_return
332
333/* Decrementer Interrupt */
334 MASKABLE_EXCEPTION(0x900, decrementer, .timer_interrupt, ACK_DEC)
335
336/* Fixed Interval Timer Interrupt */
337 MASKABLE_EXCEPTION(0x980, fixed_interval, .unknown_exception, ACK_FIT)
338
339/* Watchdog Timer Interrupt */
340 START_EXCEPTION(watchdog);
341 CRIT_EXCEPTION_PROLOG(0x9f0, PROLOG_ADDITION_NONE)
342// EXCEPTION_COMMON(0x9f0, PACA_EXCRIT, INTS_DISABLE_ALL)
343// bl special_reg_save_crit
344// addi r3,r1,STACK_FRAME_OVERHEAD
345// bl .unknown_exception
346// b ret_from_crit_except
347 b .
348
349/* System Call Interrupt */
350 START_EXCEPTION(system_call)
351 mr r9,r13 /* keep a copy of userland r13 */
352 mfspr r11,SPRN_SRR0 /* get return address */
353 mfspr r12,SPRN_SRR1 /* get previous MSR */
354 mfspr r13,SPRN_SPRG_PACA /* get our PACA */
355 b system_call_common
356
357/* Auxillary Processor Unavailable Interrupt */
358 START_EXCEPTION(ap_unavailable);
359 NORMAL_EXCEPTION_PROLOG(0xf20, PROLOG_ADDITION_NONE)
360 EXCEPTION_COMMON(0xf20, PACA_EXGEN, INTS_KEEP)
361 addi r3,r1,STACK_FRAME_OVERHEAD
362 bl .save_nvgprs
363 INTS_RESTORE_HARD
364 bl .unknown_exception
365 b .ret_from_except
366
367/* Debug exception as a critical interrupt*/
368 START_EXCEPTION(debug_crit);
369 CRIT_EXCEPTION_PROLOG(0xd00, PROLOG_ADDITION_2REGS)
370
371 /*
372 * If there is a single step or branch-taken exception in an
373 * exception entry sequence, it was probably meant to apply to
374 * the code where the exception occurred (since exception entry
375 * doesn't turn off DE automatically). We simulate the effect
376 * of turning off DE on entry to an exception handler by turning
377 * off DE in the CSRR1 value and clearing the debug status.
378 */
379
380 mfspr r14,SPRN_DBSR /* check single-step/branch taken */
381 andis. r15,r14,DBSR_IC@h
382 beq+ 1f
383
384 LOAD_REG_IMMEDIATE(r14,interrupt_base_book3e)
385 LOAD_REG_IMMEDIATE(r15,interrupt_end_book3e)
386 cmpld cr0,r10,r14
387 cmpld cr1,r10,r15
388 blt+ cr0,1f
389 bge+ cr1,1f
390
391 /* here it looks like we got an inappropriate debug exception. */
392 lis r14,DBSR_IC@h /* clear the IC event */
393 rlwinm r11,r11,0,~MSR_DE /* clear DE in the CSRR1 value */
394 mtspr SPRN_DBSR,r14
395 mtspr SPRN_CSRR1,r11
396 lwz r10,PACA_EXCRIT+EX_CR(r13) /* restore registers */
397 ld r1,PACA_EXCRIT+EX_R1(r13)
398 ld r14,PACA_EXCRIT+EX_R14(r13)
399 ld r15,PACA_EXCRIT+EX_R15(r13)
400 mtcr r10
401 ld r10,PACA_EXCRIT+EX_R10(r13) /* restore registers */
402 ld r11,PACA_EXCRIT+EX_R11(r13)
403 mfspr r13,SPRN_SPRG_CRIT_SCRATCH
404 rfci
405
406 /* Normal debug exception */
407 /* XXX We only handle coming from userspace for now since we can't
408 * quite save properly an interrupted kernel state yet
409 */
4101: andi. r14,r11,MSR_PR; /* check for userspace again */
411 beq kernel_dbg_exc; /* if from kernel mode */
412
413 /* Now we mash up things to make it look like we are coming on a
414 * normal exception
415 */
416 mfspr r15,SPRN_SPRG_CRIT_SCRATCH
417 mtspr SPRN_SPRG_GEN_SCRATCH,r15
418 mfspr r14,SPRN_DBSR
419 EXCEPTION_COMMON(0xd00, PACA_EXCRIT, INTS_DISABLE_ALL)
420 std r14,_DSISR(r1)
421 addi r3,r1,STACK_FRAME_OVERHEAD
422 mr r4,r14
423 ld r14,PACA_EXCRIT+EX_R14(r13)
424 ld r15,PACA_EXCRIT+EX_R15(r13)
425 bl .save_nvgprs
426 bl .DebugException
427 b .ret_from_except
428
429kernel_dbg_exc:
430 b . /* NYI */
431
432
433/*
434 * An interrupt came in while soft-disabled; clear EE in SRR1,
435 * clear paca->hard_enabled and return.
436 */
437masked_interrupt_book3e:
438 mtcr r10
439 stb r11,PACAHARDIRQEN(r13)
440 mfspr r10,SPRN_SRR1
441 rldicl r11,r10,48,1 /* clear MSR_EE */
442 rotldi r10,r11,16
443 mtspr SPRN_SRR1,r10
444 ld r10,PACA_EXGEN+EX_R10(r13); /* restore registers */
445 ld r11,PACA_EXGEN+EX_R11(r13);
446 mfspr r13,SPRN_SPRG_GEN_SCRATCH;
447 rfi
448 b .
449
450/*
451 * This is called from 0x300 and 0x400 handlers after the prologs with
452 * r14 and r15 containing the fault address and error code, with the
453 * original values stashed away in the PACA
454 */
455storage_fault_common:
456 std r14,_DAR(r1)
457 std r15,_DSISR(r1)
458 addi r3,r1,STACK_FRAME_OVERHEAD
459 mr r4,r14
460 mr r5,r15
461 ld r14,PACA_EXGEN+EX_R14(r13)
462 ld r15,PACA_EXGEN+EX_R15(r13)
463 INTS_RESTORE_HARD
464 bl .do_page_fault
465 cmpdi r3,0
466 bne- 1f
467 b .ret_from_except_lite
4681: bl .save_nvgprs
469 mr r5,r3
470 addi r3,r1,STACK_FRAME_OVERHEAD
471 ld r4,_DAR(r1)
472 bl .bad_page_fault
473 b .ret_from_except
474
475/*
476 * Alignment exception doesn't fit entirely in the 0x100 bytes so it
477 * continues here.
478 */
479alignment_more:
480 std r14,_DAR(r1)
481 std r15,_DSISR(r1)
482 addi r3,r1,STACK_FRAME_OVERHEAD
483 ld r14,PACA_EXGEN+EX_R14(r13)
484 ld r15,PACA_EXGEN+EX_R15(r13)
485 bl .save_nvgprs
486 INTS_RESTORE_HARD
487 bl .alignment_exception
488 b .ret_from_except
489
490/*
491 * We branch here from entry_64.S for the last stage of the exception
492 * return code path. MSR:EE is expected to be off at that point
493 */
494_GLOBAL(exception_return_book3e)
495 b 1f
496
497/* This is the return from load_up_fpu fast path which could do with
498 * less GPR restores in fact, but for now we have a single return path
499 */
500 .globl fast_exception_return
501fast_exception_return:
502 wrteei 0
5031: mr r0,r13
504 ld r10,_MSR(r1)
505 REST_4GPRS(2, r1)
506 andi. r6,r10,MSR_PR
507 REST_2GPRS(6, r1)
508 beq 1f
509 ACCOUNT_CPU_USER_EXIT(r10, r11)
510 ld r0,GPR13(r1)
511
5121: stdcx. r0,0,r1 /* to clear the reservation */
513
514 ld r8,_CCR(r1)
515 ld r9,_LINK(r1)
516 ld r10,_CTR(r1)
517 ld r11,_XER(r1)
518 mtcr r8
519 mtlr r9
520 mtctr r10
521 mtxer r11
522 REST_2GPRS(8, r1)
523 ld r10,GPR10(r1)
524 ld r11,GPR11(r1)
525 ld r12,GPR12(r1)
526 mtspr SPRN_SPRG_GEN_SCRATCH,r0
527
528 std r10,PACA_EXGEN+EX_R10(r13);
529 std r11,PACA_EXGEN+EX_R11(r13);
530 ld r10,_NIP(r1)
531 ld r11,_MSR(r1)
532 ld r0,GPR0(r1)
533 ld r1,GPR1(r1)
534 mtspr SPRN_SRR0,r10
535 mtspr SPRN_SRR1,r11
536 ld r10,PACA_EXGEN+EX_R10(r13)
537 ld r11,PACA_EXGEN+EX_R11(r13)
538 mfspr r13,SPRN_SPRG_GEN_SCRATCH
539 rfi
540
541/*
542 * Trampolines used when spotting a bad kernel stack pointer in
543 * the exception entry code.
544 *
545 * TODO: move some bits like SRR0 read to trampoline, pass PACA
546 * index around, etc... to handle crit & mcheck
547 */
548BAD_STACK_TRAMPOLINE(0x000)
549BAD_STACK_TRAMPOLINE(0x100)
550BAD_STACK_TRAMPOLINE(0x200)
551BAD_STACK_TRAMPOLINE(0x300)
552BAD_STACK_TRAMPOLINE(0x400)
553BAD_STACK_TRAMPOLINE(0x500)
554BAD_STACK_TRAMPOLINE(0x600)
555BAD_STACK_TRAMPOLINE(0x700)
556BAD_STACK_TRAMPOLINE(0x800)
557BAD_STACK_TRAMPOLINE(0x900)
558BAD_STACK_TRAMPOLINE(0x980)
559BAD_STACK_TRAMPOLINE(0x9f0)
560BAD_STACK_TRAMPOLINE(0xa00)
561BAD_STACK_TRAMPOLINE(0xb00)
562BAD_STACK_TRAMPOLINE(0xc00)
563BAD_STACK_TRAMPOLINE(0xd00)
564BAD_STACK_TRAMPOLINE(0xe00)
565BAD_STACK_TRAMPOLINE(0xf00)
566BAD_STACK_TRAMPOLINE(0xf20)
567
568 .globl bad_stack_book3e
569bad_stack_book3e:
570 /* XXX: Needs to make SPRN_SPRG_GEN depend on exception type */
571 mfspr r10,SPRN_SRR0; /* read SRR0 before touching stack */
572 ld r1,PACAEMERGSP(r13)
573 subi r1,r1,64+INT_FRAME_SIZE
574 std r10,_NIP(r1)
575 std r11,_MSR(r1)
576 ld r10,PACA_EXGEN+EX_R1(r13) /* FIXME for crit & mcheck */
577 lwz r11,PACA_EXGEN+EX_CR(r13) /* FIXME for crit & mcheck */
578 std r10,GPR1(r1)
579 std r11,_CCR(r1)
580 mfspr r10,SPRN_DEAR
581 mfspr r11,SPRN_ESR
582 std r10,_DAR(r1)
583 std r11,_DSISR(r1)
584 std r0,GPR0(r1); /* save r0 in stackframe */ \
585 std r2,GPR2(r1); /* save r2 in stackframe */ \
586 SAVE_4GPRS(3, r1); /* save r3 - r6 in stackframe */ \
587 SAVE_2GPRS(7, r1); /* save r7, r8 in stackframe */ \
588 std r9,GPR9(r1); /* save r9 in stackframe */ \
589 ld r3,PACA_EXGEN+EX_R10(r13);/* get back r10 */ \
590 ld r4,PACA_EXGEN+EX_R11(r13);/* get back r11 */ \
591 mfspr r5,SPRN_SPRG_GEN_SCRATCH;/* get back r13 XXX can be wrong */ \
592 std r3,GPR10(r1); /* save r10 to stackframe */ \
593 std r4,GPR11(r1); /* save r11 to stackframe */ \
594 std r12,GPR12(r1); /* save r12 in stackframe */ \
595 std r5,GPR13(r1); /* save it to stackframe */ \
596 mflr r10
597 mfctr r11
598 mfxer r12
599 std r10,_LINK(r1)
600 std r11,_CTR(r1)
601 std r12,_XER(r1)
602 SAVE_10GPRS(14,r1)
603 SAVE_8GPRS(24,r1)
604 lhz r12,PACA_TRAP_SAVE(r13)
605 std r12,_TRAP(r1)
606 addi r11,r1,INT_FRAME_SIZE
607 std r11,0(r1)
608 li r12,0
609 std r12,0(r11)
610 ld r2,PACATOC(r13)
6111: addi r3,r1,STACK_FRAME_OVERHEAD
612 bl .kernel_bad_stack
613 b 1b
614
615/*
616 * Setup the initial TLB for a core. This current implementation
617 * assume that whatever we are running off will not conflict with
618 * the new mapping at PAGE_OFFSET.
619 */
620_GLOBAL(initial_tlb_book3e)
621
622 /* Look for the first TLB with IPROT set */
623 mfspr r4,SPRN_TLB0CFG
624 andi. r3,r4,TLBnCFG_IPROT
625 lis r3,MAS0_TLBSEL(0)@h
626 bne found_iprot
627
628 mfspr r4,SPRN_TLB1CFG
629 andi. r3,r4,TLBnCFG_IPROT
630 lis r3,MAS0_TLBSEL(1)@h
631 bne found_iprot
632
633 mfspr r4,SPRN_TLB2CFG
634 andi. r3,r4,TLBnCFG_IPROT
635 lis r3,MAS0_TLBSEL(2)@h
636 bne found_iprot
637
638 lis r3,MAS0_TLBSEL(3)@h
639 mfspr r4,SPRN_TLB3CFG
640 /* fall through */
641
642found_iprot:
643 andi. r5,r4,TLBnCFG_HES
644 bne have_hes
645
646 mflr r8 /* save LR */
647/* 1. Find the index of the entry we're executing in
648 *
649 * r3 = MAS0_TLBSEL (for the iprot array)
650 * r4 = SPRN_TLBnCFG
651 */
652 bl invstr /* Find our address */
653invstr: mflr r6 /* Make it accessible */
654 mfmsr r7
655 rlwinm r5,r7,27,31,31 /* extract MSR[IS] */
656 mfspr r7,SPRN_PID
657 slwi r7,r7,16
658 or r7,r7,r5
659 mtspr SPRN_MAS6,r7
660 tlbsx 0,r6 /* search MSR[IS], SPID=PID */
661
662 mfspr r3,SPRN_MAS0
663 rlwinm r5,r3,16,20,31 /* Extract MAS0(Entry) */
664
665 mfspr r7,SPRN_MAS1 /* Insure IPROT set */
666 oris r7,r7,MAS1_IPROT@h
667 mtspr SPRN_MAS1,r7
668 tlbwe
669
670/* 2. Invalidate all entries except the entry we're executing in
671 *
672 * r3 = MAS0 w/TLBSEL & ESEL for the entry we are running in
673 * r4 = SPRN_TLBnCFG
674 * r5 = ESEL of entry we are running in
675 */
676 andi. r4,r4,TLBnCFG_N_ENTRY /* Extract # entries */
677 li r6,0 /* Set Entry counter to 0 */
6781: mr r7,r3 /* Set MAS0(TLBSEL) */
679 rlwimi r7,r6,16,4,15 /* Setup MAS0 = TLBSEL | ESEL(r6) */
680 mtspr SPRN_MAS0,r7
681 tlbre
682 mfspr r7,SPRN_MAS1
683 rlwinm r7,r7,0,2,31 /* Clear MAS1 Valid and IPROT */
684 cmpw r5,r6
685 beq skpinv /* Dont update the current execution TLB */
686 mtspr SPRN_MAS1,r7
687 tlbwe
688 isync
689skpinv: addi r6,r6,1 /* Increment */
690 cmpw r6,r4 /* Are we done? */
691 bne 1b /* If not, repeat */
692
693 /* Invalidate all TLBs */
694 PPC_TLBILX_ALL(0,0)
695 sync
696 isync
697
698/* 3. Setup a temp mapping and jump to it
699 *
700 * r3 = MAS0 w/TLBSEL & ESEL for the entry we are running in
701 * r5 = ESEL of entry we are running in
702 */
703 andi. r7,r5,0x1 /* Find an entry not used and is non-zero */
704 addi r7,r7,0x1
705 mr r4,r3 /* Set MAS0(TLBSEL) = 1 */
706 mtspr SPRN_MAS0,r4
707 tlbre
708
709 rlwimi r4,r7,16,4,15 /* Setup MAS0 = TLBSEL | ESEL(r7) */
710 mtspr SPRN_MAS0,r4
711
712 mfspr r7,SPRN_MAS1
713 xori r6,r7,MAS1_TS /* Setup TMP mapping in the other Address space */
714 mtspr SPRN_MAS1,r6
715
716 tlbwe
717
718 mfmsr r6
719 xori r6,r6,MSR_IS
720 mtspr SPRN_SRR1,r6
721 bl 1f /* Find our address */
7221: mflr r6
723 addi r6,r6,(2f - 1b)
724 mtspr SPRN_SRR0,r6
725 rfi
7262:
727
728/* 4. Clear out PIDs & Search info
729 *
730 * r3 = MAS0 w/TLBSEL & ESEL for the entry we started in
731 * r4 = MAS0 w/TLBSEL & ESEL for the temp mapping
732 * r5 = MAS3
733 */
734 li r6,0
735 mtspr SPRN_MAS6,r6
736 mtspr SPRN_PID,r6
737
738/* 5. Invalidate mapping we started in
739 *
740 * r3 = MAS0 w/TLBSEL & ESEL for the entry we started in
741 * r4 = MAS0 w/TLBSEL & ESEL for the temp mapping
742 * r5 = MAS3
743 */
744 mtspr SPRN_MAS0,r3
745 tlbre
746 mfspr r6,SPRN_MAS1
747 rlwinm r6,r6,0,2,0 /* clear IPROT */
748 mtspr SPRN_MAS1,r6
749 tlbwe
750
751 /* Invalidate TLB1 */
752 PPC_TLBILX_ALL(0,0)
753 sync
754 isync
755
756/* The mapping only needs to be cache-coherent on SMP */
757#ifdef CONFIG_SMP
758#define M_IF_SMP MAS2_M
759#else
760#define M_IF_SMP 0
761#endif
762
763/* 6. Setup KERNELBASE mapping in TLB[0]
764 *
765 * r3 = MAS0 w/TLBSEL & ESEL for the entry we started in
766 * r4 = MAS0 w/TLBSEL & ESEL for the temp mapping
767 * r5 = MAS3
768 */
769 rlwinm r3,r3,0,16,3 /* clear ESEL */
770 mtspr SPRN_MAS0,r3
771 lis r6,(MAS1_VALID|MAS1_IPROT)@h
772 ori r6,r6,(MAS1_TSIZE(BOOK3E_PAGESZ_1GB))@l
773 mtspr SPRN_MAS1,r6
774
775 LOAD_REG_IMMEDIATE(r6, PAGE_OFFSET | M_IF_SMP)
776 mtspr SPRN_MAS2,r6
777
778 rlwinm r5,r5,0,0,25
779 ori r5,r5,MAS3_SR | MAS3_SW | MAS3_SX
780 mtspr SPRN_MAS3,r5
781 li r5,-1
782 rlwinm r5,r5,0,0,25
783
784 tlbwe
785
786/* 7. Jump to KERNELBASE mapping
787 *
788 * r4 = MAS0 w/TLBSEL & ESEL for the temp mapping
789 */
790 /* Now we branch the new virtual address mapped by this entry */
791 LOAD_REG_IMMEDIATE(r6,2f)
792 lis r7,MSR_KERNEL@h
793 ori r7,r7,MSR_KERNEL@l
794 mtspr SPRN_SRR0,r6
795 mtspr SPRN_SRR1,r7
796 rfi /* start execution out of TLB1[0] entry */
7972:
798
799/* 8. Clear out the temp mapping
800 *
801 * r4 = MAS0 w/TLBSEL & ESEL for the entry we are running in
802 */
803 mtspr SPRN_MAS0,r4
804 tlbre
805 mfspr r5,SPRN_MAS1
806 rlwinm r5,r5,0,2,0 /* clear IPROT */
807 mtspr SPRN_MAS1,r5
808 tlbwe
809
810 /* Invalidate TLB1 */
811 PPC_TLBILX_ALL(0,0)
812 sync
813 isync
814
815 /* We translate LR and return */
816 tovirt(r8,r8)
817 mtlr r8
818 blr
819
820have_hes:
821 /* Setup MAS 0,1,2,3 and 7 for tlbwe of a 1G entry that maps the
822 * kernel linear mapping. We also set MAS8 once for all here though
823 * that will have to be made dependent on whether we are running under
824 * a hypervisor I suppose.
825 */
826 ori r3,r3,MAS0_HES | MAS0_WQ_ALLWAYS
827 mtspr SPRN_MAS0,r3
828 lis r3,(MAS1_VALID | MAS1_IPROT)@h
829 ori r3,r3,BOOK3E_PAGESZ_1GB << MAS1_TSIZE_SHIFT
830 mtspr SPRN_MAS1,r3
831 LOAD_REG_IMMEDIATE(r3, PAGE_OFFSET | MAS2_M)
832 mtspr SPRN_MAS2,r3
833 li r3,MAS3_SR | MAS3_SW | MAS3_SX
834 mtspr SPRN_MAS7_MAS3,r3
835 li r3,0
836 mtspr SPRN_MAS8,r3
837
838 /* Write the TLB entry */
839 tlbwe
840
841 /* Now we branch the new virtual address mapped by this entry */
842 LOAD_REG_IMMEDIATE(r3,1f)
843 mtctr r3
844 bctr
845
8461: /* We are now running at PAGE_OFFSET, clean the TLB of everything
847 * else (XXX we should scan for bolted crap from the firmware too)
848 */
849 PPC_TLBILX(0,0,0)
850 sync
851 isync
852
853 /* We translate LR and return */
854 mflr r3
855 tovirt(r3,r3)
856 mtlr r3
857 blr
858
859/*
860 * Main entry (boot CPU, thread 0)
861 *
862 * We enter here from head_64.S, possibly after the prom_init trampoline
863 * with r3 and r4 already saved to r31 and 30 respectively and in 64 bits
864 * mode. Anything else is as it was left by the bootloader
865 *
866 * Initial requirements of this port:
867 *
868 * - Kernel loaded at 0 physical
869 * - A good lump of memory mapped 0:0 by UTLB entry 0
870 * - MSR:IS & MSR:DS set to 0
871 *
872 * Note that some of the above requirements will be relaxed in the future
873 * as the kernel becomes smarter at dealing with different initial conditions
874 * but for now you have to be careful
875 */
876_GLOBAL(start_initialization_book3e)
877 mflr r28
878
879 /* First, we need to setup some initial TLBs to map the kernel
880 * text, data and bss at PAGE_OFFSET. We don't have a real mode
881 * and always use AS 0, so we just set it up to match our link
882 * address and never use 0 based addresses.
883 */
884 bl .initial_tlb_book3e
885
886 /* Init global core bits */
887 bl .init_core_book3e
888
889 /* Init per-thread bits */
890 bl .init_thread_book3e
891
892 /* Return to common init code */
893 tovirt(r28,r28)
894 mtlr r28
895 blr
896
897
898/*
899 * Secondary core/processor entry
900 *
901 * This is entered for thread 0 of a secondary core, all other threads
902 * are expected to be stopped. It's similar to start_initialization_book3e
903 * except that it's generally entered from the holding loop in head_64.S
904 * after CPUs have been gathered by Open Firmware.
905 *
906 * We assume we are in 32 bits mode running with whatever TLB entry was
907 * set for us by the firmware or POR engine.
908 */
909_GLOBAL(book3e_secondary_core_init_tlb_set)
910 li r4,1
911 b .generic_secondary_smp_init
912
913_GLOBAL(book3e_secondary_core_init)
914 mflr r28
915
916 /* Do we need to setup initial TLB entry ? */
917 cmplwi r4,0
918 bne 2f
919
920 /* Setup TLB for this core */
921 bl .initial_tlb_book3e
922
923 /* We can return from the above running at a different
924 * address, so recalculate r2 (TOC)
925 */
926 bl .relative_toc
927
928 /* Init global core bits */
9292: bl .init_core_book3e
930
931 /* Init per-thread bits */
9323: bl .init_thread_book3e
933
934 /* Return to common init code at proper virtual address.
935 *
936 * Due to various previous assumptions, we know we entered this
937 * function at either the final PAGE_OFFSET mapping or using a
938 * 1:1 mapping at 0, so we don't bother doing a complicated check
939 * here, we just ensure the return address has the right top bits.
940 *
941 * Note that if we ever want to be smarter about where we can be
942 * started from, we have to be careful that by the time we reach
943 * the code below we may already be running at a different location
944 * than the one we were called from since initial_tlb_book3e can
945 * have moved us already.
946 */
947 cmpdi cr0,r28,0
948 blt 1f
949 lis r3,PAGE_OFFSET@highest
950 sldi r3,r3,32
951 or r28,r28,r3
9521: mtlr r28
953 blr
954
955_GLOBAL(book3e_secondary_thread_init)
956 mflr r28
957 b 3b
958
959_STATIC(init_core_book3e)
960 /* Establish the interrupt vector base */
961 LOAD_REG_IMMEDIATE(r3, interrupt_base_book3e)
962 mtspr SPRN_IVPR,r3
963 sync
964 blr
965
966_STATIC(init_thread_book3e)
967 lis r3,(SPRN_EPCR_ICM | SPRN_EPCR_GICM)@h
968 mtspr SPRN_EPCR,r3
969
970 /* Make sure interrupts are off */
971 wrteei 0
972
973 /* disable all timers and clear out status */
974 li r3,0
975 mtspr SPRN_TCR,r3
976 mfspr r3,SPRN_TSR
977 mtspr SPRN_TSR,r3
978
979 blr
980
981_GLOBAL(__setup_base_ivors)
982 SET_IVOR(0, 0x020) /* Critical Input */
983 SET_IVOR(1, 0x000) /* Machine Check */
984 SET_IVOR(2, 0x060) /* Data Storage */
985 SET_IVOR(3, 0x080) /* Instruction Storage */
986 SET_IVOR(4, 0x0a0) /* External Input */
987 SET_IVOR(5, 0x0c0) /* Alignment */
988 SET_IVOR(6, 0x0e0) /* Program */
989 SET_IVOR(7, 0x100) /* FP Unavailable */
990 SET_IVOR(8, 0x120) /* System Call */
991 SET_IVOR(9, 0x140) /* Auxiliary Processor Unavailable */
992 SET_IVOR(10, 0x160) /* Decrementer */
993 SET_IVOR(11, 0x180) /* Fixed Interval Timer */
994 SET_IVOR(12, 0x1a0) /* Watchdog Timer */
995 SET_IVOR(13, 0x1c0) /* Data TLB Error */
996 SET_IVOR(14, 0x1e0) /* Instruction TLB Error */
997 SET_IVOR(15, 0x040) /* Debug */
998
999 sync
1000
1001 blr
diff --git a/arch/powerpc/kernel/exceptions-64s.S b/arch/powerpc/kernel/exceptions-64s.S
index 8ac85e08ffae..1808876edcc9 100644
--- a/arch/powerpc/kernel/exceptions-64s.S
+++ b/arch/powerpc/kernel/exceptions-64s.S
@@ -12,6 +12,8 @@
12 * 12 *
13 */ 13 */
14 14
15#include <asm/exception-64s.h>
16
15/* 17/*
16 * We layout physical memory as follows: 18 * We layout physical memory as follows:
17 * 0x0000 - 0x00ff : Secondary processor spin code 19 * 0x0000 - 0x00ff : Secondary processor spin code
@@ -22,18 +24,6 @@
22 * 0x8000 - : Early init and support code 24 * 0x8000 - : Early init and support code
23 */ 25 */
24 26
25
26/*
27 * SPRG Usage
28 *
29 * Register Definition
30 *
31 * SPRG0 reserved for hypervisor
32 * SPRG1 temp - used to save gpr
33 * SPRG2 temp - used to save gpr
34 * SPRG3 virt addr of paca
35 */
36
37/* 27/*
38 * This is the start of the interrupt handlers for pSeries 28 * This is the start of the interrupt handlers for pSeries
39 * This code runs with relocation off. 29 * This code runs with relocation off.
@@ -51,34 +41,44 @@ __start_interrupts:
51 . = 0x200 41 . = 0x200
52_machine_check_pSeries: 42_machine_check_pSeries:
53 HMT_MEDIUM 43 HMT_MEDIUM
54 mtspr SPRN_SPRG1,r13 /* save r13 */ 44 mtspr SPRN_SPRG_SCRATCH0,r13 /* save r13 */
55 EXCEPTION_PROLOG_PSERIES(PACA_EXMC, machine_check_common) 45 EXCEPTION_PROLOG_PSERIES(PACA_EXMC, machine_check_common)
56 46
57 . = 0x300 47 . = 0x300
58 .globl data_access_pSeries 48 .globl data_access_pSeries
59data_access_pSeries: 49data_access_pSeries:
60 HMT_MEDIUM 50 HMT_MEDIUM
61 mtspr SPRN_SPRG1,r13 51 mtspr SPRN_SPRG_SCRATCH0,r13
62BEGIN_FTR_SECTION 52BEGIN_FTR_SECTION
63 mtspr SPRN_SPRG2,r12 53 mfspr r13,SPRN_SPRG_PACA
64 mfspr r13,SPRN_DAR 54 std r9,PACA_EXSLB+EX_R9(r13)
65 mfspr r12,SPRN_DSISR 55 std r10,PACA_EXSLB+EX_R10(r13)
66 srdi r13,r13,60 56 mfspr r10,SPRN_DAR
67 rlwimi r13,r12,16,0x20 57 mfspr r9,SPRN_DSISR
68 mfcr r12 58 srdi r10,r10,60
69 cmpwi r13,0x2c 59 rlwimi r10,r9,16,0x20
60 mfcr r9
61 cmpwi r10,0x2c
70 beq do_stab_bolted_pSeries 62 beq do_stab_bolted_pSeries
71 mtcrf 0x80,r12 63 ld r10,PACA_EXSLB+EX_R10(r13)
72 mfspr r12,SPRN_SPRG2 64 std r11,PACA_EXGEN+EX_R11(r13)
73END_FTR_SECTION_IFCLR(CPU_FTR_SLB) 65 ld r11,PACA_EXSLB+EX_R9(r13)
66 std r12,PACA_EXGEN+EX_R12(r13)
67 mfspr r12,SPRN_SPRG_SCRATCH0
68 std r10,PACA_EXGEN+EX_R10(r13)
69 std r11,PACA_EXGEN+EX_R9(r13)
70 std r12,PACA_EXGEN+EX_R13(r13)
71 EXCEPTION_PROLOG_PSERIES_1(data_access_common)
72FTR_SECTION_ELSE
74 EXCEPTION_PROLOG_PSERIES(PACA_EXGEN, data_access_common) 73 EXCEPTION_PROLOG_PSERIES(PACA_EXGEN, data_access_common)
74ALT_FTR_SECTION_END_IFCLR(CPU_FTR_SLB)
75 75
76 . = 0x380 76 . = 0x380
77 .globl data_access_slb_pSeries 77 .globl data_access_slb_pSeries
78data_access_slb_pSeries: 78data_access_slb_pSeries:
79 HMT_MEDIUM 79 HMT_MEDIUM
80 mtspr SPRN_SPRG1,r13 80 mtspr SPRN_SPRG_SCRATCH0,r13
81 mfspr r13,SPRN_SPRG3 /* get paca address into r13 */ 81 mfspr r13,SPRN_SPRG_PACA /* get paca address into r13 */
82 std r3,PACA_EXSLB+EX_R3(r13) 82 std r3,PACA_EXSLB+EX_R3(r13)
83 mfspr r3,SPRN_DAR 83 mfspr r3,SPRN_DAR
84 std r9,PACA_EXSLB+EX_R9(r13) /* save r9 - r12 */ 84 std r9,PACA_EXSLB+EX_R9(r13) /* save r9 - r12 */
@@ -91,7 +91,7 @@ data_access_slb_pSeries:
91 std r10,PACA_EXSLB+EX_R10(r13) 91 std r10,PACA_EXSLB+EX_R10(r13)
92 std r11,PACA_EXSLB+EX_R11(r13) 92 std r11,PACA_EXSLB+EX_R11(r13)
93 std r12,PACA_EXSLB+EX_R12(r13) 93 std r12,PACA_EXSLB+EX_R12(r13)
94 mfspr r10,SPRN_SPRG1 94 mfspr r10,SPRN_SPRG_SCRATCH0
95 std r10,PACA_EXSLB+EX_R13(r13) 95 std r10,PACA_EXSLB+EX_R13(r13)
96 mfspr r12,SPRN_SRR1 /* and SRR1 */ 96 mfspr r12,SPRN_SRR1 /* and SRR1 */
97#ifndef CONFIG_RELOCATABLE 97#ifndef CONFIG_RELOCATABLE
@@ -115,8 +115,8 @@ data_access_slb_pSeries:
115 .globl instruction_access_slb_pSeries 115 .globl instruction_access_slb_pSeries
116instruction_access_slb_pSeries: 116instruction_access_slb_pSeries:
117 HMT_MEDIUM 117 HMT_MEDIUM
118 mtspr SPRN_SPRG1,r13 118 mtspr SPRN_SPRG_SCRATCH0,r13
119 mfspr r13,SPRN_SPRG3 /* get paca address into r13 */ 119 mfspr r13,SPRN_SPRG_PACA /* get paca address into r13 */
120 std r3,PACA_EXSLB+EX_R3(r13) 120 std r3,PACA_EXSLB+EX_R3(r13)
121 mfspr r3,SPRN_SRR0 /* SRR0 is faulting address */ 121 mfspr r3,SPRN_SRR0 /* SRR0 is faulting address */
122 std r9,PACA_EXSLB+EX_R9(r13) /* save r9 - r12 */ 122 std r9,PACA_EXSLB+EX_R9(r13) /* save r9 - r12 */
@@ -129,7 +129,7 @@ instruction_access_slb_pSeries:
129 std r10,PACA_EXSLB+EX_R10(r13) 129 std r10,PACA_EXSLB+EX_R10(r13)
130 std r11,PACA_EXSLB+EX_R11(r13) 130 std r11,PACA_EXSLB+EX_R11(r13)
131 std r12,PACA_EXSLB+EX_R12(r13) 131 std r12,PACA_EXSLB+EX_R12(r13)
132 mfspr r10,SPRN_SPRG1 132 mfspr r10,SPRN_SPRG_SCRATCH0
133 std r10,PACA_EXSLB+EX_R13(r13) 133 std r10,PACA_EXSLB+EX_R13(r13)
134 mfspr r12,SPRN_SRR1 /* and SRR1 */ 134 mfspr r12,SPRN_SRR1 /* and SRR1 */
135#ifndef CONFIG_RELOCATABLE 135#ifndef CONFIG_RELOCATABLE
@@ -159,7 +159,7 @@ BEGIN_FTR_SECTION
159 beq- 1f 159 beq- 1f
160END_FTR_SECTION_IFSET(CPU_FTR_REAL_LE) 160END_FTR_SECTION_IFSET(CPU_FTR_REAL_LE)
161 mr r9,r13 161 mr r9,r13
162 mfspr r13,SPRN_SPRG3 162 mfspr r13,SPRN_SPRG_PACA
163 mfspr r11,SPRN_SRR0 163 mfspr r11,SPRN_SRR0
164 ld r12,PACAKBASE(r13) 164 ld r12,PACAKBASE(r13)
165 ld r10,PACAKMSR(r13) 165 ld r10,PACAKMSR(r13)
@@ -228,15 +228,17 @@ masked_interrupt:
228 rotldi r10,r10,16 228 rotldi r10,r10,16
229 mtspr SPRN_SRR1,r10 229 mtspr SPRN_SRR1,r10
230 ld r10,PACA_EXGEN+EX_R10(r13) 230 ld r10,PACA_EXGEN+EX_R10(r13)
231 mfspr r13,SPRN_SPRG1 231 mfspr r13,SPRN_SPRG_SCRATCH0
232 rfid 232 rfid
233 b . 233 b .
234 234
235 .align 7 235 .align 7
236do_stab_bolted_pSeries: 236do_stab_bolted_pSeries:
237 mtcrf 0x80,r12 237 std r11,PACA_EXSLB+EX_R11(r13)
238 mfspr r12,SPRN_SPRG2 238 std r12,PACA_EXSLB+EX_R12(r13)
239 EXCEPTION_PROLOG_PSERIES(PACA_EXSLB, .do_stab_bolted) 239 mfspr r10,SPRN_SPRG_SCRATCH0
240 std r10,PACA_EXSLB+EX_R13(r13)
241 EXCEPTION_PROLOG_PSERIES_1(.do_stab_bolted)
240 242
241#ifdef CONFIG_PPC_PSERIES 243#ifdef CONFIG_PPC_PSERIES
242/* 244/*
@@ -246,14 +248,14 @@ do_stab_bolted_pSeries:
246 .align 7 248 .align 7
247system_reset_fwnmi: 249system_reset_fwnmi:
248 HMT_MEDIUM 250 HMT_MEDIUM
249 mtspr SPRN_SPRG1,r13 /* save r13 */ 251 mtspr SPRN_SPRG_SCRATCH0,r13 /* save r13 */
250 EXCEPTION_PROLOG_PSERIES(PACA_EXGEN, system_reset_common) 252 EXCEPTION_PROLOG_PSERIES(PACA_EXGEN, system_reset_common)
251 253
252 .globl machine_check_fwnmi 254 .globl machine_check_fwnmi
253 .align 7 255 .align 7
254machine_check_fwnmi: 256machine_check_fwnmi:
255 HMT_MEDIUM 257 HMT_MEDIUM
256 mtspr SPRN_SPRG1,r13 /* save r13 */ 258 mtspr SPRN_SPRG_SCRATCH0,r13 /* save r13 */
257 EXCEPTION_PROLOG_PSERIES(PACA_EXMC, machine_check_common) 259 EXCEPTION_PROLOG_PSERIES(PACA_EXMC, machine_check_common)
258 260
259#endif /* CONFIG_PPC_PSERIES */ 261#endif /* CONFIG_PPC_PSERIES */
@@ -268,7 +270,7 @@ slb_miss_user_pseries:
268 std r10,PACA_EXGEN+EX_R10(r13) 270 std r10,PACA_EXGEN+EX_R10(r13)
269 std r11,PACA_EXGEN+EX_R11(r13) 271 std r11,PACA_EXGEN+EX_R11(r13)
270 std r12,PACA_EXGEN+EX_R12(r13) 272 std r12,PACA_EXGEN+EX_R12(r13)
271 mfspr r10,SPRG1 273 mfspr r10,SPRG_SCRATCH0
272 ld r11,PACA_EXSLB+EX_R9(r13) 274 ld r11,PACA_EXSLB+EX_R9(r13)
273 ld r12,PACA_EXSLB+EX_R3(r13) 275 ld r12,PACA_EXSLB+EX_R3(r13)
274 std r10,PACA_EXGEN+EX_R13(r13) 276 std r10,PACA_EXGEN+EX_R13(r13)
diff --git a/arch/powerpc/kernel/fpu.S b/arch/powerpc/kernel/fpu.S
index 2436df33c6f4..fc8f5b14019c 100644
--- a/arch/powerpc/kernel/fpu.S
+++ b/arch/powerpc/kernel/fpu.S
@@ -91,7 +91,7 @@ END_FTR_SECTION_IFSET(CPU_FTR_VSX)
91#endif /* CONFIG_SMP */ 91#endif /* CONFIG_SMP */
92 /* enable use of FP after return */ 92 /* enable use of FP after return */
93#ifdef CONFIG_PPC32 93#ifdef CONFIG_PPC32
94 mfspr r5,SPRN_SPRG3 /* current task's THREAD (phys) */ 94 mfspr r5,SPRN_SPRG_THREAD /* current task's THREAD (phys) */
95 lwz r4,THREAD_FPEXC_MODE(r5) 95 lwz r4,THREAD_FPEXC_MODE(r5)
96 ori r9,r9,MSR_FP /* enable FP for current */ 96 ori r9,r9,MSR_FP /* enable FP for current */
97 or r9,r9,r4 97 or r9,r9,r4
diff --git a/arch/powerpc/kernel/head_32.S b/arch/powerpc/kernel/head_32.S
index fc2132942754..829c3fe7c5a2 100644
--- a/arch/powerpc/kernel/head_32.S
+++ b/arch/powerpc/kernel/head_32.S
@@ -244,8 +244,8 @@ __secondary_hold_acknowledge:
244 * task's thread_struct. 244 * task's thread_struct.
245 */ 245 */
246#define EXCEPTION_PROLOG \ 246#define EXCEPTION_PROLOG \
247 mtspr SPRN_SPRG0,r10; \ 247 mtspr SPRN_SPRG_SCRATCH0,r10; \
248 mtspr SPRN_SPRG1,r11; \ 248 mtspr SPRN_SPRG_SCRATCH1,r11; \
249 mfcr r10; \ 249 mfcr r10; \
250 EXCEPTION_PROLOG_1; \ 250 EXCEPTION_PROLOG_1; \
251 EXCEPTION_PROLOG_2 251 EXCEPTION_PROLOG_2
@@ -255,7 +255,7 @@ __secondary_hold_acknowledge:
255 andi. r11,r11,MSR_PR; \ 255 andi. r11,r11,MSR_PR; \
256 tophys(r11,r1); /* use tophys(r1) if kernel */ \ 256 tophys(r11,r1); /* use tophys(r1) if kernel */ \
257 beq 1f; \ 257 beq 1f; \
258 mfspr r11,SPRN_SPRG3; \ 258 mfspr r11,SPRN_SPRG_THREAD; \
259 lwz r11,THREAD_INFO-THREAD(r11); \ 259 lwz r11,THREAD_INFO-THREAD(r11); \
260 addi r11,r11,THREAD_SIZE; \ 260 addi r11,r11,THREAD_SIZE; \
261 tophys(r11,r11); \ 261 tophys(r11,r11); \
@@ -267,9 +267,9 @@ __secondary_hold_acknowledge:
267 stw r10,_CCR(r11); /* save registers */ \ 267 stw r10,_CCR(r11); /* save registers */ \
268 stw r12,GPR12(r11); \ 268 stw r12,GPR12(r11); \
269 stw r9,GPR9(r11); \ 269 stw r9,GPR9(r11); \
270 mfspr r10,SPRN_SPRG0; \ 270 mfspr r10,SPRN_SPRG_SCRATCH0; \
271 stw r10,GPR10(r11); \ 271 stw r10,GPR10(r11); \
272 mfspr r12,SPRN_SPRG1; \ 272 mfspr r12,SPRN_SPRG_SCRATCH1; \
273 stw r12,GPR11(r11); \ 273 stw r12,GPR11(r11); \
274 mflr r10; \ 274 mflr r10; \
275 stw r10,_LINK(r11); \ 275 stw r10,_LINK(r11); \
@@ -355,11 +355,11 @@ i##n: \
355 * -- paulus. 355 * -- paulus.
356 */ 356 */
357 . = 0x200 357 . = 0x200
358 mtspr SPRN_SPRG0,r10 358 mtspr SPRN_SPRG_SCRATCH0,r10
359 mtspr SPRN_SPRG1,r11 359 mtspr SPRN_SPRG_SCRATCH1,r11
360 mfcr r10 360 mfcr r10
361#ifdef CONFIG_PPC_CHRP 361#ifdef CONFIG_PPC_CHRP
362 mfspr r11,SPRN_SPRG2 362 mfspr r11,SPRN_SPRG_RTAS
363 cmpwi 0,r11,0 363 cmpwi 0,r11,0
364 bne 7f 364 bne 7f
365#endif /* CONFIG_PPC_CHRP */ 365#endif /* CONFIG_PPC_CHRP */
@@ -367,7 +367,7 @@ i##n: \
3677: EXCEPTION_PROLOG_2 3677: EXCEPTION_PROLOG_2
368 addi r3,r1,STACK_FRAME_OVERHEAD 368 addi r3,r1,STACK_FRAME_OVERHEAD
369#ifdef CONFIG_PPC_CHRP 369#ifdef CONFIG_PPC_CHRP
370 mfspr r4,SPRN_SPRG2 370 mfspr r4,SPRN_SPRG_RTAS
371 cmpwi cr1,r4,0 371 cmpwi cr1,r4,0
372 bne cr1,1f 372 bne cr1,1f
373#endif 373#endif
@@ -485,7 +485,7 @@ InstructionTLBMiss:
485 mfspr r3,SPRN_IMISS 485 mfspr r3,SPRN_IMISS
486 lis r1,PAGE_OFFSET@h /* check if kernel address */ 486 lis r1,PAGE_OFFSET@h /* check if kernel address */
487 cmplw 0,r1,r3 487 cmplw 0,r1,r3
488 mfspr r2,SPRN_SPRG3 488 mfspr r2,SPRN_SPRG_THREAD
489 li r1,_PAGE_USER|_PAGE_PRESENT /* low addresses tested as user */ 489 li r1,_PAGE_USER|_PAGE_PRESENT /* low addresses tested as user */
490 lwz r2,PGDIR(r2) 490 lwz r2,PGDIR(r2)
491 bge- 112f 491 bge- 112f
@@ -559,7 +559,7 @@ DataLoadTLBMiss:
559 mfspr r3,SPRN_DMISS 559 mfspr r3,SPRN_DMISS
560 lis r1,PAGE_OFFSET@h /* check if kernel address */ 560 lis r1,PAGE_OFFSET@h /* check if kernel address */
561 cmplw 0,r1,r3 561 cmplw 0,r1,r3
562 mfspr r2,SPRN_SPRG3 562 mfspr r2,SPRN_SPRG_THREAD
563 li r1,_PAGE_USER|_PAGE_PRESENT /* low addresses tested as user */ 563 li r1,_PAGE_USER|_PAGE_PRESENT /* low addresses tested as user */
564 lwz r2,PGDIR(r2) 564 lwz r2,PGDIR(r2)
565 bge- 112f 565 bge- 112f
@@ -598,12 +598,12 @@ END_FTR_SECTION_IFCLR(CPU_FTR_NEED_COHERENT)
598 mtcrf 0x80,r2 598 mtcrf 0x80,r2
599BEGIN_MMU_FTR_SECTION 599BEGIN_MMU_FTR_SECTION
600 li r0,1 600 li r0,1
601 mfspr r1,SPRN_SPRG4 601 mfspr r1,SPRN_SPRG_603_LRU
602 rlwinm r2,r3,20,27,31 /* Get Address bits 15:19 */ 602 rlwinm r2,r3,20,27,31 /* Get Address bits 15:19 */
603 slw r0,r0,r2 603 slw r0,r0,r2
604 xor r1,r0,r1 604 xor r1,r0,r1
605 srw r0,r1,r2 605 srw r0,r1,r2
606 mtspr SPRN_SPRG4,r1 606 mtspr SPRN_SPRG_603_LRU,r1
607 mfspr r2,SPRN_SRR1 607 mfspr r2,SPRN_SRR1
608 rlwimi r2,r0,31-14,14,14 608 rlwimi r2,r0,31-14,14,14
609 mtspr SPRN_SRR1,r2 609 mtspr SPRN_SRR1,r2
@@ -643,7 +643,7 @@ DataStoreTLBMiss:
643 mfspr r3,SPRN_DMISS 643 mfspr r3,SPRN_DMISS
644 lis r1,PAGE_OFFSET@h /* check if kernel address */ 644 lis r1,PAGE_OFFSET@h /* check if kernel address */
645 cmplw 0,r1,r3 645 cmplw 0,r1,r3
646 mfspr r2,SPRN_SPRG3 646 mfspr r2,SPRN_SPRG_THREAD
647 li r1,_PAGE_RW|_PAGE_USER|_PAGE_PRESENT /* access flags */ 647 li r1,_PAGE_RW|_PAGE_USER|_PAGE_PRESENT /* access flags */
648 lwz r2,PGDIR(r2) 648 lwz r2,PGDIR(r2)
649 bge- 112f 649 bge- 112f
@@ -678,12 +678,12 @@ END_FTR_SECTION_IFCLR(CPU_FTR_NEED_COHERENT)
678 mtcrf 0x80,r2 678 mtcrf 0x80,r2
679BEGIN_MMU_FTR_SECTION 679BEGIN_MMU_FTR_SECTION
680 li r0,1 680 li r0,1
681 mfspr r1,SPRN_SPRG4 681 mfspr r1,SPRN_SPRG_603_LRU
682 rlwinm r2,r3,20,27,31 /* Get Address bits 15:19 */ 682 rlwinm r2,r3,20,27,31 /* Get Address bits 15:19 */
683 slw r0,r0,r2 683 slw r0,r0,r2
684 xor r1,r0,r1 684 xor r1,r0,r1
685 srw r0,r1,r2 685 srw r0,r1,r2
686 mtspr SPRN_SPRG4,r1 686 mtspr SPRN_SPRG_603_LRU,r1
687 mfspr r2,SPRN_SRR1 687 mfspr r2,SPRN_SRR1
688 rlwimi r2,r0,31-14,14,14 688 rlwimi r2,r0,31-14,14,14
689 mtspr SPRN_SRR1,r2 689 mtspr SPRN_SRR1,r2
@@ -864,9 +864,9 @@ __secondary_start:
864 tophys(r4,r2) 864 tophys(r4,r2)
865 addi r4,r4,THREAD /* phys address of our thread_struct */ 865 addi r4,r4,THREAD /* phys address of our thread_struct */
866 CLR_TOP32(r4) 866 CLR_TOP32(r4)
867 mtspr SPRN_SPRG3,r4 867 mtspr SPRN_SPRG_THREAD,r4
868 li r3,0 868 li r3,0
869 mtspr SPRN_SPRG2,r3 /* 0 => not in RTAS */ 869 mtspr SPRN_SPRG_RTAS,r3 /* 0 => not in RTAS */
870 870
871 /* enable MMU and jump to start_secondary */ 871 /* enable MMU and jump to start_secondary */
872 li r4,MSR_KERNEL 872 li r4,MSR_KERNEL
@@ -947,9 +947,9 @@ start_here:
947 tophys(r4,r2) 947 tophys(r4,r2)
948 addi r4,r4,THREAD /* init task's THREAD */ 948 addi r4,r4,THREAD /* init task's THREAD */
949 CLR_TOP32(r4) 949 CLR_TOP32(r4)
950 mtspr SPRN_SPRG3,r4 950 mtspr SPRN_SPRG_THREAD,r4
951 li r3,0 951 li r3,0
952 mtspr SPRN_SPRG2,r3 /* 0 => not in RTAS */ 952 mtspr SPRN_SPRG_RTAS,r3 /* 0 => not in RTAS */
953 953
954 /* stack */ 954 /* stack */
955 lis r1,init_thread_union@ha 955 lis r1,init_thread_union@ha
diff --git a/arch/powerpc/kernel/head_40x.S b/arch/powerpc/kernel/head_40x.S
index 0c96911d4299..a90625f9b485 100644
--- a/arch/powerpc/kernel/head_40x.S
+++ b/arch/powerpc/kernel/head_40x.S
@@ -103,21 +103,21 @@ _ENTRY(saved_ksp_limit)
103 103
104/* 104/*
105 * Exception vector entry code. This code runs with address translation 105 * Exception vector entry code. This code runs with address translation
106 * turned off (i.e. using physical addresses). We assume SPRG3 has the 106 * turned off (i.e. using physical addresses). We assume SPRG_THREAD has
107 * physical address of the current task thread_struct. 107 * the physical address of the current task thread_struct.
108 * Note that we have to have decremented r1 before we write to any fields 108 * Note that we have to have decremented r1 before we write to any fields
109 * of the exception frame, since a critical interrupt could occur at any 109 * of the exception frame, since a critical interrupt could occur at any
110 * time, and it will write to the area immediately below the current r1. 110 * time, and it will write to the area immediately below the current r1.
111 */ 111 */
112#define NORMAL_EXCEPTION_PROLOG \ 112#define NORMAL_EXCEPTION_PROLOG \
113 mtspr SPRN_SPRG0,r10; /* save two registers to work with */\ 113 mtspr SPRN_SPRG_SCRATCH0,r10; /* save two registers to work with */\
114 mtspr SPRN_SPRG1,r11; \ 114 mtspr SPRN_SPRG_SCRATCH1,r11; \
115 mtspr SPRN_SPRG2,r1; \ 115 mtspr SPRN_SPRG_SCRATCH2,r1; \
116 mfcr r10; /* save CR in r10 for now */\ 116 mfcr r10; /* save CR in r10 for now */\
117 mfspr r11,SPRN_SRR1; /* check whether user or kernel */\ 117 mfspr r11,SPRN_SRR1; /* check whether user or kernel */\
118 andi. r11,r11,MSR_PR; \ 118 andi. r11,r11,MSR_PR; \
119 beq 1f; \ 119 beq 1f; \
120 mfspr r1,SPRN_SPRG3; /* if from user, start at top of */\ 120 mfspr r1,SPRN_SPRG_THREAD; /* if from user, start at top of */\
121 lwz r1,THREAD_INFO-THREAD(r1); /* this thread's kernel stack */\ 121 lwz r1,THREAD_INFO-THREAD(r1); /* this thread's kernel stack */\
122 addi r1,r1,THREAD_SIZE; \ 122 addi r1,r1,THREAD_SIZE; \
1231: subi r1,r1,INT_FRAME_SIZE; /* Allocate an exception frame */\ 1231: subi r1,r1,INT_FRAME_SIZE; /* Allocate an exception frame */\
@@ -125,13 +125,13 @@ _ENTRY(saved_ksp_limit)
125 stw r10,_CCR(r11); /* save various registers */\ 125 stw r10,_CCR(r11); /* save various registers */\
126 stw r12,GPR12(r11); \ 126 stw r12,GPR12(r11); \
127 stw r9,GPR9(r11); \ 127 stw r9,GPR9(r11); \
128 mfspr r10,SPRN_SPRG0; \ 128 mfspr r10,SPRN_SPRG_SCRATCH0; \
129 stw r10,GPR10(r11); \ 129 stw r10,GPR10(r11); \
130 mfspr r12,SPRN_SPRG1; \ 130 mfspr r12,SPRN_SPRG_SCRATCH1; \
131 stw r12,GPR11(r11); \ 131 stw r12,GPR11(r11); \
132 mflr r10; \ 132 mflr r10; \
133 stw r10,_LINK(r11); \ 133 stw r10,_LINK(r11); \
134 mfspr r10,SPRN_SPRG2; \ 134 mfspr r10,SPRN_SPRG_SCRATCH2; \
135 mfspr r12,SPRN_SRR0; \ 135 mfspr r12,SPRN_SRR0; \
136 stw r10,GPR1(r11); \ 136 stw r10,GPR1(r11); \
137 mfspr r9,SPRN_SRR1; \ 137 mfspr r9,SPRN_SRR1; \
@@ -160,7 +160,7 @@ _ENTRY(saved_ksp_limit)
160 lwz r11,critirq_ctx@l(r11); \ 160 lwz r11,critirq_ctx@l(r11); \
161 beq 1f; \ 161 beq 1f; \
162 /* COMING FROM USER MODE */ \ 162 /* COMING FROM USER MODE */ \
163 mfspr r11,SPRN_SPRG3; /* if from user, start at top of */\ 163 mfspr r11,SPRN_SPRG_THREAD; /* if from user, start at top of */\
164 lwz r11,THREAD_INFO-THREAD(r11); /* this thread's kernel stack */\ 164 lwz r11,THREAD_INFO-THREAD(r11); /* this thread's kernel stack */\
1651: addi r11,r11,THREAD_SIZE-INT_FRAME_SIZE; /* Alloc an excpt frm */\ 1651: addi r11,r11,THREAD_SIZE-INT_FRAME_SIZE; /* Alloc an excpt frm */\
166 tophys(r11,r11); \ 166 tophys(r11,r11); \
@@ -265,8 +265,8 @@ label:
265 * and exit. Otherwise, we call heavywight functions to do the work. 265 * and exit. Otherwise, we call heavywight functions to do the work.
266 */ 266 */
267 START_EXCEPTION(0x0300, DataStorage) 267 START_EXCEPTION(0x0300, DataStorage)
268 mtspr SPRN_SPRG0, r10 /* Save some working registers */ 268 mtspr SPRN_SPRG_SCRATCH0, r10 /* Save some working registers */
269 mtspr SPRN_SPRG1, r11 269 mtspr SPRN_SPRG_SCRATCH1, r11
270#ifdef CONFIG_403GCX 270#ifdef CONFIG_403GCX
271 stw r12, 0(r0) 271 stw r12, 0(r0)
272 stw r9, 4(r0) 272 stw r9, 4(r0)
@@ -275,12 +275,12 @@ label:
275 stw r11, 8(r0) 275 stw r11, 8(r0)
276 stw r12, 12(r0) 276 stw r12, 12(r0)
277#else 277#else
278 mtspr SPRN_SPRG4, r12 278 mtspr SPRN_SPRG_SCRATCH3, r12
279 mtspr SPRN_SPRG5, r9 279 mtspr SPRN_SPRG_SCRATCH4, r9
280 mfcr r11 280 mfcr r11
281 mfspr r12, SPRN_PID 281 mfspr r12, SPRN_PID
282 mtspr SPRN_SPRG7, r11 282 mtspr SPRN_SPRG_SCRATCH6, r11
283 mtspr SPRN_SPRG6, r12 283 mtspr SPRN_SPRG_SCRATCH5, r12
284#endif 284#endif
285 285
286 /* First, check if it was a zone fault (which means a user 286 /* First, check if it was a zone fault (which means a user
@@ -308,7 +308,7 @@ label:
308 /* Get the PGD for the current thread. 308 /* Get the PGD for the current thread.
309 */ 309 */
3103: 3103:
311 mfspr r11,SPRN_SPRG3 311 mfspr r11,SPRN_SPRG_THREAD
312 lwz r11,PGDIR(r11) 312 lwz r11,PGDIR(r11)
3134: 3134:
314 tophys(r11, r11) 314 tophys(r11, r11)
@@ -355,15 +355,15 @@ label:
355 lwz r9, 4(r0) 355 lwz r9, 4(r0)
356 lwz r12, 0(r0) 356 lwz r12, 0(r0)
357#else 357#else
358 mfspr r12, SPRN_SPRG6 358 mfspr r12, SPRN_SPRG_SCRATCH5
359 mfspr r11, SPRN_SPRG7 359 mfspr r11, SPRN_SPRG_SCRATCH6
360 mtspr SPRN_PID, r12 360 mtspr SPRN_PID, r12
361 mtcr r11 361 mtcr r11
362 mfspr r9, SPRN_SPRG5 362 mfspr r9, SPRN_SPRG_SCRATCH4
363 mfspr r12, SPRN_SPRG4 363 mfspr r12, SPRN_SPRG_SCRATCH3
364#endif 364#endif
365 mfspr r11, SPRN_SPRG1 365 mfspr r11, SPRN_SPRG_SCRATCH1
366 mfspr r10, SPRN_SPRG0 366 mfspr r10, SPRN_SPRG_SCRATCH0
367 PPC405_ERR77_SYNC 367 PPC405_ERR77_SYNC
368 rfi /* Should sync shadow TLBs */ 368 rfi /* Should sync shadow TLBs */
369 b . /* prevent prefetch past rfi */ 369 b . /* prevent prefetch past rfi */
@@ -380,15 +380,15 @@ label:
380 lwz r9, 4(r0) 380 lwz r9, 4(r0)
381 lwz r12, 0(r0) 381 lwz r12, 0(r0)
382#else 382#else
383 mfspr r12, SPRN_SPRG6 383 mfspr r12, SPRN_SPRG_SCRATCH5
384 mfspr r11, SPRN_SPRG7 384 mfspr r11, SPRN_SPRG_SCRATCH6
385 mtspr SPRN_PID, r12 385 mtspr SPRN_PID, r12
386 mtcr r11 386 mtcr r11
387 mfspr r9, SPRN_SPRG5 387 mfspr r9, SPRN_SPRG_SCRATCH4
388 mfspr r12, SPRN_SPRG4 388 mfspr r12, SPRN_SPRG_SCRATCH3
389#endif 389#endif
390 mfspr r11, SPRN_SPRG1 390 mfspr r11, SPRN_SPRG_SCRATCH1
391 mfspr r10, SPRN_SPRG0 391 mfspr r10, SPRN_SPRG_SCRATCH0
392 b DataAccess 392 b DataAccess
393 393
394/* 394/*
@@ -466,8 +466,8 @@ label:
466 * load TLB entries from the page table if they exist. 466 * load TLB entries from the page table if they exist.
467 */ 467 */
468 START_EXCEPTION(0x1100, DTLBMiss) 468 START_EXCEPTION(0x1100, DTLBMiss)
469 mtspr SPRN_SPRG0, r10 /* Save some working registers */ 469 mtspr SPRN_SPRG_SCRATCH0, r10 /* Save some working registers */
470 mtspr SPRN_SPRG1, r11 470 mtspr SPRN_SPRG_SCRATCH1, r11
471#ifdef CONFIG_403GCX 471#ifdef CONFIG_403GCX
472 stw r12, 0(r0) 472 stw r12, 0(r0)
473 stw r9, 4(r0) 473 stw r9, 4(r0)
@@ -476,12 +476,12 @@ label:
476 stw r11, 8(r0) 476 stw r11, 8(r0)
477 stw r12, 12(r0) 477 stw r12, 12(r0)
478#else 478#else
479 mtspr SPRN_SPRG4, r12 479 mtspr SPRN_SPRG_SCRATCH3, r12
480 mtspr SPRN_SPRG5, r9 480 mtspr SPRN_SPRG_SCRATCH4, r9
481 mfcr r11 481 mfcr r11
482 mfspr r12, SPRN_PID 482 mfspr r12, SPRN_PID
483 mtspr SPRN_SPRG7, r11 483 mtspr SPRN_SPRG_SCRATCH6, r11
484 mtspr SPRN_SPRG6, r12 484 mtspr SPRN_SPRG_SCRATCH5, r12
485#endif 485#endif
486 mfspr r10, SPRN_DEAR /* Get faulting address */ 486 mfspr r10, SPRN_DEAR /* Get faulting address */
487 487
@@ -500,7 +500,7 @@ label:
500 /* Get the PGD for the current thread. 500 /* Get the PGD for the current thread.
501 */ 501 */
5023: 5023:
503 mfspr r11,SPRN_SPRG3 503 mfspr r11,SPRN_SPRG_THREAD
504 lwz r11,PGDIR(r11) 504 lwz r11,PGDIR(r11)
5054: 5054:
506 tophys(r11, r11) 506 tophys(r11, r11)
@@ -550,15 +550,15 @@ label:
550 lwz r9, 4(r0) 550 lwz r9, 4(r0)
551 lwz r12, 0(r0) 551 lwz r12, 0(r0)
552#else 552#else
553 mfspr r12, SPRN_SPRG6 553 mfspr r12, SPRN_SPRG_SCRATCH5
554 mfspr r11, SPRN_SPRG7 554 mfspr r11, SPRN_SPRG_SCRATCH6
555 mtspr SPRN_PID, r12 555 mtspr SPRN_PID, r12
556 mtcr r11 556 mtcr r11
557 mfspr r9, SPRN_SPRG5 557 mfspr r9, SPRN_SPRG_SCRATCH4
558 mfspr r12, SPRN_SPRG4 558 mfspr r12, SPRN_SPRG_SCRATCH3
559#endif 559#endif
560 mfspr r11, SPRN_SPRG1 560 mfspr r11, SPRN_SPRG_SCRATCH1
561 mfspr r10, SPRN_SPRG0 561 mfspr r10, SPRN_SPRG_SCRATCH0
562 b DataAccess 562 b DataAccess
563 563
564/* 0x1200 - Instruction TLB Miss Exception 564/* 0x1200 - Instruction TLB Miss Exception
@@ -566,8 +566,8 @@ label:
566 * registers and bailout to a different point. 566 * registers and bailout to a different point.
567 */ 567 */
568 START_EXCEPTION(0x1200, ITLBMiss) 568 START_EXCEPTION(0x1200, ITLBMiss)
569 mtspr SPRN_SPRG0, r10 /* Save some working registers */ 569 mtspr SPRN_SPRG_SCRATCH0, r10 /* Save some working registers */
570 mtspr SPRN_SPRG1, r11 570 mtspr SPRN_SPRG_SCRATCH1, r11
571#ifdef CONFIG_403GCX 571#ifdef CONFIG_403GCX
572 stw r12, 0(r0) 572 stw r12, 0(r0)
573 stw r9, 4(r0) 573 stw r9, 4(r0)
@@ -576,12 +576,12 @@ label:
576 stw r11, 8(r0) 576 stw r11, 8(r0)
577 stw r12, 12(r0) 577 stw r12, 12(r0)
578#else 578#else
579 mtspr SPRN_SPRG4, r12 579 mtspr SPRN_SPRG_SCRATCH3, r12
580 mtspr SPRN_SPRG5, r9 580 mtspr SPRN_SPRG_SCRATCH4, r9
581 mfcr r11 581 mfcr r11
582 mfspr r12, SPRN_PID 582 mfspr r12, SPRN_PID
583 mtspr SPRN_SPRG7, r11 583 mtspr SPRN_SPRG_SCRATCH6, r11
584 mtspr SPRN_SPRG6, r12 584 mtspr SPRN_SPRG_SCRATCH5, r12
585#endif 585#endif
586 mfspr r10, SPRN_SRR0 /* Get faulting address */ 586 mfspr r10, SPRN_SRR0 /* Get faulting address */
587 587
@@ -600,7 +600,7 @@ label:
600 /* Get the PGD for the current thread. 600 /* Get the PGD for the current thread.
601 */ 601 */
6023: 6023:
603 mfspr r11,SPRN_SPRG3 603 mfspr r11,SPRN_SPRG_THREAD
604 lwz r11,PGDIR(r11) 604 lwz r11,PGDIR(r11)
6054: 6054:
606 tophys(r11, r11) 606 tophys(r11, r11)
@@ -650,15 +650,15 @@ label:
650 lwz r9, 4(r0) 650 lwz r9, 4(r0)
651 lwz r12, 0(r0) 651 lwz r12, 0(r0)
652#else 652#else
653 mfspr r12, SPRN_SPRG6 653 mfspr r12, SPRN_SPRG_SCRATCH5
654 mfspr r11, SPRN_SPRG7 654 mfspr r11, SPRN_SPRG_SCRATCH6
655 mtspr SPRN_PID, r12 655 mtspr SPRN_PID, r12
656 mtcr r11 656 mtcr r11
657 mfspr r9, SPRN_SPRG5 657 mfspr r9, SPRN_SPRG_SCRATCH4
658 mfspr r12, SPRN_SPRG4 658 mfspr r12, SPRN_SPRG_SCRATCH3
659#endif 659#endif
660 mfspr r11, SPRN_SPRG1 660 mfspr r11, SPRN_SPRG_SCRATCH1
661 mfspr r10, SPRN_SPRG0 661 mfspr r10, SPRN_SPRG_SCRATCH0
662 b InstructionAccess 662 b InstructionAccess
663 663
664 EXCEPTION(0x1300, Trap_13, unknown_exception, EXC_XFER_EE) 664 EXCEPTION(0x1300, Trap_13, unknown_exception, EXC_XFER_EE)
@@ -803,15 +803,15 @@ finish_tlb_load:
803 lwz r9, 4(r0) 803 lwz r9, 4(r0)
804 lwz r12, 0(r0) 804 lwz r12, 0(r0)
805#else 805#else
806 mfspr r12, SPRN_SPRG6 806 mfspr r12, SPRN_SPRG_SCRATCH5
807 mfspr r11, SPRN_SPRG7 807 mfspr r11, SPRN_SPRG_SCRATCH6
808 mtspr SPRN_PID, r12 808 mtspr SPRN_PID, r12
809 mtcr r11 809 mtcr r11
810 mfspr r9, SPRN_SPRG5 810 mfspr r9, SPRN_SPRG_SCRATCH4
811 mfspr r12, SPRN_SPRG4 811 mfspr r12, SPRN_SPRG_SCRATCH3
812#endif 812#endif
813 mfspr r11, SPRN_SPRG1 813 mfspr r11, SPRN_SPRG_SCRATCH1
814 mfspr r10, SPRN_SPRG0 814 mfspr r10, SPRN_SPRG_SCRATCH0
815 PPC405_ERR77_SYNC 815 PPC405_ERR77_SYNC
816 rfi /* Should sync shadow TLBs */ 816 rfi /* Should sync shadow TLBs */
817 b . /* prevent prefetch past rfi */ 817 b . /* prevent prefetch past rfi */
@@ -835,7 +835,7 @@ start_here:
835 /* ptr to phys current thread */ 835 /* ptr to phys current thread */
836 tophys(r4,r2) 836 tophys(r4,r2)
837 addi r4,r4,THREAD /* init task's THREAD */ 837 addi r4,r4,THREAD /* init task's THREAD */
838 mtspr SPRN_SPRG3,r4 838 mtspr SPRN_SPRG_THREAD,r4
839 839
840 /* stack */ 840 /* stack */
841 lis r1,init_thread_union@ha 841 lis r1,init_thread_union@ha
diff --git a/arch/powerpc/kernel/head_44x.S b/arch/powerpc/kernel/head_44x.S
index 18d8a1677c4d..711368b993f2 100644
--- a/arch/powerpc/kernel/head_44x.S
+++ b/arch/powerpc/kernel/head_44x.S
@@ -239,7 +239,7 @@ skpinv: addi r4,r4,1 /* Increment */
239 239
240 /* ptr to current thread */ 240 /* ptr to current thread */
241 addi r4,r2,THREAD /* init task's THREAD */ 241 addi r4,r2,THREAD /* init task's THREAD */
242 mtspr SPRN_SPRG3,r4 242 mtspr SPRN_SPRG_THREAD,r4
243 243
244 /* stack */ 244 /* stack */
245 lis r1,init_thread_union@h 245 lis r1,init_thread_union@h
@@ -350,12 +350,12 @@ interrupt_base:
350 350
351 /* Data TLB Error Interrupt */ 351 /* Data TLB Error Interrupt */
352 START_EXCEPTION(DataTLBError) 352 START_EXCEPTION(DataTLBError)
353 mtspr SPRN_SPRG0, r10 /* Save some working registers */ 353 mtspr SPRN_SPRG_WSCRATCH0, r10 /* Save some working registers */
354 mtspr SPRN_SPRG1, r11 354 mtspr SPRN_SPRG_WSCRATCH1, r11
355 mtspr SPRN_SPRG4W, r12 355 mtspr SPRN_SPRG_WSCRATCH2, r12
356 mtspr SPRN_SPRG5W, r13 356 mtspr SPRN_SPRG_WSCRATCH3, r13
357 mfcr r11 357 mfcr r11
358 mtspr SPRN_SPRG7W, r11 358 mtspr SPRN_SPRG_WSCRATCH4, r11
359 mfspr r10, SPRN_DEAR /* Get faulting address */ 359 mfspr r10, SPRN_DEAR /* Get faulting address */
360 360
361 /* If we are faulting a kernel address, we have to use the 361 /* If we are faulting a kernel address, we have to use the
@@ -374,7 +374,7 @@ interrupt_base:
374 374
375 /* Get the PGD for the current thread */ 375 /* Get the PGD for the current thread */
3763: 3763:
377 mfspr r11,SPRN_SPRG3 377 mfspr r11,SPRN_SPRG_THREAD
378 lwz r11,PGDIR(r11) 378 lwz r11,PGDIR(r11)
379 379
380 /* Load PID into MMUCR TID */ 380 /* Load PID into MMUCR TID */
@@ -446,12 +446,12 @@ tlb_44x_patch_hwater_D:
446 /* The bailout. Restore registers to pre-exception conditions 446 /* The bailout. Restore registers to pre-exception conditions
447 * and call the heavyweights to help us out. 447 * and call the heavyweights to help us out.
448 */ 448 */
449 mfspr r11, SPRN_SPRG7R 449 mfspr r11, SPRN_SPRG_RSCRATCH4
450 mtcr r11 450 mtcr r11
451 mfspr r13, SPRN_SPRG5R 451 mfspr r13, SPRN_SPRG_RSCRATCH3
452 mfspr r12, SPRN_SPRG4R 452 mfspr r12, SPRN_SPRG_RSCRATCH2
453 mfspr r11, SPRN_SPRG1 453 mfspr r11, SPRN_SPRG_RSCRATCH1
454 mfspr r10, SPRN_SPRG0 454 mfspr r10, SPRN_SPRG_RSCRATCH0
455 b DataStorage 455 b DataStorage
456 456
457 /* Instruction TLB Error Interrupt */ 457 /* Instruction TLB Error Interrupt */
@@ -461,12 +461,12 @@ tlb_44x_patch_hwater_D:
461 * to a different point. 461 * to a different point.
462 */ 462 */
463 START_EXCEPTION(InstructionTLBError) 463 START_EXCEPTION(InstructionTLBError)
464 mtspr SPRN_SPRG0, r10 /* Save some working registers */ 464 mtspr SPRN_SPRG_WSCRATCH0, r10 /* Save some working registers */
465 mtspr SPRN_SPRG1, r11 465 mtspr SPRN_SPRG_WSCRATCH1, r11
466 mtspr SPRN_SPRG4W, r12 466 mtspr SPRN_SPRG_WSCRATCH2, r12
467 mtspr SPRN_SPRG5W, r13 467 mtspr SPRN_SPRG_WSCRATCH3, r13
468 mfcr r11 468 mfcr r11
469 mtspr SPRN_SPRG7W, r11 469 mtspr SPRN_SPRG_WSCRATCH4, r11
470 mfspr r10, SPRN_SRR0 /* Get faulting address */ 470 mfspr r10, SPRN_SRR0 /* Get faulting address */
471 471
472 /* If we are faulting a kernel address, we have to use the 472 /* If we are faulting a kernel address, we have to use the
@@ -485,7 +485,7 @@ tlb_44x_patch_hwater_D:
485 485
486 /* Get the PGD for the current thread */ 486 /* Get the PGD for the current thread */
4873: 4873:
488 mfspr r11,SPRN_SPRG3 488 mfspr r11,SPRN_SPRG_THREAD
489 lwz r11,PGDIR(r11) 489 lwz r11,PGDIR(r11)
490 490
491 /* Load PID into MMUCR TID */ 491 /* Load PID into MMUCR TID */
@@ -497,7 +497,7 @@ tlb_44x_patch_hwater_D:
497 mtspr SPRN_MMUCR,r12 497 mtspr SPRN_MMUCR,r12
498 498
499 /* Make up the required permissions */ 499 /* Make up the required permissions */
500 li r13,_PAGE_PRESENT | _PAGE_ACCESSED | _PAGE_HWEXEC 500 li r13,_PAGE_PRESENT | _PAGE_ACCESSED | _PAGE_EXEC
501 501
502 /* Compute pgdir/pmd offset */ 502 /* Compute pgdir/pmd offset */
503 rlwinm r12, r10, PPC44x_PGD_OFF_SHIFT, PPC44x_PGD_OFF_MASK_BIT, 29 503 rlwinm r12, r10, PPC44x_PGD_OFF_SHIFT, PPC44x_PGD_OFF_MASK_BIT, 29
@@ -542,12 +542,12 @@ tlb_44x_patch_hwater_I:
542 /* The bailout. Restore registers to pre-exception conditions 542 /* The bailout. Restore registers to pre-exception conditions
543 * and call the heavyweights to help us out. 543 * and call the heavyweights to help us out.
544 */ 544 */
545 mfspr r11, SPRN_SPRG7R 545 mfspr r11, SPRN_SPRG_RSCRATCH4
546 mtcr r11 546 mtcr r11
547 mfspr r13, SPRN_SPRG5R 547 mfspr r13, SPRN_SPRG_RSCRATCH3
548 mfspr r12, SPRN_SPRG4R 548 mfspr r12, SPRN_SPRG_RSCRATCH2
549 mfspr r11, SPRN_SPRG1 549 mfspr r11, SPRN_SPRG_RSCRATCH1
550 mfspr r10, SPRN_SPRG0 550 mfspr r10, SPRN_SPRG_RSCRATCH0
551 b InstructionStorage 551 b InstructionStorage
552 552
553 /* Debug Interrupt */ 553 /* Debug Interrupt */
@@ -593,12 +593,12 @@ finish_tlb_load:
593 593
594 /* Done...restore registers and get out of here. 594 /* Done...restore registers and get out of here.
595 */ 595 */
596 mfspr r11, SPRN_SPRG7R 596 mfspr r11, SPRN_SPRG_RSCRATCH4
597 mtcr r11 597 mtcr r11
598 mfspr r13, SPRN_SPRG5R 598 mfspr r13, SPRN_SPRG_RSCRATCH3
599 mfspr r12, SPRN_SPRG4R 599 mfspr r12, SPRN_SPRG_RSCRATCH2
600 mfspr r11, SPRN_SPRG1 600 mfspr r11, SPRN_SPRG_RSCRATCH1
601 mfspr r10, SPRN_SPRG0 601 mfspr r10, SPRN_SPRG_RSCRATCH0
602 rfi /* Force context change */ 602 rfi /* Force context change */
603 603
604/* 604/*
diff --git a/arch/powerpc/kernel/head_64.S b/arch/powerpc/kernel/head_64.S
index 012505ebd9f9..c38afdb45d7b 100644
--- a/arch/powerpc/kernel/head_64.S
+++ b/arch/powerpc/kernel/head_64.S
@@ -36,7 +36,6 @@
36#include <asm/thread_info.h> 36#include <asm/thread_info.h>
37#include <asm/firmware.h> 37#include <asm/firmware.h>
38#include <asm/page_64.h> 38#include <asm/page_64.h>
39#include <asm/exception.h>
40#include <asm/irqflags.h> 39#include <asm/irqflags.h>
41 40
42/* The physical memory is layed out such that the secondary processor 41/* The physical memory is layed out such that the secondary processor
@@ -122,10 +121,11 @@ __run_at_load:
122 */ 121 */
123 .globl __secondary_hold 122 .globl __secondary_hold
124__secondary_hold: 123__secondary_hold:
124#ifndef CONFIG_PPC_BOOK3E
125 mfmsr r24 125 mfmsr r24
126 ori r24,r24,MSR_RI 126 ori r24,r24,MSR_RI
127 mtmsrd r24 /* RI on */ 127 mtmsrd r24 /* RI on */
128 128#endif
129 /* Grab our physical cpu number */ 129 /* Grab our physical cpu number */
130 mr r24,r3 130 mr r24,r3
131 131
@@ -144,6 +144,7 @@ __secondary_hold:
144 ld r4,0(r4) /* deref function descriptor */ 144 ld r4,0(r4) /* deref function descriptor */
145 mtctr r4 145 mtctr r4
146 mr r3,r24 146 mr r3,r24
147 li r4,0
147 bctr 148 bctr
148#else 149#else
149 BUG_OPCODE 150 BUG_OPCODE
@@ -164,21 +165,49 @@ exception_marker:
164#include "exceptions-64s.S" 165#include "exceptions-64s.S"
165#endif 166#endif
166 167
168_GLOBAL(generic_secondary_thread_init)
169 mr r24,r3
170
171 /* turn on 64-bit mode */
172 bl .enable_64b_mode
173
174 /* get a valid TOC pointer, wherever we're mapped at */
175 bl .relative_toc
176
177#ifdef CONFIG_PPC_BOOK3E
178 /* Book3E initialization */
179 mr r3,r24
180 bl .book3e_secondary_thread_init
181#endif
182 b generic_secondary_common_init
167 183
168/* 184/*
169 * On pSeries and most other platforms, secondary processors spin 185 * On pSeries and most other platforms, secondary processors spin
170 * in the following code. 186 * in the following code.
171 * At entry, r3 = this processor's number (physical cpu id) 187 * At entry, r3 = this processor's number (physical cpu id)
188 *
189 * On Book3E, r4 = 1 to indicate that the initial TLB entry for
190 * this core already exists (setup via some other mechanism such
191 * as SCOM before entry).
172 */ 192 */
173_GLOBAL(generic_secondary_smp_init) 193_GLOBAL(generic_secondary_smp_init)
174 mr r24,r3 194 mr r24,r3
175 195 mr r25,r4
196
176 /* turn on 64-bit mode */ 197 /* turn on 64-bit mode */
177 bl .enable_64b_mode 198 bl .enable_64b_mode
178 199
179 /* get the TOC pointer (real address) */ 200 /* get a valid TOC pointer, wherever we're mapped at */
180 bl .relative_toc 201 bl .relative_toc
181 202
203#ifdef CONFIG_PPC_BOOK3E
204 /* Book3E initialization */
205 mr r3,r24
206 mr r4,r25
207 bl .book3e_secondary_core_init
208#endif
209
210generic_secondary_common_init:
182 /* Set up a paca value for this processor. Since we have the 211 /* Set up a paca value for this processor. Since we have the
183 * physical cpu id in r24, we need to search the pacas to find 212 * physical cpu id in r24, we need to search the pacas to find
184 * which logical id maps to our physical one. 213 * which logical id maps to our physical one.
@@ -196,7 +225,12 @@ _GLOBAL(generic_secondary_smp_init)
196 mr r3,r24 /* not found, copy phys to r3 */ 225 mr r3,r24 /* not found, copy phys to r3 */
197 b .kexec_wait /* next kernel might do better */ 226 b .kexec_wait /* next kernel might do better */
198 227
1992: mtspr SPRN_SPRG3,r13 /* Save vaddr of paca in SPRG3 */ 2282: mtspr SPRN_SPRG_PACA,r13 /* Save vaddr of paca in an SPRG */
229#ifdef CONFIG_PPC_BOOK3E
230 addi r12,r13,PACA_EXTLB /* and TLB exc frame in another */
231 mtspr SPRN_SPRG_TLB_EXFRAME,r12
232#endif
233
200 /* From now on, r24 is expected to be logical cpuid */ 234 /* From now on, r24 is expected to be logical cpuid */
201 mr r24,r5 235 mr r24,r5
2023: HMT_LOW 2363: HMT_LOW
@@ -232,6 +266,7 @@ _GLOBAL(generic_secondary_smp_init)
232 * Turn the MMU off. 266 * Turn the MMU off.
233 * Assumes we're mapped EA == RA if the MMU is on. 267 * Assumes we're mapped EA == RA if the MMU is on.
234 */ 268 */
269#ifdef CONFIG_PPC_BOOK3S
235_STATIC(__mmu_off) 270_STATIC(__mmu_off)
236 mfmsr r3 271 mfmsr r3
237 andi. r0,r3,MSR_IR|MSR_DR 272 andi. r0,r3,MSR_IR|MSR_DR
@@ -243,6 +278,7 @@ _STATIC(__mmu_off)
243 sync 278 sync
244 rfid 279 rfid
245 b . /* prevent speculative execution */ 280 b . /* prevent speculative execution */
281#endif
246 282
247 283
248/* 284/*
@@ -280,6 +316,10 @@ _GLOBAL(__start_initialization_multiplatform)
280 mr r31,r3 316 mr r31,r3
281 mr r30,r4 317 mr r30,r4
282 318
319#ifdef CONFIG_PPC_BOOK3E
320 bl .start_initialization_book3e
321 b .__after_prom_start
322#else
283 /* Setup some critical 970 SPRs before switching MMU off */ 323 /* Setup some critical 970 SPRs before switching MMU off */
284 mfspr r0,SPRN_PVR 324 mfspr r0,SPRN_PVR
285 srwi r0,r0,16 325 srwi r0,r0,16
@@ -297,6 +337,7 @@ _GLOBAL(__start_initialization_multiplatform)
297 /* Switch off MMU if not already off */ 337 /* Switch off MMU if not already off */
298 bl .__mmu_off 338 bl .__mmu_off
299 b .__after_prom_start 339 b .__after_prom_start
340#endif /* CONFIG_PPC_BOOK3E */
300 341
301_INIT_STATIC(__boot_from_prom) 342_INIT_STATIC(__boot_from_prom)
302#ifdef CONFIG_PPC_OF_BOOT_TRAMPOLINE 343#ifdef CONFIG_PPC_OF_BOOT_TRAMPOLINE
@@ -359,10 +400,16 @@ _STATIC(__after_prom_start)
359 * Note: This process overwrites the OF exception vectors. 400 * Note: This process overwrites the OF exception vectors.
360 */ 401 */
361 li r3,0 /* target addr */ 402 li r3,0 /* target addr */
403#ifdef CONFIG_PPC_BOOK3E
404 tovirt(r3,r3) /* on booke, we already run at PAGE_OFFSET */
405#endif
362 mr. r4,r26 /* In some cases the loader may */ 406 mr. r4,r26 /* In some cases the loader may */
363 beq 9f /* have already put us at zero */ 407 beq 9f /* have already put us at zero */
364 li r6,0x100 /* Start offset, the first 0x100 */ 408 li r6,0x100 /* Start offset, the first 0x100 */
365 /* bytes were copied earlier. */ 409 /* bytes were copied earlier. */
410#ifdef CONFIG_PPC_BOOK3E
411 tovirt(r6,r6) /* on booke, we already run at PAGE_OFFSET */
412#endif
366 413
367#ifdef CONFIG_CRASH_DUMP 414#ifdef CONFIG_CRASH_DUMP
368/* 415/*
@@ -485,7 +532,7 @@ _GLOBAL(pmac_secondary_start)
485 LOAD_REG_ADDR(r4,paca) /* Get base vaddr of paca array */ 532 LOAD_REG_ADDR(r4,paca) /* Get base vaddr of paca array */
486 mulli r13,r24,PACA_SIZE /* Calculate vaddr of right paca */ 533 mulli r13,r24,PACA_SIZE /* Calculate vaddr of right paca */
487 add r13,r13,r4 /* for this processor. */ 534 add r13,r13,r4 /* for this processor. */
488 mtspr SPRN_SPRG3,r13 /* Save vaddr of paca in SPRG3 */ 535 mtspr SPRN_SPRG_PACA,r13 /* Save vaddr of paca in an SPRG*/
489 536
490 /* Create a temp kernel stack for use before relocation is on. */ 537 /* Create a temp kernel stack for use before relocation is on. */
491 ld r1,PACAEMERGSP(r13) 538 ld r1,PACAEMERGSP(r13)
@@ -503,11 +550,14 @@ _GLOBAL(pmac_secondary_start)
503 * 1. Processor number 550 * 1. Processor number
504 * 2. Segment table pointer (virtual address) 551 * 2. Segment table pointer (virtual address)
505 * On entry the following are set: 552 * On entry the following are set:
506 * r1 = stack pointer. vaddr for iSeries, raddr (temp stack) for pSeries 553 * r1 = stack pointer. vaddr for iSeries, raddr (temp stack) for pSeries
507 * r24 = cpu# (in Linux terms) 554 * r24 = cpu# (in Linux terms)
508 * r13 = paca virtual address 555 * r13 = paca virtual address
509 * SPRG3 = paca virtual address 556 * SPRG_PACA = paca virtual address
510 */ 557 */
558 .section ".text";
559 .align 2 ;
560
511 .globl __secondary_start 561 .globl __secondary_start
512__secondary_start: 562__secondary_start:
513 /* Set thread priority to MEDIUM */ 563 /* Set thread priority to MEDIUM */
@@ -544,7 +594,7 @@ END_FW_FTR_SECTION_IFCLR(FW_FEATURE_ISERIES)
544 594
545 mtspr SPRN_SRR0,r3 595 mtspr SPRN_SRR0,r3
546 mtspr SPRN_SRR1,r4 596 mtspr SPRN_SRR1,r4
547 rfid 597 RFI
548 b . /* prevent speculative execution */ 598 b . /* prevent speculative execution */
549 599
550/* 600/*
@@ -565,11 +615,16 @@ _GLOBAL(start_secondary_prolog)
565 */ 615 */
566_GLOBAL(enable_64b_mode) 616_GLOBAL(enable_64b_mode)
567 mfmsr r11 /* grab the current MSR */ 617 mfmsr r11 /* grab the current MSR */
618#ifdef CONFIG_PPC_BOOK3E
619 oris r11,r11,0x8000 /* CM bit set, we'll set ICM later */
620 mtmsr r11
621#else /* CONFIG_PPC_BOOK3E */
568 li r12,(MSR_SF | MSR_ISF)@highest 622 li r12,(MSR_SF | MSR_ISF)@highest
569 sldi r12,r12,48 623 sldi r12,r12,48
570 or r11,r11,r12 624 or r11,r11,r12
571 mtmsrd r11 625 mtmsrd r11
572 isync 626 isync
627#endif
573 blr 628 blr
574 629
575/* 630/*
@@ -613,9 +668,11 @@ _INIT_STATIC(start_here_multiplatform)
613 bdnz 3b 668 bdnz 3b
6144: 6694:
615 670
671#ifndef CONFIG_PPC_BOOK3E
616 mfmsr r6 672 mfmsr r6
617 ori r6,r6,MSR_RI 673 ori r6,r6,MSR_RI
618 mtmsrd r6 /* RI on */ 674 mtmsrd r6 /* RI on */
675#endif
619 676
620#ifdef CONFIG_RELOCATABLE 677#ifdef CONFIG_RELOCATABLE
621 /* Save the physical address we're running at in kernstart_addr */ 678 /* Save the physical address we're running at in kernstart_addr */
@@ -642,13 +699,13 @@ _INIT_STATIC(start_here_multiplatform)
642 699
643 /* Restore parameters passed from prom_init/kexec */ 700 /* Restore parameters passed from prom_init/kexec */
644 mr r3,r31 701 mr r3,r31
645 bl .early_setup /* also sets r13 and SPRG3 */ 702 bl .early_setup /* also sets r13 and SPRG_PACA */
646 703
647 LOAD_REG_ADDR(r3, .start_here_common) 704 LOAD_REG_ADDR(r3, .start_here_common)
648 ld r4,PACAKMSR(r13) 705 ld r4,PACAKMSR(r13)
649 mtspr SPRN_SRR0,r3 706 mtspr SPRN_SRR0,r3
650 mtspr SPRN_SRR1,r4 707 mtspr SPRN_SRR1,r4
651 rfid 708 RFI
652 b . /* prevent speculative execution */ 709 b . /* prevent speculative execution */
653 710
654 /* This is where all platforms converge execution */ 711 /* This is where all platforms converge execution */
diff --git a/arch/powerpc/kernel/head_8xx.S b/arch/powerpc/kernel/head_8xx.S
index 52ff8c53b93c..6ded19d01891 100644
--- a/arch/powerpc/kernel/head_8xx.S
+++ b/arch/powerpc/kernel/head_8xx.S
@@ -110,8 +110,8 @@ turn_on_mmu:
110 * task's thread_struct. 110 * task's thread_struct.
111 */ 111 */
112#define EXCEPTION_PROLOG \ 112#define EXCEPTION_PROLOG \
113 mtspr SPRN_SPRG0,r10; \ 113 mtspr SPRN_SPRG_SCRATCH0,r10; \
114 mtspr SPRN_SPRG1,r11; \ 114 mtspr SPRN_SPRG_SCRATCH1,r11; \
115 mfcr r10; \ 115 mfcr r10; \
116 EXCEPTION_PROLOG_1; \ 116 EXCEPTION_PROLOG_1; \
117 EXCEPTION_PROLOG_2 117 EXCEPTION_PROLOG_2
@@ -121,7 +121,7 @@ turn_on_mmu:
121 andi. r11,r11,MSR_PR; \ 121 andi. r11,r11,MSR_PR; \
122 tophys(r11,r1); /* use tophys(r1) if kernel */ \ 122 tophys(r11,r1); /* use tophys(r1) if kernel */ \
123 beq 1f; \ 123 beq 1f; \
124 mfspr r11,SPRN_SPRG3; \ 124 mfspr r11,SPRN_SPRG_THREAD; \
125 lwz r11,THREAD_INFO-THREAD(r11); \ 125 lwz r11,THREAD_INFO-THREAD(r11); \
126 addi r11,r11,THREAD_SIZE; \ 126 addi r11,r11,THREAD_SIZE; \
127 tophys(r11,r11); \ 127 tophys(r11,r11); \
@@ -133,9 +133,9 @@ turn_on_mmu:
133 stw r10,_CCR(r11); /* save registers */ \ 133 stw r10,_CCR(r11); /* save registers */ \
134 stw r12,GPR12(r11); \ 134 stw r12,GPR12(r11); \
135 stw r9,GPR9(r11); \ 135 stw r9,GPR9(r11); \
136 mfspr r10,SPRN_SPRG0; \ 136 mfspr r10,SPRN_SPRG_SCRATCH0; \
137 stw r10,GPR10(r11); \ 137 stw r10,GPR10(r11); \
138 mfspr r12,SPRN_SPRG1; \ 138 mfspr r12,SPRN_SPRG_SCRATCH1; \
139 stw r12,GPR11(r11); \ 139 stw r12,GPR11(r11); \
140 mflr r10; \ 140 mflr r10; \
141 stw r10,_LINK(r11); \ 141 stw r10,_LINK(r11); \
@@ -603,8 +603,9 @@ start_here:
603 /* ptr to phys current thread */ 603 /* ptr to phys current thread */
604 tophys(r4,r2) 604 tophys(r4,r2)
605 addi r4,r4,THREAD /* init task's THREAD */ 605 addi r4,r4,THREAD /* init task's THREAD */
606 mtspr SPRN_SPRG3,r4 606 mtspr SPRN_SPRG_THREAD,r4
607 li r3,0 607 li r3,0
608 /* XXX What is that for ? SPRG2 appears otherwise unused on 8xx */
608 mtspr SPRN_SPRG2,r3 /* 0 => r1 has kernel sp */ 609 mtspr SPRN_SPRG2,r3 /* 0 => r1 has kernel sp */
609 610
610 /* stack */ 611 /* stack */
diff --git a/arch/powerpc/kernel/head_booke.h b/arch/powerpc/kernel/head_booke.h
index 5f9febc8d143..50504ae39cb7 100644
--- a/arch/powerpc/kernel/head_booke.h
+++ b/arch/powerpc/kernel/head_booke.h
@@ -20,14 +20,14 @@
20#endif 20#endif
21 21
22#define NORMAL_EXCEPTION_PROLOG \ 22#define NORMAL_EXCEPTION_PROLOG \
23 mtspr SPRN_SPRG0,r10; /* save two registers to work with */\ 23 mtspr SPRN_SPRG_WSCRATCH0,r10;/* save two registers to work with */\
24 mtspr SPRN_SPRG1,r11; \ 24 mtspr SPRN_SPRG_WSCRATCH1,r11; \
25 mtspr SPRN_SPRG4W,r1; \ 25 mtspr SPRN_SPRG_WSCRATCH2,r1; \
26 mfcr r10; /* save CR in r10 for now */\ 26 mfcr r10; /* save CR in r10 for now */\
27 mfspr r11,SPRN_SRR1; /* check whether user or kernel */\ 27 mfspr r11,SPRN_SRR1; /* check whether user or kernel */\
28 andi. r11,r11,MSR_PR; \ 28 andi. r11,r11,MSR_PR; \
29 beq 1f; \ 29 beq 1f; \
30 mfspr r1,SPRN_SPRG3; /* if from user, start at top of */\ 30 mfspr r1,SPRN_SPRG_THREAD; /* if from user, start at top of */\
31 lwz r1,THREAD_INFO-THREAD(r1); /* this thread's kernel stack */\ 31 lwz r1,THREAD_INFO-THREAD(r1); /* this thread's kernel stack */\
32 ALLOC_STACK_FRAME(r1, THREAD_SIZE); \ 32 ALLOC_STACK_FRAME(r1, THREAD_SIZE); \
331: subi r1,r1,INT_FRAME_SIZE; /* Allocate an exception frame */\ 331: subi r1,r1,INT_FRAME_SIZE; /* Allocate an exception frame */\
@@ -35,13 +35,13 @@
35 stw r10,_CCR(r11); /* save various registers */\ 35 stw r10,_CCR(r11); /* save various registers */\
36 stw r12,GPR12(r11); \ 36 stw r12,GPR12(r11); \
37 stw r9,GPR9(r11); \ 37 stw r9,GPR9(r11); \
38 mfspr r10,SPRN_SPRG0; \ 38 mfspr r10,SPRN_SPRG_RSCRATCH0; \
39 stw r10,GPR10(r11); \ 39 stw r10,GPR10(r11); \
40 mfspr r12,SPRN_SPRG1; \ 40 mfspr r12,SPRN_SPRG_RSCRATCH1; \
41 stw r12,GPR11(r11); \ 41 stw r12,GPR11(r11); \
42 mflr r10; \ 42 mflr r10; \
43 stw r10,_LINK(r11); \ 43 stw r10,_LINK(r11); \
44 mfspr r10,SPRN_SPRG4R; \ 44 mfspr r10,SPRN_SPRG_RSCRATCH2; \
45 mfspr r12,SPRN_SRR0; \ 45 mfspr r12,SPRN_SRR0; \
46 stw r10,GPR1(r11); \ 46 stw r10,GPR1(r11); \
47 mfspr r9,SPRN_SRR1; \ 47 mfspr r9,SPRN_SRR1; \
@@ -69,21 +69,11 @@
69 * providing configurations that micro-optimize space usage. 69 * providing configurations that micro-optimize space usage.
70 */ 70 */
71 71
72/* CRIT_SPRG only used in critical exception handling */ 72#define MC_STACK_BASE mcheckirq_ctx
73#define CRIT_SPRG SPRN_SPRG2
74/* MCHECK_SPRG only used in machine check exception handling */
75#define MCHECK_SPRG SPRN_SPRG6W
76
77#define MCHECK_STACK_BASE mcheckirq_ctx
78#define CRIT_STACK_BASE critirq_ctx 73#define CRIT_STACK_BASE critirq_ctx
79 74
80/* only on e500mc/e200 */ 75/* only on e500mc/e200 */
81#define DEBUG_STACK_BASE dbgirq_ctx 76#define DBG_STACK_BASE dbgirq_ctx
82#ifdef CONFIG_E200
83#define DEBUG_SPRG SPRN_SPRG6W
84#else
85#define DEBUG_SPRG SPRN_SPRG9
86#endif
87 77
88#define EXC_LVL_FRAME_OVERHEAD (THREAD_SIZE - INT_FRAME_SIZE - EXC_LVL_SIZE) 78#define EXC_LVL_FRAME_OVERHEAD (THREAD_SIZE - INT_FRAME_SIZE - EXC_LVL_SIZE)
89 79
@@ -110,7 +100,7 @@
110 * critical/machine check exception stack at low physical addresses. 100 * critical/machine check exception stack at low physical addresses.
111 */ 101 */
112#define EXC_LEVEL_EXCEPTION_PROLOG(exc_level, exc_level_srr0, exc_level_srr1) \ 102#define EXC_LEVEL_EXCEPTION_PROLOG(exc_level, exc_level_srr0, exc_level_srr1) \
113 mtspr exc_level##_SPRG,r8; \ 103 mtspr SPRN_SPRG_WSCRATCH_##exc_level,r8; \
114 BOOKE_LOAD_EXC_LEVEL_STACK(exc_level);/* r8 points to the exc_level stack*/ \ 104 BOOKE_LOAD_EXC_LEVEL_STACK(exc_level);/* r8 points to the exc_level stack*/ \
115 stw r9,GPR9(r8); /* save various registers */\ 105 stw r9,GPR9(r8); /* save various registers */\
116 mfcr r9; /* save CR in r9 for now */\ 106 mfcr r9; /* save CR in r9 for now */\
@@ -119,7 +109,7 @@
119 stw r9,_CCR(r8); /* save CR on stack */\ 109 stw r9,_CCR(r8); /* save CR on stack */\
120 mfspr r10,exc_level_srr1; /* check whether user or kernel */\ 110 mfspr r10,exc_level_srr1; /* check whether user or kernel */\
121 andi. r10,r10,MSR_PR; \ 111 andi. r10,r10,MSR_PR; \
122 mfspr r11,SPRN_SPRG3; /* if from user, start at top of */\ 112 mfspr r11,SPRN_SPRG_THREAD; /* if from user, start at top of */\
123 lwz r11,THREAD_INFO-THREAD(r11); /* this thread's kernel stack */\ 113 lwz r11,THREAD_INFO-THREAD(r11); /* this thread's kernel stack */\
124 addi r11,r11,EXC_LVL_FRAME_OVERHEAD; /* allocate stack frame */\ 114 addi r11,r11,EXC_LVL_FRAME_OVERHEAD; /* allocate stack frame */\
125 beq 1f; \ 115 beq 1f; \
@@ -140,7 +130,7 @@
140 lwz r9,TI_TASK-EXC_LVL_FRAME_OVERHEAD(r11); \ 130 lwz r9,TI_TASK-EXC_LVL_FRAME_OVERHEAD(r11); \
141 stw r9,TI_TASK-EXC_LVL_FRAME_OVERHEAD(r8); \ 131 stw r9,TI_TASK-EXC_LVL_FRAME_OVERHEAD(r8); \
142 mr r11,r8; \ 132 mr r11,r8; \
1432: mfspr r8,exc_level##_SPRG; \ 1332: mfspr r8,SPRN_SPRG_RSCRATCH_##exc_level; \
144 stw r12,GPR12(r11); /* save various registers */\ 134 stw r12,GPR12(r11); /* save various registers */\
145 mflr r10; \ 135 mflr r10; \
146 stw r10,_LINK(r11); \ 136 stw r10,_LINK(r11); \
@@ -161,9 +151,9 @@
161#define CRITICAL_EXCEPTION_PROLOG \ 151#define CRITICAL_EXCEPTION_PROLOG \
162 EXC_LEVEL_EXCEPTION_PROLOG(CRIT, SPRN_CSRR0, SPRN_CSRR1) 152 EXC_LEVEL_EXCEPTION_PROLOG(CRIT, SPRN_CSRR0, SPRN_CSRR1)
163#define DEBUG_EXCEPTION_PROLOG \ 153#define DEBUG_EXCEPTION_PROLOG \
164 EXC_LEVEL_EXCEPTION_PROLOG(DEBUG, SPRN_DSRR0, SPRN_DSRR1) 154 EXC_LEVEL_EXCEPTION_PROLOG(DBG, SPRN_DSRR0, SPRN_DSRR1)
165#define MCHECK_EXCEPTION_PROLOG \ 155#define MCHECK_EXCEPTION_PROLOG \
166 EXC_LEVEL_EXCEPTION_PROLOG(MCHECK, SPRN_MCSRR0, SPRN_MCSRR1) 156 EXC_LEVEL_EXCEPTION_PROLOG(MC, SPRN_MCSRR0, SPRN_MCSRR1)
167 157
168/* 158/*
169 * Exception vectors. 159 * Exception vectors.
@@ -282,13 +272,13 @@ label:
282 mtspr SPRN_DSRR1,r9; \ 272 mtspr SPRN_DSRR1,r9; \
283 lwz r9,GPR9(r11); \ 273 lwz r9,GPR9(r11); \
284 lwz r12,GPR12(r11); \ 274 lwz r12,GPR12(r11); \
285 mtspr DEBUG_SPRG,r8; \ 275 mtspr SPRN_SPRG_WSCRATCH_DBG,r8; \
286 BOOKE_LOAD_EXC_LEVEL_STACK(DEBUG); /* r8 points to the debug stack */ \ 276 BOOKE_LOAD_EXC_LEVEL_STACK(DBG); /* r8 points to the debug stack */ \
287 lwz r10,GPR10(r8); \ 277 lwz r10,GPR10(r8); \
288 lwz r11,GPR11(r8); \ 278 lwz r11,GPR11(r8); \
289 mfspr r8,DEBUG_SPRG; \ 279 mfspr r8,SPRN_SPRG_RSCRATCH_DBG; \
290 \ 280 \
291 PPC_RFDI; \ 281 PPC_RFDI; \
292 b .; \ 282 b .; \
293 \ 283 \
294 /* continue normal handling for a debug exception... */ \ 284 /* continue normal handling for a debug exception... */ \
@@ -335,11 +325,11 @@ label:
335 mtspr SPRN_CSRR1,r9; \ 325 mtspr SPRN_CSRR1,r9; \
336 lwz r9,GPR9(r11); \ 326 lwz r9,GPR9(r11); \
337 lwz r12,GPR12(r11); \ 327 lwz r12,GPR12(r11); \
338 mtspr CRIT_SPRG,r8; \ 328 mtspr SPRN_SPRG_WSCRATCH_CRIT,r8; \
339 BOOKE_LOAD_EXC_LEVEL_STACK(CRIT); /* r8 points to the debug stack */ \ 329 BOOKE_LOAD_EXC_LEVEL_STACK(CRIT); /* r8 points to the debug stack */ \
340 lwz r10,GPR10(r8); \ 330 lwz r10,GPR10(r8); \
341 lwz r11,GPR11(r8); \ 331 lwz r11,GPR11(r8); \
342 mfspr r8,CRIT_SPRG; \ 332 mfspr r8,SPRN_SPRG_RSCRATCH_CRIT; \
343 \ 333 \
344 rfci; \ 334 rfci; \
345 b .; \ 335 b .; \
diff --git a/arch/powerpc/kernel/head_fsl_booke.S b/arch/powerpc/kernel/head_fsl_booke.S
index 5bdcc06d294c..975788ca05d2 100644
--- a/arch/powerpc/kernel/head_fsl_booke.S
+++ b/arch/powerpc/kernel/head_fsl_booke.S
@@ -361,7 +361,7 @@ skpinv: addi r6,r6,1 /* Increment */
361 361
362 /* ptr to current thread */ 362 /* ptr to current thread */
363 addi r4,r2,THREAD /* init task's THREAD */ 363 addi r4,r2,THREAD /* init task's THREAD */
364 mtspr SPRN_SPRG3,r4 364 mtspr SPRN_SPRG_THREAD,r4
365 365
366 /* stack */ 366 /* stack */
367 lis r1,init_thread_union@h 367 lis r1,init_thread_union@h
@@ -532,12 +532,12 @@ interrupt_base:
532 532
533 /* Data TLB Error Interrupt */ 533 /* Data TLB Error Interrupt */
534 START_EXCEPTION(DataTLBError) 534 START_EXCEPTION(DataTLBError)
535 mtspr SPRN_SPRG0, r10 /* Save some working registers */ 535 mtspr SPRN_SPRG_WSCRATCH0, r10 /* Save some working registers */
536 mtspr SPRN_SPRG1, r11 536 mtspr SPRN_SPRG_WSCRATCH1, r11
537 mtspr SPRN_SPRG4W, r12 537 mtspr SPRN_SPRG_WSCRATCH2, r12
538 mtspr SPRN_SPRG5W, r13 538 mtspr SPRN_SPRG_WSCRATCH3, r13
539 mfcr r11 539 mfcr r11
540 mtspr SPRN_SPRG7W, r11 540 mtspr SPRN_SPRG_WSCRATCH4, r11
541 mfspr r10, SPRN_DEAR /* Get faulting address */ 541 mfspr r10, SPRN_DEAR /* Get faulting address */
542 542
543 /* If we are faulting a kernel address, we have to use the 543 /* If we are faulting a kernel address, we have to use the
@@ -557,7 +557,7 @@ interrupt_base:
557 557
558 /* Get the PGD for the current thread */ 558 /* Get the PGD for the current thread */
5593: 5593:
560 mfspr r11,SPRN_SPRG3 560 mfspr r11,SPRN_SPRG_THREAD
561 lwz r11,PGDIR(r11) 561 lwz r11,PGDIR(r11)
562 562
5634: 5634:
@@ -575,7 +575,12 @@ interrupt_base:
575 * place or can we save a couple of instructions here ? 575 * place or can we save a couple of instructions here ?
576 */ 576 */
577 mfspr r12,SPRN_ESR 577 mfspr r12,SPRN_ESR
578#ifdef CONFIG_PTE_64BIT
579 li r13,_PAGE_PRESENT
580 oris r13,r13,_PAGE_ACCESSED@h
581#else
578 li r13,_PAGE_PRESENT|_PAGE_ACCESSED 582 li r13,_PAGE_PRESENT|_PAGE_ACCESSED
583#endif
579 rlwimi r13,r12,11,29,29 584 rlwimi r13,r12,11,29,29
580 585
581 FIND_PTE 586 FIND_PTE
@@ -598,12 +603,12 @@ interrupt_base:
598 /* The bailout. Restore registers to pre-exception conditions 603 /* The bailout. Restore registers to pre-exception conditions
599 * and call the heavyweights to help us out. 604 * and call the heavyweights to help us out.
600 */ 605 */
601 mfspr r11, SPRN_SPRG7R 606 mfspr r11, SPRN_SPRG_RSCRATCH4
602 mtcr r11 607 mtcr r11
603 mfspr r13, SPRN_SPRG5R 608 mfspr r13, SPRN_SPRG_RSCRATCH3
604 mfspr r12, SPRN_SPRG4R 609 mfspr r12, SPRN_SPRG_RSCRATCH2
605 mfspr r11, SPRN_SPRG1 610 mfspr r11, SPRN_SPRG_RSCRATCH1
606 mfspr r10, SPRN_SPRG0 611 mfspr r10, SPRN_SPRG_RSCRATCH0
607 b DataStorage 612 b DataStorage
608 613
609 /* Instruction TLB Error Interrupt */ 614 /* Instruction TLB Error Interrupt */
@@ -613,12 +618,12 @@ interrupt_base:
613 * to a different point. 618 * to a different point.
614 */ 619 */
615 START_EXCEPTION(InstructionTLBError) 620 START_EXCEPTION(InstructionTLBError)
616 mtspr SPRN_SPRG0, r10 /* Save some working registers */ 621 mtspr SPRN_SPRG_WSCRATCH0, r10 /* Save some working registers */
617 mtspr SPRN_SPRG1, r11 622 mtspr SPRN_SPRG_WSCRATCH1, r11
618 mtspr SPRN_SPRG4W, r12 623 mtspr SPRN_SPRG_WSCRATCH2, r12
619 mtspr SPRN_SPRG5W, r13 624 mtspr SPRN_SPRG_WSCRATCH3, r13
620 mfcr r11 625 mfcr r11
621 mtspr SPRN_SPRG7W, r11 626 mtspr SPRN_SPRG_WSCRATCH4, r11
622 mfspr r10, SPRN_SRR0 /* Get faulting address */ 627 mfspr r10, SPRN_SRR0 /* Get faulting address */
623 628
624 /* If we are faulting a kernel address, we have to use the 629 /* If we are faulting a kernel address, we have to use the
@@ -638,12 +643,17 @@ interrupt_base:
638 643
639 /* Get the PGD for the current thread */ 644 /* Get the PGD for the current thread */
6403: 6453:
641 mfspr r11,SPRN_SPRG3 646 mfspr r11,SPRN_SPRG_THREAD
642 lwz r11,PGDIR(r11) 647 lwz r11,PGDIR(r11)
643 648
6444: 6494:
645 /* Make up the required permissions */ 650 /* Make up the required permissions */
646 li r13,_PAGE_PRESENT | _PAGE_ACCESSED | _PAGE_HWEXEC 651#ifdef CONFIG_PTE_64BIT
652 li r13,_PAGE_PRESENT | _PAGE_EXEC
653 oris r13,r13,_PAGE_ACCESSED@h
654#else
655 li r13,_PAGE_PRESENT | _PAGE_ACCESSED | _PAGE_EXEC
656#endif
647 657
648 FIND_PTE 658 FIND_PTE
649 andc. r13,r13,r11 /* Check permission */ 659 andc. r13,r13,r11 /* Check permission */
@@ -666,12 +676,12 @@ interrupt_base:
666 /* The bailout. Restore registers to pre-exception conditions 676 /* The bailout. Restore registers to pre-exception conditions
667 * and call the heavyweights to help us out. 677 * and call the heavyweights to help us out.
668 */ 678 */
669 mfspr r11, SPRN_SPRG7R 679 mfspr r11, SPRN_SPRG_RSCRATCH4
670 mtcr r11 680 mtcr r11
671 mfspr r13, SPRN_SPRG5R 681 mfspr r13, SPRN_SPRG_RSCRATCH3
672 mfspr r12, SPRN_SPRG4R 682 mfspr r12, SPRN_SPRG_RSCRATCH2
673 mfspr r11, SPRN_SPRG1 683 mfspr r11, SPRN_SPRG_RSCRATCH1
674 mfspr r10, SPRN_SPRG0 684 mfspr r10, SPRN_SPRG_RSCRATCH0
675 b InstructionStorage 685 b InstructionStorage
676 686
677#ifdef CONFIG_SPE 687#ifdef CONFIG_SPE
@@ -733,7 +743,7 @@ finish_tlb_load:
733 743
734 mfspr r12, SPRN_MAS2 744 mfspr r12, SPRN_MAS2
735#ifdef CONFIG_PTE_64BIT 745#ifdef CONFIG_PTE_64BIT
736 rlwimi r12, r11, 26, 24, 31 /* extract ...WIMGE from pte */ 746 rlwimi r12, r11, 32-19, 27, 31 /* extract WIMGE from pte */
737#else 747#else
738 rlwimi r12, r11, 26, 27, 31 /* extract WIMGE from pte */ 748 rlwimi r12, r11, 26, 27, 31 /* extract WIMGE from pte */
739#endif 749#endif
@@ -742,23 +752,27 @@ finish_tlb_load:
742#endif 752#endif
743 mtspr SPRN_MAS2, r12 753 mtspr SPRN_MAS2, r12
744 754
745 li r10, (_PAGE_HWEXEC | _PAGE_PRESENT)
746 rlwimi r10, r11, 31, 29, 29 /* extract _PAGE_DIRTY into SW */
747 and r12, r11, r10
748 andi. r10, r11, _PAGE_USER /* Test for _PAGE_USER */
749 slwi r10, r12, 1
750 or r10, r10, r12
751 iseleq r12, r12, r10
752
753#ifdef CONFIG_PTE_64BIT 755#ifdef CONFIG_PTE_64BIT
754 rlwimi r12, r13, 24, 0, 7 /* grab RPN[32:39] */ 756 rlwinm r12, r11, 32-2, 26, 31 /* Move in perm bits */
755 rlwimi r12, r11, 24, 8, 19 /* grab RPN[40:51] */ 757 andi. r10, r11, _PAGE_DIRTY
758 bne 1f
759 li r10, MAS3_SW | MAS3_UW
760 andc r12, r12, r10
7611: rlwimi r12, r13, 20, 0, 11 /* grab RPN[32:43] */
762 rlwimi r12, r11, 20, 12, 19 /* grab RPN[44:51] */
756 mtspr SPRN_MAS3, r12 763 mtspr SPRN_MAS3, r12
757BEGIN_MMU_FTR_SECTION 764BEGIN_MMU_FTR_SECTION
758 srwi r10, r13, 8 /* grab RPN[8:31] */ 765 srwi r10, r13, 12 /* grab RPN[12:31] */
759 mtspr SPRN_MAS7, r10 766 mtspr SPRN_MAS7, r10
760END_MMU_FTR_SECTION_IFSET(MMU_FTR_BIG_PHYS) 767END_MMU_FTR_SECTION_IFSET(MMU_FTR_BIG_PHYS)
761#else 768#else
769 li r10, (_PAGE_EXEC | _PAGE_PRESENT)
770 rlwimi r10, r11, 31, 29, 29 /* extract _PAGE_DIRTY into SW */
771 and r12, r11, r10
772 andi. r10, r11, _PAGE_USER /* Test for _PAGE_USER */
773 slwi r10, r12, 1
774 or r10, r10, r12
775 iseleq r12, r12, r10
762 rlwimi r11, r12, 0, 20, 31 /* Extract RPN from PTE and merge with perms */ 776 rlwimi r11, r12, 0, 20, 31 /* Extract RPN from PTE and merge with perms */
763 mtspr SPRN_MAS3, r11 777 mtspr SPRN_MAS3, r11
764#endif 778#endif
@@ -790,12 +804,12 @@ END_MMU_FTR_SECTION_IFSET(MMU_FTR_BIG_PHYS)
790 tlbwe 804 tlbwe
791 805
792 /* Done...restore registers and get out of here. */ 806 /* Done...restore registers and get out of here. */
793 mfspr r11, SPRN_SPRG7R 807 mfspr r11, SPRN_SPRG_RSCRATCH4
794 mtcr r11 808 mtcr r11
795 mfspr r13, SPRN_SPRG5R 809 mfspr r13, SPRN_SPRG_RSCRATCH3
796 mfspr r12, SPRN_SPRG4R 810 mfspr r12, SPRN_SPRG_RSCRATCH2
797 mfspr r11, SPRN_SPRG1 811 mfspr r11, SPRN_SPRG_RSCRATCH1
798 mfspr r10, SPRN_SPRG0 812 mfspr r10, SPRN_SPRG_RSCRATCH0
799 rfi /* Force context change */ 813 rfi /* Force context change */
800 814
801#ifdef CONFIG_SPE 815#ifdef CONFIG_SPE
@@ -839,7 +853,7 @@ load_up_spe:
839#endif /* !CONFIG_SMP */ 853#endif /* !CONFIG_SMP */
840 /* enable use of SPE after return */ 854 /* enable use of SPE after return */
841 oris r9,r9,MSR_SPE@h 855 oris r9,r9,MSR_SPE@h
842 mfspr r5,SPRN_SPRG3 /* current task's THREAD (phys) */ 856 mfspr r5,SPRN_SPRG_THREAD /* current task's THREAD (phys) */
843 li r4,1 857 li r4,1
844 li r10,THREAD_ACC 858 li r10,THREAD_ACC
845 stw r4,THREAD_USED_SPE(r5) 859 stw r4,THREAD_USED_SPE(r5)
@@ -1118,7 +1132,7 @@ __secondary_start:
1118 1132
1119 /* ptr to current thread */ 1133 /* ptr to current thread */
1120 addi r4,r2,THREAD /* address of our thread_struct */ 1134 addi r4,r2,THREAD /* address of our thread_struct */
1121 mtspr SPRN_SPRG3,r4 1135 mtspr SPRN_SPRG_THREAD,r4
1122 1136
1123 /* Setup the defaults for TLB entries */ 1137 /* Setup the defaults for TLB entries */
1124 li r4,(MAS4_TSIZED(BOOK3E_PAGESZ_4K))@l 1138 li r4,(MAS4_TSIZED(BOOK3E_PAGESZ_4K))@l
diff --git a/arch/powerpc/kernel/ibmebus.c b/arch/powerpc/kernel/ibmebus.c
index 6e3f62493659..a4c8b38b0ba1 100644
--- a/arch/powerpc/kernel/ibmebus.c
+++ b/arch/powerpc/kernel/ibmebus.c
@@ -127,7 +127,7 @@ static int ibmebus_dma_supported(struct device *dev, u64 mask)
127 return 1; 127 return 1;
128} 128}
129 129
130static struct dma_mapping_ops ibmebus_dma_ops = { 130static struct dma_map_ops ibmebus_dma_ops = {
131 .alloc_coherent = ibmebus_alloc_coherent, 131 .alloc_coherent = ibmebus_alloc_coherent,
132 .free_coherent = ibmebus_free_coherent, 132 .free_coherent = ibmebus_free_coherent,
133 .map_sg = ibmebus_map_sg, 133 .map_sg = ibmebus_map_sg,
diff --git a/arch/powerpc/kernel/lparcfg.c b/arch/powerpc/kernel/lparcfg.c
index 2419cc706ff1..ed0ac4e4b8d8 100644
--- a/arch/powerpc/kernel/lparcfg.c
+++ b/arch/powerpc/kernel/lparcfg.c
@@ -35,6 +35,7 @@
35#include <asm/prom.h> 35#include <asm/prom.h>
36#include <asm/vdso_datapage.h> 36#include <asm/vdso_datapage.h>
37#include <asm/vio.h> 37#include <asm/vio.h>
38#include <asm/mmu.h>
38 39
39#define MODULE_VERS "1.8" 40#define MODULE_VERS "1.8"
40#define MODULE_NAME "lparcfg" 41#define MODULE_NAME "lparcfg"
@@ -537,6 +538,8 @@ static int pseries_lparcfg_data(struct seq_file *m, void *v)
537 538
538 seq_printf(m, "shared_processor_mode=%d\n", lppaca[0].shared_proc); 539 seq_printf(m, "shared_processor_mode=%d\n", lppaca[0].shared_proc);
539 540
541 seq_printf(m, "slb_size=%d\n", mmu_slb_size);
542
540 return 0; 543 return 0;
541} 544}
542 545
diff --git a/arch/powerpc/kernel/misc_32.S b/arch/powerpc/kernel/misc_32.S
index 15f28e0de78d..da9c0c4c10f3 100644
--- a/arch/powerpc/kernel/misc_32.S
+++ b/arch/powerpc/kernel/misc_32.S
@@ -342,10 +342,17 @@ END_FTR_SECTION_IFSET(CPU_FTR_COHERENT_ICACHE)
342 addi r3,r3,L1_CACHE_BYTES 342 addi r3,r3,L1_CACHE_BYTES
343 bdnz 1b 343 bdnz 1b
344 sync /* wait for dcbst's to get to ram */ 344 sync /* wait for dcbst's to get to ram */
345#ifndef CONFIG_44x
345 mtctr r4 346 mtctr r4
3462: icbi 0,r6 3472: icbi 0,r6
347 addi r6,r6,L1_CACHE_BYTES 348 addi r6,r6,L1_CACHE_BYTES
348 bdnz 2b 349 bdnz 2b
350#else
351 /* Flash invalidate on 44x because we are passed kmapped addresses and
352 this doesn't work for userspace pages due to the virtually tagged
353 icache. Sigh. */
354 iccci 0, r0
355#endif
349 sync /* additional sync needed on g4 */ 356 sync /* additional sync needed on g4 */
350 isync 357 isync
351 blr 358 blr
diff --git a/arch/powerpc/kernel/of_platform.c b/arch/powerpc/kernel/of_platform.c
index 87df428e3588..1a4fc0d11a03 100644
--- a/arch/powerpc/kernel/of_platform.c
+++ b/arch/powerpc/kernel/of_platform.c
@@ -276,7 +276,7 @@ static int __devinit of_pci_phb_probe(struct of_device *dev,
276#endif /* CONFIG_EEH */ 276#endif /* CONFIG_EEH */
277 277
278 /* Scan the bus */ 278 /* Scan the bus */
279 scan_phb(phb); 279 pcibios_scan_phb(phb, dev->node);
280 if (phb->bus == NULL) 280 if (phb->bus == NULL)
281 return -ENXIO; 281 return -ENXIO;
282 282
diff --git a/arch/powerpc/kernel/paca.c b/arch/powerpc/kernel/paca.c
index e9962c7f8a09..d16b1ea55d44 100644
--- a/arch/powerpc/kernel/paca.c
+++ b/arch/powerpc/kernel/paca.c
@@ -13,6 +13,7 @@
13#include <asm/lppaca.h> 13#include <asm/lppaca.h>
14#include <asm/paca.h> 14#include <asm/paca.h>
15#include <asm/sections.h> 15#include <asm/sections.h>
16#include <asm/pgtable.h>
16 17
17/* This symbol is provided by the linker - let it fill in the paca 18/* This symbol is provided by the linker - let it fill in the paca
18 * field correctly */ 19 * field correctly */
@@ -87,6 +88,8 @@ void __init initialise_pacas(void)
87 88
88#ifdef CONFIG_PPC_BOOK3S 89#ifdef CONFIG_PPC_BOOK3S
89 new_paca->lppaca_ptr = &lppaca[cpu]; 90 new_paca->lppaca_ptr = &lppaca[cpu];
91#else
92 new_paca->kernel_pgd = swapper_pg_dir;
90#endif 93#endif
91 new_paca->lock_token = 0x8000; 94 new_paca->lock_token = 0x8000;
92 new_paca->paca_index = cpu; 95 new_paca->paca_index = cpu;
diff --git a/arch/powerpc/kernel/pci-common.c b/arch/powerpc/kernel/pci-common.c
index 5a56e97c5ac0..e9f4840096b3 100644
--- a/arch/powerpc/kernel/pci-common.c
+++ b/arch/powerpc/kernel/pci-common.c
@@ -50,14 +50,14 @@ resource_size_t isa_mem_base;
50unsigned int ppc_pci_flags = 0; 50unsigned int ppc_pci_flags = 0;
51 51
52 52
53static struct dma_mapping_ops *pci_dma_ops = &dma_direct_ops; 53static struct dma_map_ops *pci_dma_ops = &dma_direct_ops;
54 54
55void set_pci_dma_ops(struct dma_mapping_ops *dma_ops) 55void set_pci_dma_ops(struct dma_map_ops *dma_ops)
56{ 56{
57 pci_dma_ops = dma_ops; 57 pci_dma_ops = dma_ops;
58} 58}
59 59
60struct dma_mapping_ops *get_pci_dma_ops(void) 60struct dma_map_ops *get_pci_dma_ops(void)
61{ 61{
62 return pci_dma_ops; 62 return pci_dma_ops;
63} 63}
@@ -176,8 +176,6 @@ int pci_domain_nr(struct pci_bus *bus)
176} 176}
177EXPORT_SYMBOL(pci_domain_nr); 177EXPORT_SYMBOL(pci_domain_nr);
178 178
179#ifdef CONFIG_PPC_OF
180
181/* This routine is meant to be used early during boot, when the 179/* This routine is meant to be used early during boot, when the
182 * PCI bus numbers have not yet been assigned, and you need to 180 * PCI bus numbers have not yet been assigned, and you need to
183 * issue PCI config cycles to an OF device. 181 * issue PCI config cycles to an OF device.
@@ -210,17 +208,11 @@ static ssize_t pci_show_devspec(struct device *dev,
210 return sprintf(buf, "%s", np->full_name); 208 return sprintf(buf, "%s", np->full_name);
211} 209}
212static DEVICE_ATTR(devspec, S_IRUGO, pci_show_devspec, NULL); 210static DEVICE_ATTR(devspec, S_IRUGO, pci_show_devspec, NULL);
213#endif /* CONFIG_PPC_OF */
214 211
215/* Add sysfs properties */ 212/* Add sysfs properties */
216int pcibios_add_platform_entries(struct pci_dev *pdev) 213int pcibios_add_platform_entries(struct pci_dev *pdev)
217{ 214{
218#ifdef CONFIG_PPC_OF
219 return device_create_file(&pdev->dev, &dev_attr_devspec); 215 return device_create_file(&pdev->dev, &dev_attr_devspec);
220#else
221 return 0;
222#endif /* CONFIG_PPC_OF */
223
224} 216}
225 217
226char __devinit *pcibios_setup(char *str) 218char __devinit *pcibios_setup(char *str)
@@ -1626,3 +1618,122 @@ void __devinit pcibios_setup_phb_resources(struct pci_controller *hose)
1626 1618
1627} 1619}
1628 1620
1621/*
1622 * Null PCI config access functions, for the case when we can't
1623 * find a hose.
1624 */
1625#define NULL_PCI_OP(rw, size, type) \
1626static int \
1627null_##rw##_config_##size(struct pci_dev *dev, int offset, type val) \
1628{ \
1629 return PCIBIOS_DEVICE_NOT_FOUND; \
1630}
1631
1632static int
1633null_read_config(struct pci_bus *bus, unsigned int devfn, int offset,
1634 int len, u32 *val)
1635{
1636 return PCIBIOS_DEVICE_NOT_FOUND;
1637}
1638
1639static int
1640null_write_config(struct pci_bus *bus, unsigned int devfn, int offset,
1641 int len, u32 val)
1642{
1643 return PCIBIOS_DEVICE_NOT_FOUND;
1644}
1645
1646static struct pci_ops null_pci_ops =
1647{
1648 .read = null_read_config,
1649 .write = null_write_config,
1650};
1651
1652/*
1653 * These functions are used early on before PCI scanning is done
1654 * and all of the pci_dev and pci_bus structures have been created.
1655 */
1656static struct pci_bus *
1657fake_pci_bus(struct pci_controller *hose, int busnr)
1658{
1659 static struct pci_bus bus;
1660
1661 if (hose == 0) {
1662 printk(KERN_ERR "Can't find hose for PCI bus %d!\n", busnr);
1663 }
1664 bus.number = busnr;
1665 bus.sysdata = hose;
1666 bus.ops = hose? hose->ops: &null_pci_ops;
1667 return &bus;
1668}
1669
1670#define EARLY_PCI_OP(rw, size, type) \
1671int early_##rw##_config_##size(struct pci_controller *hose, int bus, \
1672 int devfn, int offset, type value) \
1673{ \
1674 return pci_bus_##rw##_config_##size(fake_pci_bus(hose, bus), \
1675 devfn, offset, value); \
1676}
1677
1678EARLY_PCI_OP(read, byte, u8 *)
1679EARLY_PCI_OP(read, word, u16 *)
1680EARLY_PCI_OP(read, dword, u32 *)
1681EARLY_PCI_OP(write, byte, u8)
1682EARLY_PCI_OP(write, word, u16)
1683EARLY_PCI_OP(write, dword, u32)
1684
1685extern int pci_bus_find_capability (struct pci_bus *bus, unsigned int devfn, int cap);
1686int early_find_capability(struct pci_controller *hose, int bus, int devfn,
1687 int cap)
1688{
1689 return pci_bus_find_capability(fake_pci_bus(hose, bus), devfn, cap);
1690}
1691
1692/**
1693 * pci_scan_phb - Given a pci_controller, setup and scan the PCI bus
1694 * @hose: Pointer to the PCI host controller instance structure
1695 * @sysdata: value to use for sysdata pointer. ppc32 and ppc64 differ here
1696 *
1697 * Note: the 'data' pointer is a temporary measure. As 32 and 64 bit
1698 * pci code gets merged, this parameter should become unnecessary because
1699 * both will use the same value.
1700 */
1701void __devinit pcibios_scan_phb(struct pci_controller *hose, void *sysdata)
1702{
1703 struct pci_bus *bus;
1704 struct device_node *node = hose->dn;
1705 int mode;
1706
1707 pr_debug("PCI: Scanning PHB %s\n",
1708 node ? node->full_name : "<NO NAME>");
1709
1710 /* Create an empty bus for the toplevel */
1711 bus = pci_create_bus(hose->parent, hose->first_busno, hose->ops,
1712 sysdata);
1713 if (bus == NULL) {
1714 pr_err("Failed to create bus for PCI domain %04x\n",
1715 hose->global_number);
1716 return;
1717 }
1718 bus->secondary = hose->first_busno;
1719 hose->bus = bus;
1720
1721 /* Get some IO space for the new PHB */
1722 pcibios_setup_phb_io_space(hose);
1723
1724 /* Wire up PHB bus resources */
1725 pcibios_setup_phb_resources(hose);
1726
1727 /* Get probe mode and perform scan */
1728 mode = PCI_PROBE_NORMAL;
1729 if (node && ppc_md.pci_probe_mode)
1730 mode = ppc_md.pci_probe_mode(bus);
1731 pr_debug(" probe mode: %d\n", mode);
1732 if (mode == PCI_PROBE_DEVTREE) {
1733 bus->subordinate = hose->last_busno;
1734 of_scan_bus(node, bus);
1735 }
1736
1737 if (mode == PCI_PROBE_NORMAL)
1738 hose->last_busno = bus->subordinate = pci_scan_child_bus(bus);
1739}
diff --git a/arch/powerpc/kernel/pci_32.c b/arch/powerpc/kernel/pci_32.c
index 3ae1c666ff92..c13668cf36d9 100644
--- a/arch/powerpc/kernel/pci_32.c
+++ b/arch/powerpc/kernel/pci_32.c
@@ -34,9 +34,7 @@ int pcibios_assign_bus_offset = 1;
34void pcibios_make_OF_bus_map(void); 34void pcibios_make_OF_bus_map(void);
35 35
36static void fixup_cpc710_pci64(struct pci_dev* dev); 36static void fixup_cpc710_pci64(struct pci_dev* dev);
37#ifdef CONFIG_PPC_OF
38static u8* pci_to_OF_bus_map; 37static u8* pci_to_OF_bus_map;
39#endif
40 38
41/* By default, we don't re-assign bus numbers. We do this only on 39/* By default, we don't re-assign bus numbers. We do this only on
42 * some pmacs 40 * some pmacs
@@ -83,7 +81,6 @@ fixup_cpc710_pci64(struct pci_dev* dev)
83} 81}
84DECLARE_PCI_FIXUP_HEADER(PCI_VENDOR_ID_IBM, PCI_DEVICE_ID_IBM_CPC710_PCI64, fixup_cpc710_pci64); 82DECLARE_PCI_FIXUP_HEADER(PCI_VENDOR_ID_IBM, PCI_DEVICE_ID_IBM_CPC710_PCI64, fixup_cpc710_pci64);
85 83
86#ifdef CONFIG_PPC_OF
87/* 84/*
88 * Functions below are used on OpenFirmware machines. 85 * Functions below are used on OpenFirmware machines.
89 */ 86 */
@@ -357,42 +354,15 @@ pci_create_OF_bus_map(void)
357 } 354 }
358} 355}
359 356
360#else /* CONFIG_PPC_OF */ 357void __devinit pcibios_setup_phb_io_space(struct pci_controller *hose)
361void pcibios_make_OF_bus_map(void)
362{ 358{
363}
364#endif /* CONFIG_PPC_OF */
365
366static void __devinit pcibios_scan_phb(struct pci_controller *hose)
367{
368 struct pci_bus *bus;
369 struct device_node *node = hose->dn;
370 unsigned long io_offset; 359 unsigned long io_offset;
371 struct resource *res = &hose->io_resource; 360 struct resource *res = &hose->io_resource;
372 361
373 pr_debug("PCI: Scanning PHB %s\n",
374 node ? node->full_name : "<NO NAME>");
375
376 /* Create an empty bus for the toplevel */
377 bus = pci_create_bus(hose->parent, hose->first_busno, hose->ops, hose);
378 if (bus == NULL) {
379 printk(KERN_ERR "Failed to create bus for PCI domain %04x\n",
380 hose->global_number);
381 return;
382 }
383 bus->secondary = hose->first_busno;
384 hose->bus = bus;
385
386 /* Fixup IO space offset */ 362 /* Fixup IO space offset */
387 io_offset = (unsigned long)hose->io_base_virt - isa_io_base; 363 io_offset = (unsigned long)hose->io_base_virt - isa_io_base;
388 res->start = (res->start + io_offset) & 0xffffffffu; 364 res->start = (res->start + io_offset) & 0xffffffffu;
389 res->end = (res->end + io_offset) & 0xffffffffu; 365 res->end = (res->end + io_offset) & 0xffffffffu;
390
391 /* Wire up PHB bus resources */
392 pcibios_setup_phb_resources(hose);
393
394 /* Scan children */
395 hose->last_busno = bus->subordinate = pci_scan_child_bus(bus);
396} 366}
397 367
398static int __init pcibios_init(void) 368static int __init pcibios_init(void)
@@ -410,7 +380,7 @@ static int __init pcibios_init(void)
410 if (pci_assign_all_buses) 380 if (pci_assign_all_buses)
411 hose->first_busno = next_busno; 381 hose->first_busno = next_busno;
412 hose->last_busno = 0xff; 382 hose->last_busno = 0xff;
413 pcibios_scan_phb(hose); 383 pcibios_scan_phb(hose, hose);
414 pci_bus_add_devices(hose->bus); 384 pci_bus_add_devices(hose->bus);
415 if (pci_assign_all_buses || next_busno <= hose->last_busno) 385 if (pci_assign_all_buses || next_busno <= hose->last_busno)
416 next_busno = hose->last_busno + pcibios_assign_bus_offset; 386 next_busno = hose->last_busno + pcibios_assign_bus_offset;
@@ -478,75 +448,4 @@ long sys_pciconfig_iobase(long which, unsigned long bus, unsigned long devfn)
478 return result; 448 return result;
479} 449}
480 450
481/*
482 * Null PCI config access functions, for the case when we can't
483 * find a hose.
484 */
485#define NULL_PCI_OP(rw, size, type) \
486static int \
487null_##rw##_config_##size(struct pci_dev *dev, int offset, type val) \
488{ \
489 return PCIBIOS_DEVICE_NOT_FOUND; \
490}
491 451
492static int
493null_read_config(struct pci_bus *bus, unsigned int devfn, int offset,
494 int len, u32 *val)
495{
496 return PCIBIOS_DEVICE_NOT_FOUND;
497}
498
499static int
500null_write_config(struct pci_bus *bus, unsigned int devfn, int offset,
501 int len, u32 val)
502{
503 return PCIBIOS_DEVICE_NOT_FOUND;
504}
505
506static struct pci_ops null_pci_ops =
507{
508 .read = null_read_config,
509 .write = null_write_config,
510};
511
512/*
513 * These functions are used early on before PCI scanning is done
514 * and all of the pci_dev and pci_bus structures have been created.
515 */
516static struct pci_bus *
517fake_pci_bus(struct pci_controller *hose, int busnr)
518{
519 static struct pci_bus bus;
520
521 if (hose == 0) {
522 hose = pci_bus_to_hose(busnr);
523 if (hose == 0)
524 printk(KERN_ERR "Can't find hose for PCI bus %d!\n", busnr);
525 }
526 bus.number = busnr;
527 bus.sysdata = hose;
528 bus.ops = hose? hose->ops: &null_pci_ops;
529 return &bus;
530}
531
532#define EARLY_PCI_OP(rw, size, type) \
533int early_##rw##_config_##size(struct pci_controller *hose, int bus, \
534 int devfn, int offset, type value) \
535{ \
536 return pci_bus_##rw##_config_##size(fake_pci_bus(hose, bus), \
537 devfn, offset, value); \
538}
539
540EARLY_PCI_OP(read, byte, u8 *)
541EARLY_PCI_OP(read, word, u16 *)
542EARLY_PCI_OP(read, dword, u32 *)
543EARLY_PCI_OP(write, byte, u8)
544EARLY_PCI_OP(write, word, u16)
545EARLY_PCI_OP(write, dword, u32)
546
547extern int pci_bus_find_capability (struct pci_bus *bus, unsigned int devfn, int cap);
548int early_find_capability(struct pci_controller *hose, int bus, int devfn,
549 int cap)
550{
551 return pci_bus_find_capability(fake_pci_bus(hose, bus), devfn, cap);
552}
diff --git a/arch/powerpc/kernel/pci_64.c b/arch/powerpc/kernel/pci_64.c
index 9e8902fa14c7..ba949a2c93ac 100644
--- a/arch/powerpc/kernel/pci_64.c
+++ b/arch/powerpc/kernel/pci_64.c
@@ -43,334 +43,6 @@ unsigned long pci_probe_only = 1;
43unsigned long pci_io_base = ISA_IO_BASE; 43unsigned long pci_io_base = ISA_IO_BASE;
44EXPORT_SYMBOL(pci_io_base); 44EXPORT_SYMBOL(pci_io_base);
45 45
46static u32 get_int_prop(struct device_node *np, const char *name, u32 def)
47{
48 const u32 *prop;
49 int len;
50
51 prop = of_get_property(np, name, &len);
52 if (prop && len >= 4)
53 return *prop;
54 return def;
55}
56
57static unsigned int pci_parse_of_flags(u32 addr0, int bridge)
58{
59 unsigned int flags = 0;
60
61 if (addr0 & 0x02000000) {
62 flags = IORESOURCE_MEM | PCI_BASE_ADDRESS_SPACE_MEMORY;
63 flags |= (addr0 >> 22) & PCI_BASE_ADDRESS_MEM_TYPE_64;
64 flags |= (addr0 >> 28) & PCI_BASE_ADDRESS_MEM_TYPE_1M;
65 if (addr0 & 0x40000000)
66 flags |= IORESOURCE_PREFETCH
67 | PCI_BASE_ADDRESS_MEM_PREFETCH;
68 /* Note: We don't know whether the ROM has been left enabled
69 * by the firmware or not. We mark it as disabled (ie, we do
70 * not set the IORESOURCE_ROM_ENABLE flag) for now rather than
71 * do a config space read, it will be force-enabled if needed
72 */
73 if (!bridge && (addr0 & 0xff) == 0x30)
74 flags |= IORESOURCE_READONLY;
75 } else if (addr0 & 0x01000000)
76 flags = IORESOURCE_IO | PCI_BASE_ADDRESS_SPACE_IO;
77 if (flags)
78 flags |= IORESOURCE_SIZEALIGN;
79 return flags;
80}
81
82
83static void pci_parse_of_addrs(struct device_node *node, struct pci_dev *dev)
84{
85 u64 base, size;
86 unsigned int flags;
87 struct resource *res;
88 const u32 *addrs;
89 u32 i;
90 int proplen;
91
92 addrs = of_get_property(node, "assigned-addresses", &proplen);
93 if (!addrs)
94 return;
95 pr_debug(" parse addresses (%d bytes) @ %p\n", proplen, addrs);
96 for (; proplen >= 20; proplen -= 20, addrs += 5) {
97 flags = pci_parse_of_flags(addrs[0], 0);
98 if (!flags)
99 continue;
100 base = of_read_number(&addrs[1], 2);
101 size = of_read_number(&addrs[3], 2);
102 if (!size)
103 continue;
104 i = addrs[0] & 0xff;
105 pr_debug(" base: %llx, size: %llx, i: %x\n",
106 (unsigned long long)base,
107 (unsigned long long)size, i);
108
109 if (PCI_BASE_ADDRESS_0 <= i && i <= PCI_BASE_ADDRESS_5) {
110 res = &dev->resource[(i - PCI_BASE_ADDRESS_0) >> 2];
111 } else if (i == dev->rom_base_reg) {
112 res = &dev->resource[PCI_ROM_RESOURCE];
113 flags |= IORESOURCE_READONLY | IORESOURCE_CACHEABLE;
114 } else {
115 printk(KERN_ERR "PCI: bad cfg reg num 0x%x\n", i);
116 continue;
117 }
118 res->start = base;
119 res->end = base + size - 1;
120 res->flags = flags;
121 res->name = pci_name(dev);
122 }
123}
124
125struct pci_dev *of_create_pci_dev(struct device_node *node,
126 struct pci_bus *bus, int devfn)
127{
128 struct pci_dev *dev;
129 const char *type;
130
131 dev = alloc_pci_dev();
132 if (!dev)
133 return NULL;
134 type = of_get_property(node, "device_type", NULL);
135 if (type == NULL)
136 type = "";
137
138 pr_debug(" create device, devfn: %x, type: %s\n", devfn, type);
139
140 dev->bus = bus;
141 dev->sysdata = node;
142 dev->dev.parent = bus->bridge;
143 dev->dev.bus = &pci_bus_type;
144 dev->devfn = devfn;
145 dev->multifunction = 0; /* maybe a lie? */
146
147 dev->vendor = get_int_prop(node, "vendor-id", 0xffff);
148 dev->device = get_int_prop(node, "device-id", 0xffff);
149 dev->subsystem_vendor = get_int_prop(node, "subsystem-vendor-id", 0);
150 dev->subsystem_device = get_int_prop(node, "subsystem-id", 0);
151
152 dev->cfg_size = pci_cfg_space_size(dev);
153
154 dev_set_name(&dev->dev, "%04x:%02x:%02x.%d", pci_domain_nr(bus),
155 dev->bus->number, PCI_SLOT(devfn), PCI_FUNC(devfn));
156 dev->class = get_int_prop(node, "class-code", 0);
157 dev->revision = get_int_prop(node, "revision-id", 0);
158
159 pr_debug(" class: 0x%x\n", dev->class);
160 pr_debug(" revision: 0x%x\n", dev->revision);
161
162 dev->current_state = 4; /* unknown power state */
163 dev->error_state = pci_channel_io_normal;
164 dev->dma_mask = 0xffffffff;
165
166 if (!strcmp(type, "pci") || !strcmp(type, "pciex")) {
167 /* a PCI-PCI bridge */
168 dev->hdr_type = PCI_HEADER_TYPE_BRIDGE;
169 dev->rom_base_reg = PCI_ROM_ADDRESS1;
170 } else if (!strcmp(type, "cardbus")) {
171 dev->hdr_type = PCI_HEADER_TYPE_CARDBUS;
172 } else {
173 dev->hdr_type = PCI_HEADER_TYPE_NORMAL;
174 dev->rom_base_reg = PCI_ROM_ADDRESS;
175 /* Maybe do a default OF mapping here */
176 dev->irq = NO_IRQ;
177 }
178
179 pci_parse_of_addrs(node, dev);
180
181 pr_debug(" adding to system ...\n");
182
183 pci_device_add(dev, bus);
184
185 return dev;
186}
187EXPORT_SYMBOL(of_create_pci_dev);
188
189static void __devinit __of_scan_bus(struct device_node *node,
190 struct pci_bus *bus, int rescan_existing)
191{
192 struct device_node *child;
193 const u32 *reg;
194 int reglen, devfn;
195 struct pci_dev *dev;
196
197 pr_debug("of_scan_bus(%s) bus no %d... \n",
198 node->full_name, bus->number);
199
200 /* Scan direct children */
201 for_each_child_of_node(node, child) {
202 pr_debug(" * %s\n", child->full_name);
203 reg = of_get_property(child, "reg", &reglen);
204 if (reg == NULL || reglen < 20)
205 continue;
206 devfn = (reg[0] >> 8) & 0xff;
207
208 /* create a new pci_dev for this device */
209 dev = of_create_pci_dev(child, bus, devfn);
210 if (!dev)
211 continue;
212 pr_debug(" dev header type: %x\n", dev->hdr_type);
213 }
214
215 /* Apply all fixups necessary. We don't fixup the bus "self"
216 * for an existing bridge that is being rescanned
217 */
218 if (!rescan_existing)
219 pcibios_setup_bus_self(bus);
220 pcibios_setup_bus_devices(bus);
221
222 /* Now scan child busses */
223 list_for_each_entry(dev, &bus->devices, bus_list) {
224 if (dev->hdr_type == PCI_HEADER_TYPE_BRIDGE ||
225 dev->hdr_type == PCI_HEADER_TYPE_CARDBUS) {
226 struct device_node *child = pci_device_to_OF_node(dev);
227 if (dev)
228 of_scan_pci_bridge(child, dev);
229 }
230 }
231}
232
233void __devinit of_scan_bus(struct device_node *node,
234 struct pci_bus *bus)
235{
236 __of_scan_bus(node, bus, 0);
237}
238EXPORT_SYMBOL_GPL(of_scan_bus);
239
240void __devinit of_rescan_bus(struct device_node *node,
241 struct pci_bus *bus)
242{
243 __of_scan_bus(node, bus, 1);
244}
245EXPORT_SYMBOL_GPL(of_rescan_bus);
246
247void __devinit of_scan_pci_bridge(struct device_node *node,
248 struct pci_dev *dev)
249{
250 struct pci_bus *bus;
251 const u32 *busrange, *ranges;
252 int len, i, mode;
253 struct resource *res;
254 unsigned int flags;
255 u64 size;
256
257 pr_debug("of_scan_pci_bridge(%s)\n", node->full_name);
258
259 /* parse bus-range property */
260 busrange = of_get_property(node, "bus-range", &len);
261 if (busrange == NULL || len != 8) {
262 printk(KERN_DEBUG "Can't get bus-range for PCI-PCI bridge %s\n",
263 node->full_name);
264 return;
265 }
266 ranges = of_get_property(node, "ranges", &len);
267 if (ranges == NULL) {
268 printk(KERN_DEBUG "Can't get ranges for PCI-PCI bridge %s\n",
269 node->full_name);
270 return;
271 }
272
273 bus = pci_add_new_bus(dev->bus, dev, busrange[0]);
274 if (!bus) {
275 printk(KERN_ERR "Failed to create pci bus for %s\n",
276 node->full_name);
277 return;
278 }
279
280 bus->primary = dev->bus->number;
281 bus->subordinate = busrange[1];
282 bus->bridge_ctl = 0;
283 bus->sysdata = node;
284
285 /* parse ranges property */
286 /* PCI #address-cells == 3 and #size-cells == 2 always */
287 res = &dev->resource[PCI_BRIDGE_RESOURCES];
288 for (i = 0; i < PCI_NUM_RESOURCES - PCI_BRIDGE_RESOURCES; ++i) {
289 res->flags = 0;
290 bus->resource[i] = res;
291 ++res;
292 }
293 i = 1;
294 for (; len >= 32; len -= 32, ranges += 8) {
295 flags = pci_parse_of_flags(ranges[0], 1);
296 size = of_read_number(&ranges[6], 2);
297 if (flags == 0 || size == 0)
298 continue;
299 if (flags & IORESOURCE_IO) {
300 res = bus->resource[0];
301 if (res->flags) {
302 printk(KERN_ERR "PCI: ignoring extra I/O range"
303 " for bridge %s\n", node->full_name);
304 continue;
305 }
306 } else {
307 if (i >= PCI_NUM_RESOURCES - PCI_BRIDGE_RESOURCES) {
308 printk(KERN_ERR "PCI: too many memory ranges"
309 " for bridge %s\n", node->full_name);
310 continue;
311 }
312 res = bus->resource[i];
313 ++i;
314 }
315 res->start = of_read_number(&ranges[1], 2);
316 res->end = res->start + size - 1;
317 res->flags = flags;
318 }
319 sprintf(bus->name, "PCI Bus %04x:%02x", pci_domain_nr(bus),
320 bus->number);
321 pr_debug(" bus name: %s\n", bus->name);
322
323 mode = PCI_PROBE_NORMAL;
324 if (ppc_md.pci_probe_mode)
325 mode = ppc_md.pci_probe_mode(bus);
326 pr_debug(" probe mode: %d\n", mode);
327
328 if (mode == PCI_PROBE_DEVTREE)
329 of_scan_bus(node, bus);
330 else if (mode == PCI_PROBE_NORMAL)
331 pci_scan_child_bus(bus);
332}
333EXPORT_SYMBOL(of_scan_pci_bridge);
334
335void __devinit scan_phb(struct pci_controller *hose)
336{
337 struct pci_bus *bus;
338 struct device_node *node = hose->dn;
339 int mode;
340
341 pr_debug("PCI: Scanning PHB %s\n",
342 node ? node->full_name : "<NO NAME>");
343
344 /* Create an empty bus for the toplevel */
345 bus = pci_create_bus(hose->parent, hose->first_busno, hose->ops, node);
346 if (bus == NULL) {
347 printk(KERN_ERR "Failed to create bus for PCI domain %04x\n",
348 hose->global_number);
349 return;
350 }
351 bus->secondary = hose->first_busno;
352 hose->bus = bus;
353
354 /* Get some IO space for the new PHB */
355 pcibios_map_io_space(bus);
356
357 /* Wire up PHB bus resources */
358 pcibios_setup_phb_resources(hose);
359
360 /* Get probe mode and perform scan */
361 mode = PCI_PROBE_NORMAL;
362 if (node && ppc_md.pci_probe_mode)
363 mode = ppc_md.pci_probe_mode(bus);
364 pr_debug(" probe mode: %d\n", mode);
365 if (mode == PCI_PROBE_DEVTREE) {
366 bus->subordinate = hose->last_busno;
367 of_scan_bus(node, bus);
368 }
369
370 if (mode == PCI_PROBE_NORMAL)
371 hose->last_busno = bus->subordinate = pci_scan_child_bus(bus);
372}
373
374static int __init pcibios_init(void) 46static int __init pcibios_init(void)
375{ 47{
376 struct pci_controller *hose, *tmp; 48 struct pci_controller *hose, *tmp;
@@ -392,7 +64,7 @@ static int __init pcibios_init(void)
392 64
393 /* Scan all of the recorded PCI controllers. */ 65 /* Scan all of the recorded PCI controllers. */
394 list_for_each_entry_safe(hose, tmp, &hose_list, list_node) { 66 list_for_each_entry_safe(hose, tmp, &hose_list, list_node) {
395 scan_phb(hose); 67 pcibios_scan_phb(hose, hose->dn);
396 pci_bus_add_devices(hose->bus); 68 pci_bus_add_devices(hose->bus);
397 } 69 }
398 70
@@ -526,6 +198,11 @@ int __devinit pcibios_map_io_space(struct pci_bus *bus)
526} 198}
527EXPORT_SYMBOL_GPL(pcibios_map_io_space); 199EXPORT_SYMBOL_GPL(pcibios_map_io_space);
528 200
201void __devinit pcibios_setup_phb_io_space(struct pci_controller *hose)
202{
203 pcibios_map_io_space(hose->bus);
204}
205
529#define IOBASE_BRIDGE_NUMBER 0 206#define IOBASE_BRIDGE_NUMBER 0
530#define IOBASE_MEMORY 1 207#define IOBASE_MEMORY 1
531#define IOBASE_IO 2 208#define IOBASE_IO 2
diff --git a/arch/powerpc/kernel/pci_of_scan.c b/arch/powerpc/kernel/pci_of_scan.c
new file mode 100644
index 000000000000..7311fdfb9bf8
--- /dev/null
+++ b/arch/powerpc/kernel/pci_of_scan.c
@@ -0,0 +1,359 @@
1/*
2 * Helper routines to scan the device tree for PCI devices and busses
3 *
4 * Migrated out of PowerPC architecture pci_64.c file by Grant Likely
5 * <grant.likely@secretlab.ca> so that these routines are available for
6 * 32 bit also.
7 *
8 * Copyright (C) 2003 Anton Blanchard <anton@au.ibm.com>, IBM
9 * Rework, based on alpha PCI code.
10 * Copyright (c) 2009 Secret Lab Technologies Ltd.
11 *
12 * This program is free software; you can redistribute it and/or
13 * modify it under the terms of the GNU General Public License
14 * version 2 as published by the Free Software Foundation.
15 */
16
17#include <linux/pci.h>
18#include <asm/pci-bridge.h>
19#include <asm/prom.h>
20
21/**
22 * get_int_prop - Decode a u32 from a device tree property
23 */
24static u32 get_int_prop(struct device_node *np, const char *name, u32 def)
25{
26 const u32 *prop;
27 int len;
28
29 prop = of_get_property(np, name, &len);
30 if (prop && len >= 4)
31 return *prop;
32 return def;
33}
34
35/**
36 * pci_parse_of_flags - Parse the flags cell of a device tree PCI address
37 * @addr0: value of 1st cell of a device tree PCI address.
38 * @bridge: Set this flag if the address is from a bridge 'ranges' property
39 */
40unsigned int pci_parse_of_flags(u32 addr0, int bridge)
41{
42 unsigned int flags = 0;
43
44 if (addr0 & 0x02000000) {
45 flags = IORESOURCE_MEM | PCI_BASE_ADDRESS_SPACE_MEMORY;
46 flags |= (addr0 >> 22) & PCI_BASE_ADDRESS_MEM_TYPE_64;
47 flags |= (addr0 >> 28) & PCI_BASE_ADDRESS_MEM_TYPE_1M;
48 if (addr0 & 0x40000000)
49 flags |= IORESOURCE_PREFETCH
50 | PCI_BASE_ADDRESS_MEM_PREFETCH;
51 /* Note: We don't know whether the ROM has been left enabled
52 * by the firmware or not. We mark it as disabled (ie, we do
53 * not set the IORESOURCE_ROM_ENABLE flag) for now rather than
54 * do a config space read, it will be force-enabled if needed
55 */
56 if (!bridge && (addr0 & 0xff) == 0x30)
57 flags |= IORESOURCE_READONLY;
58 } else if (addr0 & 0x01000000)
59 flags = IORESOURCE_IO | PCI_BASE_ADDRESS_SPACE_IO;
60 if (flags)
61 flags |= IORESOURCE_SIZEALIGN;
62 return flags;
63}
64
65/**
66 * of_pci_parse_addrs - Parse PCI addresses assigned in the device tree node
67 * @node: device tree node for the PCI device
68 * @dev: pci_dev structure for the device
69 *
70 * This function parses the 'assigned-addresses' property of a PCI devices'
71 * device tree node and writes them into the associated pci_dev structure.
72 */
73static void of_pci_parse_addrs(struct device_node *node, struct pci_dev *dev)
74{
75 u64 base, size;
76 unsigned int flags;
77 struct resource *res;
78 const u32 *addrs;
79 u32 i;
80 int proplen;
81
82 addrs = of_get_property(node, "assigned-addresses", &proplen);
83 if (!addrs)
84 return;
85 pr_debug(" parse addresses (%d bytes) @ %p\n", proplen, addrs);
86 for (; proplen >= 20; proplen -= 20, addrs += 5) {
87 flags = pci_parse_of_flags(addrs[0], 0);
88 if (!flags)
89 continue;
90 base = of_read_number(&addrs[1], 2);
91 size = of_read_number(&addrs[3], 2);
92 if (!size)
93 continue;
94 i = addrs[0] & 0xff;
95 pr_debug(" base: %llx, size: %llx, i: %x\n",
96 (unsigned long long)base,
97 (unsigned long long)size, i);
98
99 if (PCI_BASE_ADDRESS_0 <= i && i <= PCI_BASE_ADDRESS_5) {
100 res = &dev->resource[(i - PCI_BASE_ADDRESS_0) >> 2];
101 } else if (i == dev->rom_base_reg) {
102 res = &dev->resource[PCI_ROM_RESOURCE];
103 flags |= IORESOURCE_READONLY | IORESOURCE_CACHEABLE;
104 } else {
105 printk(KERN_ERR "PCI: bad cfg reg num 0x%x\n", i);
106 continue;
107 }
108 res->start = base;
109 res->end = base + size - 1;
110 res->flags = flags;
111 res->name = pci_name(dev);
112 }
113}
114
115/**
116 * of_create_pci_dev - Given a device tree node on a pci bus, create a pci_dev
117 * @node: device tree node pointer
118 * @bus: bus the device is sitting on
119 * @devfn: PCI function number, extracted from device tree by caller.
120 */
121struct pci_dev *of_create_pci_dev(struct device_node *node,
122 struct pci_bus *bus, int devfn)
123{
124 struct pci_dev *dev;
125 const char *type;
126
127 dev = alloc_pci_dev();
128 if (!dev)
129 return NULL;
130 type = of_get_property(node, "device_type", NULL);
131 if (type == NULL)
132 type = "";
133
134 pr_debug(" create device, devfn: %x, type: %s\n", devfn, type);
135
136 dev->bus = bus;
137 dev->sysdata = node;
138 dev->dev.parent = bus->bridge;
139 dev->dev.bus = &pci_bus_type;
140 dev->devfn = devfn;
141 dev->multifunction = 0; /* maybe a lie? */
142 dev->needs_freset = 0; /* pcie fundamental reset required */
143
144 dev->vendor = get_int_prop(node, "vendor-id", 0xffff);
145 dev->device = get_int_prop(node, "device-id", 0xffff);
146 dev->subsystem_vendor = get_int_prop(node, "subsystem-vendor-id", 0);
147 dev->subsystem_device = get_int_prop(node, "subsystem-id", 0);
148
149 dev->cfg_size = pci_cfg_space_size(dev);
150
151 dev_set_name(&dev->dev, "%04x:%02x:%02x.%d", pci_domain_nr(bus),
152 dev->bus->number, PCI_SLOT(devfn), PCI_FUNC(devfn));
153 dev->class = get_int_prop(node, "class-code", 0);
154 dev->revision = get_int_prop(node, "revision-id", 0);
155
156 pr_debug(" class: 0x%x\n", dev->class);
157 pr_debug(" revision: 0x%x\n", dev->revision);
158
159 dev->current_state = 4; /* unknown power state */
160 dev->error_state = pci_channel_io_normal;
161 dev->dma_mask = 0xffffffff;
162
163 if (!strcmp(type, "pci") || !strcmp(type, "pciex")) {
164 /* a PCI-PCI bridge */
165 dev->hdr_type = PCI_HEADER_TYPE_BRIDGE;
166 dev->rom_base_reg = PCI_ROM_ADDRESS1;
167 } else if (!strcmp(type, "cardbus")) {
168 dev->hdr_type = PCI_HEADER_TYPE_CARDBUS;
169 } else {
170 dev->hdr_type = PCI_HEADER_TYPE_NORMAL;
171 dev->rom_base_reg = PCI_ROM_ADDRESS;
172 /* Maybe do a default OF mapping here */
173 dev->irq = NO_IRQ;
174 }
175
176 of_pci_parse_addrs(node, dev);
177
178 pr_debug(" adding to system ...\n");
179
180 pci_device_add(dev, bus);
181
182 return dev;
183}
184EXPORT_SYMBOL(of_create_pci_dev);
185
186/**
187 * of_scan_pci_bridge - Set up a PCI bridge and scan for child nodes
188 * @node: device tree node of bridge
189 * @dev: pci_dev structure for the bridge
190 *
191 * of_scan_bus() calls this routine for each PCI bridge that it finds, and
192 * this routine in turn call of_scan_bus() recusively to scan for more child
193 * devices.
194 */
195void __devinit of_scan_pci_bridge(struct device_node *node,
196 struct pci_dev *dev)
197{
198 struct pci_bus *bus;
199 const u32 *busrange, *ranges;
200 int len, i, mode;
201 struct resource *res;
202 unsigned int flags;
203 u64 size;
204
205 pr_debug("of_scan_pci_bridge(%s)\n", node->full_name);
206
207 /* parse bus-range property */
208 busrange = of_get_property(node, "bus-range", &len);
209 if (busrange == NULL || len != 8) {
210 printk(KERN_DEBUG "Can't get bus-range for PCI-PCI bridge %s\n",
211 node->full_name);
212 return;
213 }
214 ranges = of_get_property(node, "ranges", &len);
215 if (ranges == NULL) {
216 printk(KERN_DEBUG "Can't get ranges for PCI-PCI bridge %s\n",
217 node->full_name);
218 return;
219 }
220
221 bus = pci_add_new_bus(dev->bus, dev, busrange[0]);
222 if (!bus) {
223 printk(KERN_ERR "Failed to create pci bus for %s\n",
224 node->full_name);
225 return;
226 }
227
228 bus->primary = dev->bus->number;
229 bus->subordinate = busrange[1];
230 bus->bridge_ctl = 0;
231 bus->sysdata = node;
232
233 /* parse ranges property */
234 /* PCI #address-cells == 3 and #size-cells == 2 always */
235 res = &dev->resource[PCI_BRIDGE_RESOURCES];
236 for (i = 0; i < PCI_NUM_RESOURCES - PCI_BRIDGE_RESOURCES; ++i) {
237 res->flags = 0;
238 bus->resource[i] = res;
239 ++res;
240 }
241 i = 1;
242 for (; len >= 32; len -= 32, ranges += 8) {
243 flags = pci_parse_of_flags(ranges[0], 1);
244 size = of_read_number(&ranges[6], 2);
245 if (flags == 0 || size == 0)
246 continue;
247 if (flags & IORESOURCE_IO) {
248 res = bus->resource[0];
249 if (res->flags) {
250 printk(KERN_ERR "PCI: ignoring extra I/O range"
251 " for bridge %s\n", node->full_name);
252 continue;
253 }
254 } else {
255 if (i >= PCI_NUM_RESOURCES - PCI_BRIDGE_RESOURCES) {
256 printk(KERN_ERR "PCI: too many memory ranges"
257 " for bridge %s\n", node->full_name);
258 continue;
259 }
260 res = bus->resource[i];
261 ++i;
262 }
263 res->start = of_read_number(&ranges[1], 2);
264 res->end = res->start + size - 1;
265 res->flags = flags;
266 }
267 sprintf(bus->name, "PCI Bus %04x:%02x", pci_domain_nr(bus),
268 bus->number);
269 pr_debug(" bus name: %s\n", bus->name);
270
271 mode = PCI_PROBE_NORMAL;
272 if (ppc_md.pci_probe_mode)
273 mode = ppc_md.pci_probe_mode(bus);
274 pr_debug(" probe mode: %d\n", mode);
275
276 if (mode == PCI_PROBE_DEVTREE)
277 of_scan_bus(node, bus);
278 else if (mode == PCI_PROBE_NORMAL)
279 pci_scan_child_bus(bus);
280}
281EXPORT_SYMBOL(of_scan_pci_bridge);
282
283/**
284 * __of_scan_bus - given a PCI bus node, setup bus and scan for child devices
285 * @node: device tree node for the PCI bus
286 * @bus: pci_bus structure for the PCI bus
287 * @rescan_existing: Flag indicating bus has already been set up
288 */
289static void __devinit __of_scan_bus(struct device_node *node,
290 struct pci_bus *bus, int rescan_existing)
291{
292 struct device_node *child;
293 const u32 *reg;
294 int reglen, devfn;
295 struct pci_dev *dev;
296
297 pr_debug("of_scan_bus(%s) bus no %d... \n",
298 node->full_name, bus->number);
299
300 /* Scan direct children */
301 for_each_child_of_node(node, child) {
302 pr_debug(" * %s\n", child->full_name);
303 reg = of_get_property(child, "reg", &reglen);
304 if (reg == NULL || reglen < 20)
305 continue;
306 devfn = (reg[0] >> 8) & 0xff;
307
308 /* create a new pci_dev for this device */
309 dev = of_create_pci_dev(child, bus, devfn);
310 if (!dev)
311 continue;
312 pr_debug(" dev header type: %x\n", dev->hdr_type);
313 }
314
315 /* Apply all fixups necessary. We don't fixup the bus "self"
316 * for an existing bridge that is being rescanned
317 */
318 if (!rescan_existing)
319 pcibios_setup_bus_self(bus);
320 pcibios_setup_bus_devices(bus);
321
322 /* Now scan child busses */
323 list_for_each_entry(dev, &bus->devices, bus_list) {
324 if (dev->hdr_type == PCI_HEADER_TYPE_BRIDGE ||
325 dev->hdr_type == PCI_HEADER_TYPE_CARDBUS) {
326 struct device_node *child = pci_device_to_OF_node(dev);
327 if (dev)
328 of_scan_pci_bridge(child, dev);
329 }
330 }
331}
332
333/**
334 * of_scan_bus - given a PCI bus node, setup bus and scan for child devices
335 * @node: device tree node for the PCI bus
336 * @bus: pci_bus structure for the PCI bus
337 */
338void __devinit of_scan_bus(struct device_node *node,
339 struct pci_bus *bus)
340{
341 __of_scan_bus(node, bus, 0);
342}
343EXPORT_SYMBOL_GPL(of_scan_bus);
344
345/**
346 * of_rescan_bus - given a PCI bus node, scan for child devices
347 * @node: device tree node for the PCI bus
348 * @bus: pci_bus structure for the PCI bus
349 *
350 * Same as of_scan_bus, but for a pci_bus structure that has already been
351 * setup.
352 */
353void __devinit of_rescan_bus(struct device_node *node,
354 struct pci_bus *bus)
355{
356 __of_scan_bus(node, bus, 1);
357}
358EXPORT_SYMBOL_GPL(of_rescan_bus);
359
diff --git a/arch/powerpc/kernel/perf_counter.c b/arch/powerpc/kernel/perf_counter.c
index 70e1f57f7dd8..7ceefaf3a7f5 100644
--- a/arch/powerpc/kernel/perf_counter.c
+++ b/arch/powerpc/kernel/perf_counter.c
@@ -32,6 +32,9 @@ struct cpu_hw_counters {
32 unsigned long mmcr[3]; 32 unsigned long mmcr[3];
33 struct perf_counter *limited_counter[MAX_LIMITED_HWCOUNTERS]; 33 struct perf_counter *limited_counter[MAX_LIMITED_HWCOUNTERS];
34 u8 limited_hwidx[MAX_LIMITED_HWCOUNTERS]; 34 u8 limited_hwidx[MAX_LIMITED_HWCOUNTERS];
35 u64 alternatives[MAX_HWCOUNTERS][MAX_EVENT_ALTERNATIVES];
36 unsigned long amasks[MAX_HWCOUNTERS][MAX_EVENT_ALTERNATIVES];
37 unsigned long avalues[MAX_HWCOUNTERS][MAX_EVENT_ALTERNATIVES];
35}; 38};
36DEFINE_PER_CPU(struct cpu_hw_counters, cpu_hw_counters); 39DEFINE_PER_CPU(struct cpu_hw_counters, cpu_hw_counters);
37 40
@@ -62,7 +65,6 @@ static inline unsigned long perf_ip_adjust(struct pt_regs *regs)
62{ 65{
63 return 0; 66 return 0;
64} 67}
65static inline void perf_set_pmu_inuse(int inuse) { }
66static inline void perf_get_data_addr(struct pt_regs *regs, u64 *addrp) { } 68static inline void perf_get_data_addr(struct pt_regs *regs, u64 *addrp) { }
67static inline u32 perf_get_misc_flags(struct pt_regs *regs) 69static inline u32 perf_get_misc_flags(struct pt_regs *regs)
68{ 70{
@@ -93,11 +95,6 @@ static inline unsigned long perf_ip_adjust(struct pt_regs *regs)
93 return 0; 95 return 0;
94} 96}
95 97
96static inline void perf_set_pmu_inuse(int inuse)
97{
98 get_lppaca()->pmcregs_in_use = inuse;
99}
100
101/* 98/*
102 * The user wants a data address recorded. 99 * The user wants a data address recorded.
103 * If we're not doing instruction sampling, give them the SDAR 100 * If we're not doing instruction sampling, give them the SDAR
@@ -245,13 +242,11 @@ static void write_pmc(int idx, unsigned long val)
245 * and see if any combination of alternative codes is feasible. 242 * and see if any combination of alternative codes is feasible.
246 * The feasible set is returned in event[]. 243 * The feasible set is returned in event[].
247 */ 244 */
248static int power_check_constraints(u64 event[], unsigned int cflags[], 245static int power_check_constraints(struct cpu_hw_counters *cpuhw,
246 u64 event[], unsigned int cflags[],
249 int n_ev) 247 int n_ev)
250{ 248{
251 unsigned long mask, value, nv; 249 unsigned long mask, value, nv;
252 u64 alternatives[MAX_HWCOUNTERS][MAX_EVENT_ALTERNATIVES];
253 unsigned long amasks[MAX_HWCOUNTERS][MAX_EVENT_ALTERNATIVES];
254 unsigned long avalues[MAX_HWCOUNTERS][MAX_EVENT_ALTERNATIVES];
255 unsigned long smasks[MAX_HWCOUNTERS], svalues[MAX_HWCOUNTERS]; 250 unsigned long smasks[MAX_HWCOUNTERS], svalues[MAX_HWCOUNTERS];
256 int n_alt[MAX_HWCOUNTERS], choice[MAX_HWCOUNTERS]; 251 int n_alt[MAX_HWCOUNTERS], choice[MAX_HWCOUNTERS];
257 int i, j; 252 int i, j;
@@ -266,21 +261,23 @@ static int power_check_constraints(u64 event[], unsigned int cflags[],
266 if ((cflags[i] & PPMU_LIMITED_PMC_REQD) 261 if ((cflags[i] & PPMU_LIMITED_PMC_REQD)
267 && !ppmu->limited_pmc_event(event[i])) { 262 && !ppmu->limited_pmc_event(event[i])) {
268 ppmu->get_alternatives(event[i], cflags[i], 263 ppmu->get_alternatives(event[i], cflags[i],
269 alternatives[i]); 264 cpuhw->alternatives[i]);
270 event[i] = alternatives[i][0]; 265 event[i] = cpuhw->alternatives[i][0];
271 } 266 }
272 if (ppmu->get_constraint(event[i], &amasks[i][0], 267 if (ppmu->get_constraint(event[i], &cpuhw->amasks[i][0],
273 &avalues[i][0])) 268 &cpuhw->avalues[i][0]))
274 return -1; 269 return -1;
275 } 270 }
276 value = mask = 0; 271 value = mask = 0;
277 for (i = 0; i < n_ev; ++i) { 272 for (i = 0; i < n_ev; ++i) {
278 nv = (value | avalues[i][0]) + (value & avalues[i][0] & addf); 273 nv = (value | cpuhw->avalues[i][0]) +
274 (value & cpuhw->avalues[i][0] & addf);
279 if ((((nv + tadd) ^ value) & mask) != 0 || 275 if ((((nv + tadd) ^ value) & mask) != 0 ||
280 (((nv + tadd) ^ avalues[i][0]) & amasks[i][0]) != 0) 276 (((nv + tadd) ^ cpuhw->avalues[i][0]) &
277 cpuhw->amasks[i][0]) != 0)
281 break; 278 break;
282 value = nv; 279 value = nv;
283 mask |= amasks[i][0]; 280 mask |= cpuhw->amasks[i][0];
284 } 281 }
285 if (i == n_ev) 282 if (i == n_ev)
286 return 0; /* all OK */ 283 return 0; /* all OK */
@@ -291,10 +288,11 @@ static int power_check_constraints(u64 event[], unsigned int cflags[],
291 for (i = 0; i < n_ev; ++i) { 288 for (i = 0; i < n_ev; ++i) {
292 choice[i] = 0; 289 choice[i] = 0;
293 n_alt[i] = ppmu->get_alternatives(event[i], cflags[i], 290 n_alt[i] = ppmu->get_alternatives(event[i], cflags[i],
294 alternatives[i]); 291 cpuhw->alternatives[i]);
295 for (j = 1; j < n_alt[i]; ++j) 292 for (j = 1; j < n_alt[i]; ++j)
296 ppmu->get_constraint(alternatives[i][j], 293 ppmu->get_constraint(cpuhw->alternatives[i][j],
297 &amasks[i][j], &avalues[i][j]); 294 &cpuhw->amasks[i][j],
295 &cpuhw->avalues[i][j]);
298 } 296 }
299 297
300 /* enumerate all possibilities and see if any will work */ 298 /* enumerate all possibilities and see if any will work */
@@ -313,11 +311,11 @@ static int power_check_constraints(u64 event[], unsigned int cflags[],
313 * where k > j, will satisfy the constraints. 311 * where k > j, will satisfy the constraints.
314 */ 312 */
315 while (++j < n_alt[i]) { 313 while (++j < n_alt[i]) {
316 nv = (value | avalues[i][j]) + 314 nv = (value | cpuhw->avalues[i][j]) +
317 (value & avalues[i][j] & addf); 315 (value & cpuhw->avalues[i][j] & addf);
318 if ((((nv + tadd) ^ value) & mask) == 0 && 316 if ((((nv + tadd) ^ value) & mask) == 0 &&
319 (((nv + tadd) ^ avalues[i][j]) 317 (((nv + tadd) ^ cpuhw->avalues[i][j])
320 & amasks[i][j]) == 0) 318 & cpuhw->amasks[i][j]) == 0)
321 break; 319 break;
322 } 320 }
323 if (j >= n_alt[i]) { 321 if (j >= n_alt[i]) {
@@ -339,7 +337,7 @@ static int power_check_constraints(u64 event[], unsigned int cflags[],
339 svalues[i] = value; 337 svalues[i] = value;
340 smasks[i] = mask; 338 smasks[i] = mask;
341 value = nv; 339 value = nv;
342 mask |= amasks[i][j]; 340 mask |= cpuhw->amasks[i][j];
343 ++i; 341 ++i;
344 j = -1; 342 j = -1;
345 } 343 }
@@ -347,7 +345,7 @@ static int power_check_constraints(u64 event[], unsigned int cflags[],
347 345
348 /* OK, we have a feasible combination, tell the caller the solution */ 346 /* OK, we have a feasible combination, tell the caller the solution */
349 for (i = 0; i < n_ev; ++i) 347 for (i = 0; i < n_ev; ++i)
350 event[i] = alternatives[i][choice[i]]; 348 event[i] = cpuhw->alternatives[i][choice[i]];
351 return 0; 349 return 0;
352} 350}
353 351
@@ -531,8 +529,7 @@ void hw_perf_disable(void)
531 * Check if we ever enabled the PMU on this cpu. 529 * Check if we ever enabled the PMU on this cpu.
532 */ 530 */
533 if (!cpuhw->pmcs_enabled) { 531 if (!cpuhw->pmcs_enabled) {
534 if (ppc_md.enable_pmcs) 532 ppc_enable_pmcs();
535 ppc_md.enable_pmcs();
536 cpuhw->pmcs_enabled = 1; 533 cpuhw->pmcs_enabled = 1;
537 } 534 }
538 535
@@ -594,7 +591,7 @@ void hw_perf_enable(void)
594 mtspr(SPRN_MMCRA, cpuhw->mmcr[2] & ~MMCRA_SAMPLE_ENABLE); 591 mtspr(SPRN_MMCRA, cpuhw->mmcr[2] & ~MMCRA_SAMPLE_ENABLE);
595 mtspr(SPRN_MMCR1, cpuhw->mmcr[1]); 592 mtspr(SPRN_MMCR1, cpuhw->mmcr[1]);
596 if (cpuhw->n_counters == 0) 593 if (cpuhw->n_counters == 0)
597 perf_set_pmu_inuse(0); 594 ppc_set_pmu_inuse(0);
598 goto out_enable; 595 goto out_enable;
599 } 596 }
600 597
@@ -627,7 +624,7 @@ void hw_perf_enable(void)
627 * bit set and set the hardware counters to their initial values. 624 * bit set and set the hardware counters to their initial values.
628 * Then unfreeze the counters. 625 * Then unfreeze the counters.
629 */ 626 */
630 perf_set_pmu_inuse(1); 627 ppc_set_pmu_inuse(1);
631 mtspr(SPRN_MMCRA, cpuhw->mmcr[2] & ~MMCRA_SAMPLE_ENABLE); 628 mtspr(SPRN_MMCRA, cpuhw->mmcr[2] & ~MMCRA_SAMPLE_ENABLE);
632 mtspr(SPRN_MMCR1, cpuhw->mmcr[1]); 629 mtspr(SPRN_MMCR1, cpuhw->mmcr[1]);
633 mtspr(SPRN_MMCR0, (cpuhw->mmcr[0] & ~(MMCR0_PMC1CE | MMCR0_PMCjCE)) 630 mtspr(SPRN_MMCR0, (cpuhw->mmcr[0] & ~(MMCR0_PMC1CE | MMCR0_PMCjCE))
@@ -752,7 +749,7 @@ int hw_perf_group_sched_in(struct perf_counter *group_leader,
752 return -EAGAIN; 749 return -EAGAIN;
753 if (check_excludes(cpuhw->counter, cpuhw->flags, n0, n)) 750 if (check_excludes(cpuhw->counter, cpuhw->flags, n0, n))
754 return -EAGAIN; 751 return -EAGAIN;
755 i = power_check_constraints(cpuhw->events, cpuhw->flags, n + n0); 752 i = power_check_constraints(cpuhw, cpuhw->events, cpuhw->flags, n + n0);
756 if (i < 0) 753 if (i < 0)
757 return -EAGAIN; 754 return -EAGAIN;
758 cpuhw->n_counters = n0 + n; 755 cpuhw->n_counters = n0 + n;
@@ -807,7 +804,7 @@ static int power_pmu_enable(struct perf_counter *counter)
807 cpuhw->flags[n0] = counter->hw.counter_base; 804 cpuhw->flags[n0] = counter->hw.counter_base;
808 if (check_excludes(cpuhw->counter, cpuhw->flags, n0, 1)) 805 if (check_excludes(cpuhw->counter, cpuhw->flags, n0, 1))
809 goto out; 806 goto out;
810 if (power_check_constraints(cpuhw->events, cpuhw->flags, n0 + 1)) 807 if (power_check_constraints(cpuhw, cpuhw->events, cpuhw->flags, n0 + 1))
811 goto out; 808 goto out;
812 809
813 counter->hw.config = cpuhw->events[n0]; 810 counter->hw.config = cpuhw->events[n0];
@@ -1012,6 +1009,7 @@ const struct pmu *hw_perf_counter_init(struct perf_counter *counter)
1012 unsigned int cflags[MAX_HWCOUNTERS]; 1009 unsigned int cflags[MAX_HWCOUNTERS];
1013 int n; 1010 int n;
1014 int err; 1011 int err;
1012 struct cpu_hw_counters *cpuhw;
1015 1013
1016 if (!ppmu) 1014 if (!ppmu)
1017 return ERR_PTR(-ENXIO); 1015 return ERR_PTR(-ENXIO);
@@ -1090,7 +1088,11 @@ const struct pmu *hw_perf_counter_init(struct perf_counter *counter)
1090 cflags[n] = flags; 1088 cflags[n] = flags;
1091 if (check_excludes(ctrs, cflags, n, 1)) 1089 if (check_excludes(ctrs, cflags, n, 1))
1092 return ERR_PTR(-EINVAL); 1090 return ERR_PTR(-EINVAL);
1093 if (power_check_constraints(events, cflags, n + 1)) 1091
1092 cpuhw = &get_cpu_var(cpu_hw_counters);
1093 err = power_check_constraints(cpuhw, events, cflags, n + 1);
1094 put_cpu_var(cpu_hw_counters);
1095 if (err)
1094 return ERR_PTR(-EINVAL); 1096 return ERR_PTR(-EINVAL);
1095 1097
1096 counter->hw.config = events[n]; 1098 counter->hw.config = events[n];
diff --git a/arch/powerpc/kernel/process.c b/arch/powerpc/kernel/process.c
index 892a9f2e6d76..0a3216433051 100644
--- a/arch/powerpc/kernel/process.c
+++ b/arch/powerpc/kernel/process.c
@@ -284,14 +284,13 @@ int set_dabr(unsigned long dabr)
284 return ppc_md.set_dabr(dabr); 284 return ppc_md.set_dabr(dabr);
285 285
286 /* XXX should we have a CPU_FTR_HAS_DABR ? */ 286 /* XXX should we have a CPU_FTR_HAS_DABR ? */
287#if defined(CONFIG_PPC64) || defined(CONFIG_6xx)
288 mtspr(SPRN_DABR, dabr);
289#endif
290
291#if defined(CONFIG_BOOKE) 287#if defined(CONFIG_BOOKE)
292 mtspr(SPRN_DAC1, dabr); 288 mtspr(SPRN_DAC1, dabr);
289#elif defined(CONFIG_PPC_BOOK3S)
290 mtspr(SPRN_DABR, dabr);
293#endif 291#endif
294 292
293
295 return 0; 294 return 0;
296} 295}
297 296
@@ -372,15 +371,16 @@ struct task_struct *__switch_to(struct task_struct *prev,
372 371
373#endif /* CONFIG_SMP */ 372#endif /* CONFIG_SMP */
374 373
375 if (unlikely(__get_cpu_var(current_dabr) != new->thread.dabr))
376 set_dabr(new->thread.dabr);
377
378#if defined(CONFIG_BOOKE) 374#if defined(CONFIG_BOOKE)
379 /* If new thread DAC (HW breakpoint) is the same then leave it */ 375 /* If new thread DAC (HW breakpoint) is the same then leave it */
380 if (new->thread.dabr) 376 if (new->thread.dabr)
381 set_dabr(new->thread.dabr); 377 set_dabr(new->thread.dabr);
378#else
379 if (unlikely(__get_cpu_var(current_dabr) != new->thread.dabr))
380 set_dabr(new->thread.dabr);
382#endif 381#endif
383 382
383
384 new_thread = &new->thread; 384 new_thread = &new->thread;
385 old_thread = &current->thread; 385 old_thread = &current->thread;
386 386
@@ -664,6 +664,7 @@ int copy_thread(unsigned long clone_flags, unsigned long usp,
664 sp_vsid |= SLB_VSID_KERNEL | llp; 664 sp_vsid |= SLB_VSID_KERNEL | llp;
665 p->thread.ksp_vsid = sp_vsid; 665 p->thread.ksp_vsid = sp_vsid;
666 } 666 }
667#endif /* CONFIG_PPC_STD_MMU_64 */
667 668
668 /* 669 /*
669 * The PPC64 ABI makes use of a TOC to contain function 670 * The PPC64 ABI makes use of a TOC to contain function
@@ -671,6 +672,7 @@ int copy_thread(unsigned long clone_flags, unsigned long usp,
671 * to the TOC entry. The first entry is a pointer to the actual 672 * to the TOC entry. The first entry is a pointer to the actual
672 * function. 673 * function.
673 */ 674 */
675#ifdef CONFIG_PPC64
674 kregs->nip = *((unsigned long *)ret_from_fork); 676 kregs->nip = *((unsigned long *)ret_from_fork);
675#else 677#else
676 kregs->nip = (unsigned long)ret_from_fork; 678 kregs->nip = (unsigned long)ret_from_fork;
diff --git a/arch/powerpc/kernel/prom_init.c b/arch/powerpc/kernel/prom_init.c
index a538824616fd..864334b337a3 100644
--- a/arch/powerpc/kernel/prom_init.c
+++ b/arch/powerpc/kernel/prom_init.c
@@ -190,6 +190,8 @@ static int __initdata of_platform;
190 190
191static char __initdata prom_cmd_line[COMMAND_LINE_SIZE]; 191static char __initdata prom_cmd_line[COMMAND_LINE_SIZE];
192 192
193static unsigned long __initdata prom_memory_limit;
194
193static unsigned long __initdata alloc_top; 195static unsigned long __initdata alloc_top;
194static unsigned long __initdata alloc_top_high; 196static unsigned long __initdata alloc_top_high;
195static unsigned long __initdata alloc_bottom; 197static unsigned long __initdata alloc_bottom;
@@ -484,6 +486,67 @@ static int __init prom_setprop(phandle node, const char *nodename,
484 return call_prom("interpret", 1, 1, (u32)(unsigned long) cmd); 486 return call_prom("interpret", 1, 1, (u32)(unsigned long) cmd);
485} 487}
486 488
489/* We can't use the standard versions because of RELOC headaches. */
490#define isxdigit(c) (('0' <= (c) && (c) <= '9') \
491 || ('a' <= (c) && (c) <= 'f') \
492 || ('A' <= (c) && (c) <= 'F'))
493
494#define isdigit(c) ('0' <= (c) && (c) <= '9')
495#define islower(c) ('a' <= (c) && (c) <= 'z')
496#define toupper(c) (islower(c) ? ((c) - 'a' + 'A') : (c))
497
498unsigned long prom_strtoul(const char *cp, const char **endp)
499{
500 unsigned long result = 0, base = 10, value;
501
502 if (*cp == '0') {
503 base = 8;
504 cp++;
505 if (toupper(*cp) == 'X') {
506 cp++;
507 base = 16;
508 }
509 }
510
511 while (isxdigit(*cp) &&
512 (value = isdigit(*cp) ? *cp - '0' : toupper(*cp) - 'A' + 10) < base) {
513 result = result * base + value;
514 cp++;
515 }
516
517 if (endp)
518 *endp = cp;
519
520 return result;
521}
522
523unsigned long prom_memparse(const char *ptr, const char **retptr)
524{
525 unsigned long ret = prom_strtoul(ptr, retptr);
526 int shift = 0;
527
528 /*
529 * We can't use a switch here because GCC *may* generate a
530 * jump table which won't work, because we're not running at
531 * the address we're linked at.
532 */
533 if ('G' == **retptr || 'g' == **retptr)
534 shift = 30;
535
536 if ('M' == **retptr || 'm' == **retptr)
537 shift = 20;
538
539 if ('K' == **retptr || 'k' == **retptr)
540 shift = 10;
541
542 if (shift) {
543 ret <<= shift;
544 (*retptr)++;
545 }
546
547 return ret;
548}
549
487/* 550/*
488 * Early parsing of the command line passed to the kernel, used for 551 * Early parsing of the command line passed to the kernel, used for
489 * "mem=x" and the options that affect the iommu 552 * "mem=x" and the options that affect the iommu
@@ -491,9 +554,8 @@ static int __init prom_setprop(phandle node, const char *nodename,
491static void __init early_cmdline_parse(void) 554static void __init early_cmdline_parse(void)
492{ 555{
493 struct prom_t *_prom = &RELOC(prom); 556 struct prom_t *_prom = &RELOC(prom);
494#ifdef CONFIG_PPC64
495 const char *opt; 557 const char *opt;
496#endif 558
497 char *p; 559 char *p;
498 int l = 0; 560 int l = 0;
499 561
@@ -521,6 +583,15 @@ static void __init early_cmdline_parse(void)
521 RELOC(prom_iommu_force_on) = 1; 583 RELOC(prom_iommu_force_on) = 1;
522 } 584 }
523#endif 585#endif
586 opt = strstr(RELOC(prom_cmd_line), RELOC("mem="));
587 if (opt) {
588 opt += 4;
589 RELOC(prom_memory_limit) = prom_memparse(opt, (const char **)&opt);
590#ifdef CONFIG_PPC64
591 /* Align to 16 MB == size of ppc64 large page */
592 RELOC(prom_memory_limit) = ALIGN(RELOC(prom_memory_limit), 0x1000000);
593#endif
594 }
524} 595}
525 596
526#ifdef CONFIG_PPC_PSERIES 597#ifdef CONFIG_PPC_PSERIES
@@ -1027,6 +1098,29 @@ static void __init prom_init_mem(void)
1027 } 1098 }
1028 1099
1029 /* 1100 /*
1101 * If prom_memory_limit is set we reduce the upper limits *except* for
1102 * alloc_top_high. This must be the real top of RAM so we can put
1103 * TCE's up there.
1104 */
1105
1106 RELOC(alloc_top_high) = RELOC(ram_top);
1107
1108 if (RELOC(prom_memory_limit)) {
1109 if (RELOC(prom_memory_limit) <= RELOC(alloc_bottom)) {
1110 prom_printf("Ignoring mem=%x <= alloc_bottom.\n",
1111 RELOC(prom_memory_limit));
1112 RELOC(prom_memory_limit) = 0;
1113 } else if (RELOC(prom_memory_limit) >= RELOC(ram_top)) {
1114 prom_printf("Ignoring mem=%x >= ram_top.\n",
1115 RELOC(prom_memory_limit));
1116 RELOC(prom_memory_limit) = 0;
1117 } else {
1118 RELOC(ram_top) = RELOC(prom_memory_limit);
1119 RELOC(rmo_top) = min(RELOC(rmo_top), RELOC(prom_memory_limit));
1120 }
1121 }
1122
1123 /*
1030 * Setup our top alloc point, that is top of RMO or top of 1124 * Setup our top alloc point, that is top of RMO or top of
1031 * segment 0 when running non-LPAR. 1125 * segment 0 when running non-LPAR.
1032 * Some RS64 machines have buggy firmware where claims up at 1126 * Some RS64 machines have buggy firmware where claims up at
@@ -1041,6 +1135,7 @@ static void __init prom_init_mem(void)
1041 RELOC(alloc_top_high) = RELOC(ram_top); 1135 RELOC(alloc_top_high) = RELOC(ram_top);
1042 1136
1043 prom_printf("memory layout at init:\n"); 1137 prom_printf("memory layout at init:\n");
1138 prom_printf(" memory_limit : %x (16 MB aligned)\n", RELOC(prom_memory_limit));
1044 prom_printf(" alloc_bottom : %x\n", RELOC(alloc_bottom)); 1139 prom_printf(" alloc_bottom : %x\n", RELOC(alloc_bottom));
1045 prom_printf(" alloc_top : %x\n", RELOC(alloc_top)); 1140 prom_printf(" alloc_top : %x\n", RELOC(alloc_top));
1046 prom_printf(" alloc_top_hi : %x\n", RELOC(alloc_top_high)); 1141 prom_printf(" alloc_top_hi : %x\n", RELOC(alloc_top_high));
@@ -1259,10 +1354,6 @@ static void __init prom_initialize_tce_table(void)
1259 * 1354 *
1260 * -- Cort 1355 * -- Cort
1261 */ 1356 */
1262extern char __secondary_hold;
1263extern unsigned long __secondary_hold_spinloop;
1264extern unsigned long __secondary_hold_acknowledge;
1265
1266/* 1357/*
1267 * We want to reference the copy of __secondary_hold_* in the 1358 * We want to reference the copy of __secondary_hold_* in the
1268 * 0 - 0x100 address range 1359 * 0 - 0x100 address range
@@ -2399,6 +2490,10 @@ unsigned long __init prom_init(unsigned long r3, unsigned long r4,
2399 /* 2490 /*
2400 * Fill in some infos for use by the kernel later on 2491 * Fill in some infos for use by the kernel later on
2401 */ 2492 */
2493 if (RELOC(prom_memory_limit))
2494 prom_setprop(_prom->chosen, "/chosen", "linux,memory-limit",
2495 &RELOC(prom_memory_limit),
2496 sizeof(prom_memory_limit));
2402#ifdef CONFIG_PPC64 2497#ifdef CONFIG_PPC64
2403 if (RELOC(prom_iommu_off)) 2498 if (RELOC(prom_iommu_off))
2404 prom_setprop(_prom->chosen, "/chosen", "linux,iommu-off", 2499 prom_setprop(_prom->chosen, "/chosen", "linux,iommu-off",
diff --git a/arch/powerpc/kernel/rtas.c b/arch/powerpc/kernel/rtas.c
index c434823b8c83..bf90361bb70f 100644
--- a/arch/powerpc/kernel/rtas.c
+++ b/arch/powerpc/kernel/rtas.c
@@ -39,6 +39,7 @@
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#include <asm/time.h>
42#include <asm/mmu.h>
42 43
43struct rtas_t rtas = { 44struct rtas_t rtas = {
44 .lock = __RAW_SPIN_LOCK_UNLOCKED 45 .lock = __RAW_SPIN_LOCK_UNLOCKED
@@ -713,6 +714,7 @@ static void rtas_percpu_suspend_me(void *info)
713{ 714{
714 long rc = H_SUCCESS; 715 long rc = H_SUCCESS;
715 unsigned long msr_save; 716 unsigned long msr_save;
717 u16 slb_size = mmu_slb_size;
716 int cpu; 718 int cpu;
717 struct rtas_suspend_me_data *data = 719 struct rtas_suspend_me_data *data =
718 (struct rtas_suspend_me_data *)info; 720 (struct rtas_suspend_me_data *)info;
@@ -735,13 +737,16 @@ static void rtas_percpu_suspend_me(void *info)
735 /* All other cpus are in H_JOIN, this cpu does 737 /* All other cpus are in H_JOIN, this cpu does
736 * the suspend. 738 * the suspend.
737 */ 739 */
740 slb_set_size(SLB_MIN_SIZE);
738 printk(KERN_DEBUG "calling ibm,suspend-me on cpu %i\n", 741 printk(KERN_DEBUG "calling ibm,suspend-me on cpu %i\n",
739 smp_processor_id()); 742 smp_processor_id());
740 data->error = rtas_call(data->token, 0, 1, NULL); 743 data->error = rtas_call(data->token, 0, 1, NULL);
741 744
742 if (data->error) 745 if (data->error) {
743 printk(KERN_DEBUG "ibm,suspend-me returned %d\n", 746 printk(KERN_DEBUG "ibm,suspend-me returned %d\n",
744 data->error); 747 data->error);
748 slb_set_size(slb_size);
749 }
745 } else { 750 } else {
746 printk(KERN_ERR "H_JOIN on cpu %i failed with rc = %ld\n", 751 printk(KERN_ERR "H_JOIN on cpu %i failed with rc = %ld\n",
747 smp_processor_id(), rc); 752 smp_processor_id(), rc);
diff --git a/arch/powerpc/kernel/setup_32.c b/arch/powerpc/kernel/setup_32.c
index e1e3059cf34b..53bcf3d792db 100644
--- a/arch/powerpc/kernel/setup_32.c
+++ b/arch/powerpc/kernel/setup_32.c
@@ -210,6 +210,14 @@ void nvram_write_byte(unsigned char val, int addr)
210} 210}
211EXPORT_SYMBOL(nvram_write_byte); 211EXPORT_SYMBOL(nvram_write_byte);
212 212
213ssize_t nvram_get_size(void)
214{
215 if (ppc_md.nvram_size)
216 return ppc_md.nvram_size();
217 return -1;
218}
219EXPORT_SYMBOL(nvram_get_size);
220
213void nvram_sync(void) 221void nvram_sync(void)
214{ 222{
215 if (ppc_md.nvram_sync) 223 if (ppc_md.nvram_sync)
diff --git a/arch/powerpc/kernel/setup_64.c b/arch/powerpc/kernel/setup_64.c
index 1f6816003ebe..797ea95aae2e 100644
--- a/arch/powerpc/kernel/setup_64.c
+++ b/arch/powerpc/kernel/setup_64.c
@@ -57,11 +57,13 @@
57#include <asm/cache.h> 57#include <asm/cache.h>
58#include <asm/page.h> 58#include <asm/page.h>
59#include <asm/mmu.h> 59#include <asm/mmu.h>
60#include <asm/mmu-hash64.h>
60#include <asm/firmware.h> 61#include <asm/firmware.h>
61#include <asm/xmon.h> 62#include <asm/xmon.h>
62#include <asm/udbg.h> 63#include <asm/udbg.h>
63#include <asm/kexec.h> 64#include <asm/kexec.h>
64#include <asm/swiotlb.h> 65#include <asm/swiotlb.h>
66#include <asm/mmu_context.h>
65 67
66#include "setup.h" 68#include "setup.h"
67 69
@@ -142,11 +144,14 @@ early_param("smt-enabled", early_smt_enabled);
142#define check_smt_enabled() 144#define check_smt_enabled()
143#endif /* CONFIG_SMP */ 145#endif /* CONFIG_SMP */
144 146
145/* Put the paca pointer into r13 and SPRG3 */ 147/* Put the paca pointer into r13 and SPRG_PACA */
146void __init setup_paca(int cpu) 148void __init setup_paca(int cpu)
147{ 149{
148 local_paca = &paca[cpu]; 150 local_paca = &paca[cpu];
149 mtspr(SPRN_SPRG3, local_paca); 151 mtspr(SPRN_SPRG_PACA, local_paca);
152#ifdef CONFIG_PPC_BOOK3E
153 mtspr(SPRN_SPRG_TLB_EXFRAME, local_paca->extlb);
154#endif
150} 155}
151 156
152/* 157/*
@@ -230,9 +235,6 @@ void early_setup_secondary(void)
230#endif /* CONFIG_SMP */ 235#endif /* CONFIG_SMP */
231 236
232#if defined(CONFIG_SMP) || defined(CONFIG_KEXEC) 237#if defined(CONFIG_SMP) || defined(CONFIG_KEXEC)
233extern unsigned long __secondary_hold_spinloop;
234extern void generic_secondary_smp_init(void);
235
236void smp_release_cpus(void) 238void smp_release_cpus(void)
237{ 239{
238 unsigned long *ptr; 240 unsigned long *ptr;
@@ -453,6 +455,24 @@ static void __init irqstack_early_init(void)
453#define irqstack_early_init() 455#define irqstack_early_init()
454#endif 456#endif
455 457
458#ifdef CONFIG_PPC_BOOK3E
459static void __init exc_lvl_early_init(void)
460{
461 unsigned int i;
462
463 for_each_possible_cpu(i) {
464 critirq_ctx[i] = (struct thread_info *)
465 __va(lmb_alloc(THREAD_SIZE, THREAD_SIZE));
466 dbgirq_ctx[i] = (struct thread_info *)
467 __va(lmb_alloc(THREAD_SIZE, THREAD_SIZE));
468 mcheckirq_ctx[i] = (struct thread_info *)
469 __va(lmb_alloc(THREAD_SIZE, THREAD_SIZE));
470 }
471}
472#else
473#define exc_lvl_early_init()
474#endif
475
456/* 476/*
457 * Stack space used when we detect a bad kernel stack pointer, and 477 * Stack space used when we detect a bad kernel stack pointer, and
458 * early in SMP boots before relocation is enabled. 478 * early in SMP boots before relocation is enabled.
@@ -512,6 +532,7 @@ void __init setup_arch(char **cmdline_p)
512 init_mm.brk = klimit; 532 init_mm.brk = klimit;
513 533
514 irqstack_early_init(); 534 irqstack_early_init();
535 exc_lvl_early_init();
515 emergency_stack_init(); 536 emergency_stack_init();
516 537
517#ifdef CONFIG_PPC_STD_MMU_64 538#ifdef CONFIG_PPC_STD_MMU_64
@@ -534,6 +555,10 @@ void __init setup_arch(char **cmdline_p)
534#endif 555#endif
535 556
536 paging_init(); 557 paging_init();
558
559 /* Initialize the MMU context management stuff */
560 mmu_context_init();
561
537 ppc64_boot_msg(0x15, "Setup Done"); 562 ppc64_boot_msg(0x15, "Setup Done");
538} 563}
539 564
@@ -569,25 +594,53 @@ void cpu_die(void)
569} 594}
570 595
571#ifdef CONFIG_SMP 596#ifdef CONFIG_SMP
572void __init setup_per_cpu_areas(void) 597#define PCPU_DYN_SIZE ()
598
599static void * __init pcpu_fc_alloc(unsigned int cpu, size_t size, size_t align)
573{ 600{
574 int i; 601 return __alloc_bootmem_node(NODE_DATA(cpu_to_node(cpu)), size, align,
575 unsigned long size; 602 __pa(MAX_DMA_ADDRESS));
576 char *ptr; 603}
577
578 /* Copy section for each CPU (we discard the original) */
579 size = ALIGN(__per_cpu_end - __per_cpu_start, PAGE_SIZE);
580#ifdef CONFIG_MODULES
581 if (size < PERCPU_ENOUGH_ROOM)
582 size = PERCPU_ENOUGH_ROOM;
583#endif
584 604
585 for_each_possible_cpu(i) { 605static void __init pcpu_fc_free(void *ptr, size_t size)
586 ptr = alloc_bootmem_pages_node(NODE_DATA(cpu_to_node(i)), size); 606{
607 free_bootmem(__pa(ptr), size);
608}
587 609
588 paca[i].data_offset = ptr - __per_cpu_start; 610static int pcpu_cpu_distance(unsigned int from, unsigned int to)
589 memcpy(ptr, __per_cpu_start, __per_cpu_end - __per_cpu_start); 611{
590 } 612 if (cpu_to_node(from) == cpu_to_node(to))
613 return LOCAL_DISTANCE;
614 else
615 return REMOTE_DISTANCE;
616}
617
618void __init setup_per_cpu_areas(void)
619{
620 const size_t dyn_size = PERCPU_MODULE_RESERVE + PERCPU_DYNAMIC_RESERVE;
621 size_t atom_size;
622 unsigned long delta;
623 unsigned int cpu;
624 int rc;
625
626 /*
627 * Linear mapping is one of 4K, 1M and 16M. For 4K, no need
628 * to group units. For larger mappings, use 1M atom which
629 * should be large enough to contain a number of units.
630 */
631 if (mmu_linear_psize == MMU_PAGE_4K)
632 atom_size = PAGE_SIZE;
633 else
634 atom_size = 1 << 20;
635
636 rc = pcpu_embed_first_chunk(0, dyn_size, atom_size, pcpu_cpu_distance,
637 pcpu_fc_alloc, pcpu_fc_free);
638 if (rc < 0)
639 panic("cannot initialize percpu area (err=%d)", rc);
640
641 delta = (unsigned long)pcpu_base_addr - (unsigned long)__per_cpu_start;
642 for_each_possible_cpu(cpu)
643 paca[cpu].data_offset = delta + pcpu_unit_offsets[cpu];
591} 644}
592#endif 645#endif
593 646
diff --git a/arch/powerpc/kernel/smp.c b/arch/powerpc/kernel/smp.c
index 0b47de07302d..d387b3937ccc 100644
--- a/arch/powerpc/kernel/smp.c
+++ b/arch/powerpc/kernel/smp.c
@@ -269,7 +269,10 @@ void __init smp_prepare_cpus(unsigned int max_cpus)
269 cpu_callin_map[boot_cpuid] = 1; 269 cpu_callin_map[boot_cpuid] = 1;
270 270
271 if (smp_ops) 271 if (smp_ops)
272 max_cpus = smp_ops->probe(); 272 if (smp_ops->probe)
273 max_cpus = smp_ops->probe();
274 else
275 max_cpus = NR_CPUS;
273 else 276 else
274 max_cpus = 1; 277 max_cpus = 1;
275 278
@@ -412,9 +415,8 @@ int __cpuinit __cpu_up(unsigned int cpu)
412 * CPUs can take much longer to come up in the 415 * CPUs can take much longer to come up in the
413 * hotplug case. Wait five seconds. 416 * hotplug case. Wait five seconds.
414 */ 417 */
415 for (c = 25; c && !cpu_callin_map[cpu]; c--) { 418 for (c = 5000; c && !cpu_callin_map[cpu]; c--)
416 msleep(200); 419 msleep(1);
417 }
418#endif 420#endif
419 421
420 if (!cpu_callin_map[cpu]) { 422 if (!cpu_callin_map[cpu]) {
@@ -494,7 +496,8 @@ int __devinit start_secondary(void *unused)
494 preempt_disable(); 496 preempt_disable();
495 cpu_callin_map[cpu] = 1; 497 cpu_callin_map[cpu] = 1;
496 498
497 smp_ops->setup_cpu(cpu); 499 if (smp_ops->setup_cpu)
500 smp_ops->setup_cpu(cpu);
498 if (smp_ops->take_timebase) 501 if (smp_ops->take_timebase)
499 smp_ops->take_timebase(); 502 smp_ops->take_timebase();
500 503
@@ -557,7 +560,7 @@ void __init smp_cpus_done(unsigned int max_cpus)
557 old_mask = current->cpus_allowed; 560 old_mask = current->cpus_allowed;
558 set_cpus_allowed(current, cpumask_of_cpu(boot_cpuid)); 561 set_cpus_allowed(current, cpumask_of_cpu(boot_cpuid));
559 562
560 if (smp_ops) 563 if (smp_ops && smp_ops->setup_cpu)
561 smp_ops->setup_cpu(boot_cpuid); 564 smp_ops->setup_cpu(boot_cpuid);
562 565
563 set_cpus_allowed(current, old_mask); 566 set_cpus_allowed(current, old_mask);
diff --git a/arch/powerpc/kernel/sys_ppc32.c b/arch/powerpc/kernel/sys_ppc32.c
index bb1cfcfdbbbb..1cc5e9e5da96 100644
--- a/arch/powerpc/kernel/sys_ppc32.c
+++ b/arch/powerpc/kernel/sys_ppc32.c
@@ -343,6 +343,18 @@ off_t ppc32_lseek(unsigned int fd, u32 offset, unsigned int origin)
343 return sys_lseek(fd, (int)offset, origin); 343 return sys_lseek(fd, (int)offset, origin);
344} 344}
345 345
346long compat_sys_truncate(const char __user * path, u32 length)
347{
348 /* sign extend length */
349 return sys_truncate(path, (int)length);
350}
351
352long compat_sys_ftruncate(int fd, u32 length)
353{
354 /* sign extend length */
355 return sys_ftruncate(fd, (int)length);
356}
357
346/* Note: it is necessary to treat bufsiz as an unsigned int, 358/* Note: it is necessary to treat bufsiz as an unsigned int,
347 * with the corresponding cast to a signed int to insure that the 359 * with the corresponding cast to a signed int to insure that the
348 * proper conversion (sign extension) between the register representation of a signed int (msr in 32-bit mode) 360 * proper conversion (sign extension) between the register representation of a signed int (msr in 32-bit mode)
diff --git a/arch/powerpc/kernel/sysfs.c b/arch/powerpc/kernel/sysfs.c
index f41aec85aa49..956ab33fd73f 100644
--- a/arch/powerpc/kernel/sysfs.c
+++ b/arch/powerpc/kernel/sysfs.c
@@ -17,6 +17,7 @@
17#include <asm/prom.h> 17#include <asm/prom.h>
18#include <asm/machdep.h> 18#include <asm/machdep.h>
19#include <asm/smp.h> 19#include <asm/smp.h>
20#include <asm/pmc.h>
20 21
21#include "cacheinfo.h" 22#include "cacheinfo.h"
22 23
@@ -123,6 +124,8 @@ static DEFINE_PER_CPU(char, pmcs_enabled);
123 124
124void ppc_enable_pmcs(void) 125void ppc_enable_pmcs(void)
125{ 126{
127 ppc_set_pmu_inuse(1);
128
126 /* Only need to enable them once */ 129 /* Only need to enable them once */
127 if (__get_cpu_var(pmcs_enabled)) 130 if (__get_cpu_var(pmcs_enabled))
128 return; 131 return;
diff --git a/arch/powerpc/kernel/time.c b/arch/powerpc/kernel/time.c
index eae4511ceeac..a180b4f9a4f6 100644
--- a/arch/powerpc/kernel/time.c
+++ b/arch/powerpc/kernel/time.c
@@ -479,7 +479,8 @@ static int __init iSeries_tb_recal(void)
479 unsigned long tb_ticks = tb - iSeries_recal_tb; 479 unsigned long tb_ticks = tb - iSeries_recal_tb;
480 unsigned long titan_usec = (titan - iSeries_recal_titan) >> 12; 480 unsigned long titan_usec = (titan - iSeries_recal_titan) >> 12;
481 unsigned long new_tb_ticks_per_sec = (tb_ticks * USEC_PER_SEC)/titan_usec; 481 unsigned long new_tb_ticks_per_sec = (tb_ticks * USEC_PER_SEC)/titan_usec;
482 unsigned long new_tb_ticks_per_jiffy = (new_tb_ticks_per_sec+(HZ/2))/HZ; 482 unsigned long new_tb_ticks_per_jiffy =
483 DIV_ROUND_CLOSEST(new_tb_ticks_per_sec, HZ);
483 long tick_diff = new_tb_ticks_per_jiffy - tb_ticks_per_jiffy; 484 long tick_diff = new_tb_ticks_per_jiffy - tb_ticks_per_jiffy;
484 char sign = '+'; 485 char sign = '+';
485 /* make sure tb_ticks_per_sec and tb_ticks_per_jiffy are consistent */ 486 /* make sure tb_ticks_per_sec and tb_ticks_per_jiffy are consistent */
@@ -726,6 +727,18 @@ static int __init get_freq(char *name, int cells, unsigned long *val)
726 return found; 727 return found;
727} 728}
728 729
730/* should become __cpuinit when secondary_cpu_time_init also is */
731void start_cpu_decrementer(void)
732{
733#if defined(CONFIG_BOOKE) || defined(CONFIG_40x)
734 /* Clear any pending timer interrupts */
735 mtspr(SPRN_TSR, TSR_ENW | TSR_WIS | TSR_DIS | TSR_FIS);
736
737 /* Enable decrementer interrupt */
738 mtspr(SPRN_TCR, TCR_DIE);
739#endif /* defined(CONFIG_BOOKE) || defined(CONFIG_40x) */
740}
741
729void __init generic_calibrate_decr(void) 742void __init generic_calibrate_decr(void)
730{ 743{
731 ppc_tb_freq = DEFAULT_TB_FREQ; /* hardcoded default */ 744 ppc_tb_freq = DEFAULT_TB_FREQ; /* hardcoded default */
@@ -745,14 +758,6 @@ void __init generic_calibrate_decr(void)
745 printk(KERN_ERR "WARNING: Estimating processor frequency " 758 printk(KERN_ERR "WARNING: Estimating processor frequency "
746 "(not found)\n"); 759 "(not found)\n");
747 } 760 }
748
749#if defined(CONFIG_BOOKE) || defined(CONFIG_40x)
750 /* Clear any pending timer interrupts */
751 mtspr(SPRN_TSR, TSR_ENW | TSR_WIS | TSR_DIS | TSR_FIS);
752
753 /* Enable decrementer interrupt */
754 mtspr(SPRN_TCR, TCR_DIE);
755#endif
756} 761}
757 762
758int update_persistent_clock(struct timespec now) 763int update_persistent_clock(struct timespec now)
@@ -913,6 +918,11 @@ static void __init init_decrementer_clockevent(void)
913 918
914void secondary_cpu_time_init(void) 919void secondary_cpu_time_init(void)
915{ 920{
921 /* Start the decrementer on CPUs that have manual control
922 * such as BookE
923 */
924 start_cpu_decrementer();
925
916 /* FIME: Should make unrelatred change to move snapshot_timebase 926 /* FIME: Should make unrelatred change to move snapshot_timebase
917 * call here ! */ 927 * call here ! */
918 register_decrementer_clockevent(smp_processor_id()); 928 register_decrementer_clockevent(smp_processor_id());
@@ -1016,6 +1026,11 @@ void __init time_init(void)
1016 1026
1017 write_sequnlock_irqrestore(&xtime_lock, flags); 1027 write_sequnlock_irqrestore(&xtime_lock, flags);
1018 1028
1029 /* Start the decrementer on CPUs that have manual control
1030 * such as BookE
1031 */
1032 start_cpu_decrementer();
1033
1019 /* Register the clocksource, if we're not running on iSeries */ 1034 /* Register the clocksource, if we're not running on iSeries */
1020 if (!firmware_has_feature(FW_FEATURE_ISERIES)) 1035 if (!firmware_has_feature(FW_FEATURE_ISERIES))
1021 clocksource_init(); 1036 clocksource_init();
diff --git a/arch/powerpc/kernel/vdso.c b/arch/powerpc/kernel/vdso.c
index ad06d5c75b15..a0abce251d0a 100644
--- a/arch/powerpc/kernel/vdso.c
+++ b/arch/powerpc/kernel/vdso.c
@@ -203,7 +203,12 @@ int arch_setup_additional_pages(struct linux_binprm *bprm, int uses_interp)
203 } else { 203 } else {
204 vdso_pagelist = vdso64_pagelist; 204 vdso_pagelist = vdso64_pagelist;
205 vdso_pages = vdso64_pages; 205 vdso_pages = vdso64_pages;
206 vdso_base = VDSO64_MBASE; 206 /*
207 * On 64bit we don't have a preferred map address. This
208 * allows get_unmapped_area to find an area near other mmaps
209 * and most likely share a SLB entry.
210 */
211 vdso_base = 0;
207 } 212 }
208#else 213#else
209 vdso_pagelist = vdso32_pagelist; 214 vdso_pagelist = vdso32_pagelist;
diff --git a/arch/powerpc/kernel/vdso32/Makefile b/arch/powerpc/kernel/vdso32/Makefile
index c3d57bd01a88..b54b81688132 100644
--- a/arch/powerpc/kernel/vdso32/Makefile
+++ b/arch/powerpc/kernel/vdso32/Makefile
@@ -12,6 +12,7 @@ endif
12targets := $(obj-vdso32) vdso32.so vdso32.so.dbg 12targets := $(obj-vdso32) vdso32.so vdso32.so.dbg
13obj-vdso32 := $(addprefix $(obj)/, $(obj-vdso32)) 13obj-vdso32 := $(addprefix $(obj)/, $(obj-vdso32))
14 14
15GCOV_PROFILE := n
15 16
16EXTRA_CFLAGS := -shared -fno-common -fno-builtin 17EXTRA_CFLAGS := -shared -fno-common -fno-builtin
17EXTRA_CFLAGS += -nostdlib -Wl,-soname=linux-vdso32.so.1 \ 18EXTRA_CFLAGS += -nostdlib -Wl,-soname=linux-vdso32.so.1 \
diff --git a/arch/powerpc/kernel/vdso64/Makefile b/arch/powerpc/kernel/vdso64/Makefile
index fa7f1b8f3e50..dd0c8e936775 100644
--- a/arch/powerpc/kernel/vdso64/Makefile
+++ b/arch/powerpc/kernel/vdso64/Makefile
@@ -7,6 +7,8 @@ obj-vdso64 = sigtramp.o gettimeofday.o datapage.o cacheflush.o note.o
7targets := $(obj-vdso64) vdso64.so vdso64.so.dbg 7targets := $(obj-vdso64) vdso64.so vdso64.so.dbg
8obj-vdso64 := $(addprefix $(obj)/, $(obj-vdso64)) 8obj-vdso64 := $(addprefix $(obj)/, $(obj-vdso64))
9 9
10GCOV_PROFILE := n
11
10EXTRA_CFLAGS := -shared -fno-common -fno-builtin 12EXTRA_CFLAGS := -shared -fno-common -fno-builtin
11EXTRA_CFLAGS += -nostdlib -Wl,-soname=linux-vdso64.so.1 \ 13EXTRA_CFLAGS += -nostdlib -Wl,-soname=linux-vdso64.so.1 \
12 $(call ld-option, -Wl$(comma)--hash-style=sysv) 14 $(call ld-option, -Wl$(comma)--hash-style=sysv)
diff --git a/arch/powerpc/kernel/vector.S b/arch/powerpc/kernel/vector.S
index ea4d64644d02..67b6916f0e94 100644
--- a/arch/powerpc/kernel/vector.S
+++ b/arch/powerpc/kernel/vector.S
@@ -65,7 +65,7 @@ _GLOBAL(load_up_altivec)
651: 651:
66 /* enable use of VMX after return */ 66 /* enable use of VMX after return */
67#ifdef CONFIG_PPC32 67#ifdef CONFIG_PPC32
68 mfspr r5,SPRN_SPRG3 /* current task's THREAD (phys) */ 68 mfspr r5,SPRN_SPRG_THREAD /* current task's THREAD (phys) */
69 oris r9,r9,MSR_VEC@h 69 oris r9,r9,MSR_VEC@h
70#else 70#else
71 ld r4,PACACURRENT(r13) 71 ld r4,PACACURRENT(r13)
diff --git a/arch/powerpc/kernel/vio.c b/arch/powerpc/kernel/vio.c
index 819e59f6f7c7..bc7b41edbdfc 100644
--- a/arch/powerpc/kernel/vio.c
+++ b/arch/powerpc/kernel/vio.c
@@ -601,7 +601,7 @@ static void vio_dma_iommu_unmap_sg(struct device *dev,
601 vio_cmo_dealloc(viodev, alloc_size); 601 vio_cmo_dealloc(viodev, alloc_size);
602} 602}
603 603
604struct dma_mapping_ops vio_dma_mapping_ops = { 604struct dma_map_ops vio_dma_mapping_ops = {
605 .alloc_coherent = vio_dma_iommu_alloc_coherent, 605 .alloc_coherent = vio_dma_iommu_alloc_coherent,
606 .free_coherent = vio_dma_iommu_free_coherent, 606 .free_coherent = vio_dma_iommu_free_coherent,
607 .map_sg = vio_dma_iommu_map_sg, 607 .map_sg = vio_dma_iommu_map_sg,
diff --git a/arch/powerpc/kernel/vmlinux.lds.S b/arch/powerpc/kernel/vmlinux.lds.S
index 8ef8a14abc95..58da4070723d 100644
--- a/arch/powerpc/kernel/vmlinux.lds.S
+++ b/arch/powerpc/kernel/vmlinux.lds.S
@@ -37,12 +37,6 @@ jiffies = jiffies_64 + 4;
37#endif 37#endif
38SECTIONS 38SECTIONS
39{ 39{
40 /* Sections to be discarded. */
41 /DISCARD/ : {
42 *(.exitcall.exit)
43 EXIT_DATA
44 }
45
46 . = KERNELBASE; 40 . = KERNELBASE;
47 41
48/* 42/*
@@ -245,10 +239,6 @@ SECTIONS
245 } 239 }
246#endif 240#endif
247 241
248 . = ALIGN(PAGE_SIZE);
249 _edata = .;
250 PROVIDE32 (edata = .);
251
252 /* The initial task and kernel stack */ 242 /* The initial task and kernel stack */
253#ifdef CONFIG_PPC32 243#ifdef CONFIG_PPC32
254 . = ALIGN(8192); 244 . = ALIGN(8192);
@@ -282,6 +272,10 @@ SECTIONS
282 __nosave_end = .; 272 __nosave_end = .;
283 } 273 }
284 274
275 . = ALIGN(PAGE_SIZE);
276 _edata = .;
277 PROVIDE32 (edata = .);
278
285/* 279/*
286 * And finally the bss 280 * And finally the bss
287 */ 281 */
@@ -298,4 +292,7 @@ SECTIONS
298 . = ALIGN(PAGE_SIZE); 292 . = ALIGN(PAGE_SIZE);
299 _end = . ; 293 _end = . ;
300 PROVIDE32 (end = .); 294 PROVIDE32 (end = .);
295
296 /* Sections to be discarded. */
297 DISCARDS
301} 298}
diff --git a/arch/powerpc/kvm/booke_interrupts.S b/arch/powerpc/kvm/booke_interrupts.S
index d0c6f841bbd1..380a78cf484d 100644
--- a/arch/powerpc/kvm/booke_interrupts.S
+++ b/arch/powerpc/kvm/booke_interrupts.S
@@ -56,8 +56,8 @@
56.macro KVM_HANDLER ivor_nr 56.macro KVM_HANDLER ivor_nr
57_GLOBAL(kvmppc_handler_\ivor_nr) 57_GLOBAL(kvmppc_handler_\ivor_nr)
58 /* Get pointer to vcpu and record exit number. */ 58 /* Get pointer to vcpu and record exit number. */
59 mtspr SPRN_SPRG0, r4 59 mtspr SPRN_SPRG_WSCRATCH0, r4
60 mfspr r4, SPRN_SPRG1 60 mfspr r4, SPRN_SPRG_RVCPU
61 stw r5, VCPU_GPR(r5)(r4) 61 stw r5, VCPU_GPR(r5)(r4)
62 stw r6, VCPU_GPR(r6)(r4) 62 stw r6, VCPU_GPR(r6)(r4)
63 mfctr r5 63 mfctr r5
@@ -95,7 +95,7 @@ _GLOBAL(kvmppc_handler_len)
95 95
96 96
97/* Registers: 97/* Registers:
98 * SPRG0: guest r4 98 * SPRG_SCRATCH0: guest r4
99 * r4: vcpu pointer 99 * r4: vcpu pointer
100 * r5: KVM exit number 100 * r5: KVM exit number
101 */ 101 */
@@ -181,7 +181,7 @@ _GLOBAL(kvmppc_resume_host)
181 stw r3, VCPU_LR(r4) 181 stw r3, VCPU_LR(r4)
182 mfxer r3 182 mfxer r3
183 stw r3, VCPU_XER(r4) 183 stw r3, VCPU_XER(r4)
184 mfspr r3, SPRN_SPRG0 184 mfspr r3, SPRN_SPRG_RSCRATCH0
185 stw r3, VCPU_GPR(r4)(r4) 185 stw r3, VCPU_GPR(r4)(r4)
186 mfspr r3, SPRN_SRR0 186 mfspr r3, SPRN_SRR0
187 stw r3, VCPU_PC(r4) 187 stw r3, VCPU_PC(r4)
@@ -374,7 +374,7 @@ lightweight_exit:
374 mtspr SPRN_IVPR, r8 374 mtspr SPRN_IVPR, r8
375 375
376 /* Save vcpu pointer for the exception handlers. */ 376 /* Save vcpu pointer for the exception handlers. */
377 mtspr SPRN_SPRG1, r4 377 mtspr SPRN_SPRG_WVCPU, r4
378 378
379 /* Can't switch the stack pointer until after IVPR is switched, 379 /* Can't switch the stack pointer until after IVPR is switched,
380 * because host interrupt handlers would get confused. */ 380 * because host interrupt handlers would get confused. */
@@ -384,13 +384,13 @@ lightweight_exit:
384 /* Host interrupt handlers may have clobbered these guest-readable 384 /* Host interrupt handlers may have clobbered these guest-readable
385 * SPRGs, so we need to reload them here with the guest's values. */ 385 * SPRGs, so we need to reload them here with the guest's values. */
386 lwz r3, VCPU_SPRG4(r4) 386 lwz r3, VCPU_SPRG4(r4)
387 mtspr SPRN_SPRG4, r3 387 mtspr SPRN_SPRG4W, r3
388 lwz r3, VCPU_SPRG5(r4) 388 lwz r3, VCPU_SPRG5(r4)
389 mtspr SPRN_SPRG5, r3 389 mtspr SPRN_SPRG5W, r3
390 lwz r3, VCPU_SPRG6(r4) 390 lwz r3, VCPU_SPRG6(r4)
391 mtspr SPRN_SPRG6, r3 391 mtspr SPRN_SPRG6W, r3
392 lwz r3, VCPU_SPRG7(r4) 392 lwz r3, VCPU_SPRG7(r4)
393 mtspr SPRN_SPRG7, r3 393 mtspr SPRN_SPRG7W, r3
394 394
395#ifdef CONFIG_KVM_EXIT_TIMING 395#ifdef CONFIG_KVM_EXIT_TIMING
396 /* save enter time */ 396 /* save enter time */
diff --git a/arch/powerpc/mm/40x_mmu.c b/arch/powerpc/mm/40x_mmu.c
index 29954dc28942..f5e7b9ce63dd 100644
--- a/arch/powerpc/mm/40x_mmu.c
+++ b/arch/powerpc/mm/40x_mmu.c
@@ -105,7 +105,7 @@ unsigned long __init mmu_mapin_ram(void)
105 105
106 while (s >= LARGE_PAGE_SIZE_16M) { 106 while (s >= LARGE_PAGE_SIZE_16M) {
107 pmd_t *pmdp; 107 pmd_t *pmdp;
108 unsigned long val = p | _PMD_SIZE_16M | _PAGE_HWEXEC | _PAGE_HWWRITE; 108 unsigned long val = p | _PMD_SIZE_16M | _PAGE_EXEC | _PAGE_HWWRITE;
109 109
110 pmdp = pmd_offset(pud_offset(pgd_offset_k(v), v), v); 110 pmdp = pmd_offset(pud_offset(pgd_offset_k(v), v), v);
111 pmd_val(*pmdp++) = val; 111 pmd_val(*pmdp++) = val;
@@ -120,7 +120,7 @@ unsigned long __init mmu_mapin_ram(void)
120 120
121 while (s >= LARGE_PAGE_SIZE_4M) { 121 while (s >= LARGE_PAGE_SIZE_4M) {
122 pmd_t *pmdp; 122 pmd_t *pmdp;
123 unsigned long val = p | _PMD_SIZE_4M | _PAGE_HWEXEC | _PAGE_HWWRITE; 123 unsigned long val = p | _PMD_SIZE_4M | _PAGE_EXEC | _PAGE_HWWRITE;
124 124
125 pmdp = pmd_offset(pud_offset(pgd_offset_k(v), v), v); 125 pmdp = pmd_offset(pud_offset(pgd_offset_k(v), v), v);
126 pmd_val(*pmdp) = val; 126 pmd_val(*pmdp) = val;
diff --git a/arch/powerpc/mm/Makefile b/arch/powerpc/mm/Makefile
index 3e68363405b7..6fb8fc8d2fea 100644
--- a/arch/powerpc/mm/Makefile
+++ b/arch/powerpc/mm/Makefile
@@ -13,6 +13,7 @@ obj-y := fault.o mem.o pgtable.o gup.o \
13 pgtable_$(CONFIG_WORD_SIZE).o 13 pgtable_$(CONFIG_WORD_SIZE).o
14obj-$(CONFIG_PPC_MMU_NOHASH) += mmu_context_nohash.o tlb_nohash.o \ 14obj-$(CONFIG_PPC_MMU_NOHASH) += mmu_context_nohash.o tlb_nohash.o \
15 tlb_nohash_low.o 15 tlb_nohash_low.o
16obj-$(CONFIG_PPC_BOOK3E) += tlb_low_$(CONFIG_WORD_SIZE)e.o
16obj-$(CONFIG_PPC64) += mmap_64.o 17obj-$(CONFIG_PPC64) += mmap_64.o
17hash64-$(CONFIG_PPC_NATIVE) := hash_native_64.o 18hash64-$(CONFIG_PPC_NATIVE) := hash_native_64.o
18obj-$(CONFIG_PPC_STD_MMU_64) += hash_utils_64.o \ 19obj-$(CONFIG_PPC_STD_MMU_64) += hash_utils_64.o \
diff --git a/arch/powerpc/mm/fsl_booke_mmu.c b/arch/powerpc/mm/fsl_booke_mmu.c
index bb3d65998e6b..dc93e95b256e 100644
--- a/arch/powerpc/mm/fsl_booke_mmu.c
+++ b/arch/powerpc/mm/fsl_booke_mmu.c
@@ -161,7 +161,7 @@ unsigned long __init mmu_mapin_ram(void)
161 unsigned long virt = PAGE_OFFSET; 161 unsigned long virt = PAGE_OFFSET;
162 phys_addr_t phys = memstart_addr; 162 phys_addr_t phys = memstart_addr;
163 163
164 while (cam[tlbcam_index] && tlbcam_index < ARRAY_SIZE(cam)) { 164 while (tlbcam_index < ARRAY_SIZE(cam) && cam[tlbcam_index]) {
165 settlbcam(tlbcam_index, virt, phys, cam[tlbcam_index], PAGE_KERNEL_X, 0); 165 settlbcam(tlbcam_index, virt, phys, cam[tlbcam_index], PAGE_KERNEL_X, 0);
166 virt += cam[tlbcam_index]; 166 virt += cam[tlbcam_index];
167 phys += cam[tlbcam_index]; 167 phys += cam[tlbcam_index];
diff --git a/arch/powerpc/mm/hash_low_32.S b/arch/powerpc/mm/hash_low_32.S
index 14af8cedab70..b13d58932bf6 100644
--- a/arch/powerpc/mm/hash_low_32.S
+++ b/arch/powerpc/mm/hash_low_32.S
@@ -40,7 +40,7 @@ mmu_hash_lock:
40 * The address is in r4, and r3 contains an access flag: 40 * The address is in r4, and r3 contains an access flag:
41 * _PAGE_RW (0x400) if a write. 41 * _PAGE_RW (0x400) if a write.
42 * r9 contains the SRR1 value, from which we use the MSR_PR bit. 42 * r9 contains the SRR1 value, from which we use the MSR_PR bit.
43 * SPRG3 contains the physical address of the current task's thread. 43 * SPRG_THREAD contains the physical address of the current task's thread.
44 * 44 *
45 * Returns to the caller if the access is illegal or there is no 45 * Returns to the caller if the access is illegal or there is no
46 * mapping for the address. Otherwise it places an appropriate PTE 46 * mapping for the address. Otherwise it places an appropriate PTE
@@ -68,7 +68,7 @@ _GLOBAL(hash_page)
68 /* Get PTE (linux-style) and check access */ 68 /* Get PTE (linux-style) and check access */
69 lis r0,KERNELBASE@h /* check if kernel address */ 69 lis r0,KERNELBASE@h /* check if kernel address */
70 cmplw 0,r4,r0 70 cmplw 0,r4,r0
71 mfspr r8,SPRN_SPRG3 /* current task's THREAD (phys) */ 71 mfspr r8,SPRN_SPRG_THREAD /* current task's THREAD (phys) */
72 ori r3,r3,_PAGE_USER|_PAGE_PRESENT /* test low addresses as user */ 72 ori r3,r3,_PAGE_USER|_PAGE_PRESENT /* test low addresses as user */
73 lwz r5,PGDIR(r8) /* virt page-table root */ 73 lwz r5,PGDIR(r8) /* virt page-table root */
74 blt+ 112f /* assume user more likely */ 74 blt+ 112f /* assume user more likely */
diff --git a/arch/powerpc/mm/hugetlbpage.c b/arch/powerpc/mm/hugetlbpage.c
index c46ef2ffa3d9..90df6ffe3a43 100644
--- a/arch/powerpc/mm/hugetlbpage.c
+++ b/arch/powerpc/mm/hugetlbpage.c
@@ -57,8 +57,10 @@ unsigned int mmu_huge_psizes[MMU_PAGE_COUNT] = { }; /* initialize all to 0 */
57#define HUGEPTE_CACHE_NAME(psize) (huge_pgtable_cache_name[psize]) 57#define HUGEPTE_CACHE_NAME(psize) (huge_pgtable_cache_name[psize])
58 58
59static const char *huge_pgtable_cache_name[MMU_PAGE_COUNT] = { 59static const char *huge_pgtable_cache_name[MMU_PAGE_COUNT] = {
60 "unused_4K", "hugepte_cache_64K", "unused_64K_AP", 60 [MMU_PAGE_64K] = "hugepte_cache_64K",
61 "hugepte_cache_1M", "hugepte_cache_16M", "hugepte_cache_16G" 61 [MMU_PAGE_1M] = "hugepte_cache_1M",
62 [MMU_PAGE_16M] = "hugepte_cache_16M",
63 [MMU_PAGE_16G] = "hugepte_cache_16G",
62}; 64};
63 65
64/* Flag to mark huge PD pointers. This means pmd_bad() and pud_bad() 66/* Flag to mark huge PD pointers. This means pmd_bad() and pud_bad()
@@ -700,6 +702,8 @@ static void __init set_huge_psize(int psize)
700 if (mmu_huge_psizes[psize] || 702 if (mmu_huge_psizes[psize] ||
701 mmu_psize_defs[psize].shift == PAGE_SHIFT) 703 mmu_psize_defs[psize].shift == PAGE_SHIFT)
702 return; 704 return;
705 if (WARN_ON(HUGEPTE_CACHE_NAME(psize) == NULL))
706 return;
703 hugetlb_add_hstate(mmu_psize_defs[psize].shift - PAGE_SHIFT); 707 hugetlb_add_hstate(mmu_psize_defs[psize].shift - PAGE_SHIFT);
704 708
705 switch (mmu_psize_defs[psize].shift) { 709 switch (mmu_psize_defs[psize].shift) {
diff --git a/arch/powerpc/mm/init_32.c b/arch/powerpc/mm/init_32.c
index 3de6a0d93824..3ef5084b90ca 100644
--- a/arch/powerpc/mm/init_32.c
+++ b/arch/powerpc/mm/init_32.c
@@ -54,8 +54,6 @@
54#endif 54#endif
55#define MAX_LOW_MEM CONFIG_LOWMEM_SIZE 55#define MAX_LOW_MEM CONFIG_LOWMEM_SIZE
56 56
57DEFINE_PER_CPU(struct mmu_gather, mmu_gathers);
58
59phys_addr_t total_memory; 57phys_addr_t total_memory;
60phys_addr_t total_lowmem; 58phys_addr_t total_lowmem;
61 59
diff --git a/arch/powerpc/mm/init_64.c b/arch/powerpc/mm/init_64.c
index 68a821add28d..31582329cd67 100644
--- a/arch/powerpc/mm/init_64.c
+++ b/arch/powerpc/mm/init_64.c
@@ -205,6 +205,47 @@ static int __meminit vmemmap_populated(unsigned long start, int page_size)
205 return 0; 205 return 0;
206} 206}
207 207
208/* On hash-based CPUs, the vmemmap is bolted in the hash table.
209 *
210 * On Book3E CPUs, the vmemmap is currently mapped in the top half of
211 * the vmalloc space using normal page tables, though the size of
212 * pages encoded in the PTEs can be different
213 */
214
215#ifdef CONFIG_PPC_BOOK3E
216static void __meminit vmemmap_create_mapping(unsigned long start,
217 unsigned long page_size,
218 unsigned long phys)
219{
220 /* Create a PTE encoding without page size */
221 unsigned long i, flags = _PAGE_PRESENT | _PAGE_ACCESSED |
222 _PAGE_KERNEL_RW;
223
224 /* PTEs only contain page size encodings up to 32M */
225 BUG_ON(mmu_psize_defs[mmu_vmemmap_psize].enc > 0xf);
226
227 /* Encode the size in the PTE */
228 flags |= mmu_psize_defs[mmu_vmemmap_psize].enc << 8;
229
230 /* For each PTE for that area, map things. Note that we don't
231 * increment phys because all PTEs are of the large size and
232 * thus must have the low bits clear
233 */
234 for (i = 0; i < page_size; i += PAGE_SIZE)
235 BUG_ON(map_kernel_page(start + i, phys, flags));
236}
237#else /* CONFIG_PPC_BOOK3E */
238static void __meminit vmemmap_create_mapping(unsigned long start,
239 unsigned long page_size,
240 unsigned long phys)
241{
242 int mapped = htab_bolt_mapping(start, start + page_size, phys,
243 PAGE_KERNEL, mmu_vmemmap_psize,
244 mmu_kernel_ssize);
245 BUG_ON(mapped < 0);
246}
247#endif /* CONFIG_PPC_BOOK3E */
248
208int __meminit vmemmap_populate(struct page *start_page, 249int __meminit vmemmap_populate(struct page *start_page,
209 unsigned long nr_pages, int node) 250 unsigned long nr_pages, int node)
210{ 251{
@@ -215,8 +256,11 @@ int __meminit vmemmap_populate(struct page *start_page,
215 /* Align to the page size of the linear mapping. */ 256 /* Align to the page size of the linear mapping. */
216 start = _ALIGN_DOWN(start, page_size); 257 start = _ALIGN_DOWN(start, page_size);
217 258
259 pr_debug("vmemmap_populate page %p, %ld pages, node %d\n",
260 start_page, nr_pages, node);
261 pr_debug(" -> map %lx..%lx\n", start, end);
262
218 for (; start < end; start += page_size) { 263 for (; start < end; start += page_size) {
219 int mapped;
220 void *p; 264 void *p;
221 265
222 if (vmemmap_populated(start, page_size)) 266 if (vmemmap_populated(start, page_size))
@@ -226,13 +270,10 @@ int __meminit vmemmap_populate(struct page *start_page,
226 if (!p) 270 if (!p)
227 return -ENOMEM; 271 return -ENOMEM;
228 272
229 pr_debug("vmemmap %08lx allocated at %p, physical %08lx.\n", 273 pr_debug(" * %016lx..%016lx allocated at %p\n",
230 start, p, __pa(p)); 274 start, start + page_size, p);
231 275
232 mapped = htab_bolt_mapping(start, start + page_size, __pa(p), 276 vmemmap_create_mapping(start, page_size, __pa(p));
233 pgprot_val(PAGE_KERNEL),
234 mmu_vmemmap_psize, mmu_kernel_ssize);
235 BUG_ON(mapped < 0);
236 } 277 }
237 278
238 return 0; 279 return 0;
diff --git a/arch/powerpc/mm/mmu_context_nohash.c b/arch/powerpc/mm/mmu_context_nohash.c
index b1a727def15b..c2f93dc470e6 100644
--- a/arch/powerpc/mm/mmu_context_nohash.c
+++ b/arch/powerpc/mm/mmu_context_nohash.c
@@ -25,10 +25,20 @@
25 * also clear mm->cpu_vm_mask bits when processes are migrated 25 * also clear mm->cpu_vm_mask bits when processes are migrated
26 */ 26 */
27 27
28#undef DEBUG 28#define DEBUG_MAP_CONSISTENCY
29#define DEBUG_STEAL_ONLY 29#define DEBUG_CLAMP_LAST_CONTEXT 31
30#undef DEBUG_MAP_CONSISTENCY 30//#define DEBUG_HARDER
31/*#define DEBUG_CLAMP_LAST_CONTEXT 15 */ 31
32/* We don't use DEBUG because it tends to be compiled in always nowadays
33 * and this would generate way too much output
34 */
35#ifdef DEBUG_HARDER
36#define pr_hard(args...) printk(KERN_DEBUG args)
37#define pr_hardcont(args...) printk(KERN_CONT args)
38#else
39#define pr_hard(args...) do { } while(0)
40#define pr_hardcont(args...) do { } while(0)
41#endif
32 42
33#include <linux/kernel.h> 43#include <linux/kernel.h>
34#include <linux/mm.h> 44#include <linux/mm.h>
@@ -71,7 +81,7 @@ static DEFINE_SPINLOCK(context_lock);
71static unsigned int steal_context_smp(unsigned int id) 81static unsigned int steal_context_smp(unsigned int id)
72{ 82{
73 struct mm_struct *mm; 83 struct mm_struct *mm;
74 unsigned int cpu, max; 84 unsigned int cpu, max, i;
75 85
76 max = last_context - first_context; 86 max = last_context - first_context;
77 87
@@ -89,15 +99,22 @@ static unsigned int steal_context_smp(unsigned int id)
89 id = first_context; 99 id = first_context;
90 continue; 100 continue;
91 } 101 }
92 pr_devel("[%d] steal context %d from mm @%p\n", 102 pr_hardcont(" | steal %d from 0x%p", id, mm);
93 smp_processor_id(), id, mm);
94 103
95 /* Mark this mm has having no context anymore */ 104 /* Mark this mm has having no context anymore */
96 mm->context.id = MMU_NO_CONTEXT; 105 mm->context.id = MMU_NO_CONTEXT;
97 106
98 /* Mark it stale on all CPUs that used this mm */ 107 /* Mark it stale on all CPUs that used this mm. For threaded
99 for_each_cpu(cpu, mm_cpumask(mm)) 108 * implementations, we set it on all threads on each core
100 __set_bit(id, stale_map[cpu]); 109 * represented in the mask. A future implementation will use
110 * a core map instead but this will do for now.
111 */
112 for_each_cpu(cpu, mm_cpumask(mm)) {
113 for (i = cpu_first_thread_in_core(cpu);
114 i <= cpu_last_thread_in_core(cpu); i++)
115 __set_bit(id, stale_map[i]);
116 cpu = i - 1;
117 }
101 return id; 118 return id;
102 } 119 }
103 120
@@ -126,7 +143,7 @@ static unsigned int steal_context_up(unsigned int id)
126 /* Pick up the victim mm */ 143 /* Pick up the victim mm */
127 mm = context_mm[id]; 144 mm = context_mm[id];
128 145
129 pr_devel("[%d] steal context %d from mm @%p\n", cpu, id, mm); 146 pr_hardcont(" | steal %d from 0x%p", id, mm);
130 147
131 /* Flush the TLB for that context */ 148 /* Flush the TLB for that context */
132 local_flush_tlb_mm(mm); 149 local_flush_tlb_mm(mm);
@@ -173,25 +190,20 @@ static void context_check_map(void) { }
173 190
174void switch_mmu_context(struct mm_struct *prev, struct mm_struct *next) 191void switch_mmu_context(struct mm_struct *prev, struct mm_struct *next)
175{ 192{
176 unsigned int id, cpu = smp_processor_id(); 193 unsigned int i, id, cpu = smp_processor_id();
177 unsigned long *map; 194 unsigned long *map;
178 195
179 /* No lockless fast path .. yet */ 196 /* No lockless fast path .. yet */
180 spin_lock(&context_lock); 197 spin_lock(&context_lock);
181 198
182#ifndef DEBUG_STEAL_ONLY 199 pr_hard("[%d] activating context for mm @%p, active=%d, id=%d",
183 pr_devel("[%d] activating context for mm @%p, active=%d, id=%d\n", 200 cpu, next, next->context.active, next->context.id);
184 cpu, next, next->context.active, next->context.id);
185#endif
186 201
187#ifdef CONFIG_SMP 202#ifdef CONFIG_SMP
188 /* Mark us active and the previous one not anymore */ 203 /* Mark us active and the previous one not anymore */
189 next->context.active++; 204 next->context.active++;
190 if (prev) { 205 if (prev) {
191#ifndef DEBUG_STEAL_ONLY 206 pr_hardcont(" (old=0x%p a=%d)", prev, prev->context.active);
192 pr_devel(" old context %p active was: %d\n",
193 prev, prev->context.active);
194#endif
195 WARN_ON(prev->context.active < 1); 207 WARN_ON(prev->context.active < 1);
196 prev->context.active--; 208 prev->context.active--;
197 } 209 }
@@ -201,8 +213,14 @@ void switch_mmu_context(struct mm_struct *prev, struct mm_struct *next)
201 213
202 /* If we already have a valid assigned context, skip all that */ 214 /* If we already have a valid assigned context, skip all that */
203 id = next->context.id; 215 id = next->context.id;
204 if (likely(id != MMU_NO_CONTEXT)) 216 if (likely(id != MMU_NO_CONTEXT)) {
217#ifdef DEBUG_MAP_CONSISTENCY
218 if (context_mm[id] != next)
219 pr_err("MMU: mm 0x%p has id %d but context_mm[%d] says 0x%p\n",
220 next, id, id, context_mm[id]);
221#endif
205 goto ctxt_ok; 222 goto ctxt_ok;
223 }
206 224
207 /* We really don't have a context, let's try to acquire one */ 225 /* We really don't have a context, let's try to acquire one */
208 id = next_context; 226 id = next_context;
@@ -235,11 +253,7 @@ void switch_mmu_context(struct mm_struct *prev, struct mm_struct *next)
235 next_context = id + 1; 253 next_context = id + 1;
236 context_mm[id] = next; 254 context_mm[id] = next;
237 next->context.id = id; 255 next->context.id = id;
238 256 pr_hardcont(" | new id=%d,nrf=%d", id, nr_free_contexts);
239#ifndef DEBUG_STEAL_ONLY
240 pr_devel("[%d] picked up new id %d, nrf is now %d\n",
241 cpu, id, nr_free_contexts);
242#endif
243 257
244 context_check_map(); 258 context_check_map();
245 ctxt_ok: 259 ctxt_ok:
@@ -248,15 +262,21 @@ void switch_mmu_context(struct mm_struct *prev, struct mm_struct *next)
248 * local TLB for it and unmark it before we use it 262 * local TLB for it and unmark it before we use it
249 */ 263 */
250 if (test_bit(id, stale_map[cpu])) { 264 if (test_bit(id, stale_map[cpu])) {
251 pr_devel("[%d] flushing stale context %d for mm @%p !\n", 265 pr_hardcont(" | stale flush %d [%d..%d]",
252 cpu, id, next); 266 id, cpu_first_thread_in_core(cpu),
267 cpu_last_thread_in_core(cpu));
268
253 local_flush_tlb_mm(next); 269 local_flush_tlb_mm(next);
254 270
255 /* XXX This clear should ultimately be part of local_flush_tlb_mm */ 271 /* XXX This clear should ultimately be part of local_flush_tlb_mm */
256 __clear_bit(id, stale_map[cpu]); 272 for (i = cpu_first_thread_in_core(cpu);
273 i <= cpu_last_thread_in_core(cpu); i++) {
274 __clear_bit(id, stale_map[i]);
275 }
257 } 276 }
258 277
259 /* Flick the MMU and release lock */ 278 /* Flick the MMU and release lock */
279 pr_hardcont(" -> %d\n", id);
260 set_context(id, next->pgd); 280 set_context(id, next->pgd);
261 spin_unlock(&context_lock); 281 spin_unlock(&context_lock);
262} 282}
@@ -266,6 +286,8 @@ void switch_mmu_context(struct mm_struct *prev, struct mm_struct *next)
266 */ 286 */
267int init_new_context(struct task_struct *t, struct mm_struct *mm) 287int init_new_context(struct task_struct *t, struct mm_struct *mm)
268{ 288{
289 pr_hard("initing context for mm @%p\n", mm);
290
269 mm->context.id = MMU_NO_CONTEXT; 291 mm->context.id = MMU_NO_CONTEXT;
270 mm->context.active = 0; 292 mm->context.active = 0;
271 293
@@ -305,7 +327,9 @@ static int __cpuinit mmu_context_cpu_notify(struct notifier_block *self,
305 unsigned long action, void *hcpu) 327 unsigned long action, void *hcpu)
306{ 328{
307 unsigned int cpu = (unsigned int)(long)hcpu; 329 unsigned int cpu = (unsigned int)(long)hcpu;
308 330#ifdef CONFIG_HOTPLUG_CPU
331 struct task_struct *p;
332#endif
309 /* We don't touch CPU 0 map, it's allocated at aboot and kept 333 /* We don't touch CPU 0 map, it's allocated at aboot and kept
310 * around forever 334 * around forever
311 */ 335 */
@@ -324,8 +348,16 @@ static int __cpuinit mmu_context_cpu_notify(struct notifier_block *self,
324 pr_devel("MMU: Freeing stale context map for CPU %d\n", cpu); 348 pr_devel("MMU: Freeing stale context map for CPU %d\n", cpu);
325 kfree(stale_map[cpu]); 349 kfree(stale_map[cpu]);
326 stale_map[cpu] = NULL; 350 stale_map[cpu] = NULL;
327 break; 351
328#endif 352 /* We also clear the cpu_vm_mask bits of CPUs going away */
353 read_lock(&tasklist_lock);
354 for_each_process(p) {
355 if (p->mm)
356 cpu_mask_clear_cpu(cpu, mm_cpumask(p->mm));
357 }
358 read_unlock(&tasklist_lock);
359 break;
360#endif /* CONFIG_HOTPLUG_CPU */
329 } 361 }
330 return NOTIFY_OK; 362 return NOTIFY_OK;
331} 363}
diff --git a/arch/powerpc/mm/mmu_decl.h b/arch/powerpc/mm/mmu_decl.h
index d1f9c62dc177..d2e5321d5ea6 100644
--- a/arch/powerpc/mm/mmu_decl.h
+++ b/arch/powerpc/mm/mmu_decl.h
@@ -36,21 +36,37 @@ static inline void _tlbil_pid(unsigned int pid)
36{ 36{
37 asm volatile ("sync; tlbia; isync" : : : "memory"); 37 asm volatile ("sync; tlbia; isync" : : : "memory");
38} 38}
39#define _tlbil_pid_noind(pid) _tlbil_pid(pid)
40
39#else /* CONFIG_40x || CONFIG_8xx */ 41#else /* CONFIG_40x || CONFIG_8xx */
40extern void _tlbil_all(void); 42extern void _tlbil_all(void);
41extern void _tlbil_pid(unsigned int pid); 43extern void _tlbil_pid(unsigned int pid);
44#ifdef CONFIG_PPC_BOOK3E
45extern void _tlbil_pid_noind(unsigned int pid);
46#else
47#define _tlbil_pid_noind(pid) _tlbil_pid(pid)
48#endif
42#endif /* !(CONFIG_40x || CONFIG_8xx) */ 49#endif /* !(CONFIG_40x || CONFIG_8xx) */
43 50
44/* 51/*
45 * On 8xx, we directly inline tlbie, on others, it's extern 52 * On 8xx, we directly inline tlbie, on others, it's extern
46 */ 53 */
47#ifdef CONFIG_8xx 54#ifdef CONFIG_8xx
48static inline void _tlbil_va(unsigned long address, unsigned int pid) 55static inline void _tlbil_va(unsigned long address, unsigned int pid,
56 unsigned int tsize, unsigned int ind)
49{ 57{
50 asm volatile ("tlbie %0; sync" : : "r" (address) : "memory"); 58 asm volatile ("tlbie %0; sync" : : "r" (address) : "memory");
51} 59}
52#else /* CONFIG_8xx */ 60#elif defined(CONFIG_PPC_BOOK3E)
53extern void _tlbil_va(unsigned long address, unsigned int pid); 61extern void _tlbil_va(unsigned long address, unsigned int pid,
62 unsigned int tsize, unsigned int ind);
63#else
64extern void __tlbil_va(unsigned long address, unsigned int pid);
65static inline void _tlbil_va(unsigned long address, unsigned int pid,
66 unsigned int tsize, unsigned int ind)
67{
68 __tlbil_va(address, pid);
69}
54#endif /* CONIFG_8xx */ 70#endif /* CONIFG_8xx */
55 71
56/* 72/*
@@ -58,10 +74,16 @@ extern void _tlbil_va(unsigned long address, unsigned int pid);
58 * implementation. When that becomes the case, this will be 74 * implementation. When that becomes the case, this will be
59 * an extern. 75 * an extern.
60 */ 76 */
61static inline void _tlbivax_bcast(unsigned long address, unsigned int pid) 77#ifdef CONFIG_PPC_BOOK3E
78extern void _tlbivax_bcast(unsigned long address, unsigned int pid,
79 unsigned int tsize, unsigned int ind);
80#else
81static inline void _tlbivax_bcast(unsigned long address, unsigned int pid,
82 unsigned int tsize, unsigned int ind)
62{ 83{
63 BUG(); 84 BUG();
64} 85}
86#endif
65 87
66#else /* CONFIG_PPC_MMU_NOHASH */ 88#else /* CONFIG_PPC_MMU_NOHASH */
67 89
@@ -99,7 +121,12 @@ extern unsigned int rtas_data, rtas_size;
99struct hash_pte; 121struct hash_pte;
100extern struct hash_pte *Hash, *Hash_end; 122extern struct hash_pte *Hash, *Hash_end;
101extern unsigned long Hash_size, Hash_mask; 123extern unsigned long Hash_size, Hash_mask;
102#endif 124
125#endif /* CONFIG_PPC32 */
126
127#ifdef CONFIG_PPC64
128extern int map_kernel_page(unsigned long ea, unsigned long pa, int flags);
129#endif /* CONFIG_PPC64 */
103 130
104extern unsigned long ioremap_bot; 131extern unsigned long ioremap_bot;
105extern unsigned long __max_low_memory; 132extern unsigned long __max_low_memory;
diff --git a/arch/powerpc/mm/pgtable.c b/arch/powerpc/mm/pgtable.c
index 627767d6169b..83f1551ec2c9 100644
--- a/arch/powerpc/mm/pgtable.c
+++ b/arch/powerpc/mm/pgtable.c
@@ -30,6 +30,16 @@
30#include <asm/tlbflush.h> 30#include <asm/tlbflush.h>
31#include <asm/tlb.h> 31#include <asm/tlb.h>
32 32
33DEFINE_PER_CPU(struct mmu_gather, mmu_gathers);
34
35#ifdef CONFIG_SMP
36
37/*
38 * Handle batching of page table freeing on SMP. Page tables are
39 * queued up and send to be freed later by RCU in order to avoid
40 * freeing a page table page that is being walked without locks
41 */
42
33static DEFINE_PER_CPU(struct pte_freelist_batch *, pte_freelist_cur); 43static DEFINE_PER_CPU(struct pte_freelist_batch *, pte_freelist_cur);
34static unsigned long pte_freelist_forced_free; 44static unsigned long pte_freelist_forced_free;
35 45
@@ -116,27 +126,7 @@ void pte_free_finish(void)
116 *batchp = NULL; 126 *batchp = NULL;
117} 127}
118 128
119/* 129#endif /* CONFIG_SMP */
120 * Handle i/d cache flushing, called from set_pte_at() or ptep_set_access_flags()
121 */
122static pte_t do_dcache_icache_coherency(pte_t pte)
123{
124 unsigned long pfn = pte_pfn(pte);
125 struct page *page;
126
127 if (unlikely(!pfn_valid(pfn)))
128 return pte;
129 page = pfn_to_page(pfn);
130
131 if (!PageReserved(page) && !test_bit(PG_arch_1, &page->flags)) {
132 pr_devel("do_dcache_icache_coherency... flushing\n");
133 flush_dcache_icache_page(page);
134 set_bit(PG_arch_1, &page->flags);
135 }
136 else
137 pr_devel("do_dcache_icache_coherency... already clean\n");
138 return __pte(pte_val(pte) | _PAGE_HWEXEC);
139}
140 130
141static inline int is_exec_fault(void) 131static inline int is_exec_fault(void)
142{ 132{
@@ -145,49 +135,139 @@ static inline int is_exec_fault(void)
145 135
146/* We only try to do i/d cache coherency on stuff that looks like 136/* We only try to do i/d cache coherency on stuff that looks like
147 * reasonably "normal" PTEs. We currently require a PTE to be present 137 * reasonably "normal" PTEs. We currently require a PTE to be present
148 * and we avoid _PAGE_SPECIAL and _PAGE_NO_CACHE 138 * and we avoid _PAGE_SPECIAL and _PAGE_NO_CACHE. We also only do that
139 * on userspace PTEs
149 */ 140 */
150static inline int pte_looks_normal(pte_t pte) 141static inline int pte_looks_normal(pte_t pte)
151{ 142{
152 return (pte_val(pte) & 143 return (pte_val(pte) &
153 (_PAGE_PRESENT | _PAGE_SPECIAL | _PAGE_NO_CACHE)) == 144 (_PAGE_PRESENT | _PAGE_SPECIAL | _PAGE_NO_CACHE | _PAGE_USER)) ==
154 (_PAGE_PRESENT); 145 (_PAGE_PRESENT | _PAGE_USER);
155} 146}
156 147
157#if defined(CONFIG_PPC_STD_MMU) 148struct page * maybe_pte_to_page(pte_t pte)
149{
150 unsigned long pfn = pte_pfn(pte);
151 struct page *page;
152
153 if (unlikely(!pfn_valid(pfn)))
154 return NULL;
155 page = pfn_to_page(pfn);
156 if (PageReserved(page))
157 return NULL;
158 return page;
159}
160
161#if defined(CONFIG_PPC_STD_MMU) || _PAGE_EXEC == 0
162
158/* Server-style MMU handles coherency when hashing if HW exec permission 163/* Server-style MMU handles coherency when hashing if HW exec permission
159 * is supposed per page (currently 64-bit only). Else, we always flush 164 * is supposed per page (currently 64-bit only). If not, then, we always
160 * valid PTEs in set_pte. 165 * flush the cache for valid PTEs in set_pte. Embedded CPU without HW exec
166 * support falls into the same category.
161 */ 167 */
162static inline int pte_need_exec_flush(pte_t pte, int set_pte) 168
169static pte_t set_pte_filter(pte_t pte)
163{ 170{
164 return set_pte && pte_looks_normal(pte) && 171 pte = __pte(pte_val(pte) & ~_PAGE_HPTEFLAGS);
165 !(cpu_has_feature(CPU_FTR_COHERENT_ICACHE) || 172 if (pte_looks_normal(pte) && !(cpu_has_feature(CPU_FTR_COHERENT_ICACHE) ||
166 cpu_has_feature(CPU_FTR_NOEXECUTE)); 173 cpu_has_feature(CPU_FTR_NOEXECUTE))) {
174 struct page *pg = maybe_pte_to_page(pte);
175 if (!pg)
176 return pte;
177 if (!test_bit(PG_arch_1, &pg->flags)) {
178 flush_dcache_icache_page(pg);
179 set_bit(PG_arch_1, &pg->flags);
180 }
181 }
182 return pte;
167} 183}
168#elif _PAGE_HWEXEC == 0 184
169/* Embedded type MMU without HW exec support (8xx only so far), we flush 185static pte_t set_access_flags_filter(pte_t pte, struct vm_area_struct *vma,
170 * the cache for any present PTE 186 int dirty)
171 */
172static inline int pte_need_exec_flush(pte_t pte, int set_pte)
173{ 187{
174 return set_pte && pte_looks_normal(pte); 188 return pte;
175} 189}
176#else 190
177/* Other embedded CPUs with HW exec support per-page, we flush on exec 191#else /* defined(CONFIG_PPC_STD_MMU) || _PAGE_EXEC == 0 */
178 * fault if HWEXEC is not set 192
193/* Embedded type MMU with HW exec support. This is a bit more complicated
194 * as we don't have two bits to spare for _PAGE_EXEC and _PAGE_HWEXEC so
195 * instead we "filter out" the exec permission for non clean pages.
179 */ 196 */
180static inline int pte_need_exec_flush(pte_t pte, int set_pte) 197static pte_t set_pte_filter(pte_t pte)
181{ 198{
182 return pte_looks_normal(pte) && is_exec_fault() && 199 struct page *pg;
183 !(pte_val(pte) & _PAGE_HWEXEC); 200
201 /* No exec permission in the first place, move on */
202 if (!(pte_val(pte) & _PAGE_EXEC) || !pte_looks_normal(pte))
203 return pte;
204
205 /* If you set _PAGE_EXEC on weird pages you're on your own */
206 pg = maybe_pte_to_page(pte);
207 if (unlikely(!pg))
208 return pte;
209
210 /* If the page clean, we move on */
211 if (test_bit(PG_arch_1, &pg->flags))
212 return pte;
213
214 /* If it's an exec fault, we flush the cache and make it clean */
215 if (is_exec_fault()) {
216 flush_dcache_icache_page(pg);
217 set_bit(PG_arch_1, &pg->flags);
218 return pte;
219 }
220
221 /* Else, we filter out _PAGE_EXEC */
222 return __pte(pte_val(pte) & ~_PAGE_EXEC);
184} 223}
185#endif 224
225static pte_t set_access_flags_filter(pte_t pte, struct vm_area_struct *vma,
226 int dirty)
227{
228 struct page *pg;
229
230 /* So here, we only care about exec faults, as we use them
231 * to recover lost _PAGE_EXEC and perform I$/D$ coherency
232 * if necessary. Also if _PAGE_EXEC is already set, same deal,
233 * we just bail out
234 */
235 if (dirty || (pte_val(pte) & _PAGE_EXEC) || !is_exec_fault())
236 return pte;
237
238#ifdef CONFIG_DEBUG_VM
239 /* So this is an exec fault, _PAGE_EXEC is not set. If it was
240 * an error we would have bailed out earlier in do_page_fault()
241 * but let's make sure of it
242 */
243 if (WARN_ON(!(vma->vm_flags & VM_EXEC)))
244 return pte;
245#endif /* CONFIG_DEBUG_VM */
246
247 /* If you set _PAGE_EXEC on weird pages you're on your own */
248 pg = maybe_pte_to_page(pte);
249 if (unlikely(!pg))
250 goto bail;
251
252 /* If the page is already clean, we move on */
253 if (test_bit(PG_arch_1, &pg->flags))
254 goto bail;
255
256 /* Clean the page and set PG_arch_1 */
257 flush_dcache_icache_page(pg);
258 set_bit(PG_arch_1, &pg->flags);
259
260 bail:
261 return __pte(pte_val(pte) | _PAGE_EXEC);
262}
263
264#endif /* !(defined(CONFIG_PPC_STD_MMU) || _PAGE_EXEC == 0) */
186 265
187/* 266/*
188 * set_pte stores a linux PTE into the linux page table. 267 * set_pte stores a linux PTE into the linux page table.
189 */ 268 */
190void set_pte_at(struct mm_struct *mm, unsigned long addr, pte_t *ptep, pte_t pte) 269void set_pte_at(struct mm_struct *mm, unsigned long addr, pte_t *ptep,
270 pte_t pte)
191{ 271{
192#ifdef CONFIG_DEBUG_VM 272#ifdef CONFIG_DEBUG_VM
193 WARN_ON(pte_present(*ptep)); 273 WARN_ON(pte_present(*ptep));
@@ -196,9 +276,7 @@ void set_pte_at(struct mm_struct *mm, unsigned long addr, pte_t *ptep, pte_t pte
196 * this context might not have been activated yet when this 276 * this context might not have been activated yet when this
197 * is called. 277 * is called.
198 */ 278 */
199 pte = __pte(pte_val(pte) & ~_PAGE_HPTEFLAGS); 279 pte = set_pte_filter(pte);
200 if (pte_need_exec_flush(pte, 1))
201 pte = do_dcache_icache_coherency(pte);
202 280
203 /* Perform the setting of the PTE */ 281 /* Perform the setting of the PTE */
204 __set_pte_at(mm, addr, ptep, pte, 0); 282 __set_pte_at(mm, addr, ptep, pte, 0);
@@ -215,8 +293,7 @@ int ptep_set_access_flags(struct vm_area_struct *vma, unsigned long address,
215 pte_t *ptep, pte_t entry, int dirty) 293 pte_t *ptep, pte_t entry, int dirty)
216{ 294{
217 int changed; 295 int changed;
218 if (!dirty && pte_need_exec_flush(entry, 0)) 296 entry = set_access_flags_filter(entry, vma, dirty);
219 entry = do_dcache_icache_coherency(entry);
220 changed = !pte_same(*(ptep), entry); 297 changed = !pte_same(*(ptep), entry);
221 if (changed) { 298 if (changed) {
222 if (!(vma->vm_flags & VM_HUGETLB)) 299 if (!(vma->vm_flags & VM_HUGETLB))
@@ -242,7 +319,7 @@ void assert_pte_locked(struct mm_struct *mm, unsigned long addr)
242 BUG_ON(pud_none(*pud)); 319 BUG_ON(pud_none(*pud));
243 pmd = pmd_offset(pud, addr); 320 pmd = pmd_offset(pud, addr);
244 BUG_ON(!pmd_present(*pmd)); 321 BUG_ON(!pmd_present(*pmd));
245 BUG_ON(!spin_is_locked(pte_lockptr(mm, pmd))); 322 assert_spin_locked(pte_lockptr(mm, pmd));
246} 323}
247#endif /* CONFIG_DEBUG_VM */ 324#endif /* CONFIG_DEBUG_VM */
248 325
diff --git a/arch/powerpc/mm/pgtable_32.c b/arch/powerpc/mm/pgtable_32.c
index 5422169626ba..cb96cb2e17cc 100644
--- a/arch/powerpc/mm/pgtable_32.c
+++ b/arch/powerpc/mm/pgtable_32.c
@@ -142,7 +142,7 @@ ioremap_flags(phys_addr_t addr, unsigned long size, unsigned long flags)
142 flags |= _PAGE_DIRTY | _PAGE_HWWRITE; 142 flags |= _PAGE_DIRTY | _PAGE_HWWRITE;
143 143
144 /* we don't want to let _PAGE_USER and _PAGE_EXEC leak out */ 144 /* we don't want to let _PAGE_USER and _PAGE_EXEC leak out */
145 flags &= ~(_PAGE_USER | _PAGE_EXEC | _PAGE_HWEXEC); 145 flags &= ~(_PAGE_USER | _PAGE_EXEC);
146 146
147 return __ioremap_caller(addr, size, flags, __builtin_return_address(0)); 147 return __ioremap_caller(addr, size, flags, __builtin_return_address(0));
148} 148}
diff --git a/arch/powerpc/mm/pgtable_64.c b/arch/powerpc/mm/pgtable_64.c
index bfa7db6b2fd5..853d5565eed5 100644
--- a/arch/powerpc/mm/pgtable_64.c
+++ b/arch/powerpc/mm/pgtable_64.c
@@ -33,6 +33,8 @@
33#include <linux/stddef.h> 33#include <linux/stddef.h>
34#include <linux/vmalloc.h> 34#include <linux/vmalloc.h>
35#include <linux/init.h> 35#include <linux/init.h>
36#include <linux/bootmem.h>
37#include <linux/lmb.h>
36 38
37#include <asm/pgalloc.h> 39#include <asm/pgalloc.h>
38#include <asm/page.h> 40#include <asm/page.h>
@@ -55,19 +57,36 @@
55 57
56unsigned long ioremap_bot = IOREMAP_BASE; 58unsigned long ioremap_bot = IOREMAP_BASE;
57 59
60
61#ifdef CONFIG_PPC_MMU_NOHASH
62static void *early_alloc_pgtable(unsigned long size)
63{
64 void *pt;
65
66 if (init_bootmem_done)
67 pt = __alloc_bootmem(size, size, __pa(MAX_DMA_ADDRESS));
68 else
69 pt = __va(lmb_alloc_base(size, size,
70 __pa(MAX_DMA_ADDRESS)));
71 memset(pt, 0, size);
72
73 return pt;
74}
75#endif /* CONFIG_PPC_MMU_NOHASH */
76
58/* 77/*
59 * map_io_page currently only called by __ioremap 78 * map_kernel_page currently only called by __ioremap
60 * map_io_page adds an entry to the ioremap page table 79 * map_kernel_page adds an entry to the ioremap page table
61 * and adds an entry to the HPT, possibly bolting it 80 * and adds an entry to the HPT, possibly bolting it
62 */ 81 */
63static int map_io_page(unsigned long ea, unsigned long pa, int flags) 82int map_kernel_page(unsigned long ea, unsigned long pa, int flags)
64{ 83{
65 pgd_t *pgdp; 84 pgd_t *pgdp;
66 pud_t *pudp; 85 pud_t *pudp;
67 pmd_t *pmdp; 86 pmd_t *pmdp;
68 pte_t *ptep; 87 pte_t *ptep;
69 88
70 if (mem_init_done) { 89 if (slab_is_available()) {
71 pgdp = pgd_offset_k(ea); 90 pgdp = pgd_offset_k(ea);
72 pudp = pud_alloc(&init_mm, pgdp, ea); 91 pudp = pud_alloc(&init_mm, pgdp, ea);
73 if (!pudp) 92 if (!pudp)
@@ -81,6 +100,35 @@ static int map_io_page(unsigned long ea, unsigned long pa, int flags)
81 set_pte_at(&init_mm, ea, ptep, pfn_pte(pa >> PAGE_SHIFT, 100 set_pte_at(&init_mm, ea, ptep, pfn_pte(pa >> PAGE_SHIFT,
82 __pgprot(flags))); 101 __pgprot(flags)));
83 } else { 102 } else {
103#ifdef CONFIG_PPC_MMU_NOHASH
104 /* Warning ! This will blow up if bootmem is not initialized
105 * which our ppc64 code is keen to do that, we'll need to
106 * fix it and/or be more careful
107 */
108 pgdp = pgd_offset_k(ea);
109#ifdef PUD_TABLE_SIZE
110 if (pgd_none(*pgdp)) {
111 pudp = early_alloc_pgtable(PUD_TABLE_SIZE);
112 BUG_ON(pudp == NULL);
113 pgd_populate(&init_mm, pgdp, pudp);
114 }
115#endif /* PUD_TABLE_SIZE */
116 pudp = pud_offset(pgdp, ea);
117 if (pud_none(*pudp)) {
118 pmdp = early_alloc_pgtable(PMD_TABLE_SIZE);
119 BUG_ON(pmdp == NULL);
120 pud_populate(&init_mm, pudp, pmdp);
121 }
122 pmdp = pmd_offset(pudp, ea);
123 if (!pmd_present(*pmdp)) {
124 ptep = early_alloc_pgtable(PAGE_SIZE);
125 BUG_ON(ptep == NULL);
126 pmd_populate_kernel(&init_mm, pmdp, ptep);
127 }
128 ptep = pte_offset_kernel(pmdp, ea);
129 set_pte_at(&init_mm, ea, ptep, pfn_pte(pa >> PAGE_SHIFT,
130 __pgprot(flags)));
131#else /* CONFIG_PPC_MMU_NOHASH */
84 /* 132 /*
85 * If the mm subsystem is not fully up, we cannot create a 133 * If the mm subsystem is not fully up, we cannot create a
86 * linux page table entry for this mapping. Simply bolt an 134 * linux page table entry for this mapping. Simply bolt an
@@ -93,6 +141,7 @@ static int map_io_page(unsigned long ea, unsigned long pa, int flags)
93 "memory at %016lx !\n", pa); 141 "memory at %016lx !\n", pa);
94 return -ENOMEM; 142 return -ENOMEM;
95 } 143 }
144#endif /* !CONFIG_PPC_MMU_NOHASH */
96 } 145 }
97 return 0; 146 return 0;
98} 147}
@@ -124,7 +173,7 @@ void __iomem * __ioremap_at(phys_addr_t pa, void *ea, unsigned long size,
124 WARN_ON(size & ~PAGE_MASK); 173 WARN_ON(size & ~PAGE_MASK);
125 174
126 for (i = 0; i < size; i += PAGE_SIZE) 175 for (i = 0; i < size; i += PAGE_SIZE)
127 if (map_io_page((unsigned long)ea+i, pa+i, flags)) 176 if (map_kernel_page((unsigned long)ea+i, pa+i, flags))
128 return NULL; 177 return NULL;
129 178
130 return (void __iomem *)ea; 179 return (void __iomem *)ea;
diff --git a/arch/powerpc/mm/slb.c b/arch/powerpc/mm/slb.c
index a685652effeb..1d98ecc8eecd 100644
--- a/arch/powerpc/mm/slb.c
+++ b/arch/powerpc/mm/slb.c
@@ -191,7 +191,7 @@ void switch_slb(struct task_struct *tsk, struct mm_struct *mm)
191 unsigned long slbie_data = 0; 191 unsigned long slbie_data = 0;
192 unsigned long pc = KSTK_EIP(tsk); 192 unsigned long pc = KSTK_EIP(tsk);
193 unsigned long stack = KSTK_ESP(tsk); 193 unsigned long stack = KSTK_ESP(tsk);
194 unsigned long unmapped_base; 194 unsigned long exec_base;
195 195
196 /* 196 /*
197 * We need interrupts hard-disabled here, not just soft-disabled, 197 * We need interrupts hard-disabled here, not just soft-disabled,
@@ -227,42 +227,44 @@ void switch_slb(struct task_struct *tsk, struct mm_struct *mm)
227 227
228 /* 228 /*
229 * preload some userspace segments into the SLB. 229 * preload some userspace segments into the SLB.
230 * Almost all 32 and 64bit PowerPC executables are linked at
231 * 0x10000000 so it makes sense to preload this segment.
230 */ 232 */
231 if (test_tsk_thread_flag(tsk, TIF_32BIT)) 233 exec_base = 0x10000000;
232 unmapped_base = TASK_UNMAPPED_BASE_USER32;
233 else
234 unmapped_base = TASK_UNMAPPED_BASE_USER64;
235 234
236 if (is_kernel_addr(pc)) 235 if (is_kernel_addr(pc) || is_kernel_addr(stack) ||
237 return; 236 is_kernel_addr(exec_base))
238 slb_allocate(pc);
239
240 if (esids_match(pc,stack))
241 return; 237 return;
242 238
243 if (is_kernel_addr(stack)) 239 slb_allocate(pc);
244 return;
245 slb_allocate(stack);
246 240
247 if (esids_match(pc,unmapped_base) || esids_match(stack,unmapped_base)) 241 if (!esids_match(pc, stack))
248 return; 242 slb_allocate(stack);
249 243
250 if (is_kernel_addr(unmapped_base)) 244 if (!esids_match(pc, exec_base) &&
251 return; 245 !esids_match(stack, exec_base))
252 slb_allocate(unmapped_base); 246 slb_allocate(exec_base);
253} 247}
254 248
255static inline void patch_slb_encoding(unsigned int *insn_addr, 249static inline void patch_slb_encoding(unsigned int *insn_addr,
256 unsigned int immed) 250 unsigned int immed)
257{ 251{
258 /* Assume the instruction had a "0" immediate value, just 252 *insn_addr = (*insn_addr & 0xffff0000) | immed;
259 * "or" in the new value
260 */
261 *insn_addr |= immed;
262 flush_icache_range((unsigned long)insn_addr, 4+ 253 flush_icache_range((unsigned long)insn_addr, 4+
263 (unsigned long)insn_addr); 254 (unsigned long)insn_addr);
264} 255}
265 256
257void slb_set_size(u16 size)
258{
259 extern unsigned int *slb_compare_rr_to_size;
260
261 if (mmu_slb_size == size)
262 return;
263
264 mmu_slb_size = size;
265 patch_slb_encoding(slb_compare_rr_to_size, mmu_slb_size);
266}
267
266void slb_initialize(void) 268void slb_initialize(void)
267{ 269{
268 unsigned long linear_llp, vmalloc_llp, io_llp; 270 unsigned long linear_llp, vmalloc_llp, io_llp;
diff --git a/arch/powerpc/mm/stab.c b/arch/powerpc/mm/stab.c
index ab5fb48b3e90..687fddaa24c5 100644
--- a/arch/powerpc/mm/stab.c
+++ b/arch/powerpc/mm/stab.c
@@ -31,7 +31,7 @@ struct stab_entry {
31 31
32#define NR_STAB_CACHE_ENTRIES 8 32#define NR_STAB_CACHE_ENTRIES 8
33static DEFINE_PER_CPU(long, stab_cache_ptr); 33static DEFINE_PER_CPU(long, stab_cache_ptr);
34static DEFINE_PER_CPU(long, stab_cache[NR_STAB_CACHE_ENTRIES]); 34static DEFINE_PER_CPU(long [NR_STAB_CACHE_ENTRIES], stab_cache);
35 35
36/* 36/*
37 * Create a segment table entry for the given esid/vsid pair. 37 * Create a segment table entry for the given esid/vsid pair.
diff --git a/arch/powerpc/mm/tlb_hash32.c b/arch/powerpc/mm/tlb_hash32.c
index 65190587a365..8aaa8b7eb324 100644
--- a/arch/powerpc/mm/tlb_hash32.c
+++ b/arch/powerpc/mm/tlb_hash32.c
@@ -71,6 +71,9 @@ void tlb_flush(struct mmu_gather *tlb)
71 */ 71 */
72 _tlbia(); 72 _tlbia();
73 } 73 }
74
75 /* Push out batch of freed page tables */
76 pte_free_finish();
74} 77}
75 78
76/* 79/*
diff --git a/arch/powerpc/mm/tlb_hash64.c b/arch/powerpc/mm/tlb_hash64.c
index 937eb90677d9..2b2f35f6985e 100644
--- a/arch/powerpc/mm/tlb_hash64.c
+++ b/arch/powerpc/mm/tlb_hash64.c
@@ -33,11 +33,6 @@
33 33
34DEFINE_PER_CPU(struct ppc64_tlb_batch, ppc64_tlb_batch); 34DEFINE_PER_CPU(struct ppc64_tlb_batch, ppc64_tlb_batch);
35 35
36/* This is declared as we are using the more or less generic
37 * arch/powerpc/include/asm/tlb.h file -- tgall
38 */
39DEFINE_PER_CPU(struct mmu_gather, mmu_gathers);
40
41/* 36/*
42 * A linux PTE was changed and the corresponding hash table entry 37 * A linux PTE was changed and the corresponding hash table entry
43 * neesd to be flushed. This function will either perform the flush 38 * neesd to be flushed. This function will either perform the flush
@@ -154,6 +149,21 @@ void __flush_tlb_pending(struct ppc64_tlb_batch *batch)
154 batch->index = 0; 149 batch->index = 0;
155} 150}
156 151
152void tlb_flush(struct mmu_gather *tlb)
153{
154 struct ppc64_tlb_batch *tlbbatch = &__get_cpu_var(ppc64_tlb_batch);
155
156 /* If there's a TLB batch pending, then we must flush it because the
157 * pages are going to be freed and we really don't want to have a CPU
158 * access a freed page because it has a stale TLB
159 */
160 if (tlbbatch->index)
161 __flush_tlb_pending(tlbbatch);
162
163 /* Push out batch of freed page tables */
164 pte_free_finish();
165}
166
157/** 167/**
158 * __flush_hash_table_range - Flush all HPTEs for a given address range 168 * __flush_hash_table_range - Flush all HPTEs for a given address range
159 * from the hash table (and the TLB). But keeps 169 * from the hash table (and the TLB). But keeps
diff --git a/arch/powerpc/mm/tlb_low_64e.S b/arch/powerpc/mm/tlb_low_64e.S
new file mode 100644
index 000000000000..ef1cccf71173
--- /dev/null
+++ b/arch/powerpc/mm/tlb_low_64e.S
@@ -0,0 +1,770 @@
1/*
2 * Low leve TLB miss handlers for Book3E
3 *
4 * Copyright (C) 2008-2009
5 * Ben. Herrenschmidt (benh@kernel.crashing.org), IBM Corp.
6 *
7 * This program is free software; you can redistribute it and/or
8 * modify it under the terms of the GNU General Public License
9 * as published by the Free Software Foundation; either version
10 * 2 of the License, or (at your option) any later version.
11 */
12
13#include <asm/processor.h>
14#include <asm/reg.h>
15#include <asm/page.h>
16#include <asm/mmu.h>
17#include <asm/ppc_asm.h>
18#include <asm/asm-offsets.h>
19#include <asm/cputable.h>
20#include <asm/pgtable.h>
21#include <asm/reg.h>
22#include <asm/exception-64e.h>
23#include <asm/ppc-opcode.h>
24
25#ifdef CONFIG_PPC_64K_PAGES
26#define VPTE_PMD_SHIFT (PTE_INDEX_SIZE+1)
27#else
28#define VPTE_PMD_SHIFT (PTE_INDEX_SIZE)
29#endif
30#define VPTE_PUD_SHIFT (VPTE_PMD_SHIFT + PMD_INDEX_SIZE)
31#define VPTE_PGD_SHIFT (VPTE_PUD_SHIFT + PUD_INDEX_SIZE)
32#define VPTE_INDEX_SIZE (VPTE_PGD_SHIFT + PGD_INDEX_SIZE)
33
34
35/**********************************************************************
36 * *
37 * TLB miss handling for Book3E with TLB reservation and HES support *
38 * *
39 **********************************************************************/
40
41
42/* Data TLB miss */
43 START_EXCEPTION(data_tlb_miss)
44 TLB_MISS_PROLOG
45
46 /* Now we handle the fault proper. We only save DEAR in normal
47 * fault case since that's the only interesting values here.
48 * We could probably also optimize by not saving SRR0/1 in the
49 * linear mapping case but I'll leave that for later
50 */
51 mfspr r14,SPRN_ESR
52 mfspr r16,SPRN_DEAR /* get faulting address */
53 srdi r15,r16,60 /* get region */
54 cmpldi cr0,r15,0xc /* linear mapping ? */
55 TLB_MISS_STATS_SAVE_INFO
56 beq tlb_load_linear /* yes -> go to linear map load */
57
58 /* The page tables are mapped virtually linear. At this point, though,
59 * we don't know whether we are trying to fault in a first level
60 * virtual address or a virtual page table address. We can get that
61 * from bit 0x1 of the region ID which we have set for a page table
62 */
63 andi. r10,r15,0x1
64 bne- virt_page_table_tlb_miss
65
66 std r14,EX_TLB_ESR(r12); /* save ESR */
67 std r16,EX_TLB_DEAR(r12); /* save DEAR */
68
69 /* We need _PAGE_PRESENT and _PAGE_ACCESSED set */
70 li r11,_PAGE_PRESENT
71 oris r11,r11,_PAGE_ACCESSED@h
72
73 /* We do the user/kernel test for the PID here along with the RW test
74 */
75 cmpldi cr0,r15,0 /* Check for user region */
76
77 /* We pre-test some combination of permissions to avoid double
78 * faults:
79 *
80 * We move the ESR:ST bit into the position of _PAGE_BAP_SW in the PTE
81 * ESR_ST is 0x00800000
82 * _PAGE_BAP_SW is 0x00000010
83 * So the shift is >> 19. This tests for supervisor writeability.
84 * If the page happens to be supervisor writeable and not user
85 * writeable, we will take a new fault later, but that should be
86 * a rare enough case.
87 *
88 * We also move ESR_ST in _PAGE_DIRTY position
89 * _PAGE_DIRTY is 0x00001000 so the shift is >> 11
90 *
91 * MAS1 is preset for all we need except for TID that needs to
92 * be cleared for kernel translations
93 */
94 rlwimi r11,r14,32-19,27,27
95 rlwimi r11,r14,32-16,19,19
96 beq normal_tlb_miss
97 /* XXX replace the RMW cycles with immediate loads + writes */
981: mfspr r10,SPRN_MAS1
99 cmpldi cr0,r15,8 /* Check for vmalloc region */
100 rlwinm r10,r10,0,16,1 /* Clear TID */
101 mtspr SPRN_MAS1,r10
102 beq+ normal_tlb_miss
103
104 /* We got a crappy address, just fault with whatever DEAR and ESR
105 * are here
106 */
107 TLB_MISS_STATS_D(MMSTAT_TLB_MISS_NORM_FAULT)
108 TLB_MISS_EPILOG_ERROR
109 b exc_data_storage_book3e
110
111/* Instruction TLB miss */
112 START_EXCEPTION(instruction_tlb_miss)
113 TLB_MISS_PROLOG
114
115 /* If we take a recursive fault, the second level handler may need
116 * to know whether we are handling a data or instruction fault in
117 * order to get to the right store fault handler. We provide that
118 * info by writing a crazy value in ESR in our exception frame
119 */
120 li r14,-1 /* store to exception frame is done later */
121
122 /* Now we handle the fault proper. We only save DEAR in the non
123 * linear mapping case since we know the linear mapping case will
124 * not re-enter. We could indeed optimize and also not save SRR0/1
125 * in the linear mapping case but I'll leave that for later
126 *
127 * Faulting address is SRR0 which is already in r16
128 */
129 srdi r15,r16,60 /* get region */
130 cmpldi cr0,r15,0xc /* linear mapping ? */
131 TLB_MISS_STATS_SAVE_INFO
132 beq tlb_load_linear /* yes -> go to linear map load */
133
134 /* We do the user/kernel test for the PID here along with the RW test
135 */
136 li r11,_PAGE_PRESENT|_PAGE_EXEC /* Base perm */
137 oris r11,r11,_PAGE_ACCESSED@h
138
139 cmpldi cr0,r15,0 /* Check for user region */
140 std r14,EX_TLB_ESR(r12) /* write crazy -1 to frame */
141 beq normal_tlb_miss
142 /* XXX replace the RMW cycles with immediate loads + writes */
1431: mfspr r10,SPRN_MAS1
144 cmpldi cr0,r15,8 /* Check for vmalloc region */
145 rlwinm r10,r10,0,16,1 /* Clear TID */
146 mtspr SPRN_MAS1,r10
147 beq+ normal_tlb_miss
148
149 /* We got a crappy address, just fault */
150 TLB_MISS_STATS_I(MMSTAT_TLB_MISS_NORM_FAULT)
151 TLB_MISS_EPILOG_ERROR
152 b exc_instruction_storage_book3e
153
154/*
155 * This is the guts of the first-level TLB miss handler for direct
156 * misses. We are entered with:
157 *
158 * r16 = faulting address
159 * r15 = region ID
160 * r14 = crap (free to use)
161 * r13 = PACA
162 * r12 = TLB exception frame in PACA
163 * r11 = PTE permission mask
164 * r10 = crap (free to use)
165 */
166normal_tlb_miss:
167 /* So we first construct the page table address. We do that by
168 * shifting the bottom of the address (not the region ID) by
169 * PAGE_SHIFT-3, clearing the bottom 3 bits (get a PTE ptr) and
170 * or'ing the fourth high bit.
171 *
172 * NOTE: For 64K pages, we do things slightly differently in
173 * order to handle the weird page table format used by linux
174 */
175 ori r10,r15,0x1
176#ifdef CONFIG_PPC_64K_PAGES
177 /* For the top bits, 16 bytes per PTE */
178 rldicl r14,r16,64-(PAGE_SHIFT-4),PAGE_SHIFT-4+4
179 /* Now create the bottom bits as 0 in position 0x8000 and
180 * the rest calculated for 8 bytes per PTE
181 */
182 rldicl r15,r16,64-(PAGE_SHIFT-3),64-15
183 /* Insert the bottom bits in */
184 rlwimi r14,r15,0,16,31
185#else
186 rldicl r14,r16,64-(PAGE_SHIFT-3),PAGE_SHIFT-3+4
187#endif
188 sldi r15,r10,60
189 clrrdi r14,r14,3
190 or r10,r15,r14
191
192BEGIN_MMU_FTR_SECTION
193 /* Set the TLB reservation and seach for existing entry. Then load
194 * the entry.
195 */
196 PPC_TLBSRX_DOT(0,r16)
197 ld r14,0(r10)
198 beq normal_tlb_miss_done
199MMU_FTR_SECTION_ELSE
200 ld r14,0(r10)
201ALT_MMU_FTR_SECTION_END_IFSET(MMU_FTR_USE_TLBRSRV)
202
203finish_normal_tlb_miss:
204 /* Check if required permissions are met */
205 andc. r15,r11,r14
206 bne- normal_tlb_miss_access_fault
207
208 /* Now we build the MAS:
209 *
210 * MAS 0 : Fully setup with defaults in MAS4 and TLBnCFG
211 * MAS 1 : Almost fully setup
212 * - PID already updated by caller if necessary
213 * - TSIZE need change if !base page size, not
214 * yet implemented for now
215 * MAS 2 : Defaults not useful, need to be redone
216 * MAS 3+7 : Needs to be done
217 *
218 * TODO: mix up code below for better scheduling
219 */
220 clrrdi r11,r16,12 /* Clear low crap in EA */
221 rlwimi r11,r14,32-19,27,31 /* Insert WIMGE */
222 mtspr SPRN_MAS2,r11
223
224 /* Check page size, if not standard, update MAS1 */
225 rldicl r11,r14,64-8,64-8
226#ifdef CONFIG_PPC_64K_PAGES
227 cmpldi cr0,r11,BOOK3E_PAGESZ_64K
228#else
229 cmpldi cr0,r11,BOOK3E_PAGESZ_4K
230#endif
231 beq- 1f
232 mfspr r11,SPRN_MAS1
233 rlwimi r11,r14,31,21,24
234 rlwinm r11,r11,0,21,19
235 mtspr SPRN_MAS1,r11
2361:
237 /* Move RPN in position */
238 rldicr r11,r14,64-(PTE_RPN_SHIFT-PAGE_SHIFT),63-PAGE_SHIFT
239 clrldi r15,r11,12 /* Clear crap at the top */
240 rlwimi r15,r14,32-8,22,25 /* Move in U bits */
241 rlwimi r15,r14,32-2,26,31 /* Move in BAP bits */
242
243 /* Mask out SW and UW if !DIRTY (XXX optimize this !) */
244 andi. r11,r14,_PAGE_DIRTY
245 bne 1f
246 li r11,MAS3_SW|MAS3_UW
247 andc r15,r15,r11
2481:
249BEGIN_MMU_FTR_SECTION
250 srdi r16,r15,32
251 mtspr SPRN_MAS3,r15
252 mtspr SPRN_MAS7,r16
253MMU_FTR_SECTION_ELSE
254 mtspr SPRN_MAS7_MAS3,r15
255ALT_MMU_FTR_SECTION_END_IFCLR(MMU_FTR_USE_PAIRED_MAS)
256
257 tlbwe
258
259normal_tlb_miss_done:
260 /* We don't bother with restoring DEAR or ESR since we know we are
261 * level 0 and just going back to userland. They are only needed
262 * if you are going to take an access fault
263 */
264 TLB_MISS_STATS_X(MMSTAT_TLB_MISS_NORM_OK)
265 TLB_MISS_EPILOG_SUCCESS
266 rfi
267
268normal_tlb_miss_access_fault:
269 /* We need to check if it was an instruction miss */
270 andi. r10,r11,_PAGE_EXEC
271 bne 1f
272 ld r14,EX_TLB_DEAR(r12)
273 ld r15,EX_TLB_ESR(r12)
274 mtspr SPRN_DEAR,r14
275 mtspr SPRN_ESR,r15
276 TLB_MISS_STATS_D(MMSTAT_TLB_MISS_NORM_FAULT)
277 TLB_MISS_EPILOG_ERROR
278 b exc_data_storage_book3e
2791: TLB_MISS_STATS_I(MMSTAT_TLB_MISS_NORM_FAULT)
280 TLB_MISS_EPILOG_ERROR
281 b exc_instruction_storage_book3e
282
283
284/*
285 * This is the guts of the second-level TLB miss handler for direct
286 * misses. We are entered with:
287 *
288 * r16 = virtual page table faulting address
289 * r15 = region (top 4 bits of address)
290 * r14 = crap (free to use)
291 * r13 = PACA
292 * r12 = TLB exception frame in PACA
293 * r11 = crap (free to use)
294 * r10 = crap (free to use)
295 *
296 * Note that this should only ever be called as a second level handler
297 * with the current scheme when using SW load.
298 * That means we can always get the original fault DEAR at
299 * EX_TLB_DEAR-EX_TLB_SIZE(r12)
300 *
301 * It can be re-entered by the linear mapping miss handler. However, to
302 * avoid too much complication, it will restart the whole fault at level
303 * 0 so we don't care too much about clobbers
304 *
305 * XXX That code was written back when we couldn't clobber r14. We can now,
306 * so we could probably optimize things a bit
307 */
308virt_page_table_tlb_miss:
309 /* Are we hitting a kernel page table ? */
310 andi. r10,r15,0x8
311
312 /* The cool thing now is that r10 contains 0 for user and 8 for kernel,
313 * and we happen to have the swapper_pg_dir at offset 8 from the user
314 * pgdir in the PACA :-).
315 */
316 add r11,r10,r13
317
318 /* If kernel, we need to clear MAS1 TID */
319 beq 1f
320 /* XXX replace the RMW cycles with immediate loads + writes */
321 mfspr r10,SPRN_MAS1
322 rlwinm r10,r10,0,16,1 /* Clear TID */
323 mtspr SPRN_MAS1,r10
3241:
325BEGIN_MMU_FTR_SECTION
326 /* Search if we already have a TLB entry for that virtual address, and
327 * if we do, bail out.
328 */
329 PPC_TLBSRX_DOT(0,r16)
330 beq virt_page_table_tlb_miss_done
331END_MMU_FTR_SECTION_IFSET(MMU_FTR_USE_TLBRSRV)
332
333 /* Now, we need to walk the page tables. First check if we are in
334 * range.
335 */
336 rldicl. r10,r16,64-(VPTE_INDEX_SIZE+3),VPTE_INDEX_SIZE+3+4
337 bne- virt_page_table_tlb_miss_fault
338
339 /* Get the PGD pointer */
340 ld r15,PACAPGD(r11)
341 cmpldi cr0,r15,0
342 beq- virt_page_table_tlb_miss_fault
343
344 /* Get to PGD entry */
345 rldicl r11,r16,64-VPTE_PGD_SHIFT,64-PGD_INDEX_SIZE-3
346 clrrdi r10,r11,3
347 ldx r15,r10,r15
348 cmpldi cr0,r15,0
349 beq virt_page_table_tlb_miss_fault
350
351#ifndef CONFIG_PPC_64K_PAGES
352 /* Get to PUD entry */
353 rldicl r11,r16,64-VPTE_PUD_SHIFT,64-PUD_INDEX_SIZE-3
354 clrrdi r10,r11,3
355 ldx r15,r10,r15
356 cmpldi cr0,r15,0
357 beq virt_page_table_tlb_miss_fault
358#endif /* CONFIG_PPC_64K_PAGES */
359
360 /* Get to PMD entry */
361 rldicl r11,r16,64-VPTE_PMD_SHIFT,64-PMD_INDEX_SIZE-3
362 clrrdi r10,r11,3
363 ldx r15,r10,r15
364 cmpldi cr0,r15,0
365 beq virt_page_table_tlb_miss_fault
366
367 /* Ok, we're all right, we can now create a kernel translation for
368 * a 4K or 64K page from r16 -> r15.
369 */
370 /* Now we build the MAS:
371 *
372 * MAS 0 : Fully setup with defaults in MAS4 and TLBnCFG
373 * MAS 1 : Almost fully setup
374 * - PID already updated by caller if necessary
375 * - TSIZE for now is base page size always
376 * MAS 2 : Use defaults
377 * MAS 3+7 : Needs to be done
378 *
379 * So we only do MAS 2 and 3 for now...
380 */
381 clrldi r11,r15,4 /* remove region ID from RPN */
382 ori r10,r11,1 /* Or-in SR */
383
384BEGIN_MMU_FTR_SECTION
385 srdi r16,r10,32
386 mtspr SPRN_MAS3,r10
387 mtspr SPRN_MAS7,r16
388MMU_FTR_SECTION_ELSE
389 mtspr SPRN_MAS7_MAS3,r10
390ALT_MMU_FTR_SECTION_END_IFCLR(MMU_FTR_USE_PAIRED_MAS)
391
392 tlbwe
393
394BEGIN_MMU_FTR_SECTION
395virt_page_table_tlb_miss_done:
396
397 /* We have overriden MAS2:EPN but currently our primary TLB miss
398 * handler will always restore it so that should not be an issue,
399 * if we ever optimize the primary handler to not write MAS2 on
400 * some cases, we'll have to restore MAS2:EPN here based on the
401 * original fault's DEAR. If we do that we have to modify the
402 * ITLB miss handler to also store SRR0 in the exception frame
403 * as DEAR.
404 *
405 * However, one nasty thing we did is we cleared the reservation
406 * (well, potentially we did). We do a trick here thus if we
407 * are not a level 0 exception (we interrupted the TLB miss) we
408 * offset the return address by -4 in order to replay the tlbsrx
409 * instruction there
410 */
411 subf r10,r13,r12
412 cmpldi cr0,r10,PACA_EXTLB+EX_TLB_SIZE
413 bne- 1f
414 ld r11,PACA_EXTLB+EX_TLB_SIZE+EX_TLB_SRR0(r13)
415 addi r10,r11,-4
416 std r10,PACA_EXTLB+EX_TLB_SIZE+EX_TLB_SRR0(r13)
4171:
418END_MMU_FTR_SECTION_IFSET(MMU_FTR_USE_TLBRSRV)
419 /* Return to caller, normal case */
420 TLB_MISS_STATS_X(MMSTAT_TLB_MISS_PT_OK);
421 TLB_MISS_EPILOG_SUCCESS
422 rfi
423
424virt_page_table_tlb_miss_fault:
425 /* If we fault here, things are a little bit tricky. We need to call
426 * either data or instruction store fault, and we need to retreive
427 * the original fault address and ESR (for data).
428 *
429 * The thing is, we know that in normal circumstances, this is
430 * always called as a second level tlb miss for SW load or as a first
431 * level TLB miss for HW load, so we should be able to peek at the
432 * relevant informations in the first exception frame in the PACA.
433 *
434 * However, we do need to double check that, because we may just hit
435 * a stray kernel pointer or a userland attack trying to hit those
436 * areas. If that is the case, we do a data fault. (We can't get here
437 * from an instruction tlb miss anyway).
438 *
439 * Note also that when going to a fault, we must unwind the previous
440 * level as well. Since we are doing that, we don't need to clear or
441 * restore the TLB reservation neither.
442 */
443 subf r10,r13,r12
444 cmpldi cr0,r10,PACA_EXTLB+EX_TLB_SIZE
445 bne- virt_page_table_tlb_miss_whacko_fault
446
447 /* We dig the original DEAR and ESR from slot 0 */
448 ld r15,EX_TLB_DEAR+PACA_EXTLB(r13)
449 ld r16,EX_TLB_ESR+PACA_EXTLB(r13)
450
451 /* We check for the "special" ESR value for instruction faults */
452 cmpdi cr0,r16,-1
453 beq 1f
454 mtspr SPRN_DEAR,r15
455 mtspr SPRN_ESR,r16
456 TLB_MISS_STATS_D(MMSTAT_TLB_MISS_PT_FAULT);
457 TLB_MISS_EPILOG_ERROR
458 b exc_data_storage_book3e
4591: TLB_MISS_STATS_I(MMSTAT_TLB_MISS_PT_FAULT);
460 TLB_MISS_EPILOG_ERROR
461 b exc_instruction_storage_book3e
462
463virt_page_table_tlb_miss_whacko_fault:
464 /* The linear fault will restart everything so ESR and DEAR will
465 * not have been clobbered, let's just fault with what we have
466 */
467 TLB_MISS_STATS_X(MMSTAT_TLB_MISS_PT_FAULT);
468 TLB_MISS_EPILOG_ERROR
469 b exc_data_storage_book3e
470
471
472/**************************************************************
473 * *
474 * TLB miss handling for Book3E with hw page table support *
475 * *
476 **************************************************************/
477
478
479/* Data TLB miss */
480 START_EXCEPTION(data_tlb_miss_htw)
481 TLB_MISS_PROLOG
482
483 /* Now we handle the fault proper. We only save DEAR in normal
484 * fault case since that's the only interesting values here.
485 * We could probably also optimize by not saving SRR0/1 in the
486 * linear mapping case but I'll leave that for later
487 */
488 mfspr r14,SPRN_ESR
489 mfspr r16,SPRN_DEAR /* get faulting address */
490 srdi r11,r16,60 /* get region */
491 cmpldi cr0,r11,0xc /* linear mapping ? */
492 TLB_MISS_STATS_SAVE_INFO
493 beq tlb_load_linear /* yes -> go to linear map load */
494
495 /* We do the user/kernel test for the PID here along with the RW test
496 */
497 cmpldi cr0,r11,0 /* Check for user region */
498 ld r15,PACAPGD(r13) /* Load user pgdir */
499 beq htw_tlb_miss
500
501 /* XXX replace the RMW cycles with immediate loads + writes */
5021: mfspr r10,SPRN_MAS1
503 cmpldi cr0,r11,8 /* Check for vmalloc region */
504 rlwinm r10,r10,0,16,1 /* Clear TID */
505 mtspr SPRN_MAS1,r10
506 ld r15,PACA_KERNELPGD(r13) /* Load kernel pgdir */
507 beq+ htw_tlb_miss
508
509 /* We got a crappy address, just fault with whatever DEAR and ESR
510 * are here
511 */
512 TLB_MISS_STATS_D(MMSTAT_TLB_MISS_NORM_FAULT)
513 TLB_MISS_EPILOG_ERROR
514 b exc_data_storage_book3e
515
516/* Instruction TLB miss */
517 START_EXCEPTION(instruction_tlb_miss_htw)
518 TLB_MISS_PROLOG
519
520 /* If we take a recursive fault, the second level handler may need
521 * to know whether we are handling a data or instruction fault in
522 * order to get to the right store fault handler. We provide that
523 * info by keeping a crazy value for ESR in r14
524 */
525 li r14,-1 /* store to exception frame is done later */
526
527 /* Now we handle the fault proper. We only save DEAR in the non
528 * linear mapping case since we know the linear mapping case will
529 * not re-enter. We could indeed optimize and also not save SRR0/1
530 * in the linear mapping case but I'll leave that for later
531 *
532 * Faulting address is SRR0 which is already in r16
533 */
534 srdi r11,r16,60 /* get region */
535 cmpldi cr0,r11,0xc /* linear mapping ? */
536 TLB_MISS_STATS_SAVE_INFO
537 beq tlb_load_linear /* yes -> go to linear map load */
538
539 /* We do the user/kernel test for the PID here along with the RW test
540 */
541 cmpldi cr0,r11,0 /* Check for user region */
542 ld r15,PACAPGD(r13) /* Load user pgdir */
543 beq htw_tlb_miss
544
545 /* XXX replace the RMW cycles with immediate loads + writes */
5461: mfspr r10,SPRN_MAS1
547 cmpldi cr0,r11,8 /* Check for vmalloc region */
548 rlwinm r10,r10,0,16,1 /* Clear TID */
549 mtspr SPRN_MAS1,r10
550 ld r15,PACA_KERNELPGD(r13) /* Load kernel pgdir */
551 beq+ htw_tlb_miss
552
553 /* We got a crappy address, just fault */
554 TLB_MISS_STATS_I(MMSTAT_TLB_MISS_NORM_FAULT)
555 TLB_MISS_EPILOG_ERROR
556 b exc_instruction_storage_book3e
557
558
559/*
560 * This is the guts of the second-level TLB miss handler for direct
561 * misses. We are entered with:
562 *
563 * r16 = virtual page table faulting address
564 * r15 = PGD pointer
565 * r14 = ESR
566 * r13 = PACA
567 * r12 = TLB exception frame in PACA
568 * r11 = crap (free to use)
569 * r10 = crap (free to use)
570 *
571 * It can be re-entered by the linear mapping miss handler. However, to
572 * avoid too much complication, it will save/restore things for us
573 */
574htw_tlb_miss:
575 /* Search if we already have a TLB entry for that virtual address, and
576 * if we do, bail out.
577 *
578 * MAS1:IND should be already set based on MAS4
579 */
580 PPC_TLBSRX_DOT(0,r16)
581 beq htw_tlb_miss_done
582
583 /* Now, we need to walk the page tables. First check if we are in
584 * range.
585 */
586 rldicl. r10,r16,64-PGTABLE_EADDR_SIZE,PGTABLE_EADDR_SIZE+4
587 bne- htw_tlb_miss_fault
588
589 /* Get the PGD pointer */
590 cmpldi cr0,r15,0
591 beq- htw_tlb_miss_fault
592
593 /* Get to PGD entry */
594 rldicl r11,r16,64-(PGDIR_SHIFT-3),64-PGD_INDEX_SIZE-3
595 clrrdi r10,r11,3
596 ldx r15,r10,r15
597 cmpldi cr0,r15,0
598 beq htw_tlb_miss_fault
599
600#ifndef CONFIG_PPC_64K_PAGES
601 /* Get to PUD entry */
602 rldicl r11,r16,64-(PUD_SHIFT-3),64-PUD_INDEX_SIZE-3
603 clrrdi r10,r11,3
604 ldx r15,r10,r15
605 cmpldi cr0,r15,0
606 beq htw_tlb_miss_fault
607#endif /* CONFIG_PPC_64K_PAGES */
608
609 /* Get to PMD entry */
610 rldicl r11,r16,64-(PMD_SHIFT-3),64-PMD_INDEX_SIZE-3
611 clrrdi r10,r11,3
612 ldx r15,r10,r15
613 cmpldi cr0,r15,0
614 beq htw_tlb_miss_fault
615
616 /* Ok, we're all right, we can now create an indirect entry for
617 * a 1M or 256M page.
618 *
619 * The last trick is now that because we use "half" pages for
620 * the HTW (1M IND is 2K and 256M IND is 32K) we need to account
621 * for an added LSB bit to the RPN. For 64K pages, there is no
622 * problem as we already use 32K arrays (half PTE pages), but for
623 * 4K page we need to extract a bit from the virtual address and
624 * insert it into the "PA52" bit of the RPN.
625 */
626#ifndef CONFIG_PPC_64K_PAGES
627 rlwimi r15,r16,32-9,20,20
628#endif
629 /* Now we build the MAS:
630 *
631 * MAS 0 : Fully setup with defaults in MAS4 and TLBnCFG
632 * MAS 1 : Almost fully setup
633 * - PID already updated by caller if necessary
634 * - TSIZE for now is base ind page size always
635 * MAS 2 : Use defaults
636 * MAS 3+7 : Needs to be done
637 */
638#ifdef CONFIG_PPC_64K_PAGES
639 ori r10,r15,(BOOK3E_PAGESZ_64K << MAS3_SPSIZE_SHIFT)
640#else
641 ori r10,r15,(BOOK3E_PAGESZ_4K << MAS3_SPSIZE_SHIFT)
642#endif
643
644BEGIN_MMU_FTR_SECTION
645 srdi r16,r10,32
646 mtspr SPRN_MAS3,r10
647 mtspr SPRN_MAS7,r16
648MMU_FTR_SECTION_ELSE
649 mtspr SPRN_MAS7_MAS3,r10
650ALT_MMU_FTR_SECTION_END_IFCLR(MMU_FTR_USE_PAIRED_MAS)
651
652 tlbwe
653
654htw_tlb_miss_done:
655 /* We don't bother with restoring DEAR or ESR since we know we are
656 * level 0 and just going back to userland. They are only needed
657 * if you are going to take an access fault
658 */
659 TLB_MISS_STATS_X(MMSTAT_TLB_MISS_PT_OK)
660 TLB_MISS_EPILOG_SUCCESS
661 rfi
662
663htw_tlb_miss_fault:
664 /* We need to check if it was an instruction miss. We know this
665 * though because r14 would contain -1
666 */
667 cmpdi cr0,r14,-1
668 beq 1f
669 mtspr SPRN_DEAR,r16
670 mtspr SPRN_ESR,r14
671 TLB_MISS_STATS_D(MMSTAT_TLB_MISS_PT_FAULT)
672 TLB_MISS_EPILOG_ERROR
673 b exc_data_storage_book3e
6741: TLB_MISS_STATS_I(MMSTAT_TLB_MISS_PT_FAULT)
675 TLB_MISS_EPILOG_ERROR
676 b exc_instruction_storage_book3e
677
678/*
679 * This is the guts of "any" level TLB miss handler for kernel linear
680 * mapping misses. We are entered with:
681 *
682 *
683 * r16 = faulting address
684 * r15 = crap (free to use)
685 * r14 = ESR (data) or -1 (instruction)
686 * r13 = PACA
687 * r12 = TLB exception frame in PACA
688 * r11 = crap (free to use)
689 * r10 = crap (free to use)
690 *
691 * In addition we know that we will not re-enter, so in theory, we could
692 * use a simpler epilog not restoring SRR0/1 etc.. but we'll do that later.
693 *
694 * We also need to be careful about MAS registers here & TLB reservation,
695 * as we know we'll have clobbered them if we interrupt the main TLB miss
696 * handlers in which case we probably want to do a full restart at level
697 * 0 rather than saving / restoring the MAS.
698 *
699 * Note: If we care about performance of that core, we can easily shuffle
700 * a few things around
701 */
702tlb_load_linear:
703 /* For now, we assume the linear mapping is contiguous and stops at
704 * linear_map_top. We also assume the size is a multiple of 1G, thus
705 * we only use 1G pages for now. That might have to be changed in a
706 * final implementation, especially when dealing with hypervisors
707 */
708 ld r11,PACATOC(r13)
709 ld r11,linear_map_top@got(r11)
710 ld r10,0(r11)
711 cmpld cr0,r10,r16
712 bge tlb_load_linear_fault
713
714 /* MAS1 need whole new setup. */
715 li r15,(BOOK3E_PAGESZ_1GB<<MAS1_TSIZE_SHIFT)
716 oris r15,r15,MAS1_VALID@h /* MAS1 needs V and TSIZE */
717 mtspr SPRN_MAS1,r15
718
719 /* Already somebody there ? */
720 PPC_TLBSRX_DOT(0,r16)
721 beq tlb_load_linear_done
722
723 /* Now we build the remaining MAS. MAS0 and 2 should be fine
724 * with their defaults, which leaves us with MAS 3 and 7. The
725 * mapping is linear, so we just take the address, clear the
726 * region bits, and or in the permission bits which are currently
727 * hard wired
728 */
729 clrrdi r10,r16,30 /* 1G page index */
730 clrldi r10,r10,4 /* clear region bits */
731 ori r10,r10,MAS3_SR|MAS3_SW|MAS3_SX
732
733BEGIN_MMU_FTR_SECTION
734 srdi r16,r10,32
735 mtspr SPRN_MAS3,r10
736 mtspr SPRN_MAS7,r16
737MMU_FTR_SECTION_ELSE
738 mtspr SPRN_MAS7_MAS3,r10
739ALT_MMU_FTR_SECTION_END_IFCLR(MMU_FTR_USE_PAIRED_MAS)
740
741 tlbwe
742
743tlb_load_linear_done:
744 /* We use the "error" epilog for success as we do want to
745 * restore to the initial faulting context, whatever it was.
746 * We do that because we can't resume a fault within a TLB
747 * miss handler, due to MAS and TLB reservation being clobbered.
748 */
749 TLB_MISS_STATS_X(MMSTAT_TLB_MISS_LINEAR)
750 TLB_MISS_EPILOG_ERROR
751 rfi
752
753tlb_load_linear_fault:
754 /* We keep the DEAR and ESR around, this shouldn't have happened */
755 cmpdi cr0,r14,-1
756 beq 1f
757 TLB_MISS_EPILOG_ERROR_SPECIAL
758 b exc_data_storage_book3e
7591: TLB_MISS_EPILOG_ERROR_SPECIAL
760 b exc_instruction_storage_book3e
761
762
763#ifdef CONFIG_BOOK3E_MMU_TLB_STATS
764.tlb_stat_inc:
7651: ldarx r8,0,r9
766 addi r8,r8,1
767 stdcx. r8,0,r9
768 bne- 1b
769 blr
770#endif
diff --git a/arch/powerpc/mm/tlb_nohash.c b/arch/powerpc/mm/tlb_nohash.c
index ad2eb4d34dd4..2fbc680c2c71 100644
--- a/arch/powerpc/mm/tlb_nohash.c
+++ b/arch/powerpc/mm/tlb_nohash.c
@@ -7,8 +7,8 @@
7 * 7 *
8 * -- BenH 8 * -- BenH
9 * 9 *
10 * Copyright 2008 Ben Herrenschmidt <benh@kernel.crashing.org> 10 * Copyright 2008,2009 Ben Herrenschmidt <benh@kernel.crashing.org>
11 * IBM Corp. 11 * IBM Corp.
12 * 12 *
13 * Derived from arch/ppc/mm/init.c: 13 * Derived from arch/ppc/mm/init.c:
14 * Copyright (C) 1995-1996 Gary Thomas (gdt@linuxppc.org) 14 * Copyright (C) 1995-1996 Gary Thomas (gdt@linuxppc.org)
@@ -34,12 +34,71 @@
34#include <linux/pagemap.h> 34#include <linux/pagemap.h>
35#include <linux/preempt.h> 35#include <linux/preempt.h>
36#include <linux/spinlock.h> 36#include <linux/spinlock.h>
37#include <linux/lmb.h>
37 38
38#include <asm/tlbflush.h> 39#include <asm/tlbflush.h>
39#include <asm/tlb.h> 40#include <asm/tlb.h>
41#include <asm/code-patching.h>
40 42
41#include "mmu_decl.h" 43#include "mmu_decl.h"
42 44
45#ifdef CONFIG_PPC_BOOK3E
46struct mmu_psize_def mmu_psize_defs[MMU_PAGE_COUNT] = {
47 [MMU_PAGE_4K] = {
48 .shift = 12,
49 .enc = BOOK3E_PAGESZ_4K,
50 },
51 [MMU_PAGE_16K] = {
52 .shift = 14,
53 .enc = BOOK3E_PAGESZ_16K,
54 },
55 [MMU_PAGE_64K] = {
56 .shift = 16,
57 .enc = BOOK3E_PAGESZ_64K,
58 },
59 [MMU_PAGE_1M] = {
60 .shift = 20,
61 .enc = BOOK3E_PAGESZ_1M,
62 },
63 [MMU_PAGE_16M] = {
64 .shift = 24,
65 .enc = BOOK3E_PAGESZ_16M,
66 },
67 [MMU_PAGE_256M] = {
68 .shift = 28,
69 .enc = BOOK3E_PAGESZ_256M,
70 },
71 [MMU_PAGE_1G] = {
72 .shift = 30,
73 .enc = BOOK3E_PAGESZ_1GB,
74 },
75};
76static inline int mmu_get_tsize(int psize)
77{
78 return mmu_psize_defs[psize].enc;
79}
80#else
81static inline int mmu_get_tsize(int psize)
82{
83 /* This isn't used on !Book3E for now */
84 return 0;
85}
86#endif
87
88/* The variables below are currently only used on 64-bit Book3E
89 * though this will probably be made common with other nohash
90 * implementations at some point
91 */
92#ifdef CONFIG_PPC64
93
94int mmu_linear_psize; /* Page size used for the linear mapping */
95int mmu_pte_psize; /* Page size used for PTE pages */
96int mmu_vmemmap_psize; /* Page size used for the virtual mem map */
97int book3e_htw_enabled; /* Is HW tablewalk enabled ? */
98unsigned long linear_map_top; /* Top of linear mapping */
99
100#endif /* CONFIG_PPC64 */
101
43/* 102/*
44 * Base TLB flushing operations: 103 * Base TLB flushing operations:
45 * 104 *
@@ -67,18 +126,24 @@ void local_flush_tlb_mm(struct mm_struct *mm)
67} 126}
68EXPORT_SYMBOL(local_flush_tlb_mm); 127EXPORT_SYMBOL(local_flush_tlb_mm);
69 128
70void local_flush_tlb_page(struct vm_area_struct *vma, unsigned long vmaddr) 129void __local_flush_tlb_page(struct mm_struct *mm, unsigned long vmaddr,
130 int tsize, int ind)
71{ 131{
72 unsigned int pid; 132 unsigned int pid;
73 133
74 preempt_disable(); 134 preempt_disable();
75 pid = vma ? vma->vm_mm->context.id : 0; 135 pid = mm ? mm->context.id : 0;
76 if (pid != MMU_NO_CONTEXT) 136 if (pid != MMU_NO_CONTEXT)
77 _tlbil_va(vmaddr, pid); 137 _tlbil_va(vmaddr, pid, tsize, ind);
78 preempt_enable(); 138 preempt_enable();
79} 139}
80EXPORT_SYMBOL(local_flush_tlb_page);
81 140
141void local_flush_tlb_page(struct vm_area_struct *vma, unsigned long vmaddr)
142{
143 __local_flush_tlb_page(vma ? vma->vm_mm : NULL, vmaddr,
144 mmu_get_tsize(mmu_virtual_psize), 0);
145}
146EXPORT_SYMBOL(local_flush_tlb_page);
82 147
83/* 148/*
84 * And here are the SMP non-local implementations 149 * And here are the SMP non-local implementations
@@ -87,9 +152,17 @@ EXPORT_SYMBOL(local_flush_tlb_page);
87 152
88static DEFINE_SPINLOCK(tlbivax_lock); 153static DEFINE_SPINLOCK(tlbivax_lock);
89 154
155static int mm_is_core_local(struct mm_struct *mm)
156{
157 return cpumask_subset(mm_cpumask(mm),
158 topology_thread_cpumask(smp_processor_id()));
159}
160
90struct tlb_flush_param { 161struct tlb_flush_param {
91 unsigned long addr; 162 unsigned long addr;
92 unsigned int pid; 163 unsigned int pid;
164 unsigned int tsize;
165 unsigned int ind;
93}; 166};
94 167
95static void do_flush_tlb_mm_ipi(void *param) 168static void do_flush_tlb_mm_ipi(void *param)
@@ -103,7 +176,7 @@ static void do_flush_tlb_page_ipi(void *param)
103{ 176{
104 struct tlb_flush_param *p = param; 177 struct tlb_flush_param *p = param;
105 178
106 _tlbil_va(p->addr, p->pid); 179 _tlbil_va(p->addr, p->pid, p->tsize, p->ind);
107} 180}
108 181
109 182
@@ -131,7 +204,7 @@ void flush_tlb_mm(struct mm_struct *mm)
131 pid = mm->context.id; 204 pid = mm->context.id;
132 if (unlikely(pid == MMU_NO_CONTEXT)) 205 if (unlikely(pid == MMU_NO_CONTEXT))
133 goto no_context; 206 goto no_context;
134 if (!cpumask_equal(mm_cpumask(mm), cpumask_of(smp_processor_id()))) { 207 if (!mm_is_core_local(mm)) {
135 struct tlb_flush_param p = { .pid = pid }; 208 struct tlb_flush_param p = { .pid = pid };
136 /* Ignores smp_processor_id() even if set. */ 209 /* Ignores smp_processor_id() even if set. */
137 smp_call_function_many(mm_cpumask(mm), 210 smp_call_function_many(mm_cpumask(mm),
@@ -143,37 +216,49 @@ void flush_tlb_mm(struct mm_struct *mm)
143} 216}
144EXPORT_SYMBOL(flush_tlb_mm); 217EXPORT_SYMBOL(flush_tlb_mm);
145 218
146void flush_tlb_page(struct vm_area_struct *vma, unsigned long vmaddr) 219void __flush_tlb_page(struct mm_struct *mm, unsigned long vmaddr,
220 int tsize, int ind)
147{ 221{
148 struct cpumask *cpu_mask; 222 struct cpumask *cpu_mask;
149 unsigned int pid; 223 unsigned int pid;
150 224
151 preempt_disable(); 225 preempt_disable();
152 pid = vma ? vma->vm_mm->context.id : 0; 226 pid = mm ? mm->context.id : 0;
153 if (unlikely(pid == MMU_NO_CONTEXT)) 227 if (unlikely(pid == MMU_NO_CONTEXT))
154 goto bail; 228 goto bail;
155 cpu_mask = mm_cpumask(vma->vm_mm); 229 cpu_mask = mm_cpumask(mm);
156 if (!cpumask_equal(cpu_mask, cpumask_of(smp_processor_id()))) { 230 if (!mm_is_core_local(mm)) {
157 /* If broadcast tlbivax is supported, use it */ 231 /* If broadcast tlbivax is supported, use it */
158 if (mmu_has_feature(MMU_FTR_USE_TLBIVAX_BCAST)) { 232 if (mmu_has_feature(MMU_FTR_USE_TLBIVAX_BCAST)) {
159 int lock = mmu_has_feature(MMU_FTR_LOCK_BCAST_INVAL); 233 int lock = mmu_has_feature(MMU_FTR_LOCK_BCAST_INVAL);
160 if (lock) 234 if (lock)
161 spin_lock(&tlbivax_lock); 235 spin_lock(&tlbivax_lock);
162 _tlbivax_bcast(vmaddr, pid); 236 _tlbivax_bcast(vmaddr, pid, tsize, ind);
163 if (lock) 237 if (lock)
164 spin_unlock(&tlbivax_lock); 238 spin_unlock(&tlbivax_lock);
165 goto bail; 239 goto bail;
166 } else { 240 } else {
167 struct tlb_flush_param p = { .pid = pid, .addr = vmaddr }; 241 struct tlb_flush_param p = {
242 .pid = pid,
243 .addr = vmaddr,
244 .tsize = tsize,
245 .ind = ind,
246 };
168 /* Ignores smp_processor_id() even if set in cpu_mask */ 247 /* Ignores smp_processor_id() even if set in cpu_mask */
169 smp_call_function_many(cpu_mask, 248 smp_call_function_many(cpu_mask,
170 do_flush_tlb_page_ipi, &p, 1); 249 do_flush_tlb_page_ipi, &p, 1);
171 } 250 }
172 } 251 }
173 _tlbil_va(vmaddr, pid); 252 _tlbil_va(vmaddr, pid, tsize, ind);
174 bail: 253 bail:
175 preempt_enable(); 254 preempt_enable();
176} 255}
256
257void flush_tlb_page(struct vm_area_struct *vma, unsigned long vmaddr)
258{
259 __flush_tlb_page(vma ? vma->vm_mm : NULL, vmaddr,
260 mmu_get_tsize(mmu_virtual_psize), 0);
261}
177EXPORT_SYMBOL(flush_tlb_page); 262EXPORT_SYMBOL(flush_tlb_page);
178 263
179#endif /* CONFIG_SMP */ 264#endif /* CONFIG_SMP */
@@ -207,3 +292,156 @@ void flush_tlb_range(struct vm_area_struct *vma, unsigned long start,
207 flush_tlb_mm(vma->vm_mm); 292 flush_tlb_mm(vma->vm_mm);
208} 293}
209EXPORT_SYMBOL(flush_tlb_range); 294EXPORT_SYMBOL(flush_tlb_range);
295
296void tlb_flush(struct mmu_gather *tlb)
297{
298 flush_tlb_mm(tlb->mm);
299
300 /* Push out batch of freed page tables */
301 pte_free_finish();
302}
303
304/*
305 * Below are functions specific to the 64-bit variant of Book3E though that
306 * may change in the future
307 */
308
309#ifdef CONFIG_PPC64
310
311/*
312 * Handling of virtual linear page tables or indirect TLB entries
313 * flushing when PTE pages are freed
314 */
315void tlb_flush_pgtable(struct mmu_gather *tlb, unsigned long address)
316{
317 int tsize = mmu_psize_defs[mmu_pte_psize].enc;
318
319 if (book3e_htw_enabled) {
320 unsigned long start = address & PMD_MASK;
321 unsigned long end = address + PMD_SIZE;
322 unsigned long size = 1UL << mmu_psize_defs[mmu_pte_psize].shift;
323
324 /* This isn't the most optimal, ideally we would factor out the
325 * while preempt & CPU mask mucking around, or even the IPI but
326 * it will do for now
327 */
328 while (start < end) {
329 __flush_tlb_page(tlb->mm, start, tsize, 1);
330 start += size;
331 }
332 } else {
333 unsigned long rmask = 0xf000000000000000ul;
334 unsigned long rid = (address & rmask) | 0x1000000000000000ul;
335 unsigned long vpte = address & ~rmask;
336
337#ifdef CONFIG_PPC_64K_PAGES
338 vpte = (vpte >> (PAGE_SHIFT - 4)) & ~0xfffful;
339#else
340 vpte = (vpte >> (PAGE_SHIFT - 3)) & ~0xffful;
341#endif
342 vpte |= rid;
343 __flush_tlb_page(tlb->mm, vpte, tsize, 0);
344 }
345}
346
347/*
348 * Early initialization of the MMU TLB code
349 */
350static void __early_init_mmu(int boot_cpu)
351{
352 extern unsigned int interrupt_base_book3e;
353 extern unsigned int exc_data_tlb_miss_htw_book3e;
354 extern unsigned int exc_instruction_tlb_miss_htw_book3e;
355
356 unsigned int *ibase = &interrupt_base_book3e;
357 unsigned int mas4;
358
359 /* XXX This will have to be decided at runtime, but right
360 * now our boot and TLB miss code hard wires it. Ideally
361 * we should find out a suitable page size and patch the
362 * TLB miss code (either that or use the PACA to store
363 * the value we want)
364 */
365 mmu_linear_psize = MMU_PAGE_1G;
366
367 /* XXX This should be decided at runtime based on supported
368 * page sizes in the TLB, but for now let's assume 16M is
369 * always there and a good fit (which it probably is)
370 */
371 mmu_vmemmap_psize = MMU_PAGE_16M;
372
373 /* Check if HW tablewalk is present, and if yes, enable it by:
374 *
375 * - patching the TLB miss handlers to branch to the
376 * one dedicates to it
377 *
378 * - setting the global book3e_htw_enabled
379 *
380 * - Set MAS4:INDD and default page size
381 */
382
383 /* XXX This code only checks for TLB 0 capabilities and doesn't
384 * check what page size combos are supported by the HW. It
385 * also doesn't handle the case where a separate array holds
386 * the IND entries from the array loaded by the PT.
387 */
388 if (boot_cpu) {
389 unsigned int tlb0cfg = mfspr(SPRN_TLB0CFG);
390
391 /* Check if HW loader is supported */
392 if ((tlb0cfg & TLBnCFG_IND) &&
393 (tlb0cfg & TLBnCFG_PT)) {
394 patch_branch(ibase + (0x1c0 / 4),
395 (unsigned long)&exc_data_tlb_miss_htw_book3e, 0);
396 patch_branch(ibase + (0x1e0 / 4),
397 (unsigned long)&exc_instruction_tlb_miss_htw_book3e, 0);
398 book3e_htw_enabled = 1;
399 }
400 pr_info("MMU: Book3E Page Tables %s\n",
401 book3e_htw_enabled ? "Enabled" : "Disabled");
402 }
403
404 /* Set MAS4 based on page table setting */
405
406 mas4 = 0x4 << MAS4_WIMGED_SHIFT;
407 if (book3e_htw_enabled) {
408 mas4 |= mas4 | MAS4_INDD;
409#ifdef CONFIG_PPC_64K_PAGES
410 mas4 |= BOOK3E_PAGESZ_256M << MAS4_TSIZED_SHIFT;
411 mmu_pte_psize = MMU_PAGE_256M;
412#else
413 mas4 |= BOOK3E_PAGESZ_1M << MAS4_TSIZED_SHIFT;
414 mmu_pte_psize = MMU_PAGE_1M;
415#endif
416 } else {
417#ifdef CONFIG_PPC_64K_PAGES
418 mas4 |= BOOK3E_PAGESZ_64K << MAS4_TSIZED_SHIFT;
419#else
420 mas4 |= BOOK3E_PAGESZ_4K << MAS4_TSIZED_SHIFT;
421#endif
422 mmu_pte_psize = mmu_virtual_psize;
423 }
424 mtspr(SPRN_MAS4, mas4);
425
426 /* Set the global containing the top of the linear mapping
427 * for use by the TLB miss code
428 */
429 linear_map_top = lmb_end_of_DRAM();
430
431 /* A sync won't hurt us after mucking around with
432 * the MMU configuration
433 */
434 mb();
435}
436
437void __init early_init_mmu(void)
438{
439 __early_init_mmu(1);
440}
441
442void __cpuinit early_init_mmu_secondary(void)
443{
444 __early_init_mmu(0);
445}
446
447#endif /* CONFIG_PPC64 */
diff --git a/arch/powerpc/mm/tlb_nohash_low.S b/arch/powerpc/mm/tlb_nohash_low.S
index 3037911279b1..bbdc5b577b85 100644
--- a/arch/powerpc/mm/tlb_nohash_low.S
+++ b/arch/powerpc/mm/tlb_nohash_low.S
@@ -39,7 +39,7 @@
39/* 39/*
40 * 40x implementation needs only tlbil_va 40 * 40x implementation needs only tlbil_va
41 */ 41 */
42_GLOBAL(_tlbil_va) 42_GLOBAL(__tlbil_va)
43 /* We run the search with interrupts disabled because we have to change 43 /* We run the search with interrupts disabled because we have to change
44 * the PID and I don't want to preempt when that happens. 44 * the PID and I don't want to preempt when that happens.
45 */ 45 */
@@ -71,7 +71,7 @@ _GLOBAL(_tlbil_va)
71 * 440 implementation uses tlbsx/we for tlbil_va and a full sweep 71 * 440 implementation uses tlbsx/we for tlbil_va and a full sweep
72 * of the TLB for everything else. 72 * of the TLB for everything else.
73 */ 73 */
74_GLOBAL(_tlbil_va) 74_GLOBAL(__tlbil_va)
75 mfspr r5,SPRN_MMUCR 75 mfspr r5,SPRN_MMUCR
76 rlwimi r5,r4,0,24,31 /* Set TID */ 76 rlwimi r5,r4,0,24,31 /* Set TID */
77 77
@@ -124,8 +124,6 @@ _GLOBAL(_tlbil_pid)
124 * to have the larger code path before the _SECTION_ELSE 124 * to have the larger code path before the _SECTION_ELSE
125 */ 125 */
126 126
127#define MMUCSR0_TLBFI (MMUCSR0_TLB0FI | MMUCSR0_TLB1FI | \
128 MMUCSR0_TLB2FI | MMUCSR0_TLB3FI)
129/* 127/*
130 * Flush MMU TLB on the local processor 128 * Flush MMU TLB on the local processor
131 */ 129 */
@@ -170,7 +168,7 @@ ALT_MMU_FTR_SECTION_END_IFSET(MMU_FTR_USE_TLBILX)
170 * Flush MMU TLB for a particular address, but only on the local processor 168 * Flush MMU TLB for a particular address, but only on the local processor
171 * (no broadcast) 169 * (no broadcast)
172 */ 170 */
173_GLOBAL(_tlbil_va) 171_GLOBAL(__tlbil_va)
174 mfmsr r10 172 mfmsr r10
175 wrteei 0 173 wrteei 0
176 slwi r4,r4,16 174 slwi r4,r4,16
@@ -191,6 +189,85 @@ ALT_MMU_FTR_SECTION_END_IFCLR(MMU_FTR_USE_TLBILX)
191 isync 189 isync
1921: wrtee r10 1901: wrtee r10
193 blr 191 blr
192#elif defined(CONFIG_PPC_BOOK3E)
193/*
194 * New Book3E (>= 2.06) implementation
195 *
196 * Note: We may be able to get away without the interrupt masking stuff
197 * if we save/restore MAS6 on exceptions that might modify it
198 */
199_GLOBAL(_tlbil_pid)
200 slwi r4,r3,MAS6_SPID_SHIFT
201 mfmsr r10
202 wrteei 0
203 mtspr SPRN_MAS6,r4
204 PPC_TLBILX_PID(0,0)
205 wrtee r10
206 msync
207 isync
208 blr
209
210_GLOBAL(_tlbil_pid_noind)
211 slwi r4,r3,MAS6_SPID_SHIFT
212 mfmsr r10
213 ori r4,r4,MAS6_SIND
214 wrteei 0
215 mtspr SPRN_MAS6,r4
216 PPC_TLBILX_PID(0,0)
217 wrtee r10
218 msync
219 isync
220 blr
221
222_GLOBAL(_tlbil_all)
223 PPC_TLBILX_ALL(0,0)
224 msync
225 isync
226 blr
227
228_GLOBAL(_tlbil_va)
229 mfmsr r10
230 wrteei 0
231 cmpwi cr0,r6,0
232 slwi r4,r4,MAS6_SPID_SHIFT
233 rlwimi r4,r5,MAS6_ISIZE_SHIFT,MAS6_ISIZE_MASK
234 beq 1f
235 rlwimi r4,r6,MAS6_SIND_SHIFT,MAS6_SIND
2361: mtspr SPRN_MAS6,r4 /* assume AS=0 for now */
237 PPC_TLBILX_VA(0,r3)
238 msync
239 isync
240 wrtee r10
241 blr
242
243_GLOBAL(_tlbivax_bcast)
244 mfmsr r10
245 wrteei 0
246 cmpwi cr0,r6,0
247 slwi r4,r4,MAS6_SPID_SHIFT
248 rlwimi r4,r5,MAS6_ISIZE_SHIFT,MAS6_ISIZE_MASK
249 beq 1f
250 rlwimi r4,r6,MAS6_SIND_SHIFT,MAS6_SIND
2511: mtspr SPRN_MAS6,r4 /* assume AS=0 for now */
252 PPC_TLBIVAX(0,r3)
253 eieio
254 tlbsync
255 sync
256 wrtee r10
257 blr
258
259_GLOBAL(set_context)
260#ifdef CONFIG_BDI_SWITCH
261 /* Context switch the PTE pointer for the Abatron BDI2000.
262 * The PGDIR is the second parameter.
263 */
264 lis r5, abatron_pteptrs@h
265 ori r5, r5, abatron_pteptrs@l
266 stw r4, 0x4(r5)
267#endif
268 mtspr SPRN_PID,r3
269 isync /* Force context change */
270 blr
194#else 271#else
195#error Unsupported processor type ! 272#error Unsupported processor type !
196#endif 273#endif
diff --git a/arch/powerpc/platforms/40x/Kconfig b/arch/powerpc/platforms/40x/Kconfig
index a6e43cb6f825..ec64264f7a50 100644
--- a/arch/powerpc/platforms/40x/Kconfig
+++ b/arch/powerpc/platforms/40x/Kconfig
@@ -40,6 +40,16 @@ config HCU4
40 help 40 help
41 This option enables support for the Nestal Maschinen HCU4 board. 41 This option enables support for the Nestal Maschinen HCU4 board.
42 42
43config HOTFOOT
44 bool "Hotfoot"
45 depends on 40x
46 default n
47 select 405EP
48 select PPC40x_SIMPLE
49 select PCI
50 help
51 This option enables support for the ESTEEM 195E Hotfoot board.
52
43config KILAUEA 53config KILAUEA
44 bool "Kilauea" 54 bool "Kilauea"
45 depends on 40x 55 depends on 40x
diff --git a/arch/powerpc/platforms/40x/ppc40x_simple.c b/arch/powerpc/platforms/40x/ppc40x_simple.c
index 5fd5a5974001..546bbc229d19 100644
--- a/arch/powerpc/platforms/40x/ppc40x_simple.c
+++ b/arch/powerpc/platforms/40x/ppc40x_simple.c
@@ -54,7 +54,8 @@ static char *board[] __initdata = {
54 "amcc,acadia", 54 "amcc,acadia",
55 "amcc,haleakala", 55 "amcc,haleakala",
56 "amcc,kilauea", 56 "amcc,kilauea",
57 "amcc,makalu" 57 "amcc,makalu",
58 "est,hotfoot"
58}; 59};
59 60
60static int __init ppc40x_probe(void) 61static int __init ppc40x_probe(void)
diff --git a/arch/powerpc/platforms/44x/Kconfig b/arch/powerpc/platforms/44x/Kconfig
index 90e3192611a4..7486bffd3ebb 100644
--- a/arch/powerpc/platforms/44x/Kconfig
+++ b/arch/powerpc/platforms/44x/Kconfig
@@ -129,6 +129,18 @@ config REDWOOD
129 help 129 help
130 This option enables support for the AMCC PPC460SX Redwood board. 130 This option enables support for the AMCC PPC460SX Redwood board.
131 131
132config EIGER
133 bool "Eiger"
134 depends on 44x
135 default n
136 select PPC44x_SIMPLE
137 select 460SX
138 select PCI
139 select PPC4xx_PCI_EXPRESS
140 select IBM_NEW_EMAC_RGMII
141 help
142 This option enables support for the AMCC PPC460SX evaluation board.
143
132config YOSEMITE 144config YOSEMITE
133 bool "Yosemite" 145 bool "Yosemite"
134 depends on 44x 146 depends on 44x
diff --git a/arch/powerpc/platforms/44x/ppc44x_simple.c b/arch/powerpc/platforms/44x/ppc44x_simple.c
index 5bcd441885e8..e8c23ccaa1fc 100644
--- a/arch/powerpc/platforms/44x/ppc44x_simple.c
+++ b/arch/powerpc/platforms/44x/ppc44x_simple.c
@@ -55,6 +55,7 @@ static char *board[] __initdata = {
55 "amcc,canyonlands", 55 "amcc,canyonlands",
56 "amcc,glacier", 56 "amcc,glacier",
57 "ibm,ebony", 57 "ibm,ebony",
58 "amcc,eiger",
58 "amcc,katmai", 59 "amcc,katmai",
59 "amcc,rainier", 60 "amcc,rainier",
60 "amcc,redwood", 61 "amcc,redwood",
diff --git a/arch/powerpc/platforms/82xx/mgcoge.c b/arch/powerpc/platforms/82xx/mgcoge.c
index c2af169c1d1d..7a5de9eb3c73 100644
--- a/arch/powerpc/platforms/82xx/mgcoge.c
+++ b/arch/powerpc/platforms/82xx/mgcoge.c
@@ -50,16 +50,63 @@ struct cpm_pin {
50static __initdata struct cpm_pin mgcoge_pins[] = { 50static __initdata struct cpm_pin mgcoge_pins[] = {
51 51
52 /* SMC2 */ 52 /* SMC2 */
53 {1, 8, CPM_PIN_INPUT | CPM_PIN_PRIMARY}, 53 {0, 8, CPM_PIN_INPUT | CPM_PIN_PRIMARY},
54 {1, 9, CPM_PIN_OUTPUT | CPM_PIN_PRIMARY}, 54 {0, 9, CPM_PIN_OUTPUT | CPM_PIN_PRIMARY},
55 55
56 /* SCC4 */ 56 /* SCC4 */
57 {3, 25, CPM_PIN_INPUT | CPM_PIN_PRIMARY}, 57 {2, 25, CPM_PIN_INPUT | CPM_PIN_PRIMARY},
58 {3, 24, CPM_PIN_INPUT | CPM_PIN_PRIMARY}, 58 {2, 24, CPM_PIN_INPUT | CPM_PIN_PRIMARY},
59 {3, 9, CPM_PIN_INPUT | CPM_PIN_PRIMARY}, 59 {2, 9, CPM_PIN_INPUT | CPM_PIN_PRIMARY},
60 {3, 8, CPM_PIN_INPUT | CPM_PIN_PRIMARY}, 60 {2, 8, CPM_PIN_INPUT | CPM_PIN_PRIMARY},
61 {4, 22, CPM_PIN_INPUT | CPM_PIN_PRIMARY}, 61 {3, 22, CPM_PIN_INPUT | CPM_PIN_PRIMARY},
62 {4, 21, CPM_PIN_OUTPUT | CPM_PIN_PRIMARY}, 62 {3, 21, CPM_PIN_OUTPUT | CPM_PIN_PRIMARY},
63
64 /* FCC1 */
65 {0, 14, CPM_PIN_INPUT | CPM_PIN_PRIMARY},
66 {0, 15, CPM_PIN_INPUT | CPM_PIN_PRIMARY},
67 {0, 16, CPM_PIN_INPUT | CPM_PIN_PRIMARY},
68 {0, 17, CPM_PIN_INPUT | CPM_PIN_PRIMARY},
69 {0, 18, CPM_PIN_OUTPUT | CPM_PIN_PRIMARY},
70 {0, 19, CPM_PIN_OUTPUT | CPM_PIN_PRIMARY},
71 {0, 20, CPM_PIN_OUTPUT | CPM_PIN_PRIMARY},
72 {0, 21, CPM_PIN_OUTPUT | CPM_PIN_PRIMARY},
73 {0, 26, CPM_PIN_INPUT | CPM_PIN_SECONDARY},
74 {0, 27, CPM_PIN_INPUT | CPM_PIN_SECONDARY},
75 {0, 28, CPM_PIN_OUTPUT | CPM_PIN_SECONDARY},
76 {0, 29, CPM_PIN_OUTPUT | CPM_PIN_SECONDARY},
77 {0, 30, CPM_PIN_INPUT | CPM_PIN_SECONDARY},
78 {0, 31, CPM_PIN_INPUT | CPM_PIN_SECONDARY},
79
80 {2, 22, CPM_PIN_INPUT | CPM_PIN_PRIMARY},
81 {2, 23, CPM_PIN_INPUT | CPM_PIN_PRIMARY},
82
83 /* FCC2 */
84 {1, 18, CPM_PIN_INPUT | CPM_PIN_PRIMARY},
85 {1, 19, CPM_PIN_INPUT | CPM_PIN_PRIMARY},
86 {1, 20, CPM_PIN_INPUT | CPM_PIN_PRIMARY},
87 {1, 21, CPM_PIN_INPUT | CPM_PIN_PRIMARY},
88 {1, 22, CPM_PIN_OUTPUT | CPM_PIN_PRIMARY},
89 {1, 23, CPM_PIN_OUTPUT | CPM_PIN_PRIMARY},
90 {1, 24, CPM_PIN_OUTPUT | CPM_PIN_PRIMARY},
91 {1, 25, CPM_PIN_OUTPUT | CPM_PIN_PRIMARY},
92 {1, 26, CPM_PIN_INPUT | CPM_PIN_PRIMARY},
93 {1, 27, CPM_PIN_INPUT | CPM_PIN_PRIMARY},
94 {1, 28, CPM_PIN_INPUT | CPM_PIN_PRIMARY},
95 {1, 29, CPM_PIN_OUTPUT | CPM_PIN_SECONDARY},
96 {1, 30, CPM_PIN_INPUT | CPM_PIN_PRIMARY},
97 {1, 31, CPM_PIN_OUTPUT | CPM_PIN_PRIMARY},
98
99 {2, 18, CPM_PIN_INPUT | CPM_PIN_PRIMARY},
100 {2, 19, CPM_PIN_INPUT | CPM_PIN_PRIMARY},
101
102 /* MDC */
103 {0, 13, CPM_PIN_OUTPUT | CPM_PIN_GPIO},
104
105#if defined(CONFIG_I2C_CPM)
106 /* I2C */
107 {3, 14, CPM_PIN_INPUT | CPM_PIN_SECONDARY | CPM_PIN_OPENDRAIN},
108 {3, 15, CPM_PIN_INPUT | CPM_PIN_SECONDARY | CPM_PIN_OPENDRAIN},
109#endif
63}; 110};
64 111
65static void __init init_ioports(void) 112static void __init init_ioports(void)
@@ -68,12 +115,16 @@ static void __init init_ioports(void)
68 115
69 for (i = 0; i < ARRAY_SIZE(mgcoge_pins); i++) { 116 for (i = 0; i < ARRAY_SIZE(mgcoge_pins); i++) {
70 const struct cpm_pin *pin = &mgcoge_pins[i]; 117 const struct cpm_pin *pin = &mgcoge_pins[i];
71 cpm2_set_pin(pin->port - 1, pin->pin, pin->flags); 118 cpm2_set_pin(pin->port, pin->pin, pin->flags);
72 } 119 }
73 120
74 cpm2_smc_clk_setup(CPM_CLK_SMC2, CPM_BRG8); 121 cpm2_smc_clk_setup(CPM_CLK_SMC2, CPM_BRG8);
75 cpm2_clk_setup(CPM_CLK_SCC4, CPM_CLK7, CPM_CLK_RX); 122 cpm2_clk_setup(CPM_CLK_SCC4, CPM_CLK7, CPM_CLK_RX);
76 cpm2_clk_setup(CPM_CLK_SCC4, CPM_CLK8, CPM_CLK_TX); 123 cpm2_clk_setup(CPM_CLK_SCC4, CPM_CLK8, CPM_CLK_TX);
124 cpm2_clk_setup(CPM_CLK_FCC1, CPM_CLK10, CPM_CLK_RX);
125 cpm2_clk_setup(CPM_CLK_FCC1, CPM_CLK9, CPM_CLK_TX);
126 cpm2_clk_setup(CPM_CLK_FCC2, CPM_CLK13, CPM_CLK_RX);
127 cpm2_clk_setup(CPM_CLK_FCC2, CPM_CLK14, CPM_CLK_TX);
77} 128}
78 129
79static void __init mgcoge_setup_arch(void) 130static void __init mgcoge_setup_arch(void)
diff --git a/arch/powerpc/platforms/82xx/mpc8272_ads.c b/arch/powerpc/platforms/82xx/mpc8272_ads.c
index 8054c685d323..30394b409b3f 100644
--- a/arch/powerpc/platforms/82xx/mpc8272_ads.c
+++ b/arch/powerpc/platforms/82xx/mpc8272_ads.c
@@ -29,7 +29,6 @@
29#include <sysdev/fsl_soc.h> 29#include <sysdev/fsl_soc.h>
30#include <sysdev/cpm2_pic.h> 30#include <sysdev/cpm2_pic.h>
31 31
32#include "pq2ads.h"
33#include "pq2.h" 32#include "pq2.h"
34 33
35static void __init mpc8272_ads_pic_init(void) 34static void __init mpc8272_ads_pic_init(void)
@@ -100,6 +99,15 @@ static struct cpm_pin mpc8272_ads_pins[] = {
100 /* I2C */ 99 /* I2C */
101 {3, 14, CPM_PIN_INPUT | CPM_PIN_SECONDARY | CPM_PIN_OPENDRAIN}, 100 {3, 14, CPM_PIN_INPUT | CPM_PIN_SECONDARY | CPM_PIN_OPENDRAIN},
102 {3, 15, CPM_PIN_INPUT | CPM_PIN_SECONDARY | CPM_PIN_OPENDRAIN}, 101 {3, 15, CPM_PIN_INPUT | CPM_PIN_SECONDARY | CPM_PIN_OPENDRAIN},
102
103 /* USB */
104 {2, 10, CPM_PIN_INPUT | CPM_PIN_PRIMARY},
105 {2, 11, CPM_PIN_INPUT | CPM_PIN_PRIMARY},
106 {2, 20, CPM_PIN_OUTPUT | CPM_PIN_PRIMARY},
107 {2, 24, CPM_PIN_INPUT | CPM_PIN_PRIMARY},
108 {3, 23, CPM_PIN_OUTPUT | CPM_PIN_PRIMARY},
109 {3, 24, CPM_PIN_OUTPUT | CPM_PIN_PRIMARY},
110 {3, 25, CPM_PIN_INPUT | CPM_PIN_PRIMARY},
103}; 111};
104 112
105static void __init init_ioports(void) 113static void __init init_ioports(void)
@@ -113,6 +121,8 @@ static void __init init_ioports(void)
113 121
114 cpm2_clk_setup(CPM_CLK_SCC1, CPM_BRG1, CPM_CLK_RX); 122 cpm2_clk_setup(CPM_CLK_SCC1, CPM_BRG1, CPM_CLK_RX);
115 cpm2_clk_setup(CPM_CLK_SCC1, CPM_BRG1, CPM_CLK_TX); 123 cpm2_clk_setup(CPM_CLK_SCC1, CPM_BRG1, CPM_CLK_TX);
124 cpm2_clk_setup(CPM_CLK_SCC3, CPM_CLK8, CPM_CLK_RX);
125 cpm2_clk_setup(CPM_CLK_SCC3, CPM_CLK8, CPM_CLK_TX);
116 cpm2_clk_setup(CPM_CLK_SCC4, CPM_BRG4, CPM_CLK_RX); 126 cpm2_clk_setup(CPM_CLK_SCC4, CPM_BRG4, CPM_CLK_RX);
117 cpm2_clk_setup(CPM_CLK_SCC4, CPM_BRG4, CPM_CLK_TX); 127 cpm2_clk_setup(CPM_CLK_SCC4, CPM_BRG4, CPM_CLK_TX);
118 cpm2_clk_setup(CPM_CLK_FCC1, CPM_CLK11, CPM_CLK_RX); 128 cpm2_clk_setup(CPM_CLK_FCC1, CPM_CLK11, CPM_CLK_RX);
@@ -144,12 +154,22 @@ static void __init mpc8272_ads_setup_arch(void)
144 return; 154 return;
145 } 155 }
146 156
157#define BCSR1_FETHIEN 0x08000000
158#define BCSR1_FETH_RST 0x04000000
159#define BCSR1_RS232_EN1 0x02000000
160#define BCSR1_RS232_EN2 0x01000000
161#define BCSR3_USB_nEN 0x80000000
162#define BCSR3_FETHIEN2 0x10000000
163#define BCSR3_FETH2_RST 0x08000000
164
147 clrbits32(&bcsr[1], BCSR1_RS232_EN1 | BCSR1_RS232_EN2 | BCSR1_FETHIEN); 165 clrbits32(&bcsr[1], BCSR1_RS232_EN1 | BCSR1_RS232_EN2 | BCSR1_FETHIEN);
148 setbits32(&bcsr[1], BCSR1_FETH_RST); 166 setbits32(&bcsr[1], BCSR1_FETH_RST);
149 167
150 clrbits32(&bcsr[3], BCSR3_FETHIEN2); 168 clrbits32(&bcsr[3], BCSR3_FETHIEN2);
151 setbits32(&bcsr[3], BCSR3_FETH2_RST); 169 setbits32(&bcsr[3], BCSR3_FETH2_RST);
152 170
171 clrbits32(&bcsr[3], BCSR3_USB_nEN);
172
153 iounmap(bcsr); 173 iounmap(bcsr);
154 174
155 init_ioports(); 175 init_ioports();
diff --git a/arch/powerpc/platforms/83xx/Kconfig b/arch/powerpc/platforms/83xx/Kconfig
index 083ebee9a16d..f49a2548c5ff 100644
--- a/arch/powerpc/platforms/83xx/Kconfig
+++ b/arch/powerpc/platforms/83xx/Kconfig
@@ -75,11 +75,11 @@ config MPC837x_MDS
75 This option enables support for the MPC837x MDS Processor Board. 75 This option enables support for the MPC837x MDS Processor Board.
76 76
77config MPC837x_RDB 77config MPC837x_RDB
78 bool "Freescale MPC837x RDB" 78 bool "Freescale MPC837x RDB/WLAN"
79 select DEFAULT_UIMAGE 79 select DEFAULT_UIMAGE
80 select PPC_MPC837x 80 select PPC_MPC837x
81 help 81 help
82 This option enables support for the MPC837x RDB Board. 82 This option enables support for the MPC837x RDB and WLAN Boards.
83 83
84config SBC834x 84config SBC834x
85 bool "Wind River SBC834x" 85 bool "Wind River SBC834x"
diff --git a/arch/powerpc/platforms/83xx/mpc837x_rdb.c b/arch/powerpc/platforms/83xx/mpc837x_rdb.c
index 76f3b32a155e..a1908d261240 100644
--- a/arch/powerpc/platforms/83xx/mpc837x_rdb.c
+++ b/arch/powerpc/platforms/83xx/mpc837x_rdb.c
@@ -17,10 +17,32 @@
17#include <asm/time.h> 17#include <asm/time.h>
18#include <asm/ipic.h> 18#include <asm/ipic.h>
19#include <asm/udbg.h> 19#include <asm/udbg.h>
20#include <sysdev/fsl_soc.h>
20#include <sysdev/fsl_pci.h> 21#include <sysdev/fsl_pci.h>
21 22
22#include "mpc83xx.h" 23#include "mpc83xx.h"
23 24
25static void mpc837x_rdb_sd_cfg(void)
26{
27 void __iomem *im;
28
29 im = ioremap(get_immrbase(), 0x1000);
30 if (!im) {
31 WARN_ON(1);
32 return;
33 }
34
35 /*
36 * On RDB boards (in contrast to MDS) USBB pins are used for SD only,
37 * so we can safely mux them away from the USB block.
38 */
39 clrsetbits_be32(im + MPC83XX_SICRL_OFFS, MPC837X_SICRL_USBB_MASK,
40 MPC837X_SICRL_SD);
41 clrsetbits_be32(im + MPC83XX_SICRH_OFFS, MPC837X_SICRH_SPI_MASK,
42 MPC837X_SICRH_SD);
43 iounmap(im);
44}
45
24/* ************************************************************************ 46/* ************************************************************************
25 * 47 *
26 * Setup the architecture 48 * Setup the architecture
@@ -42,6 +64,7 @@ static void __init mpc837x_rdb_setup_arch(void)
42 mpc83xx_add_bridge(np); 64 mpc83xx_add_bridge(np);
43#endif 65#endif
44 mpc837x_usb_cfg(); 66 mpc837x_usb_cfg();
67 mpc837x_rdb_sd_cfg();
45} 68}
46 69
47static struct of_device_id mpc837x_ids[] = { 70static struct of_device_id mpc837x_ids[] = {
@@ -86,11 +109,12 @@ static int __init mpc837x_rdb_probe(void)
86 109
87 return of_flat_dt_is_compatible(root, "fsl,mpc8377rdb") || 110 return of_flat_dt_is_compatible(root, "fsl,mpc8377rdb") ||
88 of_flat_dt_is_compatible(root, "fsl,mpc8378rdb") || 111 of_flat_dt_is_compatible(root, "fsl,mpc8378rdb") ||
89 of_flat_dt_is_compatible(root, "fsl,mpc8379rdb"); 112 of_flat_dt_is_compatible(root, "fsl,mpc8379rdb") ||
113 of_flat_dt_is_compatible(root, "fsl,mpc8377wlan");
90} 114}
91 115
92define_machine(mpc837x_rdb) { 116define_machine(mpc837x_rdb) {
93 .name = "MPC837x RDB", 117 .name = "MPC837x RDB/WLAN",
94 .probe = mpc837x_rdb_probe, 118 .probe = mpc837x_rdb_probe,
95 .setup_arch = mpc837x_rdb_setup_arch, 119 .setup_arch = mpc837x_rdb_setup_arch,
96 .init_IRQ = mpc837x_rdb_init_IRQ, 120 .init_IRQ = mpc837x_rdb_init_IRQ,
diff --git a/arch/powerpc/platforms/83xx/mpc83xx.h b/arch/powerpc/platforms/83xx/mpc83xx.h
index d1dc5b0b4fbf..0fea8811d45b 100644
--- a/arch/powerpc/platforms/83xx/mpc83xx.h
+++ b/arch/powerpc/platforms/83xx/mpc83xx.h
@@ -30,6 +30,8 @@
30#define MPC8315_SICRL_USB_ULPI 0x00000054 30#define MPC8315_SICRL_USB_ULPI 0x00000054
31#define MPC837X_SICRL_USB_MASK 0xf0000000 31#define MPC837X_SICRL_USB_MASK 0xf0000000
32#define MPC837X_SICRL_USB_ULPI 0x50000000 32#define MPC837X_SICRL_USB_ULPI 0x50000000
33#define MPC837X_SICRL_USBB_MASK 0x30000000
34#define MPC837X_SICRL_SD 0x20000000
33 35
34/* system i/o configuration register high */ 36/* system i/o configuration register high */
35#define MPC83XX_SICRH_OFFS 0x118 37#define MPC83XX_SICRH_OFFS 0x118
@@ -38,6 +40,8 @@
38#define MPC831X_SICRH_USB_ULPI 0x000000a0 40#define MPC831X_SICRH_USB_ULPI 0x000000a0
39#define MPC8315_SICRH_USB_MASK 0x0000ff00 41#define MPC8315_SICRH_USB_MASK 0x0000ff00
40#define MPC8315_SICRH_USB_ULPI 0x00000000 42#define MPC8315_SICRH_USB_ULPI 0x00000000
43#define MPC837X_SICRH_SPI_MASK 0x00000003
44#define MPC837X_SICRH_SD 0x00000001
41 45
42/* USB Control Register */ 46/* USB Control Register */
43#define FSL_USB2_CONTROL_OFFS 0x500 47#define FSL_USB2_CONTROL_OFFS 0x500
diff --git a/arch/powerpc/platforms/85xx/Kconfig b/arch/powerpc/platforms/85xx/Kconfig
index a9b416688975..d3a975e8fd3e 100644
--- a/arch/powerpc/platforms/85xx/Kconfig
+++ b/arch/powerpc/platforms/85xx/Kconfig
@@ -55,6 +55,15 @@ config MPC85xx_DS
55 help 55 help
56 This option enables support for the MPC85xx DS (MPC8544 DS) board 56 This option enables support for the MPC85xx DS (MPC8544 DS) board
57 57
58config MPC85xx_RDB
59 bool "Freescale MPC85xx RDB"
60 select PPC_I8259
61 select DEFAULT_UIMAGE
62 select FSL_ULI1575
63 select SWIOTLB
64 help
65 This option enables support for the MPC85xx RDB (P2020 RDB) board
66
58config SOCRATES 67config SOCRATES
59 bool "Socrates" 68 bool "Socrates"
60 select DEFAULT_UIMAGE 69 select DEFAULT_UIMAGE
diff --git a/arch/powerpc/platforms/85xx/Makefile b/arch/powerpc/platforms/85xx/Makefile
index 835733f2b12c..9098aea0cf32 100644
--- a/arch/powerpc/platforms/85xx/Makefile
+++ b/arch/powerpc/platforms/85xx/Makefile
@@ -9,10 +9,11 @@ obj-$(CONFIG_MPC85xx_CDS) += mpc85xx_cds.o
9obj-$(CONFIG_MPC8536_DS) += mpc8536_ds.o 9obj-$(CONFIG_MPC8536_DS) += mpc8536_ds.o
10obj-$(CONFIG_MPC85xx_DS) += mpc85xx_ds.o 10obj-$(CONFIG_MPC85xx_DS) += mpc85xx_ds.o
11obj-$(CONFIG_MPC85xx_MDS) += mpc85xx_mds.o 11obj-$(CONFIG_MPC85xx_MDS) += mpc85xx_mds.o
12obj-$(CONFIG_MPC85xx_RDB) += mpc85xx_rdb.o
12obj-$(CONFIG_STX_GP3) += stx_gp3.o 13obj-$(CONFIG_STX_GP3) += stx_gp3.o
13obj-$(CONFIG_TQM85xx) += tqm85xx.o 14obj-$(CONFIG_TQM85xx) += tqm85xx.o
14obj-$(CONFIG_SBC8560) += sbc8560.o 15obj-$(CONFIG_SBC8560) += sbc8560.o
15obj-$(CONFIG_SBC8548) += sbc8548.o 16obj-$(CONFIG_SBC8548) += sbc8548.o
16obj-$(CONFIG_SOCRATES) += socrates.o socrates_fpga_pic.o 17obj-$(CONFIG_SOCRATES) += socrates.o socrates_fpga_pic.o
17obj-$(CONFIG_KSI8560) += ksi8560.o 18obj-$(CONFIG_KSI8560) += ksi8560.o
18obj-$(CONFIG_XES_MPC85xx) += xes_mpc85xx.o \ No newline at end of file 19obj-$(CONFIG_XES_MPC85xx) += xes_mpc85xx.o
diff --git a/arch/powerpc/platforms/85xx/mpc8536_ds.c b/arch/powerpc/platforms/85xx/mpc8536_ds.c
index 055ff417bae9..004b7d36cdb7 100644
--- a/arch/powerpc/platforms/85xx/mpc8536_ds.c
+++ b/arch/powerpc/platforms/85xx/mpc8536_ds.c
@@ -96,7 +96,8 @@ static void __init mpc8536_ds_setup_arch(void)
96#ifdef CONFIG_SWIOTLB 96#ifdef CONFIG_SWIOTLB
97 if (lmb_end_of_DRAM() > max) { 97 if (lmb_end_of_DRAM() > max) {
98 ppc_swiotlb_enable = 1; 98 ppc_swiotlb_enable = 1;
99 set_pci_dma_ops(&swiotlb_pci_dma_ops); 99 set_pci_dma_ops(&swiotlb_dma_ops);
100 ppc_md.pci_dma_dev_setup = pci_dma_dev_setup_swiotlb;
100 } 101 }
101#endif 102#endif
102 103
diff --git a/arch/powerpc/platforms/85xx/mpc85xx_ds.c b/arch/powerpc/platforms/85xx/mpc85xx_ds.c
index 849c0ac0025f..544011a562fb 100644
--- a/arch/powerpc/platforms/85xx/mpc85xx_ds.c
+++ b/arch/powerpc/platforms/85xx/mpc85xx_ds.c
@@ -192,7 +192,8 @@ static void __init mpc85xx_ds_setup_arch(void)
192#ifdef CONFIG_SWIOTLB 192#ifdef CONFIG_SWIOTLB
193 if (lmb_end_of_DRAM() > max) { 193 if (lmb_end_of_DRAM() > max) {
194 ppc_swiotlb_enable = 1; 194 ppc_swiotlb_enable = 1;
195 set_pci_dma_ops(&swiotlb_pci_dma_ops); 195 set_pci_dma_ops(&swiotlb_dma_ops);
196 ppc_md.pci_dma_dev_setup = pci_dma_dev_setup_swiotlb;
196 } 197 }
197#endif 198#endif
198 199
diff --git a/arch/powerpc/platforms/85xx/mpc85xx_mds.c b/arch/powerpc/platforms/85xx/mpc85xx_mds.c
index bfb32834ab0c..3909d57b86e3 100644
--- a/arch/powerpc/platforms/85xx/mpc85xx_mds.c
+++ b/arch/powerpc/platforms/85xx/mpc85xx_mds.c
@@ -47,6 +47,7 @@
47#include <asm/udbg.h> 47#include <asm/udbg.h>
48#include <sysdev/fsl_soc.h> 48#include <sysdev/fsl_soc.h>
49#include <sysdev/fsl_pci.h> 49#include <sysdev/fsl_pci.h>
50#include <sysdev/simple_gpio.h>
50#include <asm/qe.h> 51#include <asm/qe.h>
51#include <asm/qe_ic.h> 52#include <asm/qe_ic.h>
52#include <asm/mpic.h> 53#include <asm/mpic.h>
@@ -254,7 +255,8 @@ static void __init mpc85xx_mds_setup_arch(void)
254#ifdef CONFIG_SWIOTLB 255#ifdef CONFIG_SWIOTLB
255 if (lmb_end_of_DRAM() > max) { 256 if (lmb_end_of_DRAM() > max) {
256 ppc_swiotlb_enable = 1; 257 ppc_swiotlb_enable = 1;
257 set_pci_dma_ops(&swiotlb_pci_dma_ops); 258 set_pci_dma_ops(&swiotlb_dma_ops);
259 ppc_md.pci_dma_dev_setup = pci_dma_dev_setup_swiotlb;
258 } 260 }
259#endif 261#endif
260} 262}
@@ -304,6 +306,9 @@ static struct of_device_id mpc85xx_ids[] = {
304 306
305static int __init mpc85xx_publish_devices(void) 307static int __init mpc85xx_publish_devices(void)
306{ 308{
309 if (machine_is(mpc8569_mds))
310 simple_gpiochip_init("fsl,mpc8569mds-bcsr-gpio");
311
307 /* Publish the QE devices */ 312 /* Publish the QE devices */
308 of_platform_bus_probe(NULL, mpc85xx_ids, NULL); 313 of_platform_bus_probe(NULL, mpc85xx_ids, NULL);
309 314
diff --git a/arch/powerpc/platforms/85xx/mpc85xx_rdb.c b/arch/powerpc/platforms/85xx/mpc85xx_rdb.c
new file mode 100644
index 000000000000..c8468de4acf6
--- /dev/null
+++ b/arch/powerpc/platforms/85xx/mpc85xx_rdb.c
@@ -0,0 +1,141 @@
1/*
2 * MPC85xx RDB Board Setup
3 *
4 * Copyright 2009 Freescale Semiconductor Inc.
5 *
6 * This program is free software; you can redistribute it and/or modify it
7 * under the terms of the GNU General Public License as published by the
8 * Free Software Foundation; either version 2 of the License, or (at your
9 * option) any later version.
10 */
11
12#include <linux/stddef.h>
13#include <linux/kernel.h>
14#include <linux/pci.h>
15#include <linux/kdev_t.h>
16#include <linux/delay.h>
17#include <linux/seq_file.h>
18#include <linux/interrupt.h>
19#include <linux/of_platform.h>
20
21#include <asm/system.h>
22#include <asm/time.h>
23#include <asm/machdep.h>
24#include <asm/pci-bridge.h>
25#include <mm/mmu_decl.h>
26#include <asm/prom.h>
27#include <asm/udbg.h>
28#include <asm/mpic.h>
29
30#include <sysdev/fsl_soc.h>
31#include <sysdev/fsl_pci.h>
32
33#undef DEBUG
34
35#ifdef DEBUG
36#define DBG(fmt, args...) printk(KERN_ERR "%s: " fmt, __func__, ## args)
37#else
38#define DBG(fmt, args...)
39#endif
40
41
42void __init mpc85xx_rdb_pic_init(void)
43{
44 struct mpic *mpic;
45 struct resource r;
46 struct device_node *np;
47
48 np = of_find_node_by_type(NULL, "open-pic");
49 if (np == NULL) {
50 printk(KERN_ERR "Could not find open-pic node\n");
51 return;
52 }
53
54 if (of_address_to_resource(np, 0, &r)) {
55 printk(KERN_ERR "Failed to map mpic register space\n");
56 of_node_put(np);
57 return;
58 }
59
60 mpic = mpic_alloc(np, r.start,
61 MPIC_PRIMARY | MPIC_WANTS_RESET |
62 MPIC_BIG_ENDIAN | MPIC_BROKEN_FRR_NIRQS |
63 MPIC_SINGLE_DEST_CPU,
64 0, 256, " OpenPIC ");
65
66 BUG_ON(mpic == NULL);
67 of_node_put(np);
68
69 mpic_init(mpic);
70
71}
72
73/*
74 * Setup the architecture
75 */
76#ifdef CONFIG_SMP
77extern void __init mpc85xx_smp_init(void);
78#endif
79static void __init mpc85xx_rdb_setup_arch(void)
80{
81#ifdef CONFIG_PCI
82 struct device_node *np;
83#endif
84
85 if (ppc_md.progress)
86 ppc_md.progress("mpc85xx_rdb_setup_arch()", 0);
87
88#ifdef CONFIG_PCI
89 for_each_node_by_type(np, "pci") {
90 if (of_device_is_compatible(np, "fsl,mpc8548-pcie"))
91 fsl_add_bridge(np, 0);
92 }
93
94#endif
95
96#ifdef CONFIG_SMP
97 mpc85xx_smp_init();
98#endif
99
100 printk(KERN_INFO "MPC85xx RDB board from Freescale Semiconductor\n");
101}
102
103static struct of_device_id __initdata mpc85xxrdb_ids[] = {
104 { .type = "soc", },
105 { .compatible = "soc", },
106 { .compatible = "simple-bus", },
107 { .compatible = "gianfar", },
108 {},
109};
110
111static int __init mpc85xxrdb_publish_devices(void)
112{
113 return of_platform_bus_probe(NULL, mpc85xxrdb_ids, NULL);
114}
115machine_device_initcall(p2020_rdb, mpc85xxrdb_publish_devices);
116
117/*
118 * Called very early, device-tree isn't unflattened
119 */
120static int __init p2020_rdb_probe(void)
121{
122 unsigned long root = of_get_flat_dt_root();
123
124 if (of_flat_dt_is_compatible(root, "fsl,P2020RDB"))
125 return 1;
126 return 0;
127}
128
129define_machine(p2020_rdb) {
130 .name = "P2020 RDB",
131 .probe = p2020_rdb_probe,
132 .setup_arch = mpc85xx_rdb_setup_arch,
133 .init_IRQ = mpc85xx_rdb_pic_init,
134#ifdef CONFIG_PCI
135 .pcibios_fixup_bus = fsl_pcibios_fixup_bus,
136#endif
137 .get_irq = mpic_get_irq,
138 .restart = fsl_rstcr_restart,
139 .calibrate_decr = generic_calibrate_decr,
140 .progress = udbg_progress,
141};
diff --git a/arch/powerpc/platforms/85xx/sbc8560.c b/arch/powerpc/platforms/85xx/sbc8560.c
index cc27807a8b64..a5ad1c7794bf 100644
--- a/arch/powerpc/platforms/85xx/sbc8560.c
+++ b/arch/powerpc/platforms/85xx/sbc8560.c
@@ -267,6 +267,43 @@ arch_initcall(sbc8560_rtc_init);
267 267
268#endif /* M48T59 */ 268#endif /* M48T59 */
269 269
270static __u8 __iomem *brstcr;
271
272static int __init sbc8560_bdrstcr_init(void)
273{
274 struct device_node *np;
275 struct resource res;
276
277 np = of_find_compatible_node(NULL, NULL, "wrs,sbc8560-brstcr");
278 if (np == NULL) {
279 printk(KERN_WARNING "sbc8560: No board specific RSTCR in DTB.\n");
280 return -ENODEV;
281 }
282
283 of_address_to_resource(np, 0, &res);
284
285 printk(KERN_INFO "sbc8560: Found BRSTCR at i/o 0x%x\n", res.start);
286
287 brstcr = ioremap(res.start, res.end - res.start);
288 if(!brstcr)
289 printk(KERN_WARNING "sbc8560: ioremap of brstcr failed.\n");
290
291 of_node_put(np);
292
293 return 0;
294}
295
296arch_initcall(sbc8560_bdrstcr_init);
297
298void sbc8560_rstcr_restart(char * cmd)
299{
300 local_irq_disable();
301 if(brstcr)
302 clrbits8(brstcr, 0x80);
303
304 while(1);
305}
306
270define_machine(sbc8560) { 307define_machine(sbc8560) {
271 .name = "SBC8560", 308 .name = "SBC8560",
272 .probe = sbc8560_probe, 309 .probe = sbc8560_probe,
@@ -274,7 +311,7 @@ define_machine(sbc8560) {
274 .init_IRQ = sbc8560_pic_init, 311 .init_IRQ = sbc8560_pic_init,
275 .show_cpuinfo = sbc8560_show_cpuinfo, 312 .show_cpuinfo = sbc8560_show_cpuinfo,
276 .get_irq = mpic_get_irq, 313 .get_irq = mpic_get_irq,
277 .restart = fsl_rstcr_restart, 314 .restart = sbc8560_rstcr_restart,
278 .calibrate_decr = generic_calibrate_decr, 315 .calibrate_decr = generic_calibrate_decr,
279 .progress = udbg_progress, 316 .progress = udbg_progress,
280}; 317};
diff --git a/arch/powerpc/platforms/85xx/smp.c b/arch/powerpc/platforms/85xx/smp.c
index 62c592ede641..04160a4cc699 100644
--- a/arch/powerpc/platforms/85xx/smp.c
+++ b/arch/powerpc/platforms/85xx/smp.c
@@ -25,7 +25,6 @@
25 25
26#include <sysdev/fsl_soc.h> 26#include <sysdev/fsl_soc.h>
27 27
28extern volatile unsigned long __secondary_hold_acknowledge;
29extern void __early_start(void); 28extern void __early_start(void);
30 29
31#define BOOT_ENTRY_ADDR_UPPER 0 30#define BOOT_ENTRY_ADDR_UPPER 0
@@ -80,46 +79,24 @@ smp_85xx_kick_cpu(int nr)
80} 79}
81 80
82static void __init 81static void __init
83smp_85xx_basic_setup(int cpu_nr)
84{
85 /* Clear any pending timer interrupts */
86 mtspr(SPRN_TSR, TSR_ENW | TSR_WIS | TSR_DIS | TSR_FIS);
87
88 /* Enable decrementer interrupt */
89 mtspr(SPRN_TCR, TCR_DIE);
90}
91
92static void __init
93smp_85xx_setup_cpu(int cpu_nr) 82smp_85xx_setup_cpu(int cpu_nr)
94{ 83{
95 mpic_setup_this_cpu(); 84 mpic_setup_this_cpu();
96
97 smp_85xx_basic_setup(cpu_nr);
98} 85}
99 86
100struct smp_ops_t smp_85xx_ops = { 87struct smp_ops_t smp_85xx_ops = {
101 .kick_cpu = smp_85xx_kick_cpu, 88 .kick_cpu = smp_85xx_kick_cpu,
102}; 89};
103 90
104static int __init smp_dummy_probe(void)
105{
106 return NR_CPUS;
107}
108
109void __init mpc85xx_smp_init(void) 91void __init mpc85xx_smp_init(void)
110{ 92{
111 struct device_node *np; 93 struct device_node *np;
112 94
113 smp_85xx_ops.message_pass = NULL;
114
115 np = of_find_node_by_type(NULL, "open-pic"); 95 np = of_find_node_by_type(NULL, "open-pic");
116 if (np) { 96 if (np) {
117 smp_85xx_ops.probe = smp_mpic_probe; 97 smp_85xx_ops.probe = smp_mpic_probe;
118 smp_85xx_ops.setup_cpu = smp_85xx_setup_cpu; 98 smp_85xx_ops.setup_cpu = smp_85xx_setup_cpu;
119 smp_85xx_ops.message_pass = smp_mpic_message_pass; 99 smp_85xx_ops.message_pass = smp_mpic_message_pass;
120 } else {
121 smp_85xx_ops.probe = smp_dummy_probe;
122 smp_85xx_ops.setup_cpu = smp_85xx_basic_setup;
123 } 100 }
124 101
125 if (cpu_has_feature(CPU_FTR_DBELL)) 102 if (cpu_has_feature(CPU_FTR_DBELL))
diff --git a/arch/powerpc/platforms/86xx/gef_ppc9a.c b/arch/powerpc/platforms/86xx/gef_ppc9a.c
index 2efa052975e6..287f7bd17dd9 100644
--- a/arch/powerpc/platforms/86xx/gef_ppc9a.c
+++ b/arch/powerpc/platforms/86xx/gef_ppc9a.c
@@ -102,8 +102,8 @@ static unsigned int gef_ppc9a_get_pcb_rev(void)
102{ 102{
103 unsigned int reg; 103 unsigned int reg;
104 104
105 reg = ioread32(ppc9a_regs); 105 reg = ioread32be(ppc9a_regs);
106 return (reg >> 8) & 0xff; 106 return (reg >> 16) & 0xff;
107} 107}
108 108
109/* Return the board (software) revision */ 109/* Return the board (software) revision */
@@ -111,8 +111,8 @@ static unsigned int gef_ppc9a_get_board_rev(void)
111{ 111{
112 unsigned int reg; 112 unsigned int reg;
113 113
114 reg = ioread32(ppc9a_regs); 114 reg = ioread32be(ppc9a_regs);
115 return (reg >> 16) & 0xff; 115 return (reg >> 8) & 0xff;
116} 116}
117 117
118/* Return the FPGA revision */ 118/* Return the FPGA revision */
@@ -120,8 +120,26 @@ static unsigned int gef_ppc9a_get_fpga_rev(void)
120{ 120{
121 unsigned int reg; 121 unsigned int reg;
122 122
123 reg = ioread32(ppc9a_regs); 123 reg = ioread32be(ppc9a_regs);
124 return (reg >> 24) & 0xf; 124 return reg & 0xf;
125}
126
127/* Return VME Geographical Address */
128static unsigned int gef_ppc9a_get_vme_geo_addr(void)
129{
130 unsigned int reg;
131
132 reg = ioread32be(ppc9a_regs + 0x4);
133 return reg & 0x1f;
134}
135
136/* Return VME System Controller Status */
137static unsigned int gef_ppc9a_get_vme_is_syscon(void)
138{
139 unsigned int reg;
140
141 reg = ioread32be(ppc9a_regs + 0x4);
142 return (reg >> 9) & 0x1;
125} 143}
126 144
127static void gef_ppc9a_show_cpuinfo(struct seq_file *m) 145static void gef_ppc9a_show_cpuinfo(struct seq_file *m)
@@ -131,10 +149,15 @@ static void gef_ppc9a_show_cpuinfo(struct seq_file *m)
131 seq_printf(m, "Vendor\t\t: GE Fanuc Intelligent Platforms\n"); 149 seq_printf(m, "Vendor\t\t: GE Fanuc Intelligent Platforms\n");
132 150
133 seq_printf(m, "Revision\t: %u%c\n", gef_ppc9a_get_pcb_rev(), 151 seq_printf(m, "Revision\t: %u%c\n", gef_ppc9a_get_pcb_rev(),
134 ('A' + gef_ppc9a_get_board_rev() - 1)); 152 ('A' + gef_ppc9a_get_board_rev()));
135 seq_printf(m, "FPGA Revision\t: %u\n", gef_ppc9a_get_fpga_rev()); 153 seq_printf(m, "FPGA Revision\t: %u\n", gef_ppc9a_get_fpga_rev());
136 154
137 seq_printf(m, "SVR\t\t: 0x%x\n", svid); 155 seq_printf(m, "SVR\t\t: 0x%x\n", svid);
156
157 seq_printf(m, "VME geo. addr\t: %u\n", gef_ppc9a_get_vme_geo_addr());
158
159 seq_printf(m, "VME syscon\t: %s\n",
160 gef_ppc9a_get_vme_is_syscon() ? "yes" : "no");
138} 161}
139 162
140static void __init gef_ppc9a_nec_fixup(struct pci_dev *pdev) 163static void __init gef_ppc9a_nec_fixup(struct pci_dev *pdev)
diff --git a/arch/powerpc/platforms/86xx/mpc86xx_hpcn.c b/arch/powerpc/platforms/86xx/mpc86xx_hpcn.c
index 66327024a6a6..2aa69a69bcc8 100644
--- a/arch/powerpc/platforms/86xx/mpc86xx_hpcn.c
+++ b/arch/powerpc/platforms/86xx/mpc86xx_hpcn.c
@@ -105,7 +105,8 @@ mpc86xx_hpcn_setup_arch(void)
105#ifdef CONFIG_SWIOTLB 105#ifdef CONFIG_SWIOTLB
106 if (lmb_end_of_DRAM() > max) { 106 if (lmb_end_of_DRAM() > max) {
107 ppc_swiotlb_enable = 1; 107 ppc_swiotlb_enable = 1;
108 set_pci_dma_ops(&swiotlb_pci_dma_ops); 108 set_pci_dma_ops(&swiotlb_dma_ops);
109 ppc_md.pci_dma_dev_setup = pci_dma_dev_setup_swiotlb;
109 } 110 }
110#endif 111#endif
111} 112}
diff --git a/arch/powerpc/platforms/86xx/mpc86xx_smp.c b/arch/powerpc/platforms/86xx/mpc86xx_smp.c
index d84bbb508ee7..eacea0e3fcc8 100644
--- a/arch/powerpc/platforms/86xx/mpc86xx_smp.c
+++ b/arch/powerpc/platforms/86xx/mpc86xx_smp.c
@@ -27,7 +27,6 @@
27#include "mpc86xx.h" 27#include "mpc86xx.h"
28 28
29extern void __secondary_start_mpc86xx(void); 29extern void __secondary_start_mpc86xx(void);
30extern unsigned long __secondary_hold_acknowledge;
31 30
32#define MCM_PORT_CONFIG_OFFSET 0x10 31#define MCM_PORT_CONFIG_OFFSET 0x10
33 32
diff --git a/arch/powerpc/platforms/Kconfig.cputype b/arch/powerpc/platforms/Kconfig.cputype
index 61187bec7506..9efc8bda01b4 100644
--- a/arch/powerpc/platforms/Kconfig.cputype
+++ b/arch/powerpc/platforms/Kconfig.cputype
@@ -57,15 +57,35 @@ config E200
57 57
58endchoice 58endchoice
59 59
60config PPC_BOOK3S_64 60choice
61 def_bool y 61 prompt "Processor Type"
62 depends on PPC64 62 depends on PPC64
63 help
64 There are two families of 64 bit PowerPC chips supported.
65 The most common ones are the desktop and server CPUs
66 (POWER3, RS64, POWER4, POWER5, POWER5+, POWER6, ...)
67
68 The other are the "embedded" processors compliant with the
69 "Book 3E" variant of the architecture
70
71config PPC_BOOK3S_64
72 bool "Server processors"
63 select PPC_FPU 73 select PPC_FPU
64 74
75config PPC_BOOK3E_64
76 bool "Embedded processors"
77 select PPC_FPU # Make it a choice ?
78
79endchoice
80
65config PPC_BOOK3S 81config PPC_BOOK3S
66 def_bool y 82 def_bool y
67 depends on PPC_BOOK3S_32 || PPC_BOOK3S_64 83 depends on PPC_BOOK3S_32 || PPC_BOOK3S_64
68 84
85config PPC_BOOK3E
86 def_bool y
87 depends on PPC_BOOK3E_64
88
69config POWER4_ONLY 89config POWER4_ONLY
70 bool "Optimize for POWER4" 90 bool "Optimize for POWER4"
71 depends on PPC64 && PPC_BOOK3S 91 depends on PPC64 && PPC_BOOK3S
@@ -125,7 +145,7 @@ config 4xx
125 145
126config BOOKE 146config BOOKE
127 bool 147 bool
128 depends on E200 || E500 || 44x 148 depends on E200 || E500 || 44x || PPC_BOOK3E
129 default y 149 default y
130 150
131config FSL_BOOKE 151config FSL_BOOKE
@@ -223,9 +243,17 @@ config PPC_MMU_NOHASH
223 def_bool y 243 def_bool y
224 depends on !PPC_STD_MMU 244 depends on !PPC_STD_MMU
225 245
246config PPC_MMU_NOHASH_32
247 def_bool y
248 depends on PPC_MMU_NOHASH && PPC32
249
250config PPC_MMU_NOHASH_64
251 def_bool y
252 depends on PPC_MMU_NOHASH && PPC64
253
226config PPC_BOOK3E_MMU 254config PPC_BOOK3E_MMU
227 def_bool y 255 def_bool y
228 depends on FSL_BOOKE 256 depends on FSL_BOOKE || PPC_BOOK3E
229 257
230config PPC_MM_SLICES 258config PPC_MM_SLICES
231 bool 259 bool
@@ -257,7 +285,7 @@ config PPC_PERF_CTRS
257 This enables the powerpc-specific perf_counter back-end. 285 This enables the powerpc-specific perf_counter back-end.
258 286
259config SMP 287config SMP
260 depends on PPC_STD_MMU || FSL_BOOKE 288 depends on PPC_BOOK3S || PPC_BOOK3E || FSL_BOOKE
261 bool "Symmetric multi-processing support" 289 bool "Symmetric multi-processing support"
262 ---help--- 290 ---help---
263 This enables support for systems with more than one CPU. If you have 291 This enables support for systems with more than one CPU. If you have
diff --git a/arch/powerpc/platforms/amigaone/setup.c b/arch/powerpc/platforms/amigaone/setup.c
index 443035366c12..9290a7a442d0 100644
--- a/arch/powerpc/platforms/amigaone/setup.c
+++ b/arch/powerpc/platforms/amigaone/setup.c
@@ -110,13 +110,16 @@ void __init amigaone_init_IRQ(void)
110 irq_set_default_host(i8259_get_host()); 110 irq_set_default_host(i8259_get_host());
111} 111}
112 112
113void __init amigaone_init(void) 113static int __init request_isa_regions(void)
114{ 114{
115 request_region(0x00, 0x20, "dma1"); 115 request_region(0x00, 0x20, "dma1");
116 request_region(0x40, 0x20, "timer"); 116 request_region(0x40, 0x20, "timer");
117 request_region(0x80, 0x10, "dma page reg"); 117 request_region(0x80, 0x10, "dma page reg");
118 request_region(0xc0, 0x20, "dma2"); 118 request_region(0xc0, 0x20, "dma2");
119
120 return 0;
119} 121}
122machine_device_initcall(amigaone, request_isa_regions);
120 123
121void amigaone_restart(char *cmd) 124void amigaone_restart(char *cmd)
122{ 125{
@@ -161,7 +164,6 @@ define_machine(amigaone) {
161 .name = "AmigaOne", 164 .name = "AmigaOne",
162 .probe = amigaone_probe, 165 .probe = amigaone_probe,
163 .setup_arch = amigaone_setup_arch, 166 .setup_arch = amigaone_setup_arch,
164 .init = amigaone_init,
165 .show_cpuinfo = amigaone_show_cpuinfo, 167 .show_cpuinfo = amigaone_show_cpuinfo,
166 .init_IRQ = amigaone_init_IRQ, 168 .init_IRQ = amigaone_init_IRQ,
167 .restart = amigaone_restart, 169 .restart = amigaone_restart,
diff --git a/arch/powerpc/platforms/cell/Kconfig b/arch/powerpc/platforms/cell/Kconfig
index 50f17bdd3c16..48cd7d2e1b75 100644
--- a/arch/powerpc/platforms/cell/Kconfig
+++ b/arch/powerpc/platforms/cell/Kconfig
@@ -80,13 +80,6 @@ config SPU_FS_64K_LS
80 uses 4K pages. This can improve performances of applications 80 uses 4K pages. This can improve performances of applications
81 using multiple SPEs by lowering the TLB pressure on them. 81 using multiple SPEs by lowering the TLB pressure on them.
82 82
83config SPU_TRACE
84 tristate "SPU event tracing support"
85 depends on SPU_FS && MARKERS
86 help
87 This option allows reading a trace of spu-related events through
88 the sputrace file in procfs.
89
90config SPU_BASE 83config SPU_BASE
91 bool 84 bool
92 default n 85 default n
diff --git a/arch/powerpc/platforms/cell/celleb_setup.c b/arch/powerpc/platforms/cell/celleb_setup.c
index 07c234f6b2b6..e53845579770 100644
--- a/arch/powerpc/platforms/cell/celleb_setup.c
+++ b/arch/powerpc/platforms/cell/celleb_setup.c
@@ -80,8 +80,7 @@ static void celleb_show_cpuinfo(struct seq_file *m)
80 80
81static int __init celleb_machine_type_hack(char *ptr) 81static int __init celleb_machine_type_hack(char *ptr)
82{ 82{
83 strncpy(celleb_machine_type, ptr, sizeof(celleb_machine_type)); 83 strlcpy(celleb_machine_type, ptr, sizeof(celleb_machine_type));
84 celleb_machine_type[sizeof(celleb_machine_type)-1] = 0;
85 return 0; 84 return 0;
86} 85}
87 86
diff --git a/arch/powerpc/platforms/cell/iommu.c b/arch/powerpc/platforms/cell/iommu.c
index 5b34fc211f35..416db17eb18f 100644
--- a/arch/powerpc/platforms/cell/iommu.c
+++ b/arch/powerpc/platforms/cell/iommu.c
@@ -642,7 +642,7 @@ static int dma_fixed_dma_supported(struct device *dev, u64 mask)
642 642
643static int dma_set_mask_and_switch(struct device *dev, u64 dma_mask); 643static int dma_set_mask_and_switch(struct device *dev, u64 dma_mask);
644 644
645struct dma_mapping_ops dma_iommu_fixed_ops = { 645struct dma_map_ops dma_iommu_fixed_ops = {
646 .alloc_coherent = dma_fixed_alloc_coherent, 646 .alloc_coherent = dma_fixed_alloc_coherent,
647 .free_coherent = dma_fixed_free_coherent, 647 .free_coherent = dma_fixed_free_coherent,
648 .map_sg = dma_fixed_map_sg, 648 .map_sg = dma_fixed_map_sg,
diff --git a/arch/powerpc/platforms/cell/smp.c b/arch/powerpc/platforms/cell/smp.c
index bc97fada48c6..f774530075b7 100644
--- a/arch/powerpc/platforms/cell/smp.c
+++ b/arch/powerpc/platforms/cell/smp.c
@@ -58,8 +58,6 @@
58 */ 58 */
59static cpumask_t of_spin_map; 59static cpumask_t of_spin_map;
60 60
61extern void generic_secondary_smp_init(unsigned long);
62
63/** 61/**
64 * smp_startup_cpu() - start the given cpu 62 * smp_startup_cpu() - start the given cpu
65 * 63 *
diff --git a/arch/powerpc/platforms/cell/spufs/Makefile b/arch/powerpc/platforms/cell/spufs/Makefile
index 99610a6361f2..b93f877ba504 100644
--- a/arch/powerpc/platforms/cell/spufs/Makefile
+++ b/arch/powerpc/platforms/cell/spufs/Makefile
@@ -4,7 +4,8 @@ spufs-y += inode.o file.o context.o syscalls.o coredump.o
4spufs-y += sched.o backing_ops.o hw_ops.o run.o gang.o 4spufs-y += sched.o backing_ops.o hw_ops.o run.o gang.o
5spufs-y += switch.o fault.o lscsa_alloc.o 5spufs-y += switch.o fault.o lscsa_alloc.o
6 6
7obj-$(CONFIG_SPU_TRACE) += sputrace.o 7# magic for the trace events
8CFLAGS_sched.o := -I$(src)
8 9
9# Rules to build switch.o with the help of SPU tool chain 10# Rules to build switch.o with the help of SPU tool chain
10SPU_CROSS := spu- 11SPU_CROSS := spu-
diff --git a/arch/powerpc/platforms/cell/spufs/context.c b/arch/powerpc/platforms/cell/spufs/context.c
index db5398c0339f..0c87bcd2452a 100644
--- a/arch/powerpc/platforms/cell/spufs/context.c
+++ b/arch/powerpc/platforms/cell/spufs/context.c
@@ -28,6 +28,7 @@
28#include <asm/spu.h> 28#include <asm/spu.h>
29#include <asm/spu_csa.h> 29#include <asm/spu_csa.h>
30#include "spufs.h" 30#include "spufs.h"
31#include "sputrace.h"
31 32
32 33
33atomic_t nr_spu_contexts = ATOMIC_INIT(0); 34atomic_t nr_spu_contexts = ATOMIC_INIT(0);
diff --git a/arch/powerpc/platforms/cell/spufs/file.c b/arch/powerpc/platforms/cell/spufs/file.c
index d6a519e6e1c1..ab8aef9bb8ea 100644
--- a/arch/powerpc/platforms/cell/spufs/file.c
+++ b/arch/powerpc/platforms/cell/spufs/file.c
@@ -38,6 +38,7 @@
38#include <asm/uaccess.h> 38#include <asm/uaccess.h>
39 39
40#include "spufs.h" 40#include "spufs.h"
41#include "sputrace.h"
41 42
42#define SPUFS_MMAP_4K (PAGE_SIZE == 0x1000) 43#define SPUFS_MMAP_4K (PAGE_SIZE == 0x1000)
43 44
diff --git a/arch/powerpc/platforms/cell/spufs/sched.c b/arch/powerpc/platforms/cell/spufs/sched.c
index f085369301b1..bb5b77c66d05 100644
--- a/arch/powerpc/platforms/cell/spufs/sched.c
+++ b/arch/powerpc/platforms/cell/spufs/sched.c
@@ -47,6 +47,8 @@
47#include <asm/spu_csa.h> 47#include <asm/spu_csa.h>
48#include <asm/spu_priv1.h> 48#include <asm/spu_priv1.h>
49#include "spufs.h" 49#include "spufs.h"
50#define CREATE_TRACE_POINTS
51#include "sputrace.h"
50 52
51struct spu_prio_array { 53struct spu_prio_array {
52 DECLARE_BITMAP(bitmap, MAX_PRIO); 54 DECLARE_BITMAP(bitmap, MAX_PRIO);
diff --git a/arch/powerpc/platforms/cell/spufs/spufs.h b/arch/powerpc/platforms/cell/spufs/spufs.h
index ae31573bea4a..c448bac65518 100644
--- a/arch/powerpc/platforms/cell/spufs/spufs.h
+++ b/arch/powerpc/platforms/cell/spufs/spufs.h
@@ -373,9 +373,4 @@ extern void spu_free_lscsa(struct spu_state *csa);
373extern void spuctx_switch_state(struct spu_context *ctx, 373extern void spuctx_switch_state(struct spu_context *ctx,
374 enum spu_utilization_state new_state); 374 enum spu_utilization_state new_state);
375 375
376#define spu_context_trace(name, ctx, spu) \
377 trace_mark(name, "ctx %p spu %p", ctx, spu);
378#define spu_context_nospu_trace(name, ctx) \
379 trace_mark(name, "ctx %p", ctx);
380
381#endif 376#endif
diff --git a/arch/powerpc/platforms/cell/spufs/sputrace.c b/arch/powerpc/platforms/cell/spufs/sputrace.c
deleted file mode 100644
index d0b1f3f4d9c8..000000000000
--- a/arch/powerpc/platforms/cell/spufs/sputrace.c
+++ /dev/null
@@ -1,272 +0,0 @@
1/*
2 * Copyright (C) 2007 IBM Deutschland Entwicklung GmbH
3 * Released under GPL v2.
4 *
5 * Partially based on net/ipv4/tcp_probe.c.
6 *
7 * Simple tracing facility for spu contexts.
8 */
9#include <linux/sched.h>
10#include <linux/kernel.h>
11#include <linux/module.h>
12#include <linux/marker.h>
13#include <linux/proc_fs.h>
14#include <linux/wait.h>
15#include <asm/atomic.h>
16#include <asm/uaccess.h>
17#include "spufs.h"
18
19struct spu_probe {
20 const char *name;
21 const char *format;
22 marker_probe_func *probe_func;
23};
24
25struct sputrace {
26 ktime_t tstamp;
27 int owner_tid; /* owner */
28 int curr_tid;
29 const char *name;
30 int number;
31};
32
33static int bufsize __read_mostly = 16384;
34MODULE_PARM_DESC(bufsize, "Log buffer size (number of records)");
35module_param(bufsize, int, 0);
36
37
38static DEFINE_SPINLOCK(sputrace_lock);
39static DECLARE_WAIT_QUEUE_HEAD(sputrace_wait);
40static ktime_t sputrace_start;
41static unsigned long sputrace_head, sputrace_tail;
42static struct sputrace *sputrace_log;
43static int sputrace_logging;
44
45static int sputrace_used(void)
46{
47 return (sputrace_head - sputrace_tail) % bufsize;
48}
49
50static inline int sputrace_avail(void)
51{
52 return bufsize - sputrace_used();
53}
54
55static int sputrace_sprint(char *tbuf, int n)
56{
57 const struct sputrace *t = sputrace_log + sputrace_tail % bufsize;
58 struct timespec tv =
59 ktime_to_timespec(ktime_sub(t->tstamp, sputrace_start));
60
61 return snprintf(tbuf, n,
62 "[%lu.%09lu] %d: %s (ctxthread = %d, spu = %d)\n",
63 (unsigned long) tv.tv_sec,
64 (unsigned long) tv.tv_nsec,
65 t->curr_tid,
66 t->name,
67 t->owner_tid,
68 t->number);
69}
70
71static ssize_t sputrace_read(struct file *file, char __user *buf,
72 size_t len, loff_t *ppos)
73{
74 int error = 0, cnt = 0;
75
76 if (!buf || len < 0)
77 return -EINVAL;
78
79 while (cnt < len) {
80 char tbuf[128];
81 int width;
82
83 /* If we have data ready to return, don't block waiting
84 * for more */
85 if (cnt > 0 && sputrace_used() == 0)
86 break;
87
88 error = wait_event_interruptible(sputrace_wait,
89 sputrace_used() > 0);
90 if (error)
91 break;
92
93 spin_lock(&sputrace_lock);
94 if (sputrace_head == sputrace_tail) {
95 spin_unlock(&sputrace_lock);
96 continue;
97 }
98
99 width = sputrace_sprint(tbuf, sizeof(tbuf));
100 if (width < len)
101 sputrace_tail = (sputrace_tail + 1) % bufsize;
102 spin_unlock(&sputrace_lock);
103
104 if (width >= len)
105 break;
106
107 error = copy_to_user(buf + cnt, tbuf, width);
108 if (error)
109 break;
110 cnt += width;
111 }
112
113 return cnt == 0 ? error : cnt;
114}
115
116static int sputrace_open(struct inode *inode, struct file *file)
117{
118 int rc;
119
120 spin_lock(&sputrace_lock);
121 if (sputrace_logging) {
122 rc = -EBUSY;
123 goto out;
124 }
125
126 sputrace_logging = 1;
127 sputrace_head = sputrace_tail = 0;
128 sputrace_start = ktime_get();
129 rc = 0;
130
131out:
132 spin_unlock(&sputrace_lock);
133 return rc;
134}
135
136static int sputrace_release(struct inode *inode, struct file *file)
137{
138 spin_lock(&sputrace_lock);
139 sputrace_logging = 0;
140 spin_unlock(&sputrace_lock);
141 return 0;
142}
143
144static const struct file_operations sputrace_fops = {
145 .owner = THIS_MODULE,
146 .open = sputrace_open,
147 .read = sputrace_read,
148 .release = sputrace_release,
149};
150
151static void sputrace_log_item(const char *name, struct spu_context *ctx,
152 struct spu *spu)
153{
154 spin_lock(&sputrace_lock);
155
156 if (!sputrace_logging) {
157 spin_unlock(&sputrace_lock);
158 return;
159 }
160
161 if (sputrace_avail() > 1) {
162 struct sputrace *t = sputrace_log + sputrace_head;
163
164 t->tstamp = ktime_get();
165 t->owner_tid = ctx->tid;
166 t->name = name;
167 t->curr_tid = current->pid;
168 t->number = spu ? spu->number : -1;
169
170 sputrace_head = (sputrace_head + 1) % bufsize;
171 } else {
172 printk(KERN_WARNING
173 "sputrace: lost samples due to full buffer.\n");
174 }
175 spin_unlock(&sputrace_lock);
176
177 wake_up(&sputrace_wait);
178}
179
180static void spu_context_event(void *probe_private, void *call_data,
181 const char *format, va_list *args)
182{
183 struct spu_probe *p = probe_private;
184 struct spu_context *ctx;
185 struct spu *spu;
186
187 ctx = va_arg(*args, struct spu_context *);
188 spu = va_arg(*args, struct spu *);
189
190 sputrace_log_item(p->name, ctx, spu);
191}
192
193static void spu_context_nospu_event(void *probe_private, void *call_data,
194 const char *format, va_list *args)
195{
196 struct spu_probe *p = probe_private;
197 struct spu_context *ctx;
198
199 ctx = va_arg(*args, struct spu_context *);
200
201 sputrace_log_item(p->name, ctx, NULL);
202}
203
204struct spu_probe spu_probes[] = {
205 { "spu_bind_context__enter", "ctx %p spu %p", spu_context_event },
206 { "spu_unbind_context__enter", "ctx %p spu %p", spu_context_event },
207 { "spu_get_idle__enter", "ctx %p", spu_context_nospu_event },
208 { "spu_get_idle__found", "ctx %p spu %p", spu_context_event },
209 { "spu_get_idle__not_found", "ctx %p", spu_context_nospu_event },
210 { "spu_find_victim__enter", "ctx %p", spu_context_nospu_event },
211 { "spusched_tick__preempt", "ctx %p spu %p", spu_context_event },
212 { "spusched_tick__newslice", "ctx %p", spu_context_nospu_event },
213 { "spu_yield__enter", "ctx %p", spu_context_nospu_event },
214 { "spu_deactivate__enter", "ctx %p", spu_context_nospu_event },
215 { "__spu_deactivate__unload", "ctx %p spu %p", spu_context_event },
216 { "spufs_ps_fault__enter", "ctx %p", spu_context_nospu_event },
217 { "spufs_ps_fault__sleep", "ctx %p", spu_context_nospu_event },
218 { "spufs_ps_fault__wake", "ctx %p spu %p", spu_context_event },
219 { "spufs_ps_fault__insert", "ctx %p spu %p", spu_context_event },
220 { "spu_acquire_saved__enter", "ctx %p", spu_context_nospu_event },
221 { "destroy_spu_context__enter", "ctx %p", spu_context_nospu_event },
222 { "spufs_stop_callback__enter", "ctx %p spu %p", spu_context_event },
223};
224
225static int __init sputrace_init(void)
226{
227 struct proc_dir_entry *entry;
228 int i, error = -ENOMEM;
229
230 sputrace_log = kcalloc(bufsize, sizeof(struct sputrace), GFP_KERNEL);
231 if (!sputrace_log)
232 goto out;
233
234 entry = proc_create("sputrace", S_IRUSR, NULL, &sputrace_fops);
235 if (!entry)
236 goto out_free_log;
237
238 for (i = 0; i < ARRAY_SIZE(spu_probes); i++) {
239 struct spu_probe *p = &spu_probes[i];
240
241 error = marker_probe_register(p->name, p->format,
242 p->probe_func, p);
243 if (error)
244 printk(KERN_INFO "Unable to register probe %s\n",
245 p->name);
246 }
247
248 return 0;
249
250out_free_log:
251 kfree(sputrace_log);
252out:
253 return -ENOMEM;
254}
255
256static void __exit sputrace_exit(void)
257{
258 int i;
259
260 for (i = 0; i < ARRAY_SIZE(spu_probes); i++)
261 marker_probe_unregister(spu_probes[i].name,
262 spu_probes[i].probe_func, &spu_probes[i]);
263
264 remove_proc_entry("sputrace", NULL);
265 kfree(sputrace_log);
266 marker_synchronize_unregister();
267}
268
269module_init(sputrace_init);
270module_exit(sputrace_exit);
271
272MODULE_LICENSE("GPL");
diff --git a/arch/powerpc/platforms/cell/spufs/sputrace.h b/arch/powerpc/platforms/cell/spufs/sputrace.h
new file mode 100644
index 000000000000..db2656aa4103
--- /dev/null
+++ b/arch/powerpc/platforms/cell/spufs/sputrace.h
@@ -0,0 +1,39 @@
1#if !defined(_TRACE_SPUFS_H) || defined(TRACE_HEADER_MULTI_READ)
2#define _TRACE_SPUFS_H
3
4#include <linux/tracepoint.h>
5
6#undef TRACE_SYSTEM
7#define TRACE_SYSTEM spufs
8
9TRACE_EVENT(spufs_context,
10 TP_PROTO(struct spu_context *ctx, struct spu *spu, const char *name),
11 TP_ARGS(ctx, spu, name),
12
13 TP_STRUCT__entry(
14 __field(const char *, name)
15 __field(int, owner_tid)
16 __field(int, number)
17 ),
18
19 TP_fast_assign(
20 __entry->name = name;
21 __entry->owner_tid = ctx->tid;
22 __entry->number = spu ? spu->number : -1;
23 ),
24
25 TP_printk("%s (ctxthread = %d, spu = %d)",
26 __entry->name, __entry->owner_tid, __entry->number)
27);
28
29#define spu_context_trace(name, ctx, spu) \
30 trace_spufs_context(ctx, spu, __stringify(name))
31#define spu_context_nospu_trace(name, ctx) \
32 trace_spufs_context(ctx, NULL, __stringify(name))
33
34#endif /* _TRACE_SPUFS_H */
35
36#undef TRACE_INCLUDE_PATH
37#define TRACE_INCLUDE_PATH .
38#define TRACE_INCLUDE_FILE sputrace
39#include <trace/define_trace.h>
diff --git a/arch/powerpc/platforms/iseries/exception.S b/arch/powerpc/platforms/iseries/exception.S
index 2f581521eb9b..5369653dcf6a 100644
--- a/arch/powerpc/platforms/iseries/exception.S
+++ b/arch/powerpc/platforms/iseries/exception.S
@@ -47,7 +47,7 @@ system_reset_iSeries:
47 LOAD_REG_ADDR(r13, paca) 47 LOAD_REG_ADDR(r13, paca)
48 mulli r0,r23,PACA_SIZE 48 mulli r0,r23,PACA_SIZE
49 add r13,r13,r0 49 add r13,r13,r0
50 mtspr SPRN_SPRG3,r13 /* Save it away for the future */ 50 mtspr SPRN_SPRG_PACA,r13 /* Save it away for the future */
51 mfmsr r24 51 mfmsr r24
52 ori r24,r24,MSR_RI 52 ori r24,r24,MSR_RI
53 mtmsrd r24 /* RI on */ 53 mtmsrd r24 /* RI on */
@@ -116,7 +116,7 @@ iSeries_secondary_smp_loop:
116#endif /* CONFIG_SMP */ 116#endif /* CONFIG_SMP */
117 li r0,-1 /* r0=-1 indicates a Hypervisor call */ 117 li r0,-1 /* r0=-1 indicates a Hypervisor call */
118 sc /* Invoke the hypervisor via a system call */ 118 sc /* Invoke the hypervisor via a system call */
119 mfspr r13,SPRN_SPRG3 /* Put r13 back ???? */ 119 mfspr r13,SPRN_SPRG_PACA /* Put r13 back ???? */
120 b 2b /* If SMP not configured, secondaries 120 b 2b /* If SMP not configured, secondaries
121 * loop forever */ 121 * loop forever */
122 122
@@ -126,34 +126,45 @@ iSeries_secondary_smp_loop:
126 126
127 .globl data_access_iSeries 127 .globl data_access_iSeries
128data_access_iSeries: 128data_access_iSeries:
129 mtspr SPRN_SPRG1,r13 129 mtspr SPRN_SPRG_SCRATCH0,r13
130BEGIN_FTR_SECTION 130BEGIN_FTR_SECTION
131 mtspr SPRN_SPRG2,r12 131 mfspr r13,SPRN_SPRG_PACA
132 mfspr r13,SPRN_DAR 132 std r9,PACA_EXSLB+EX_R9(r13)
133 mfspr r12,SPRN_DSISR 133 std r10,PACA_EXSLB+EX_R10(r13)
134 srdi r13,r13,60 134 mfspr r10,SPRN_DAR
135 rlwimi r13,r12,16,0x20 135 mfspr r9,SPRN_DSISR
136 mfcr r12 136 srdi r10,r10,60
137 cmpwi r13,0x2c 137 rlwimi r10,r9,16,0x20
138 mfcr r9
139 cmpwi r10,0x2c
138 beq .do_stab_bolted_iSeries 140 beq .do_stab_bolted_iSeries
139 mtcrf 0x80,r12 141 ld r10,PACA_EXSLB+EX_R10(r13)
140 mfspr r12,SPRN_SPRG2 142 std r11,PACA_EXGEN+EX_R11(r13)
141END_FTR_SECTION_IFCLR(CPU_FTR_SLB) 143 ld r11,PACA_EXSLB+EX_R9(r13)
144 std r12,PACA_EXGEN+EX_R12(r13)
145 mfspr r12,SPRN_SPRG_SCRATCH0
146 std r10,PACA_EXGEN+EX_R10(r13)
147 std r11,PACA_EXGEN+EX_R9(r13)
148 std r12,PACA_EXGEN+EX_R13(r13)
149 EXCEPTION_PROLOG_ISERIES_1
150FTR_SECTION_ELSE
142 EXCEPTION_PROLOG_1(PACA_EXGEN) 151 EXCEPTION_PROLOG_1(PACA_EXGEN)
143 EXCEPTION_PROLOG_ISERIES_1 152 EXCEPTION_PROLOG_ISERIES_1
153ALT_FTR_SECTION_END_IFCLR(CPU_FTR_SLB)
144 b data_access_common 154 b data_access_common
145 155
146.do_stab_bolted_iSeries: 156.do_stab_bolted_iSeries:
147 mtcrf 0x80,r12 157 std r11,PACA_EXSLB+EX_R11(r13)
148 mfspr r12,SPRN_SPRG2 158 std r12,PACA_EXSLB+EX_R12(r13)
149 EXCEPTION_PROLOG_1(PACA_EXSLB) 159 mfspr r10,SPRN_SPRG_SCRATCH0
160 std r10,PACA_EXSLB+EX_R13(r13)
150 EXCEPTION_PROLOG_ISERIES_1 161 EXCEPTION_PROLOG_ISERIES_1
151 b .do_stab_bolted 162 b .do_stab_bolted
152 163
153 .globl data_access_slb_iSeries 164 .globl data_access_slb_iSeries
154data_access_slb_iSeries: 165data_access_slb_iSeries:
155 mtspr SPRN_SPRG1,r13 /* save r13 */ 166 mtspr SPRN_SPRG_SCRATCH0,r13 /* save r13 */
156 mfspr r13,SPRN_SPRG3 /* get paca address into r13 */ 167 mfspr r13,SPRN_SPRG_PACA /* get paca address into r13 */
157 std r3,PACA_EXSLB+EX_R3(r13) 168 std r3,PACA_EXSLB+EX_R3(r13)
158 mfspr r3,SPRN_DAR 169 mfspr r3,SPRN_DAR
159 std r9,PACA_EXSLB+EX_R9(r13) 170 std r9,PACA_EXSLB+EX_R9(r13)
@@ -165,7 +176,7 @@ data_access_slb_iSeries:
165 std r10,PACA_EXSLB+EX_R10(r13) 176 std r10,PACA_EXSLB+EX_R10(r13)
166 std r11,PACA_EXSLB+EX_R11(r13) 177 std r11,PACA_EXSLB+EX_R11(r13)
167 std r12,PACA_EXSLB+EX_R12(r13) 178 std r12,PACA_EXSLB+EX_R12(r13)
168 mfspr r10,SPRN_SPRG1 179 mfspr r10,SPRN_SPRG_SCRATCH0
169 std r10,PACA_EXSLB+EX_R13(r13) 180 std r10,PACA_EXSLB+EX_R13(r13)
170 ld r12,PACALPPACAPTR(r13) 181 ld r12,PACALPPACAPTR(r13)
171 ld r12,LPPACASRR1(r12) 182 ld r12,LPPACASRR1(r12)
@@ -175,8 +186,8 @@ data_access_slb_iSeries:
175 186
176 .globl instruction_access_slb_iSeries 187 .globl instruction_access_slb_iSeries
177instruction_access_slb_iSeries: 188instruction_access_slb_iSeries:
178 mtspr SPRN_SPRG1,r13 /* save r13 */ 189 mtspr SPRN_SPRG_SCRATCH0,r13 /* save r13 */
179 mfspr r13,SPRN_SPRG3 /* get paca address into r13 */ 190 mfspr r13,SPRN_SPRG_PACA /* get paca address into r13 */
180 std r3,PACA_EXSLB+EX_R3(r13) 191 std r3,PACA_EXSLB+EX_R3(r13)
181 ld r3,PACALPPACAPTR(r13) 192 ld r3,PACALPPACAPTR(r13)
182 ld r3,LPPACASRR0(r3) /* get SRR0 value */ 193 ld r3,LPPACASRR0(r3) /* get SRR0 value */
@@ -189,7 +200,7 @@ instruction_access_slb_iSeries:
189 std r10,PACA_EXSLB+EX_R10(r13) 200 std r10,PACA_EXSLB+EX_R10(r13)
190 std r11,PACA_EXSLB+EX_R11(r13) 201 std r11,PACA_EXSLB+EX_R11(r13)
191 std r12,PACA_EXSLB+EX_R12(r13) 202 std r12,PACA_EXSLB+EX_R12(r13)
192 mfspr r10,SPRN_SPRG1 203 mfspr r10,SPRN_SPRG_SCRATCH0
193 std r10,PACA_EXSLB+EX_R13(r13) 204 std r10,PACA_EXSLB+EX_R13(r13)
194 ld r12,PACALPPACAPTR(r13) 205 ld r12,PACALPPACAPTR(r13)
195 ld r12,LPPACASRR1(r12) 206 ld r12,LPPACASRR1(r12)
@@ -200,7 +211,7 @@ slb_miss_user_iseries:
200 std r10,PACA_EXGEN+EX_R10(r13) 211 std r10,PACA_EXGEN+EX_R10(r13)
201 std r11,PACA_EXGEN+EX_R11(r13) 212 std r11,PACA_EXGEN+EX_R11(r13)
202 std r12,PACA_EXGEN+EX_R12(r13) 213 std r12,PACA_EXGEN+EX_R12(r13)
203 mfspr r10,SPRG1 214 mfspr r10,SPRG_SCRATCH0
204 ld r11,PACA_EXSLB+EX_R9(r13) 215 ld r11,PACA_EXSLB+EX_R9(r13)
205 ld r12,PACA_EXSLB+EX_R3(r13) 216 ld r12,PACA_EXSLB+EX_R3(r13)
206 std r10,PACA_EXGEN+EX_R13(r13) 217 std r10,PACA_EXGEN+EX_R13(r13)
@@ -221,7 +232,7 @@ slb_miss_user_iseries:
221 .globl system_call_iSeries 232 .globl system_call_iSeries
222system_call_iSeries: 233system_call_iSeries:
223 mr r9,r13 234 mr r9,r13
224 mfspr r13,SPRN_SPRG3 235 mfspr r13,SPRN_SPRG_PACA
225 EXCEPTION_PROLOG_ISERIES_1 236 EXCEPTION_PROLOG_ISERIES_1
226 b system_call_common 237 b system_call_common
227 238
diff --git a/arch/powerpc/platforms/iseries/exception.h b/arch/powerpc/platforms/iseries/exception.h
index ced45a8fa1aa..bae3fba5ad8e 100644
--- a/arch/powerpc/platforms/iseries/exception.h
+++ b/arch/powerpc/platforms/iseries/exception.h
@@ -24,7 +24,7 @@
24 * as published by the Free Software Foundation; either version 24 * as published by the Free Software Foundation; either version
25 * 2 of the License, or (at your option) any later version. 25 * 2 of the License, or (at your option) any later version.
26 */ 26 */
27#include <asm/exception.h> 27#include <asm/exception-64s.h>
28 28
29#define EXCEPTION_PROLOG_ISERIES_1 \ 29#define EXCEPTION_PROLOG_ISERIES_1 \
30 mfmsr r10; \ 30 mfmsr r10; \
@@ -38,7 +38,7 @@
38 .globl label##_iSeries; \ 38 .globl label##_iSeries; \
39label##_iSeries: \ 39label##_iSeries: \
40 HMT_MEDIUM; \ 40 HMT_MEDIUM; \
41 mtspr SPRN_SPRG1,r13; /* save r13 */ \ 41 mtspr SPRN_SPRG_SCRATCH0,r13; /* save r13 */ \
42 EXCEPTION_PROLOG_1(area); \ 42 EXCEPTION_PROLOG_1(area); \
43 EXCEPTION_PROLOG_ISERIES_1; \ 43 EXCEPTION_PROLOG_ISERIES_1; \
44 b label##_common 44 b label##_common
@@ -47,7 +47,7 @@ label##_iSeries: \
47 .globl label##_iSeries; \ 47 .globl label##_iSeries; \
48label##_iSeries: \ 48label##_iSeries: \
49 HMT_MEDIUM; \ 49 HMT_MEDIUM; \
50 mtspr SPRN_SPRG1,r13; /* save r13 */ \ 50 mtspr SPRN_SPRG_SCRATCH0,r13; /* save r13 */ \
51 EXCEPTION_PROLOG_1(PACA_EXGEN); \ 51 EXCEPTION_PROLOG_1(PACA_EXGEN); \
52 lbz r10,PACASOFTIRQEN(r13); \ 52 lbz r10,PACASOFTIRQEN(r13); \
53 cmpwi 0,r10,0; \ 53 cmpwi 0,r10,0; \
diff --git a/arch/powerpc/platforms/iseries/mf.c b/arch/powerpc/platforms/iseries/mf.c
index fef4d5150517..0d9343df35bc 100644
--- a/arch/powerpc/platforms/iseries/mf.c
+++ b/arch/powerpc/platforms/iseries/mf.c
@@ -872,7 +872,7 @@ static int proc_mf_dump_cmdline(char *page, char **start, off_t off,
872 count = 256 - off; 872 count = 256 - off;
873 873
874 dma_addr = iseries_hv_map(page, off + count, DMA_FROM_DEVICE); 874 dma_addr = iseries_hv_map(page, off + count, DMA_FROM_DEVICE);
875 if (dma_mapping_error(NULL, dma_addr)) 875 if (dma_addr == DMA_ERROR_CODE)
876 return -ENOMEM; 876 return -ENOMEM;
877 memset(page, 0, off + count); 877 memset(page, 0, off + count);
878 memset(&vsp_cmd, 0, sizeof(vsp_cmd)); 878 memset(&vsp_cmd, 0, sizeof(vsp_cmd));
diff --git a/arch/powerpc/platforms/pasemi/idle.c b/arch/powerpc/platforms/pasemi/idle.c
index 43911d8b0206..75b296bc51af 100644
--- a/arch/powerpc/platforms/pasemi/idle.c
+++ b/arch/powerpc/platforms/pasemi/idle.c
@@ -90,7 +90,7 @@ machine_late_initcall(pasemi, pasemi_idle_init);
90static int __init idle_param(char *p) 90static int __init idle_param(char *p)
91{ 91{
92 int i; 92 int i;
93 for (i = 0; i < sizeof(modes)/sizeof(struct sleep_mode); i++) { 93 for (i = 0; i < ARRAY_SIZE(modes); i++) {
94 if (!strcmp(modes[i].name, p)) { 94 if (!strcmp(modes[i].name, p)) {
95 current_mode = i; 95 current_mode = i;
96 break; 96 break;
diff --git a/arch/powerpc/platforms/powermac/cpufreq_32.c b/arch/powerpc/platforms/powermac/cpufreq_32.c
index 65c585b8b00d..08d94e4cedd3 100644
--- a/arch/powerpc/platforms/powermac/cpufreq_32.c
+++ b/arch/powerpc/platforms/powermac/cpufreq_32.c
@@ -44,14 +44,6 @@
44 */ 44 */
45#undef DEBUG_FREQ 45#undef DEBUG_FREQ
46 46
47/*
48 * There is a problem with the core cpufreq code on SMP kernels,
49 * it won't recalculate the Bogomips properly
50 */
51#ifdef CONFIG_SMP
52#warning "WARNING, CPUFREQ not recommended on SMP kernels"
53#endif
54
55extern void low_choose_7447a_dfs(int dfs); 47extern void low_choose_7447a_dfs(int dfs);
56extern void low_choose_750fx_pll(int pll); 48extern void low_choose_750fx_pll(int pll);
57extern void low_sleep_handler(void); 49extern void low_sleep_handler(void);
diff --git a/arch/powerpc/platforms/powermac/feature.c b/arch/powerpc/platforms/powermac/feature.c
index e6c0040ee797..fbc9bbd74dbd 100644
--- a/arch/powerpc/platforms/powermac/feature.c
+++ b/arch/powerpc/platforms/powermac/feature.c
@@ -2419,13 +2419,13 @@ static int __init probe_motherboard(void)
2419 dt = of_find_node_by_name(NULL, "device-tree"); 2419 dt = of_find_node_by_name(NULL, "device-tree");
2420 if (dt != NULL) 2420 if (dt != NULL)
2421 model = of_get_property(dt, "model", NULL); 2421 model = of_get_property(dt, "model", NULL);
2422 for(i=0; model && i<(sizeof(pmac_mb_defs)/sizeof(struct pmac_mb_def)); i++) { 2422 for(i=0; model && i<ARRAY_SIZE(pmac_mb_defs); i++) {
2423 if (strcmp(model, pmac_mb_defs[i].model_string) == 0) { 2423 if (strcmp(model, pmac_mb_defs[i].model_string) == 0) {
2424 pmac_mb = pmac_mb_defs[i]; 2424 pmac_mb = pmac_mb_defs[i];
2425 goto found; 2425 goto found;
2426 } 2426 }
2427 } 2427 }
2428 for(i=0; i<(sizeof(pmac_mb_defs)/sizeof(struct pmac_mb_def)); i++) { 2428 for(i=0; i<ARRAY_SIZE(pmac_mb_defs); i++) {
2429 if (machine_is_compatible(pmac_mb_defs[i].model_string)) { 2429 if (machine_is_compatible(pmac_mb_defs[i].model_string)) {
2430 pmac_mb = pmac_mb_defs[i]; 2430 pmac_mb = pmac_mb_defs[i];
2431 goto found; 2431 goto found;
@@ -2589,9 +2589,16 @@ static void __init probe_uninorth(void)
2589 if (address == 0) 2589 if (address == 0)
2590 return; 2590 return;
2591 uninorth_base = ioremap(address, 0x40000); 2591 uninorth_base = ioremap(address, 0x40000);
2592 if (uninorth_base == NULL)
2593 return;
2592 uninorth_rev = in_be32(UN_REG(UNI_N_VERSION)); 2594 uninorth_rev = in_be32(UN_REG(UNI_N_VERSION));
2593 if (uninorth_maj == 3 || uninorth_maj == 4) 2595 if (uninorth_maj == 3 || uninorth_maj == 4) {
2594 u3_ht_base = ioremap(address + U3_HT_CONFIG_BASE, 0x1000); 2596 u3_ht_base = ioremap(address + U3_HT_CONFIG_BASE, 0x1000);
2597 if (u3_ht_base == NULL) {
2598 iounmap(uninorth_base);
2599 return;
2600 }
2601 }
2595 2602
2596 printk(KERN_INFO "Found %s memory controller & host bridge" 2603 printk(KERN_INFO "Found %s memory controller & host bridge"
2597 " @ 0x%08x revision: 0x%02x\n", uninorth_maj == 3 ? "U3" : 2604 " @ 0x%08x revision: 0x%02x\n", uninorth_maj == 3 ? "U3" :
diff --git a/arch/powerpc/platforms/powermac/pci.c b/arch/powerpc/platforms/powermac/pci.c
index 04cdd32624d4..e81403b245b5 100644
--- a/arch/powerpc/platforms/powermac/pci.c
+++ b/arch/powerpc/platforms/powermac/pci.c
@@ -1286,3 +1286,64 @@ static void fixup_k2_sata(struct pci_dev* dev)
1286} 1286}
1287DECLARE_PCI_FIXUP_HEADER(PCI_VENDOR_ID_SERVERWORKS, 0x0240, fixup_k2_sata); 1287DECLARE_PCI_FIXUP_HEADER(PCI_VENDOR_ID_SERVERWORKS, 0x0240, fixup_k2_sata);
1288 1288
1289/*
1290 * On U4 (aka CPC945) the PCIe root complex "P2P" bridge resource ranges aren't
1291 * configured by the firmware. The bridge itself seems to ignore them but it
1292 * causes problems with Linux which then re-assigns devices below the bridge,
1293 * thus changing addresses of those devices from what was in the device-tree,
1294 * which sucks when those are video cards using offb
1295 *
1296 * We could just mark it transparent but I prefer fixing up the resources to
1297 * properly show what's going on here, as I have some doubts about having them
1298 * badly configured potentially being an issue for DMA.
1299 *
1300 * We leave PIO alone, it seems to be fine
1301 *
1302 * Oh and there's another funny bug. The OF properties advertize the region
1303 * 0xf1000000..0xf1ffffff as being forwarded as memory space. But that's
1304 * actually not true, this region is the memory mapped config space. So we
1305 * also need to filter it out or we'll map things in the wrong place.
1306 */
1307static void fixup_u4_pcie(struct pci_dev* dev)
1308{
1309 struct pci_controller *host = pci_bus_to_host(dev->bus);
1310 struct resource *region = NULL;
1311 u32 reg;
1312 int i;
1313
1314 /* Only do that on PowerMac */
1315 if (!machine_is(powermac))
1316 return;
1317
1318 /* Find the largest MMIO region */
1319 for (i = 0; i < 3; i++) {
1320 struct resource *r = &host->mem_resources[i];
1321 if (!(r->flags & IORESOURCE_MEM))
1322 continue;
1323 /* Skip the 0xf0xxxxxx..f2xxxxxx regions, we know they
1324 * are reserved by HW for other things
1325 */
1326 if (r->start >= 0xf0000000 && r->start < 0xf3000000)
1327 continue;
1328 if (!region || (r->end - r->start) >
1329 (region->end - region->start))
1330 region = r;
1331 }
1332 /* Nothing found, bail */
1333 if (region == 0)
1334 return;
1335
1336 /* Print things out */
1337 printk(KERN_INFO "PCI: Fixup U4 PCIe bridge range: %pR\n", region);
1338
1339 /* Fixup bridge config space. We know it's a Mac, resource aren't
1340 * offset so let's just blast them as-is. We also know that they
1341 * fit in 32 bits
1342 */
1343 reg = ((region->start >> 16) & 0xfff0) | (region->end & 0xfff00000);
1344 pci_write_config_dword(dev, PCI_MEMORY_BASE, reg);
1345 pci_write_config_dword(dev, PCI_PREF_BASE_UPPER32, 0);
1346 pci_write_config_dword(dev, PCI_PREF_LIMIT_UPPER32, 0);
1347 pci_write_config_dword(dev, PCI_PREF_MEMORY_BASE, 0);
1348}
1349DECLARE_PCI_FIXUP_HEADER(PCI_VENDOR_ID_APPLE, PCI_DEVICE_ID_APPLE_U4_PCIE, fixup_u4_pcie);
diff --git a/arch/powerpc/platforms/powermac/smp.c b/arch/powerpc/platforms/powermac/smp.c
index 6d4da7b46b41..937a38e73178 100644
--- a/arch/powerpc/platforms/powermac/smp.c
+++ b/arch/powerpc/platforms/powermac/smp.c
@@ -408,7 +408,7 @@ static void __init smp_psurge_setup_cpu(int cpu_nr)
408 /* reset the entry point so if we get another intr we won't 408 /* reset the entry point so if we get another intr we won't
409 * try to startup again */ 409 * try to startup again */
410 out_be32(psurge_start, 0x100); 410 out_be32(psurge_start, 0x100);
411 if (setup_irq(30, &psurge_irqaction)) 411 if (setup_irq(irq_create_mapping(NULL, 30), &psurge_irqaction))
412 printk(KERN_ERR "Couldn't get primary IPI interrupt"); 412 printk(KERN_ERR "Couldn't get primary IPI interrupt");
413} 413}
414 414
diff --git a/arch/powerpc/platforms/ps3/mm.c b/arch/powerpc/platforms/ps3/mm.c
index 846eb8b57fd1..189a25b80735 100644
--- a/arch/powerpc/platforms/ps3/mm.c
+++ b/arch/powerpc/platforms/ps3/mm.c
@@ -23,8 +23,8 @@
23#include <linux/memory_hotplug.h> 23#include <linux/memory_hotplug.h>
24#include <linux/lmb.h> 24#include <linux/lmb.h>
25 25
26#include <asm/cell-regs.h>
26#include <asm/firmware.h> 27#include <asm/firmware.h>
27#include <asm/iommu.h>
28#include <asm/prom.h> 28#include <asm/prom.h>
29#include <asm/udbg.h> 29#include <asm/udbg.h>
30#include <asm/lv1call.h> 30#include <asm/lv1call.h>
diff --git a/arch/powerpc/platforms/ps3/smp.c b/arch/powerpc/platforms/ps3/smp.c
index f6e04bcc70ef..51ffde40af2b 100644
--- a/arch/powerpc/platforms/ps3/smp.c
+++ b/arch/powerpc/platforms/ps3/smp.c
@@ -37,7 +37,7 @@
37 */ 37 */
38 38
39#define MSG_COUNT 4 39#define MSG_COUNT 4
40static DEFINE_PER_CPU(unsigned int, ps3_ipi_virqs[MSG_COUNT]); 40static DEFINE_PER_CPU(unsigned int [MSG_COUNT], ps3_ipi_virqs);
41 41
42static void do_message_pass(int target, int msg) 42static void do_message_pass(int target, int msg)
43{ 43{
diff --git a/arch/powerpc/platforms/ps3/system-bus.c b/arch/powerpc/platforms/ps3/system-bus.c
index 3f763c5284ac..e34b305a7a52 100644
--- a/arch/powerpc/platforms/ps3/system-bus.c
+++ b/arch/powerpc/platforms/ps3/system-bus.c
@@ -27,7 +27,7 @@
27#include <asm/udbg.h> 27#include <asm/udbg.h>
28#include <asm/lv1call.h> 28#include <asm/lv1call.h>
29#include <asm/firmware.h> 29#include <asm/firmware.h>
30#include <asm/iommu.h> 30#include <asm/cell-regs.h>
31 31
32#include "platform.h" 32#include "platform.h"
33 33
@@ -694,7 +694,7 @@ static int ps3_dma_supported(struct device *_dev, u64 mask)
694 return mask >= DMA_BIT_MASK(32); 694 return mask >= DMA_BIT_MASK(32);
695} 695}
696 696
697static struct dma_mapping_ops ps3_sb_dma_ops = { 697static struct dma_map_ops ps3_sb_dma_ops = {
698 .alloc_coherent = ps3_alloc_coherent, 698 .alloc_coherent = ps3_alloc_coherent,
699 .free_coherent = ps3_free_coherent, 699 .free_coherent = ps3_free_coherent,
700 .map_sg = ps3_sb_map_sg, 700 .map_sg = ps3_sb_map_sg,
@@ -704,7 +704,7 @@ static struct dma_mapping_ops ps3_sb_dma_ops = {
704 .unmap_page = ps3_unmap_page, 704 .unmap_page = ps3_unmap_page,
705}; 705};
706 706
707static struct dma_mapping_ops ps3_ioc0_dma_ops = { 707static struct dma_map_ops ps3_ioc0_dma_ops = {
708 .alloc_coherent = ps3_alloc_coherent, 708 .alloc_coherent = ps3_alloc_coherent,
709 .free_coherent = ps3_free_coherent, 709 .free_coherent = ps3_free_coherent,
710 .map_sg = ps3_ioc0_map_sg, 710 .map_sg = ps3_ioc0_map_sg,
diff --git a/arch/powerpc/platforms/pseries/eeh.c b/arch/powerpc/platforms/pseries/eeh.c
index 989d6462c154..ccd8dd03b8c9 100644
--- a/arch/powerpc/platforms/pseries/eeh.c
+++ b/arch/powerpc/platforms/pseries/eeh.c
@@ -744,7 +744,15 @@ int pcibios_set_pcie_reset_state(struct pci_dev *dev, enum pcie_reset_state stat
744 744
745static void __rtas_set_slot_reset(struct pci_dn *pdn) 745static void __rtas_set_slot_reset(struct pci_dn *pdn)
746{ 746{
747 rtas_pci_slot_reset (pdn, 1); 747 struct pci_dev *dev = pdn->pcidev;
748
749 /* Determine type of EEH reset required by device,
750 * default hot reset or fundamental reset
751 */
752 if (dev->needs_freset)
753 rtas_pci_slot_reset(pdn, 3);
754 else
755 rtas_pci_slot_reset(pdn, 1);
748 756
749 /* The PCI bus requires that the reset be held high for at least 757 /* The PCI bus requires that the reset be held high for at least
750 * a 100 milliseconds. We wait a bit longer 'just in case'. */ 758 * a 100 milliseconds. We wait a bit longer 'just in case'. */
diff --git a/arch/powerpc/platforms/pseries/pci_dlpar.c b/arch/powerpc/platforms/pseries/pci_dlpar.c
index ad152a0e3946..b6fa3e4b51b5 100644
--- a/arch/powerpc/platforms/pseries/pci_dlpar.c
+++ b/arch/powerpc/platforms/pseries/pci_dlpar.c
@@ -151,7 +151,7 @@ struct pci_controller * __devinit init_phb_dynamic(struct device_node *dn)
151 if (dn->child) 151 if (dn->child)
152 eeh_add_device_tree_early(dn); 152 eeh_add_device_tree_early(dn);
153 153
154 scan_phb(phb); 154 pcibios_scan_phb(phb, dn);
155 pcibios_finish_adding_to_bus(phb->bus); 155 pcibios_finish_adding_to_bus(phb->bus);
156 156
157 return phb; 157 return phb;
diff --git a/arch/powerpc/platforms/pseries/reconfig.c b/arch/powerpc/platforms/pseries/reconfig.c
index b6f1b137d427..2e2bbe120b90 100644
--- a/arch/powerpc/platforms/pseries/reconfig.c
+++ b/arch/powerpc/platforms/pseries/reconfig.c
@@ -20,6 +20,7 @@
20#include <asm/machdep.h> 20#include <asm/machdep.h>
21#include <asm/uaccess.h> 21#include <asm/uaccess.h>
22#include <asm/pSeries_reconfig.h> 22#include <asm/pSeries_reconfig.h>
23#include <asm/mmu.h>
23 24
24 25
25 26
@@ -439,9 +440,15 @@ static int do_update_property(char *buf, size_t bufsize)
439 if (!newprop) 440 if (!newprop)
440 return -ENOMEM; 441 return -ENOMEM;
441 442
443 if (!strcmp(name, "slb-size") || !strcmp(name, "ibm,slb-size"))
444 slb_set_size(*(int *)value);
445
442 oldprop = of_find_property(np, name,NULL); 446 oldprop = of_find_property(np, name,NULL);
443 if (!oldprop) 447 if (!oldprop) {
448 if (strlen(name))
449 return prom_add_property(np, newprop);
444 return -ENODEV; 450 return -ENODEV;
451 }
445 452
446 rc = prom_update_property(np, newprop, oldprop); 453 rc = prom_update_property(np, newprop, oldprop);
447 if (rc) 454 if (rc)
diff --git a/arch/powerpc/platforms/pseries/setup.c b/arch/powerpc/platforms/pseries/setup.c
index 8d75ea21296f..ca5f2e10972c 100644
--- a/arch/powerpc/platforms/pseries/setup.c
+++ b/arch/powerpc/platforms/pseries/setup.c
@@ -223,10 +223,6 @@ static void pseries_lpar_enable_pmcs(void)
223 set = 1UL << 63; 223 set = 1UL << 63;
224 reset = 0; 224 reset = 0;
225 plpar_hcall_norets(H_PERFMON, set, reset); 225 plpar_hcall_norets(H_PERFMON, set, reset);
226
227 /* instruct hypervisor to maintain PMCs */
228 if (firmware_has_feature(FW_FEATURE_SPLPAR))
229 get_lppaca()->pmcregs_in_use = 1;
230} 226}
231 227
232static void __init pseries_discover_pic(void) 228static void __init pseries_discover_pic(void)
diff --git a/arch/powerpc/platforms/pseries/smp.c b/arch/powerpc/platforms/pseries/smp.c
index 1f8f6cfb94f7..440000cc7130 100644
--- a/arch/powerpc/platforms/pseries/smp.c
+++ b/arch/powerpc/platforms/pseries/smp.c
@@ -56,8 +56,6 @@
56 */ 56 */
57static cpumask_t of_spin_map; 57static cpumask_t of_spin_map;
58 58
59extern void generic_secondary_smp_init(unsigned long);
60
61/** 59/**
62 * smp_startup_cpu() - start the given cpu 60 * smp_startup_cpu() - start the given cpu
63 * 61 *
diff --git a/arch/powerpc/sysdev/fsl_rio.c b/arch/powerpc/sysdev/fsl_rio.c
index cbb3bed75d3c..757a83fe5e59 100644
--- a/arch/powerpc/sysdev/fsl_rio.c
+++ b/arch/powerpc/sysdev/fsl_rio.c
@@ -1057,6 +1057,10 @@ int fsl_rio_setup(struct of_device *dev)
1057 law_start, law_size); 1057 law_start, law_size);
1058 1058
1059 ops = kmalloc(sizeof(struct rio_ops), GFP_KERNEL); 1059 ops = kmalloc(sizeof(struct rio_ops), GFP_KERNEL);
1060 if (!ops) {
1061 rc = -ENOMEM;
1062 goto err_ops;
1063 }
1060 ops->lcread = fsl_local_config_read; 1064 ops->lcread = fsl_local_config_read;
1061 ops->lcwrite = fsl_local_config_write; 1065 ops->lcwrite = fsl_local_config_write;
1062 ops->cread = fsl_rio_config_read; 1066 ops->cread = fsl_rio_config_read;
@@ -1064,6 +1068,10 @@ int fsl_rio_setup(struct of_device *dev)
1064 ops->dsend = fsl_rio_doorbell_send; 1068 ops->dsend = fsl_rio_doorbell_send;
1065 1069
1066 port = kzalloc(sizeof(struct rio_mport), GFP_KERNEL); 1070 port = kzalloc(sizeof(struct rio_mport), GFP_KERNEL);
1071 if (!port) {
1072 rc = -ENOMEM;
1073 goto err_port;
1074 }
1067 port->id = 0; 1075 port->id = 0;
1068 port->index = 0; 1076 port->index = 0;
1069 1077
@@ -1071,7 +1079,7 @@ int fsl_rio_setup(struct of_device *dev)
1071 if (!priv) { 1079 if (!priv) {
1072 printk(KERN_ERR "Can't alloc memory for 'priv'\n"); 1080 printk(KERN_ERR "Can't alloc memory for 'priv'\n");
1073 rc = -ENOMEM; 1081 rc = -ENOMEM;
1074 goto err; 1082 goto err_priv;
1075 } 1083 }
1076 1084
1077 INIT_LIST_HEAD(&port->dbells); 1085 INIT_LIST_HEAD(&port->dbells);
@@ -1169,11 +1177,13 @@ int fsl_rio_setup(struct of_device *dev)
1169 1177
1170 return 0; 1178 return 0;
1171err: 1179err:
1172 if (priv) 1180 iounmap(priv->regs_win);
1173 iounmap(priv->regs_win);
1174 kfree(ops);
1175 kfree(priv); 1181 kfree(priv);
1182err_priv:
1176 kfree(port); 1183 kfree(port);
1184err_port:
1185 kfree(ops);
1186err_ops:
1177 return rc; 1187 return rc;
1178} 1188}
1179 1189
diff --git a/arch/powerpc/sysdev/fsl_soc.c b/arch/powerpc/sysdev/fsl_soc.c
index 95dbc643c4fc..adca4affcf1f 100644
--- a/arch/powerpc/sysdev/fsl_soc.c
+++ b/arch/powerpc/sysdev/fsl_soc.c
@@ -37,6 +37,7 @@
37#include <asm/irq.h> 37#include <asm/irq.h>
38#include <asm/time.h> 38#include <asm/time.h>
39#include <asm/prom.h> 39#include <asm/prom.h>
40#include <asm/machdep.h>
40#include <sysdev/fsl_soc.h> 41#include <sysdev/fsl_soc.h>
41#include <mm/mmu_decl.h> 42#include <mm/mmu_decl.h>
42#include <asm/cpm2.h> 43#include <asm/cpm2.h>
@@ -383,8 +384,9 @@ static int __init setup_rstcr(void)
383 if (!rstcr) 384 if (!rstcr)
384 printk (KERN_EMERG "Error: reset control register " 385 printk (KERN_EMERG "Error: reset control register "
385 "not mapped!\n"); 386 "not mapped!\n");
386 } else 387 } else if (ppc_md.restart == fsl_rstcr_restart)
387 printk (KERN_INFO "rstcr compatible register does not exist!\n"); 388 printk(KERN_ERR "No RSTCR register, warm reboot won't work\n");
389
388 if (np) 390 if (np)
389 of_node_put(np); 391 of_node_put(np);
390 return 0; 392 return 0;
diff --git a/arch/powerpc/sysdev/ipic.c b/arch/powerpc/sysdev/ipic.c
index 69e2630c9062..cb7689c4bfbd 100644
--- a/arch/powerpc/sysdev/ipic.c
+++ b/arch/powerpc/sysdev/ipic.c
@@ -735,8 +735,10 @@ struct ipic * __init ipic_init(struct device_node *node, unsigned int flags)
735 ipic->irqhost = irq_alloc_host(node, IRQ_HOST_MAP_LINEAR, 735 ipic->irqhost = irq_alloc_host(node, IRQ_HOST_MAP_LINEAR,
736 NR_IPIC_INTS, 736 NR_IPIC_INTS,
737 &ipic_host_ops, 0); 737 &ipic_host_ops, 0);
738 if (ipic->irqhost == NULL) 738 if (ipic->irqhost == NULL) {
739 kfree(ipic);
739 return NULL; 740 return NULL;
741 }
740 742
741 ipic->regs = ioremap(res.start, res.end - res.start + 1); 743 ipic->regs = ioremap(res.start, res.end - res.start + 1);
742 744
@@ -781,6 +783,9 @@ struct ipic * __init ipic_init(struct device_node *node, unsigned int flags)
781 primary_ipic = ipic; 783 primary_ipic = ipic;
782 irq_set_default_host(primary_ipic->irqhost); 784 irq_set_default_host(primary_ipic->irqhost);
783 785
786 ipic_write(ipic->regs, IPIC_SIMSR_H, 0);
787 ipic_write(ipic->regs, IPIC_SIMSR_L, 0);
788
784 printk ("IPIC (%d IRQ sources) at %p\n", NR_IPIC_INTS, 789 printk ("IPIC (%d IRQ sources) at %p\n", NR_IPIC_INTS,
785 primary_ipic->regs); 790 primary_ipic->regs);
786 791
diff --git a/arch/powerpc/sysdev/mmio_nvram.c b/arch/powerpc/sysdev/mmio_nvram.c
index 7b49633a4bd0..207324209065 100644
--- a/arch/powerpc/sysdev/mmio_nvram.c
+++ b/arch/powerpc/sysdev/mmio_nvram.c
@@ -53,6 +53,23 @@ static ssize_t mmio_nvram_read(char *buf, size_t count, loff_t *index)
53 return count; 53 return count;
54} 54}
55 55
56static unsigned char mmio_nvram_read_val(int addr)
57{
58 unsigned long flags;
59 unsigned char val;
60
61 if (addr >= mmio_nvram_len)
62 return 0xff;
63
64 spin_lock_irqsave(&mmio_nvram_lock, flags);
65
66 val = ioread8(mmio_nvram_start + addr);
67
68 spin_unlock_irqrestore(&mmio_nvram_lock, flags);
69
70 return val;
71}
72
56static ssize_t mmio_nvram_write(char *buf, size_t count, loff_t *index) 73static ssize_t mmio_nvram_write(char *buf, size_t count, loff_t *index)
57{ 74{
58 unsigned long flags; 75 unsigned long flags;
@@ -72,6 +89,19 @@ static ssize_t mmio_nvram_write(char *buf, size_t count, loff_t *index)
72 return count; 89 return count;
73} 90}
74 91
92void mmio_nvram_write_val(int addr, unsigned char val)
93{
94 unsigned long flags;
95
96 if (addr < mmio_nvram_len) {
97 spin_lock_irqsave(&mmio_nvram_lock, flags);
98
99 iowrite8(val, mmio_nvram_start + addr);
100
101 spin_unlock_irqrestore(&mmio_nvram_lock, flags);
102 }
103}
104
75static ssize_t mmio_nvram_get_size(void) 105static ssize_t mmio_nvram_get_size(void)
76{ 106{
77 return mmio_nvram_len; 107 return mmio_nvram_len;
@@ -114,6 +144,8 @@ int __init mmio_nvram_init(void)
114 printk(KERN_INFO "mmio NVRAM, %luk at 0x%lx mapped to %p\n", 144 printk(KERN_INFO "mmio NVRAM, %luk at 0x%lx mapped to %p\n",
115 mmio_nvram_len >> 10, nvram_addr, mmio_nvram_start); 145 mmio_nvram_len >> 10, nvram_addr, mmio_nvram_start);
116 146
147 ppc_md.nvram_read_val = mmio_nvram_read_val;
148 ppc_md.nvram_write_val = mmio_nvram_write_val;
117 ppc_md.nvram_read = mmio_nvram_read; 149 ppc_md.nvram_read = mmio_nvram_read;
118 ppc_md.nvram_write = mmio_nvram_write; 150 ppc_md.nvram_write = mmio_nvram_write;
119 ppc_md.nvram_size = mmio_nvram_get_size; 151 ppc_md.nvram_size = mmio_nvram_get_size;
diff --git a/arch/powerpc/sysdev/mpic.c b/arch/powerpc/sysdev/mpic.c
index 3981ae4cb58e..30c44e6b0413 100644
--- a/arch/powerpc/sysdev/mpic.c
+++ b/arch/powerpc/sysdev/mpic.c
@@ -230,14 +230,16 @@ static inline u32 _mpic_irq_read(struct mpic *mpic, unsigned int src_no, unsigne
230{ 230{
231 unsigned int isu = src_no >> mpic->isu_shift; 231 unsigned int isu = src_no >> mpic->isu_shift;
232 unsigned int idx = src_no & mpic->isu_mask; 232 unsigned int idx = src_no & mpic->isu_mask;
233 unsigned int val;
233 234
235 val = _mpic_read(mpic->reg_type, &mpic->isus[isu],
236 reg + (idx * MPIC_INFO(IRQ_STRIDE)));
234#ifdef CONFIG_MPIC_BROKEN_REGREAD 237#ifdef CONFIG_MPIC_BROKEN_REGREAD
235 if (reg == 0) 238 if (reg == 0)
236 return mpic->isu_reg0_shadow[idx]; 239 val = (val & (MPIC_VECPRI_MASK | MPIC_VECPRI_ACTIVITY)) |
237 else 240 mpic->isu_reg0_shadow[src_no];
238#endif 241#endif
239 return _mpic_read(mpic->reg_type, &mpic->isus[isu], 242 return val;
240 reg + (idx * MPIC_INFO(IRQ_STRIDE)));
241} 243}
242 244
243static inline void _mpic_irq_write(struct mpic *mpic, unsigned int src_no, 245static inline void _mpic_irq_write(struct mpic *mpic, unsigned int src_no,
@@ -251,7 +253,8 @@ static inline void _mpic_irq_write(struct mpic *mpic, unsigned int src_no,
251 253
252#ifdef CONFIG_MPIC_BROKEN_REGREAD 254#ifdef CONFIG_MPIC_BROKEN_REGREAD
253 if (reg == 0) 255 if (reg == 0)
254 mpic->isu_reg0_shadow[idx] = value; 256 mpic->isu_reg0_shadow[src_no] =
257 value & ~(MPIC_VECPRI_MASK | MPIC_VECPRI_ACTIVITY);
255#endif 258#endif
256} 259}
257 260
diff --git a/arch/powerpc/sysdev/qe_lib/gpio.c b/arch/powerpc/sysdev/qe_lib/gpio.c
index 3485288dce31..8e7a7767dd5c 100644
--- a/arch/powerpc/sysdev/qe_lib/gpio.c
+++ b/arch/powerpc/sysdev/qe_lib/gpio.c
@@ -105,14 +105,14 @@ static int qe_gpio_dir_out(struct gpio_chip *gc, unsigned int gpio, int val)
105 struct qe_gpio_chip *qe_gc = to_qe_gpio_chip(mm_gc); 105 struct qe_gpio_chip *qe_gc = to_qe_gpio_chip(mm_gc);
106 unsigned long flags; 106 unsigned long flags;
107 107
108 qe_gpio_set(gc, gpio, val);
109
108 spin_lock_irqsave(&qe_gc->lock, flags); 110 spin_lock_irqsave(&qe_gc->lock, flags);
109 111
110 __par_io_config_pin(mm_gc->regs, gpio, QE_PIO_DIR_OUT, 0, 0, 0); 112 __par_io_config_pin(mm_gc->regs, gpio, QE_PIO_DIR_OUT, 0, 0, 0);
111 113
112 spin_unlock_irqrestore(&qe_gc->lock, flags); 114 spin_unlock_irqrestore(&qe_gc->lock, flags);
113 115
114 qe_gpio_set(gc, gpio, val);
115
116 return 0; 116 return 0;
117} 117}
118 118
diff --git a/arch/powerpc/sysdev/qe_lib/qe_ic.c b/arch/powerpc/sysdev/qe_lib/qe_ic.c
index 074905c3ee5a..3faa42e03a85 100644
--- a/arch/powerpc/sysdev/qe_lib/qe_ic.c
+++ b/arch/powerpc/sysdev/qe_lib/qe_ic.c
@@ -339,8 +339,10 @@ void __init qe_ic_init(struct device_node *node, unsigned int flags,
339 339
340 qe_ic->irqhost = irq_alloc_host(node, IRQ_HOST_MAP_LINEAR, 340 qe_ic->irqhost = irq_alloc_host(node, IRQ_HOST_MAP_LINEAR,
341 NR_QE_IC_INTS, &qe_ic_host_ops, 0); 341 NR_QE_IC_INTS, &qe_ic_host_ops, 0);
342 if (qe_ic->irqhost == NULL) 342 if (qe_ic->irqhost == NULL) {
343 kfree(qe_ic);
343 return; 344 return;
345 }
344 346
345 qe_ic->regs = ioremap(res.start, res.end - res.start + 1); 347 qe_ic->regs = ioremap(res.start, res.end - res.start + 1);
346 348
@@ -352,6 +354,7 @@ void __init qe_ic_init(struct device_node *node, unsigned int flags,
352 354
353 if (qe_ic->virq_low == NO_IRQ) { 355 if (qe_ic->virq_low == NO_IRQ) {
354 printk(KERN_ERR "Failed to map QE_IC low IRQ\n"); 356 printk(KERN_ERR "Failed to map QE_IC low IRQ\n");
357 kfree(qe_ic);
355 return; 358 return;
356 } 359 }
357 360
diff --git a/arch/powerpc/xmon/Makefile b/arch/powerpc/xmon/Makefile
index 85ab97ab840a..faa81b6a6612 100644
--- a/arch/powerpc/xmon/Makefile
+++ b/arch/powerpc/xmon/Makefile
@@ -2,6 +2,8 @@
2 2
3subdir-ccflags-$(CONFIG_PPC_WERROR) := -Werror 3subdir-ccflags-$(CONFIG_PPC_WERROR) := -Werror
4 4
5GCOV_PROFILE := n
6
5ifdef CONFIG_PPC64 7ifdef CONFIG_PPC64
6EXTRA_CFLAGS += -mno-minimal-toc 8EXTRA_CFLAGS += -mno-minimal-toc
7endif 9endif
diff --git a/arch/powerpc/xmon/xmon.c b/arch/powerpc/xmon/xmon.c
index e1f33a81e5e1..0e09a45ac79a 100644
--- a/arch/powerpc/xmon/xmon.c
+++ b/arch/powerpc/xmon/xmon.c
@@ -2570,7 +2570,7 @@ static void xmon_print_symbol(unsigned long address, const char *mid,
2570 printf("%s", after); 2570 printf("%s", after);
2571} 2571}
2572 2572
2573#ifdef CONFIG_PPC64 2573#ifdef CONFIG_PPC_BOOK3S_64
2574static void dump_slb(void) 2574static void dump_slb(void)
2575{ 2575{
2576 int i; 2576 int i;
diff --git a/arch/s390/include/asm/percpu.h b/arch/s390/include/asm/percpu.h
index 408d60b4f75b..f7ad8719d02d 100644
--- a/arch/s390/include/asm/percpu.h
+++ b/arch/s390/include/asm/percpu.h
@@ -1,37 +1,21 @@
1#ifndef __ARCH_S390_PERCPU__ 1#ifndef __ARCH_S390_PERCPU__
2#define __ARCH_S390_PERCPU__ 2#define __ARCH_S390_PERCPU__
3 3
4#include <linux/compiler.h>
5#include <asm/lowcore.h>
6
7/* 4/*
8 * s390 uses its own implementation for per cpu data, the offset of 5 * s390 uses its own implementation for per cpu data, the offset of
9 * the cpu local data area is cached in the cpu's lowcore memory. 6 * the cpu local data area is cached in the cpu's lowcore memory.
10 * For 64 bit module code s390 forces the use of a GOT slot for the
11 * address of the per cpu variable. This is needed because the module
12 * may be more than 4G above the per cpu area.
13 */ 7 */
14#if defined(__s390x__) && defined(MODULE) 8#define __my_cpu_offset S390_lowcore.percpu_offset
15
16#define SHIFT_PERCPU_PTR(ptr,offset) (({ \
17 extern int simple_identifier_##var(void); \
18 unsigned long *__ptr; \
19 asm ( "larl %0, %1@GOTENT" \
20 : "=a" (__ptr) : "X" (ptr) ); \
21 (typeof(ptr))((*__ptr) + (offset)); }))
22
23#else
24
25#define SHIFT_PERCPU_PTR(ptr, offset) (({ \
26 extern int simple_identifier_##var(void); \
27 unsigned long __ptr; \
28 asm ( "" : "=a" (__ptr) : "0" (ptr) ); \
29 (typeof(ptr)) (__ptr + (offset)); }))
30 9
10/*
11 * For 64 bit module code, the module may be more than 4G above the
12 * per cpu area, use weak definitions to force the compiler to
13 * generate external references.
14 */
15#if defined(CONFIG_SMP) && defined(__s390x__) && defined(MODULE)
16#define ARCH_NEEDS_WEAK_PER_CPU
31#endif 17#endif
32 18
33#define __my_cpu_offset S390_lowcore.percpu_offset
34
35#include <asm-generic/percpu.h> 19#include <asm-generic/percpu.h>
36 20
37#endif /* __ARCH_S390_PERCPU__ */ 21#endif /* __ARCH_S390_PERCPU__ */
diff --git a/arch/s390/kernel/vmlinux.lds.S b/arch/s390/kernel/vmlinux.lds.S
index 7315f9e67e1d..bc15ef93e656 100644
--- a/arch/s390/kernel/vmlinux.lds.S
+++ b/arch/s390/kernel/vmlinux.lds.S
@@ -84,13 +84,10 @@ SECTIONS
84 84
85 _end = . ; 85 _end = . ;
86 86
87 /* Sections to be discarded */
88 /DISCARD/ : {
89 EXIT_DATA
90 *(.exitcall.exit)
91 }
92
93 /* Debugging sections. */ 87 /* Debugging sections. */
94 STABS_DEBUG 88 STABS_DEBUG
95 DWARF_DEBUG 89 DWARF_DEBUG
90
91 /* Sections to be discarded */
92 DISCARDS
96} 93}
diff --git a/arch/sh/include/asm/pci.h b/arch/sh/include/asm/pci.h
index d3633f513ebc..4163950cd1c6 100644
--- a/arch/sh/include/asm/pci.h
+++ b/arch/sh/include/asm/pci.h
@@ -10,7 +10,6 @@
10 or architectures with incomplete PCI setup by the loader */ 10 or architectures with incomplete PCI setup by the loader */
11 11
12#define pcibios_assign_all_busses() 1 12#define pcibios_assign_all_busses() 1
13#define pcibios_scan_all_fns(a, b) 0
14 13
15/* 14/*
16 * A board can define one or more PCI channels that represent built-in (or 15 * A board can define one or more PCI channels that represent built-in (or
diff --git a/arch/sh/include/asm/topology.h b/arch/sh/include/asm/topology.h
index b69ee850906d..f8c40cc65054 100644
--- a/arch/sh/include/asm/topology.h
+++ b/arch/sh/include/asm/topology.h
@@ -15,14 +15,14 @@
15 .cache_nice_tries = 2, \ 15 .cache_nice_tries = 2, \
16 .busy_idx = 3, \ 16 .busy_idx = 3, \
17 .idle_idx = 2, \ 17 .idle_idx = 2, \
18 .newidle_idx = 2, \ 18 .newidle_idx = 0, \
19 .wake_idx = 1, \ 19 .wake_idx = 0, \
20 .forkexec_idx = 1, \ 20 .forkexec_idx = 0, \
21 .flags = SD_LOAD_BALANCE \ 21 .flags = SD_LOAD_BALANCE \
22 | SD_BALANCE_FORK \ 22 | SD_BALANCE_FORK \
23 | SD_BALANCE_EXEC \ 23 | SD_BALANCE_EXEC \
24 | SD_SERIALIZE \ 24 | SD_BALANCE_NEWIDLE \
25 | SD_WAKE_BALANCE, \ 25 | SD_SERIALIZE, \
26 .last_balance = jiffies, \ 26 .last_balance = jiffies, \
27 .balance_interval = 1, \ 27 .balance_interval = 1, \
28 .nr_balance_failed = 0, \ 28 .nr_balance_failed = 0, \
diff --git a/arch/sh/kernel/vmlinux.lds.S b/arch/sh/kernel/vmlinux.lds.S
index f53c76acaede..0ce254bca92f 100644
--- a/arch/sh/kernel/vmlinux.lds.S
+++ b/arch/sh/kernel/vmlinux.lds.S
@@ -163,16 +163,14 @@ SECTIONS
163 _end = . ; 163 _end = . ;
164 } 164 }
165 165
166 STABS_DEBUG
167 DWARF_DEBUG
168
166 /* 169 /*
167 * When something in the kernel is NOT compiled as a module, the 170 * When something in the kernel is NOT compiled as a module, the
168 * module cleanup code and data are put into these segments. Both 171 * module cleanup code and data are put into these segments. Both
169 * can then be thrown away, as cleanup code is never called unless 172 * can then be thrown away, as cleanup code is never called unless
170 * it's a module. 173 * it's a module.
171 */ 174 */
172 /DISCARD/ : { 175 DISCARDS
173 *(.exitcall.exit)
174 }
175
176 STABS_DEBUG
177 DWARF_DEBUG
178} 176}
diff --git a/arch/sparc/Kconfig b/arch/sparc/Kconfig
index 2bd5c287538a..86b82348b97c 100644
--- a/arch/sparc/Kconfig
+++ b/arch/sparc/Kconfig
@@ -99,7 +99,7 @@ config AUDIT_ARCH
99config HAVE_SETUP_PER_CPU_AREA 99config HAVE_SETUP_PER_CPU_AREA
100 def_bool y if SPARC64 100 def_bool y if SPARC64
101 101
102config HAVE_DYNAMIC_PER_CPU_AREA 102config NEED_PER_CPU_EMBED_FIRST_CHUNK
103 def_bool y if SPARC64 103 def_bool y if SPARC64
104 104
105config GENERIC_HARDIRQS_NO__DO_IRQ 105config GENERIC_HARDIRQS_NO__DO_IRQ
diff --git a/arch/sparc/configs/sparc32_defconfig b/arch/sparc/configs/sparc32_defconfig
index a0f62a808edb..983d59824a28 100644
--- a/arch/sparc/configs/sparc32_defconfig
+++ b/arch/sparc/configs/sparc32_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.31-rc1 3# Linux kernel version: 2.6.31
4# Tue Aug 18 23:45:52 2009 4# Wed Sep 16 00:03:43 2009
5# 5#
6# CONFIG_64BIT is not set 6# CONFIG_64BIT is not set
7CONFIG_SPARC=y 7CONFIG_SPARC=y
@@ -39,11 +39,12 @@ CONFIG_POSIX_MQUEUE_SYSCTL=y
39# 39#
40# RCU Subsystem 40# RCU Subsystem
41# 41#
42CONFIG_CLASSIC_RCU=y 42CONFIG_TREE_RCU=y
43# CONFIG_TREE_RCU is not set 43# CONFIG_TREE_PREEMPT_RCU is not set
44# CONFIG_PREEMPT_RCU is not set 44# CONFIG_RCU_TRACE is not set
45CONFIG_RCU_FANOUT=32
46# CONFIG_RCU_FANOUT_EXACT is not set
45# CONFIG_TREE_RCU_TRACE is not set 47# CONFIG_TREE_RCU_TRACE is not set
46# CONFIG_PREEMPT_RCU_TRACE is not set
47# CONFIG_IKCONFIG is not set 48# CONFIG_IKCONFIG is not set
48CONFIG_LOG_BUF_SHIFT=14 49CONFIG_LOG_BUF_SHIFT=14
49CONFIG_GROUP_SCHED=y 50CONFIG_GROUP_SCHED=y
@@ -87,10 +88,12 @@ CONFIG_TIMERFD=y
87CONFIG_EVENTFD=y 88CONFIG_EVENTFD=y
88CONFIG_SHMEM=y 89CONFIG_SHMEM=y
89CONFIG_AIO=y 90CONFIG_AIO=y
91CONFIG_HAVE_PERF_COUNTERS=y
90 92
91# 93#
92# Performance Counters 94# Performance Counters
93# 95#
96# CONFIG_PERF_COUNTERS is not set
94CONFIG_VM_EVENT_COUNTERS=y 97CONFIG_VM_EVENT_COUNTERS=y
95CONFIG_PCI_QUIRKS=y 98CONFIG_PCI_QUIRKS=y
96# CONFIG_STRIP_ASM_SYMS is not set 99# CONFIG_STRIP_ASM_SYMS is not set
@@ -102,6 +105,8 @@ CONFIG_SLAB=y
102# CONFIG_MARKERS is not set 105# CONFIG_MARKERS is not set
103CONFIG_HAVE_OPROFILE=y 106CONFIG_HAVE_OPROFILE=y
104CONFIG_HAVE_ARCH_TRACEHOOK=y 107CONFIG_HAVE_ARCH_TRACEHOOK=y
108CONFIG_HAVE_DMA_ATTRS=y
109CONFIG_HAVE_DMA_API_DEBUG=y
105 110
106# 111#
107# GCOV-based kernel profiling 112# GCOV-based kernel profiling
@@ -169,6 +174,7 @@ CONFIG_DEFAULT_MMAP_MIN_ADDR=4096
169CONFIG_SUN_PM=y 174CONFIG_SUN_PM=y
170# CONFIG_SPARC_LED is not set 175# CONFIG_SPARC_LED is not set
171CONFIG_SERIAL_CONSOLE=y 176CONFIG_SERIAL_CONSOLE=y
177# CONFIG_SPARC_LEON is not set
172 178
173# 179#
174# Bus options (PCI etc.) 180# Bus options (PCI etc.)
@@ -259,6 +265,7 @@ CONFIG_IPV6_TUNNEL=m
259# CONFIG_NETFILTER is not set 265# CONFIG_NETFILTER is not set
260# CONFIG_IP_DCCP is not set 266# CONFIG_IP_DCCP is not set
261# CONFIG_IP_SCTP is not set 267# CONFIG_IP_SCTP is not set
268# CONFIG_RDS is not set
262# CONFIG_TIPC is not set 269# CONFIG_TIPC is not set
263# CONFIG_ATM is not set 270# CONFIG_ATM is not set
264# CONFIG_BRIDGE is not set 271# CONFIG_BRIDGE is not set
@@ -288,6 +295,7 @@ CONFIG_NET_PKTGEN=m
288# CONFIG_AF_RXRPC is not set 295# CONFIG_AF_RXRPC is not set
289CONFIG_WIRELESS=y 296CONFIG_WIRELESS=y
290# CONFIG_CFG80211 is not set 297# CONFIG_CFG80211 is not set
298CONFIG_CFG80211_DEFAULT_PS_VALUE=0
291CONFIG_WIRELESS_OLD_REGULATORY=y 299CONFIG_WIRELESS_OLD_REGULATORY=y
292# CONFIG_WIRELESS_EXT is not set 300# CONFIG_WIRELESS_EXT is not set
293# CONFIG_LIB80211 is not set 301# CONFIG_LIB80211 is not set
@@ -295,7 +303,6 @@ CONFIG_WIRELESS_OLD_REGULATORY=y
295# 303#
296# CFG80211 needs to be enabled for MAC80211 304# CFG80211 needs to be enabled for MAC80211
297# 305#
298CONFIG_MAC80211_DEFAULT_PS_VALUE=0
299# CONFIG_WIMAX is not set 306# CONFIG_WIMAX is not set
300# CONFIG_RFKILL is not set 307# CONFIG_RFKILL is not set
301# CONFIG_NET_9P is not set 308# CONFIG_NET_9P is not set
@@ -426,6 +433,7 @@ CONFIG_SCSI_QLOGICPTI=m
426# CONFIG_SCSI_NSP32 is not set 433# CONFIG_SCSI_NSP32 is not set
427# CONFIG_SCSI_DEBUG is not set 434# CONFIG_SCSI_DEBUG is not set
428CONFIG_SCSI_SUNESP=y 435CONFIG_SCSI_SUNESP=y
436# CONFIG_SCSI_PMCRAID is not set
429# CONFIG_SCSI_SRP is not set 437# CONFIG_SCSI_SRP is not set
430# CONFIG_SCSI_DH is not set 438# CONFIG_SCSI_DH is not set
431# CONFIG_SCSI_OSD_INITIATOR is not set 439# CONFIG_SCSI_OSD_INITIATOR is not set
@@ -524,12 +532,7 @@ CONFIG_CHELSIO_T3_DEPENDS=y
524# CONFIG_SFC is not set 532# CONFIG_SFC is not set
525# CONFIG_BE2NET is not set 533# CONFIG_BE2NET is not set
526# CONFIG_TR is not set 534# CONFIG_TR is not set
527 535# CONFIG_WLAN is not set
528#
529# Wireless LAN
530#
531# CONFIG_WLAN_PRE80211 is not set
532# CONFIG_WLAN_80211 is not set
533 536
534# 537#
535# Enable WiMAX (Networking options) to see the WiMAX drivers 538# Enable WiMAX (Networking options) to see the WiMAX drivers
@@ -569,11 +572,11 @@ CONFIG_INPUT_EVBUG=m
569# 572#
570CONFIG_INPUT_KEYBOARD=y 573CONFIG_INPUT_KEYBOARD=y
571CONFIG_KEYBOARD_ATKBD=m 574CONFIG_KEYBOARD_ATKBD=m
572CONFIG_KEYBOARD_SUNKBD=m
573# CONFIG_KEYBOARD_LKKBD is not set 575# CONFIG_KEYBOARD_LKKBD is not set
574# CONFIG_KEYBOARD_XTKBD is not set
575# CONFIG_KEYBOARD_NEWTON is not set 576# CONFIG_KEYBOARD_NEWTON is not set
576# CONFIG_KEYBOARD_STOWAWAY is not set 577# CONFIG_KEYBOARD_STOWAWAY is not set
578CONFIG_KEYBOARD_SUNKBD=m
579# CONFIG_KEYBOARD_XTKBD is not set
577CONFIG_INPUT_MOUSE=y 580CONFIG_INPUT_MOUSE=y
578CONFIG_MOUSE_PS2=m 581CONFIG_MOUSE_PS2=m
579CONFIG_MOUSE_PS2_ALPS=y 582CONFIG_MOUSE_PS2_ALPS=y
@@ -581,6 +584,7 @@ CONFIG_MOUSE_PS2_LOGIPS2PP=y
581CONFIG_MOUSE_PS2_SYNAPTICS=y 584CONFIG_MOUSE_PS2_SYNAPTICS=y
582CONFIG_MOUSE_PS2_TRACKPOINT=y 585CONFIG_MOUSE_PS2_TRACKPOINT=y
583# CONFIG_MOUSE_PS2_ELANTECH is not set 586# CONFIG_MOUSE_PS2_ELANTECH is not set
587# CONFIG_MOUSE_PS2_SENTELIC is not set
584# CONFIG_MOUSE_PS2_TOUCHKIT is not set 588# CONFIG_MOUSE_PS2_TOUCHKIT is not set
585CONFIG_MOUSE_SERIAL=m 589CONFIG_MOUSE_SERIAL=m
586# CONFIG_MOUSE_APPLETOUCH is not set 590# CONFIG_MOUSE_APPLETOUCH is not set
@@ -708,12 +712,10 @@ CONFIG_SSB_POSSIBLE=y
708# 712#
709# Console display driver support 713# Console display driver support
710# 714#
711# CONFIG_PROM_CONSOLE is not set
712CONFIG_DUMMY_CONSOLE=y 715CONFIG_DUMMY_CONSOLE=y
713# CONFIG_SOUND is not set 716# CONFIG_SOUND is not set
714CONFIG_HID_SUPPORT=y 717CONFIG_HID_SUPPORT=y
715CONFIG_HID=y 718CONFIG_HID=y
716# CONFIG_HID_DEBUG is not set
717# CONFIG_HIDRAW is not set 719# CONFIG_HIDRAW is not set
718# CONFIG_HID_PID is not set 720# CONFIG_HID_PID is not set
719 721
@@ -814,6 +816,7 @@ CONFIG_FS_POSIX_ACL=y
814# CONFIG_GFS2_FS is not set 816# CONFIG_GFS2_FS is not set
815# CONFIG_OCFS2_FS is not set 817# CONFIG_OCFS2_FS is not set
816# CONFIG_BTRFS_FS is not set 818# CONFIG_BTRFS_FS is not set
819# CONFIG_NILFS2_FS is not set
817CONFIG_FILE_LOCKING=y 820CONFIG_FILE_LOCKING=y
818CONFIG_FSNOTIFY=y 821CONFIG_FSNOTIFY=y
819CONFIG_DNOTIFY=y 822CONFIG_DNOTIFY=y
@@ -877,7 +880,6 @@ CONFIG_ROMFS_BACKED_BY_BLOCK=y
877CONFIG_ROMFS_ON_BLOCK=y 880CONFIG_ROMFS_ON_BLOCK=y
878# CONFIG_SYSV_FS is not set 881# CONFIG_SYSV_FS is not set
879# CONFIG_UFS_FS is not set 882# CONFIG_UFS_FS is not set
880# CONFIG_NILFS2_FS is not set
881CONFIG_NETWORK_FILESYSTEMS=y 883CONFIG_NETWORK_FILESYSTEMS=y
882CONFIG_NFS_FS=y 884CONFIG_NFS_FS=y
883# CONFIG_NFS_V3 is not set 885# CONFIG_NFS_V3 is not set
@@ -984,14 +986,17 @@ CONFIG_DEBUG_MEMORY_INIT=y
984# CONFIG_DEBUG_LIST is not set 986# CONFIG_DEBUG_LIST is not set
985# CONFIG_DEBUG_SG is not set 987# CONFIG_DEBUG_SG is not set
986# CONFIG_DEBUG_NOTIFIERS is not set 988# CONFIG_DEBUG_NOTIFIERS is not set
989# CONFIG_DEBUG_CREDENTIALS is not set
987# CONFIG_BOOT_PRINTK_DELAY is not set 990# CONFIG_BOOT_PRINTK_DELAY is not set
988# CONFIG_RCU_TORTURE_TEST is not set 991# CONFIG_RCU_TORTURE_TEST is not set
989# CONFIG_RCU_CPU_STALL_DETECTOR is not set 992# CONFIG_RCU_CPU_STALL_DETECTOR is not set
990# CONFIG_BACKTRACE_SELF_TEST is not set 993# CONFIG_BACKTRACE_SELF_TEST is not set
991# CONFIG_DEBUG_BLOCK_EXT_DEVT is not set 994# CONFIG_DEBUG_BLOCK_EXT_DEVT is not set
995# CONFIG_DEBUG_FORCE_WEAK_PER_CPU is not set
992# CONFIG_FAULT_INJECTION is not set 996# CONFIG_FAULT_INJECTION is not set
993# CONFIG_SYSCTL_SYSCALL_CHECK is not set 997# CONFIG_SYSCTL_SYSCALL_CHECK is not set
994# CONFIG_PAGE_POISONING is not set 998# CONFIG_PAGE_POISONING is not set
999# CONFIG_DMA_API_DEBUG is not set
995# CONFIG_SAMPLES is not set 1000# CONFIG_SAMPLES is not set
996CONFIG_HAVE_ARCH_KGDB=y 1001CONFIG_HAVE_ARCH_KGDB=y
997CONFIG_KGDB=y 1002CONFIG_KGDB=y
@@ -1014,7 +1019,6 @@ CONFIG_CRYPTO=y
1014# 1019#
1015# Crypto core or helper 1020# Crypto core or helper
1016# 1021#
1017# CONFIG_CRYPTO_FIPS is not set
1018CONFIG_CRYPTO_ALGAPI=y 1022CONFIG_CRYPTO_ALGAPI=y
1019CONFIG_CRYPTO_ALGAPI2=y 1023CONFIG_CRYPTO_ALGAPI2=y
1020CONFIG_CRYPTO_AEAD=y 1024CONFIG_CRYPTO_AEAD=y
@@ -1057,11 +1061,13 @@ CONFIG_CRYPTO_PCBC=m
1057# 1061#
1058CONFIG_CRYPTO_HMAC=y 1062CONFIG_CRYPTO_HMAC=y
1059# CONFIG_CRYPTO_XCBC is not set 1063# CONFIG_CRYPTO_XCBC is not set
1064# CONFIG_CRYPTO_VMAC is not set
1060 1065
1061# 1066#
1062# Digest 1067# Digest
1063# 1068#
1064CONFIG_CRYPTO_CRC32C=m 1069CONFIG_CRYPTO_CRC32C=m
1070# CONFIG_CRYPTO_GHASH is not set
1065CONFIG_CRYPTO_MD4=y 1071CONFIG_CRYPTO_MD4=y
1066CONFIG_CRYPTO_MD5=y 1072CONFIG_CRYPTO_MD5=y
1067CONFIG_CRYPTO_MICHAEL_MIC=m 1073CONFIG_CRYPTO_MICHAEL_MIC=m
diff --git a/arch/sparc/configs/sparc64_defconfig b/arch/sparc/configs/sparc64_defconfig
index fdddf7a6f725..f80b881dfea7 100644
--- a/arch/sparc/configs/sparc64_defconfig
+++ b/arch/sparc/configs/sparc64_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.31-rc1 3# Linux kernel version: 2.6.31
4# Tue Aug 18 23:56:02 2009 4# Tue Sep 15 17:06:03 2009
5# 5#
6CONFIG_64BIT=y 6CONFIG_64BIT=y
7CONFIG_SPARC=y 7CONFIG_SPARC=y
@@ -19,7 +19,7 @@ CONFIG_LOCKDEP_SUPPORT=y
19CONFIG_HAVE_LATENCYTOP_SUPPORT=y 19CONFIG_HAVE_LATENCYTOP_SUPPORT=y
20CONFIG_AUDIT_ARCH=y 20CONFIG_AUDIT_ARCH=y
21CONFIG_HAVE_SETUP_PER_CPU_AREA=y 21CONFIG_HAVE_SETUP_PER_CPU_AREA=y
22CONFIG_HAVE_DYNAMIC_PER_CPU_AREA=y 22CONFIG_NEED_PER_CPU_EMBED_FIRST_CHUNK=y
23CONFIG_GENERIC_HARDIRQS_NO__DO_IRQ=y 23CONFIG_GENERIC_HARDIRQS_NO__DO_IRQ=y
24CONFIG_MMU=y 24CONFIG_MMU=y
25CONFIG_ARCH_NO_VIRT_TO_BUS=y 25CONFIG_ARCH_NO_VIRT_TO_BUS=y
@@ -48,11 +48,12 @@ CONFIG_POSIX_MQUEUE_SYSCTL=y
48# 48#
49# RCU Subsystem 49# RCU Subsystem
50# 50#
51CONFIG_CLASSIC_RCU=y 51CONFIG_TREE_RCU=y
52# CONFIG_TREE_RCU is not set 52# CONFIG_TREE_PREEMPT_RCU is not set
53# CONFIG_PREEMPT_RCU is not set 53# CONFIG_RCU_TRACE is not set
54CONFIG_RCU_FANOUT=64
55# CONFIG_RCU_FANOUT_EXACT is not set
54# CONFIG_TREE_RCU_TRACE is not set 56# CONFIG_TREE_RCU_TRACE is not set
55# CONFIG_PREEMPT_RCU_TRACE is not set
56# CONFIG_IKCONFIG is not set 57# CONFIG_IKCONFIG is not set
57CONFIG_LOG_BUF_SHIFT=18 58CONFIG_LOG_BUF_SHIFT=18
58CONFIG_GROUP_SCHED=y 59CONFIG_GROUP_SCHED=y
@@ -96,10 +97,13 @@ CONFIG_TIMERFD=y
96CONFIG_EVENTFD=y 97CONFIG_EVENTFD=y
97CONFIG_SHMEM=y 98CONFIG_SHMEM=y
98CONFIG_AIO=y 99CONFIG_AIO=y
100CONFIG_HAVE_PERF_COUNTERS=y
99 101
100# 102#
101# Performance Counters 103# Performance Counters
102# 104#
105CONFIG_PERF_COUNTERS=y
106CONFIG_EVENT_PROFILE=y
103CONFIG_VM_EVENT_COUNTERS=y 107CONFIG_VM_EVENT_COUNTERS=y
104CONFIG_PCI_QUIRKS=y 108CONFIG_PCI_QUIRKS=y
105CONFIG_SLUB_DEBUG=y 109CONFIG_SLUB_DEBUG=y
@@ -119,7 +123,9 @@ CONFIG_KRETPROBES=y
119CONFIG_HAVE_KPROBES=y 123CONFIG_HAVE_KPROBES=y
120CONFIG_HAVE_KRETPROBES=y 124CONFIG_HAVE_KRETPROBES=y
121CONFIG_HAVE_ARCH_TRACEHOOK=y 125CONFIG_HAVE_ARCH_TRACEHOOK=y
126CONFIG_HAVE_DMA_ATTRS=y
122CONFIG_USE_GENERIC_SMP_HELPERS=y 127CONFIG_USE_GENERIC_SMP_HELPERS=y
128CONFIG_HAVE_DMA_API_DEBUG=y
123 129
124# 130#
125# GCOV-based kernel profiling 131# GCOV-based kernel profiling
@@ -317,6 +323,7 @@ CONFIG_IPV6_TUNNEL=m
317# CONFIG_NETFILTER is not set 323# CONFIG_NETFILTER is not set
318# CONFIG_IP_DCCP is not set 324# CONFIG_IP_DCCP is not set
319# CONFIG_IP_SCTP is not set 325# CONFIG_IP_SCTP is not set
326# CONFIG_RDS is not set
320# CONFIG_TIPC is not set 327# CONFIG_TIPC is not set
321# CONFIG_ATM is not set 328# CONFIG_ATM is not set
322# CONFIG_BRIDGE is not set 329# CONFIG_BRIDGE is not set
@@ -349,6 +356,7 @@ CONFIG_NET_TCPPROBE=m
349# CONFIG_AF_RXRPC is not set 356# CONFIG_AF_RXRPC is not set
350CONFIG_WIRELESS=y 357CONFIG_WIRELESS=y
351# CONFIG_CFG80211 is not set 358# CONFIG_CFG80211 is not set
359CONFIG_CFG80211_DEFAULT_PS_VALUE=0
352CONFIG_WIRELESS_OLD_REGULATORY=y 360CONFIG_WIRELESS_OLD_REGULATORY=y
353# CONFIG_WIRELESS_EXT is not set 361# CONFIG_WIRELESS_EXT is not set
354# CONFIG_LIB80211 is not set 362# CONFIG_LIB80211 is not set
@@ -356,7 +364,6 @@ CONFIG_WIRELESS_OLD_REGULATORY=y
356# 364#
357# CFG80211 needs to be enabled for MAC80211 365# CFG80211 needs to be enabled for MAC80211
358# 366#
359CONFIG_MAC80211_DEFAULT_PS_VALUE=0
360# CONFIG_WIMAX is not set 367# CONFIG_WIMAX is not set
361# CONFIG_RFKILL is not set 368# CONFIG_RFKILL is not set
362# CONFIG_NET_9P is not set 369# CONFIG_NET_9P is not set
@@ -549,6 +556,7 @@ CONFIG_SCSI_LOWLEVEL=y
549# CONFIG_SCSI_DC390T is not set 556# CONFIG_SCSI_DC390T is not set
550# CONFIG_SCSI_DEBUG is not set 557# CONFIG_SCSI_DEBUG is not set
551# CONFIG_SCSI_SUNESP is not set 558# CONFIG_SCSI_SUNESP is not set
559# CONFIG_SCSI_PMCRAID is not set
552# CONFIG_SCSI_SRP is not set 560# CONFIG_SCSI_SRP is not set
553# CONFIG_SCSI_DH is not set 561# CONFIG_SCSI_DH is not set
554# CONFIG_SCSI_OSD_INITIATOR is not set 562# CONFIG_SCSI_OSD_INITIATOR is not set
@@ -704,12 +712,7 @@ CONFIG_NIU=m
704# CONFIG_SFC is not set 712# CONFIG_SFC is not set
705# CONFIG_BE2NET is not set 713# CONFIG_BE2NET is not set
706# CONFIG_TR is not set 714# CONFIG_TR is not set
707 715# CONFIG_WLAN is not set
708#
709# Wireless LAN
710#
711# CONFIG_WLAN_PRE80211 is not set
712# CONFIG_WLAN_80211 is not set
713 716
714# 717#
715# Enable WiMAX (Networking options) to see the WiMAX drivers 718# Enable WiMAX (Networking options) to see the WiMAX drivers
@@ -768,11 +771,11 @@ CONFIG_INPUT_EVDEV=y
768# 771#
769CONFIG_INPUT_KEYBOARD=y 772CONFIG_INPUT_KEYBOARD=y
770CONFIG_KEYBOARD_ATKBD=y 773CONFIG_KEYBOARD_ATKBD=y
771CONFIG_KEYBOARD_SUNKBD=y
772CONFIG_KEYBOARD_LKKBD=m 774CONFIG_KEYBOARD_LKKBD=m
773# CONFIG_KEYBOARD_XTKBD is not set
774# CONFIG_KEYBOARD_NEWTON is not set 775# CONFIG_KEYBOARD_NEWTON is not set
775# CONFIG_KEYBOARD_STOWAWAY is not set 776# CONFIG_KEYBOARD_STOWAWAY is not set
777CONFIG_KEYBOARD_SUNKBD=y
778# CONFIG_KEYBOARD_XTKBD is not set
776CONFIG_INPUT_MOUSE=y 779CONFIG_INPUT_MOUSE=y
777CONFIG_MOUSE_PS2=y 780CONFIG_MOUSE_PS2=y
778CONFIG_MOUSE_PS2_ALPS=y 781CONFIG_MOUSE_PS2_ALPS=y
@@ -780,6 +783,7 @@ CONFIG_MOUSE_PS2_LOGIPS2PP=y
780CONFIG_MOUSE_PS2_SYNAPTICS=y 783CONFIG_MOUSE_PS2_SYNAPTICS=y
781CONFIG_MOUSE_PS2_TRACKPOINT=y 784CONFIG_MOUSE_PS2_TRACKPOINT=y
782# CONFIG_MOUSE_PS2_ELANTECH is not set 785# CONFIG_MOUSE_PS2_ELANTECH is not set
786# CONFIG_MOUSE_PS2_SENTELIC is not set
783# CONFIG_MOUSE_PS2_TOUCHKIT is not set 787# CONFIG_MOUSE_PS2_TOUCHKIT is not set
784CONFIG_MOUSE_SERIAL=y 788CONFIG_MOUSE_SERIAL=y
785# CONFIG_MOUSE_APPLETOUCH is not set 789# CONFIG_MOUSE_APPLETOUCH is not set
@@ -883,7 +887,6 @@ CONFIG_I2C_ALGOBIT=y
883# 887#
884# I2C system bus drivers (mostly embedded / system-on-chip) 888# I2C system bus drivers (mostly embedded / system-on-chip)
885# 889#
886# CONFIG_I2C_DESIGNWARE is not set
887# CONFIG_I2C_OCORES is not set 890# CONFIG_I2C_OCORES is not set
888# CONFIG_I2C_SIMTEC is not set 891# CONFIG_I2C_SIMTEC is not set
889 892
@@ -1102,7 +1105,6 @@ CONFIG_FB_ATY_GX=y
1102# 1105#
1103# Console display driver support 1106# Console display driver support
1104# 1107#
1105# CONFIG_PROM_CONSOLE is not set
1106CONFIG_DUMMY_CONSOLE=y 1108CONFIG_DUMMY_CONSOLE=y
1107CONFIG_FRAMEBUFFER_CONSOLE=y 1109CONFIG_FRAMEBUFFER_CONSOLE=y
1108CONFIG_FRAMEBUFFER_CONSOLE_DETECT_PRIMARY=y 1110CONFIG_FRAMEBUFFER_CONSOLE_DETECT_PRIMARY=y
@@ -1124,6 +1126,7 @@ CONFIG_LOGO=y
1124CONFIG_LOGO_SUN_CLUT224=y 1126CONFIG_LOGO_SUN_CLUT224=y
1125CONFIG_SOUND=m 1127CONFIG_SOUND=m
1126CONFIG_SOUND_OSS_CORE=y 1128CONFIG_SOUND_OSS_CORE=y
1129CONFIG_SOUND_OSS_CORE_PRECLAIM=y
1127CONFIG_SND=m 1130CONFIG_SND=m
1128CONFIG_SND_TIMER=m 1131CONFIG_SND_TIMER=m
1129CONFIG_SND_PCM=m 1132CONFIG_SND_PCM=m
@@ -1232,7 +1235,6 @@ CONFIG_SND_SUN_CS4231=m
1232CONFIG_AC97_BUS=m 1235CONFIG_AC97_BUS=m
1233CONFIG_HID_SUPPORT=y 1236CONFIG_HID_SUPPORT=y
1234CONFIG_HID=y 1237CONFIG_HID=y
1235# CONFIG_HID_DEBUG is not set
1236# CONFIG_HIDRAW is not set 1238# CONFIG_HIDRAW is not set
1237 1239
1238# 1240#
@@ -1256,6 +1258,7 @@ CONFIG_HID_DRAGONRISE=y
1256CONFIG_HID_EZKEY=y 1258CONFIG_HID_EZKEY=y
1257CONFIG_HID_KYE=y 1259CONFIG_HID_KYE=y
1258CONFIG_HID_GYRATION=y 1260CONFIG_HID_GYRATION=y
1261CONFIG_HID_TWINHAN=y
1259CONFIG_HID_KENSINGTON=y 1262CONFIG_HID_KENSINGTON=y
1260CONFIG_HID_LOGITECH=y 1263CONFIG_HID_LOGITECH=y
1261# CONFIG_LOGITECH_FF is not set 1264# CONFIG_LOGITECH_FF is not set
@@ -1289,6 +1292,7 @@ CONFIG_USB=y
1289# 1292#
1290# Miscellaneous USB options 1293# Miscellaneous USB options
1291# 1294#
1295# CONFIG_USB_DEVICEFS is not set
1292# CONFIG_USB_DEVICE_CLASS is not set 1296# CONFIG_USB_DEVICE_CLASS is not set
1293# CONFIG_USB_DYNAMIC_MINORS is not set 1297# CONFIG_USB_DYNAMIC_MINORS is not set
1294# CONFIG_USB_OTG is not set 1298# CONFIG_USB_OTG is not set
@@ -1379,6 +1383,7 @@ CONFIG_USB_STORAGE=m
1379# CONFIG_USB_LD is not set 1383# CONFIG_USB_LD is not set
1380# CONFIG_USB_TRANCEVIBRATOR is not set 1384# CONFIG_USB_TRANCEVIBRATOR is not set
1381# CONFIG_USB_IOWARRIOR is not set 1385# CONFIG_USB_IOWARRIOR is not set
1386# CONFIG_USB_TEST is not set
1382# CONFIG_USB_ISIGHTFW is not set 1387# CONFIG_USB_ISIGHTFW is not set
1383# CONFIG_USB_VST is not set 1388# CONFIG_USB_VST is not set
1384# CONFIG_USB_GADGET is not set 1389# CONFIG_USB_GADGET is not set
@@ -1493,6 +1498,7 @@ CONFIG_FS_POSIX_ACL=y
1493# CONFIG_GFS2_FS is not set 1498# CONFIG_GFS2_FS is not set
1494# CONFIG_OCFS2_FS is not set 1499# CONFIG_OCFS2_FS is not set
1495# CONFIG_BTRFS_FS is not set 1500# CONFIG_BTRFS_FS is not set
1501# CONFIG_NILFS2_FS is not set
1496CONFIG_FILE_LOCKING=y 1502CONFIG_FILE_LOCKING=y
1497CONFIG_FSNOTIFY=y 1503CONFIG_FSNOTIFY=y
1498CONFIG_DNOTIFY=y 1504CONFIG_DNOTIFY=y
@@ -1553,7 +1559,6 @@ CONFIG_MISC_FILESYSTEMS=y
1553# CONFIG_ROMFS_FS is not set 1559# CONFIG_ROMFS_FS is not set
1554# CONFIG_SYSV_FS is not set 1560# CONFIG_SYSV_FS is not set
1555# CONFIG_UFS_FS is not set 1561# CONFIG_UFS_FS is not set
1556# CONFIG_NILFS2_FS is not set
1557CONFIG_NETWORK_FILESYSTEMS=y 1562CONFIG_NETWORK_FILESYSTEMS=y
1558# CONFIG_NFS_FS is not set 1563# CONFIG_NFS_FS is not set
1559# CONFIG_NFSD is not set 1564# CONFIG_NFSD is not set
@@ -1656,12 +1661,14 @@ CONFIG_DEBUG_MEMORY_INIT=y
1656# CONFIG_DEBUG_LIST is not set 1661# CONFIG_DEBUG_LIST is not set
1657# CONFIG_DEBUG_SG is not set 1662# CONFIG_DEBUG_SG is not set
1658# CONFIG_DEBUG_NOTIFIERS is not set 1663# CONFIG_DEBUG_NOTIFIERS is not set
1664# CONFIG_DEBUG_CREDENTIALS is not set
1659# CONFIG_BOOT_PRINTK_DELAY is not set 1665# CONFIG_BOOT_PRINTK_DELAY is not set
1660# CONFIG_RCU_TORTURE_TEST is not set 1666# CONFIG_RCU_TORTURE_TEST is not set
1661# CONFIG_RCU_CPU_STALL_DETECTOR is not set 1667# CONFIG_RCU_CPU_STALL_DETECTOR is not set
1662# CONFIG_KPROBES_SANITY_TEST is not set 1668# CONFIG_KPROBES_SANITY_TEST is not set
1663# CONFIG_BACKTRACE_SELF_TEST is not set 1669# CONFIG_BACKTRACE_SELF_TEST is not set
1664# CONFIG_DEBUG_BLOCK_EXT_DEVT is not set 1670# CONFIG_DEBUG_BLOCK_EXT_DEVT is not set
1671# CONFIG_DEBUG_FORCE_WEAK_PER_CPU is not set
1665# CONFIG_LKDTM is not set 1672# CONFIG_LKDTM is not set
1666# CONFIG_FAULT_INJECTION is not set 1673# CONFIG_FAULT_INJECTION is not set
1667# CONFIG_LATENCYTOP is not set 1674# CONFIG_LATENCYTOP is not set
@@ -1692,6 +1699,7 @@ CONFIG_BLK_DEV_IO_TRACE=y
1692# CONFIG_FTRACE_STARTUP_TEST is not set 1699# CONFIG_FTRACE_STARTUP_TEST is not set
1693# CONFIG_RING_BUFFER_BENCHMARK is not set 1700# CONFIG_RING_BUFFER_BENCHMARK is not set
1694# CONFIG_DYNAMIC_DEBUG is not set 1701# CONFIG_DYNAMIC_DEBUG is not set
1702# CONFIG_DMA_API_DEBUG is not set
1695# CONFIG_SAMPLES is not set 1703# CONFIG_SAMPLES is not set
1696CONFIG_HAVE_ARCH_KGDB=y 1704CONFIG_HAVE_ARCH_KGDB=y
1697# CONFIG_KGDB is not set 1705# CONFIG_KGDB is not set
@@ -1716,7 +1724,6 @@ CONFIG_CRYPTO=y
1716# 1724#
1717# Crypto core or helper 1725# Crypto core or helper
1718# 1726#
1719# CONFIG_CRYPTO_FIPS is not set
1720CONFIG_CRYPTO_ALGAPI=y 1727CONFIG_CRYPTO_ALGAPI=y
1721CONFIG_CRYPTO_ALGAPI2=y 1728CONFIG_CRYPTO_ALGAPI2=y
1722CONFIG_CRYPTO_AEAD=y 1729CONFIG_CRYPTO_AEAD=y
@@ -1759,11 +1766,13 @@ CONFIG_CRYPTO_XTS=m
1759# 1766#
1760CONFIG_CRYPTO_HMAC=y 1767CONFIG_CRYPTO_HMAC=y
1761CONFIG_CRYPTO_XCBC=y 1768CONFIG_CRYPTO_XCBC=y
1769# CONFIG_CRYPTO_VMAC is not set
1762 1770
1763# 1771#
1764# Digest 1772# Digest
1765# 1773#
1766CONFIG_CRYPTO_CRC32C=m 1774CONFIG_CRYPTO_CRC32C=m
1775# CONFIG_CRYPTO_GHASH is not set
1767CONFIG_CRYPTO_MD4=y 1776CONFIG_CRYPTO_MD4=y
1768CONFIG_CRYPTO_MD5=y 1777CONFIG_CRYPTO_MD5=y
1769CONFIG_CRYPTO_MICHAEL_MIC=m 1778CONFIG_CRYPTO_MICHAEL_MIC=m
diff --git a/arch/sparc/include/asm/agp.h b/arch/sparc/include/asm/agp.h
index c2456870b05c..70f52c1661bc 100644
--- a/arch/sparc/include/asm/agp.h
+++ b/arch/sparc/include/asm/agp.h
@@ -7,10 +7,6 @@
7#define unmap_page_from_agp(page) 7#define unmap_page_from_agp(page)
8#define flush_agp_cache() mb() 8#define flush_agp_cache() mb()
9 9
10/* Convert a physical address to an address suitable for the GART. */
11#define phys_to_gart(x) (x)
12#define gart_to_phys(x) (x)
13
14/* GATT allocation. Returns/accepts GATT kernel virtual address. */ 10/* GATT allocation. Returns/accepts GATT kernel virtual address. */
15#define alloc_gatt_pages(order) \ 11#define alloc_gatt_pages(order) \
16 ((char *)__get_free_pages(GFP_KERNEL, (order))) 12 ((char *)__get_free_pages(GFP_KERNEL, (order)))
diff --git a/arch/sparc/include/asm/pci_32.h b/arch/sparc/include/asm/pci_32.h
index ac0e8369fd97..e769f668a4b5 100644
--- a/arch/sparc/include/asm/pci_32.h
+++ b/arch/sparc/include/asm/pci_32.h
@@ -10,7 +10,6 @@
10 * or architectures with incomplete PCI setup by the loader. 10 * or architectures with incomplete PCI setup by the loader.
11 */ 11 */
12#define pcibios_assign_all_busses() 0 12#define pcibios_assign_all_busses() 0
13#define pcibios_scan_all_fns(a, b) 0
14 13
15#define PCIBIOS_MIN_IO 0UL 14#define PCIBIOS_MIN_IO 0UL
16#define PCIBIOS_MIN_MEM 0UL 15#define PCIBIOS_MIN_MEM 0UL
diff --git a/arch/sparc/include/asm/pci_64.h b/arch/sparc/include/asm/pci_64.h
index 5cc9f6aa5494..b63e51c3c3ee 100644
--- a/arch/sparc/include/asm/pci_64.h
+++ b/arch/sparc/include/asm/pci_64.h
@@ -10,7 +10,6 @@
10 * or architectures with incomplete PCI setup by the loader. 10 * or architectures with incomplete PCI setup by the loader.
11 */ 11 */
12#define pcibios_assign_all_busses() 0 12#define pcibios_assign_all_busses() 0
13#define pcibios_scan_all_fns(a, b) 0
14 13
15#define PCIBIOS_MIN_IO 0UL 14#define PCIBIOS_MIN_IO 0UL
16#define PCIBIOS_MIN_MEM 0UL 15#define PCIBIOS_MIN_MEM 0UL
diff --git a/arch/sparc/include/asm/topology_64.h b/arch/sparc/include/asm/topology_64.h
index e5ea8d332421..26cd25c08399 100644
--- a/arch/sparc/include/asm/topology_64.h
+++ b/arch/sparc/include/asm/topology_64.h
@@ -52,13 +52,12 @@ static inline int pcibus_to_node(struct pci_bus *pbus)
52 .busy_idx = 3, \ 52 .busy_idx = 3, \
53 .idle_idx = 2, \ 53 .idle_idx = 2, \
54 .newidle_idx = 0, \ 54 .newidle_idx = 0, \
55 .wake_idx = 1, \ 55 .wake_idx = 0, \
56 .forkexec_idx = 1, \ 56 .forkexec_idx = 0, \
57 .flags = SD_LOAD_BALANCE \ 57 .flags = SD_LOAD_BALANCE \
58 | SD_BALANCE_FORK \ 58 | SD_BALANCE_FORK \
59 | SD_BALANCE_EXEC \ 59 | SD_BALANCE_EXEC \
60 | SD_SERIALIZE \ 60 | SD_SERIALIZE, \
61 | SD_WAKE_BALANCE, \
62 .last_balance = jiffies, \ 61 .last_balance = jiffies, \
63 .balance_interval = 1, \ 62 .balance_interval = 1, \
64} 63}
diff --git a/arch/sparc/kernel/setup_32.c b/arch/sparc/kernel/setup_32.c
index 16a47ffe03c1..9be2af55c5cd 100644
--- a/arch/sparc/kernel/setup_32.c
+++ b/arch/sparc/kernel/setup_32.c
@@ -268,8 +268,6 @@ void __init setup_arch(char **cmdline_p)
268 268
269#ifdef CONFIG_DUMMY_CONSOLE 269#ifdef CONFIG_DUMMY_CONSOLE
270 conswitchp = &dummy_con; 270 conswitchp = &dummy_con;
271#elif defined(CONFIG_PROM_CONSOLE)
272 conswitchp = &prom_con;
273#endif 271#endif
274 boot_flags_init(*cmdline_p); 272 boot_flags_init(*cmdline_p);
275 273
diff --git a/arch/sparc/kernel/setup_64.c b/arch/sparc/kernel/setup_64.c
index f2bcfd2967d7..21180339cb09 100644
--- a/arch/sparc/kernel/setup_64.c
+++ b/arch/sparc/kernel/setup_64.c
@@ -295,8 +295,6 @@ void __init setup_arch(char **cmdline_p)
295 295
296#ifdef CONFIG_DUMMY_CONSOLE 296#ifdef CONFIG_DUMMY_CONSOLE
297 conswitchp = &dummy_con; 297 conswitchp = &dummy_con;
298#elif defined(CONFIG_PROM_CONSOLE)
299 conswitchp = &prom_con;
300#endif 298#endif
301 299
302 idprom_init(); 300 idprom_init();
diff --git a/arch/sparc/kernel/smp_64.c b/arch/sparc/kernel/smp_64.c
index 3691907a43b4..ff68373ce6d6 100644
--- a/arch/sparc/kernel/smp_64.c
+++ b/arch/sparc/kernel/smp_64.c
@@ -1389,8 +1389,8 @@ void smp_send_stop(void)
1389 * RETURNS: 1389 * RETURNS:
1390 * Pointer to the allocated area on success, NULL on failure. 1390 * Pointer to the allocated area on success, NULL on failure.
1391 */ 1391 */
1392static void * __init pcpu_alloc_bootmem(unsigned int cpu, unsigned long size, 1392static void * __init pcpu_alloc_bootmem(unsigned int cpu, size_t size,
1393 unsigned long align) 1393 size_t align)
1394{ 1394{
1395 const unsigned long goal = __pa(MAX_DMA_ADDRESS); 1395 const unsigned long goal = __pa(MAX_DMA_ADDRESS);
1396#ifdef CONFIG_NEED_MULTIPLE_NODES 1396#ifdef CONFIG_NEED_MULTIPLE_NODES
@@ -1415,127 +1415,35 @@ static void * __init pcpu_alloc_bootmem(unsigned int cpu, unsigned long size,
1415#endif 1415#endif
1416} 1416}
1417 1417
1418static size_t pcpur_size __initdata; 1418static void __init pcpu_free_bootmem(void *ptr, size_t size)
1419static void **pcpur_ptrs __initdata;
1420
1421static struct page * __init pcpur_get_page(unsigned int cpu, int pageno)
1422{ 1419{
1423 size_t off = (size_t)pageno << PAGE_SHIFT; 1420 free_bootmem(__pa(ptr), size);
1424
1425 if (off >= pcpur_size)
1426 return NULL;
1427
1428 return virt_to_page(pcpur_ptrs[cpu] + off);
1429} 1421}
1430 1422
1431#define PCPU_CHUNK_SIZE (4UL * 1024UL * 1024UL) 1423static int pcpu_cpu_distance(unsigned int from, unsigned int to)
1432
1433static void __init pcpu_map_range(unsigned long start, unsigned long end,
1434 struct page *page)
1435{ 1424{
1436 unsigned long pfn = page_to_pfn(page); 1425 if (cpu_to_node(from) == cpu_to_node(to))
1437 unsigned long pte_base; 1426 return LOCAL_DISTANCE;
1438 1427 else
1439 BUG_ON((pfn<<PAGE_SHIFT)&(PCPU_CHUNK_SIZE - 1UL)); 1428 return REMOTE_DISTANCE;
1440
1441 pte_base = (_PAGE_VALID | _PAGE_SZ4MB_4U |
1442 _PAGE_CP_4U | _PAGE_CV_4U |
1443 _PAGE_P_4U | _PAGE_W_4U);
1444 if (tlb_type == hypervisor)
1445 pte_base = (_PAGE_VALID | _PAGE_SZ4MB_4V |
1446 _PAGE_CP_4V | _PAGE_CV_4V |
1447 _PAGE_P_4V | _PAGE_W_4V);
1448
1449 while (start < end) {
1450 pgd_t *pgd = pgd_offset_k(start);
1451 unsigned long this_end;
1452 pud_t *pud;
1453 pmd_t *pmd;
1454 pte_t *pte;
1455
1456 pud = pud_offset(pgd, start);
1457 if (pud_none(*pud)) {
1458 pmd_t *new;
1459
1460 new = __alloc_bootmem(PAGE_SIZE, PAGE_SIZE, PAGE_SIZE);
1461 pud_populate(&init_mm, pud, new);
1462 }
1463
1464 pmd = pmd_offset(pud, start);
1465 if (!pmd_present(*pmd)) {
1466 pte_t *new;
1467
1468 new = __alloc_bootmem(PAGE_SIZE, PAGE_SIZE, PAGE_SIZE);
1469 pmd_populate_kernel(&init_mm, pmd, new);
1470 }
1471
1472 pte = pte_offset_kernel(pmd, start);
1473 this_end = (start + PMD_SIZE) & PMD_MASK;
1474 if (this_end > end)
1475 this_end = end;
1476
1477 while (start < this_end) {
1478 unsigned long paddr = pfn << PAGE_SHIFT;
1479
1480 pte_val(*pte) = (paddr | pte_base);
1481
1482 start += PAGE_SIZE;
1483 pte++;
1484 pfn++;
1485 }
1486 }
1487} 1429}
1488 1430
1489void __init setup_per_cpu_areas(void) 1431void __init setup_per_cpu_areas(void)
1490{ 1432{
1491 size_t dyn_size, static_size = __per_cpu_end - __per_cpu_start; 1433 unsigned long delta;
1492 static struct vm_struct vm; 1434 unsigned int cpu;
1493 unsigned long delta, cpu; 1435 int rc;
1494 size_t pcpu_unit_size;
1495 size_t ptrs_size;
1496
1497 pcpur_size = PFN_ALIGN(static_size + PERCPU_MODULE_RESERVE +
1498 PERCPU_DYNAMIC_RESERVE);
1499 dyn_size = pcpur_size - static_size - PERCPU_MODULE_RESERVE;
1500
1501 1436
1502 ptrs_size = PFN_ALIGN(nr_cpu_ids * sizeof(pcpur_ptrs[0])); 1437 rc = pcpu_embed_first_chunk(PERCPU_MODULE_RESERVE,
1503 pcpur_ptrs = alloc_bootmem(ptrs_size); 1438 PERCPU_DYNAMIC_RESERVE, 4 << 20,
1504 1439 pcpu_cpu_distance, pcpu_alloc_bootmem,
1505 for_each_possible_cpu(cpu) { 1440 pcpu_free_bootmem);
1506 pcpur_ptrs[cpu] = pcpu_alloc_bootmem(cpu, PCPU_CHUNK_SIZE, 1441 if (rc)
1507 PCPU_CHUNK_SIZE); 1442 panic("failed to initialize first chunk (%d)", rc);
1508
1509 free_bootmem(__pa(pcpur_ptrs[cpu] + pcpur_size),
1510 PCPU_CHUNK_SIZE - pcpur_size);
1511
1512 memcpy(pcpur_ptrs[cpu], __per_cpu_load, static_size);
1513 }
1514
1515 /* allocate address and map */
1516 vm.flags = VM_ALLOC;
1517 vm.size = nr_cpu_ids * PCPU_CHUNK_SIZE;
1518 vm_area_register_early(&vm, PCPU_CHUNK_SIZE);
1519
1520 for_each_possible_cpu(cpu) {
1521 unsigned long start = (unsigned long) vm.addr;
1522 unsigned long end;
1523
1524 start += cpu * PCPU_CHUNK_SIZE;
1525 end = start + PCPU_CHUNK_SIZE;
1526 pcpu_map_range(start, end, virt_to_page(pcpur_ptrs[cpu]));
1527 }
1528
1529 pcpu_unit_size = pcpu_setup_first_chunk(pcpur_get_page, static_size,
1530 PERCPU_MODULE_RESERVE, dyn_size,
1531 PCPU_CHUNK_SIZE, vm.addr, NULL);
1532
1533 free_bootmem(__pa(pcpur_ptrs), ptrs_size);
1534 1443
1535 delta = (unsigned long)pcpu_base_addr - (unsigned long)__per_cpu_start; 1444 delta = (unsigned long)pcpu_base_addr - (unsigned long)__per_cpu_start;
1536 for_each_possible_cpu(cpu) { 1445 for_each_possible_cpu(cpu)
1537 __per_cpu_offset(cpu) = delta + cpu * pcpu_unit_size; 1446 __per_cpu_offset(cpu) = delta + pcpu_unit_offsets[cpu];
1538 }
1539 1447
1540 /* Setup %g5 for the boot cpu. */ 1448 /* Setup %g5 for the boot cpu. */
1541 __local_per_cpu_offset = __per_cpu_offset(smp_processor_id()); 1449 __local_per_cpu_offset = __per_cpu_offset(smp_processor_id());
diff --git a/arch/sparc/kernel/vmlinux.lds.S b/arch/sparc/kernel/vmlinux.lds.S
index fcbbd000ec08..866390feb683 100644
--- a/arch/sparc/kernel/vmlinux.lds.S
+++ b/arch/sparc/kernel/vmlinux.lds.S
@@ -171,12 +171,8 @@ SECTIONS
171 } 171 }
172 _end = . ; 172 _end = . ;
173 173
174 /DISCARD/ : {
175 EXIT_TEXT
176 EXIT_DATA
177 *(.exitcall.exit)
178 }
179
180 STABS_DEBUG 174 STABS_DEBUG
181 DWARF_DEBUG 175 DWARF_DEBUG
176
177 DISCARDS
182} 178}
diff --git a/arch/um/include/asm/common.lds.S b/arch/um/include/asm/common.lds.S
index cb0248616d49..37ecc5577a9a 100644
--- a/arch/um/include/asm/common.lds.S
+++ b/arch/um/include/asm/common.lds.S
@@ -123,8 +123,3 @@
123 __initramfs_end = .; 123 __initramfs_end = .;
124 } 124 }
125 125
126 /* Sections to be discarded */
127 /DISCARD/ : {
128 *(.exitcall.exit)
129 }
130
diff --git a/arch/um/include/asm/pci.h b/arch/um/include/asm/pci.h
index 59923199cdc3..b44cf59ede1e 100644
--- a/arch/um/include/asm/pci.h
+++ b/arch/um/include/asm/pci.h
@@ -2,6 +2,5 @@
2#define __UM_PCI_H 2#define __UM_PCI_H
3 3
4#define PCI_DMA_BUS_IS_PHYS (1) 4#define PCI_DMA_BUS_IS_PHYS (1)
5#define pcibios_scan_all_fns(a, b) 0
6 5
7#endif 6#endif
diff --git a/arch/um/kernel/dyn.lds.S b/arch/um/kernel/dyn.lds.S
index 9975e1ab44fb..715a188c0472 100644
--- a/arch/um/kernel/dyn.lds.S
+++ b/arch/um/kernel/dyn.lds.S
@@ -156,4 +156,6 @@ SECTIONS
156 STABS_DEBUG 156 STABS_DEBUG
157 157
158 DWARF_DEBUG 158 DWARF_DEBUG
159
160 DISCARDS
159} 161}
diff --git a/arch/um/kernel/uml.lds.S b/arch/um/kernel/uml.lds.S
index 11b835248b86..2ebd39765db8 100644
--- a/arch/um/kernel/uml.lds.S
+++ b/arch/um/kernel/uml.lds.S
@@ -100,4 +100,6 @@ SECTIONS
100 STABS_DEBUG 100 STABS_DEBUG
101 101
102 DWARF_DEBUG 102 DWARF_DEBUG
103
104 DISCARDS
103} 105}
diff --git a/arch/x86/Kconfig b/arch/x86/Kconfig
index fc20fdc0f7f2..e5deee2dfcfe 100644
--- a/arch/x86/Kconfig
+++ b/arch/x86/Kconfig
@@ -150,7 +150,10 @@ config ARCH_HAS_CACHE_LINE_SIZE
150config HAVE_SETUP_PER_CPU_AREA 150config HAVE_SETUP_PER_CPU_AREA
151 def_bool y 151 def_bool y
152 152
153config HAVE_DYNAMIC_PER_CPU_AREA 153config NEED_PER_CPU_EMBED_FIRST_CHUNK
154 def_bool y
155
156config NEED_PER_CPU_PAGE_FIRST_CHUNK
154 def_bool y 157 def_bool y
155 158
156config HAVE_CPUMASK_OF_CPU_MAP 159config HAVE_CPUMASK_OF_CPU_MAP
@@ -179,6 +182,10 @@ config ARCH_SUPPORTS_OPTIMIZED_INLINING
179config ARCH_SUPPORTS_DEBUG_PAGEALLOC 182config ARCH_SUPPORTS_DEBUG_PAGEALLOC
180 def_bool y 183 def_bool y
181 184
185config HAVE_INTEL_TXT
186 def_bool y
187 depends on EXPERIMENTAL && DMAR && ACPI
188
182# Use the generic interrupt handling code in kernel/irq/: 189# Use the generic interrupt handling code in kernel/irq/:
183config GENERIC_HARDIRQS 190config GENERIC_HARDIRQS
184 bool 191 bool
@@ -776,41 +783,17 @@ config X86_REROUTE_FOR_BROKEN_BOOT_IRQS
776 increased on these systems. 783 increased on these systems.
777 784
778config X86_MCE 785config X86_MCE
779 bool "Machine Check Exception" 786 bool "Machine Check / overheating reporting"
780 ---help--- 787 ---help---
781 Machine Check Exception support allows the processor to notify the 788 Machine Check support allows the processor to notify the
782 kernel if it detects a problem (e.g. overheating, component failure). 789 kernel if it detects a problem (e.g. overheating, data corruption).
783 The action the kernel takes depends on the severity of the problem, 790 The action the kernel takes depends on the severity of the problem,
784 ranging from a warning message on the console, to halting the machine. 791 ranging from warning messages to halting the machine.
785 Your processor must be a Pentium or newer to support this - check the
786 flags in /proc/cpuinfo for mce. Note that some older Pentium systems
787 have a design flaw which leads to false MCE events - hence MCE is
788 disabled on all P5 processors, unless explicitly enabled with "mce"
789 as a boot argument. Similarly, if MCE is built in and creates a
790 problem on some new non-standard machine, you can boot with "nomce"
791 to disable it. MCE support simply ignores non-MCE processors like
792 the 386 and 486, so nearly everyone can say Y here.
793
794config X86_OLD_MCE
795 depends on X86_32 && X86_MCE
796 bool "Use legacy machine check code (will go away)"
797 default n
798 select X86_ANCIENT_MCE
799 ---help---
800 Use the old i386 machine check code. This is merely intended for
801 testing in a transition period. Try this if you run into any machine
802 check related software problems, but report the problem to
803 linux-kernel. When in doubt say no.
804
805config X86_NEW_MCE
806 depends on X86_MCE
807 bool
808 default y if (!X86_OLD_MCE && X86_32) || X86_64
809 792
810config X86_MCE_INTEL 793config X86_MCE_INTEL
811 def_bool y 794 def_bool y
812 prompt "Intel MCE features" 795 prompt "Intel MCE features"
813 depends on X86_NEW_MCE && X86_LOCAL_APIC 796 depends on X86_MCE && X86_LOCAL_APIC
814 ---help--- 797 ---help---
815 Additional support for intel specific MCE features such as 798 Additional support for intel specific MCE features such as
816 the thermal monitor. 799 the thermal monitor.
@@ -818,14 +801,14 @@ config X86_MCE_INTEL
818config X86_MCE_AMD 801config X86_MCE_AMD
819 def_bool y 802 def_bool y
820 prompt "AMD MCE features" 803 prompt "AMD MCE features"
821 depends on X86_NEW_MCE && X86_LOCAL_APIC 804 depends on X86_MCE && X86_LOCAL_APIC
822 ---help--- 805 ---help---
823 Additional support for AMD specific MCE features such as 806 Additional support for AMD specific MCE features such as
824 the DRAM Error Threshold. 807 the DRAM Error Threshold.
825 808
826config X86_ANCIENT_MCE 809config X86_ANCIENT_MCE
827 def_bool n 810 def_bool n
828 depends on X86_32 811 depends on X86_32 && X86_MCE
829 prompt "Support for old Pentium 5 / WinChip machine checks" 812 prompt "Support for old Pentium 5 / WinChip machine checks"
830 ---help--- 813 ---help---
831 Include support for machine check handling on old Pentium 5 or WinChip 814 Include support for machine check handling on old Pentium 5 or WinChip
@@ -838,36 +821,16 @@ config X86_MCE_THRESHOLD
838 default y 821 default y
839 822
840config X86_MCE_INJECT 823config X86_MCE_INJECT
841 depends on X86_NEW_MCE 824 depends on X86_MCE
842 tristate "Machine check injector support" 825 tristate "Machine check injector support"
843 ---help--- 826 ---help---
844 Provide support for injecting machine checks for testing purposes. 827 Provide support for injecting machine checks for testing purposes.
845 If you don't know what a machine check is and you don't do kernel 828 If you don't know what a machine check is and you don't do kernel
846 QA it is safe to say n. 829 QA it is safe to say n.
847 830
848config X86_MCE_NONFATAL
849 tristate "Check for non-fatal errors on AMD Athlon/Duron / Intel Pentium 4"
850 depends on X86_OLD_MCE
851 ---help---
852 Enabling this feature starts a timer that triggers every 5 seconds which
853 will look at the machine check registers to see if anything happened.
854 Non-fatal problems automatically get corrected (but still logged).
855 Disable this if you don't want to see these messages.
856 Seeing the messages this option prints out may be indicative of dying
857 or out-of-spec (ie, overclocked) hardware.
858 This option only does something on certain CPUs.
859 (AMD Athlon/Duron and Intel Pentium 4)
860
861config X86_MCE_P4THERMAL
862 bool "check for P4 thermal throttling interrupt."
863 depends on X86_OLD_MCE && X86_MCE && (X86_UP_APIC || SMP)
864 ---help---
865 Enabling this feature will cause a message to be printed when the P4
866 enters thermal throttling.
867
868config X86_THERMAL_VECTOR 831config X86_THERMAL_VECTOR
869 def_bool y 832 def_bool y
870 depends on X86_MCE_P4THERMAL || X86_MCE_INTEL 833 depends on X86_MCE_INTEL
871 834
872config VM86 835config VM86
873 bool "Enable VM86 support" if EMBEDDED 836 bool "Enable VM86 support" if EMBEDDED
@@ -1413,6 +1376,10 @@ config X86_PAT
1413 1376
1414 If unsure, say Y. 1377 If unsure, say Y.
1415 1378
1379config ARCH_USES_PG_UNCACHED
1380 def_bool y
1381 depends on X86_PAT
1382
1416config EFI 1383config EFI
1417 bool "EFI runtime service support" 1384 bool "EFI runtime service support"
1418 depends on ACPI 1385 depends on ACPI
diff --git a/arch/x86/include/asm/agp.h b/arch/x86/include/asm/agp.h
index 9825cd64c9b6..eec2a70d4376 100644
--- a/arch/x86/include/asm/agp.h
+++ b/arch/x86/include/asm/agp.h
@@ -22,10 +22,6 @@
22 */ 22 */
23#define flush_agp_cache() wbinvd() 23#define flush_agp_cache() wbinvd()
24 24
25/* Convert a physical address to an address suitable for the GART. */
26#define phys_to_gart(x) (x)
27#define gart_to_phys(x) (x)
28
29/* GATT allocation. Returns/accepts GATT kernel virtual address. */ 25/* GATT allocation. Returns/accepts GATT kernel virtual address. */
30#define alloc_gatt_pages(order) \ 26#define alloc_gatt_pages(order) \
31 ((char *)__get_free_pages(GFP_KERNEL, (order))) 27 ((char *)__get_free_pages(GFP_KERNEL, (order)))
diff --git a/arch/x86/include/asm/bootparam.h b/arch/x86/include/asm/bootparam.h
index 1724e8de317c..6ca20218dd72 100644
--- a/arch/x86/include/asm/bootparam.h
+++ b/arch/x86/include/asm/bootparam.h
@@ -85,7 +85,8 @@ struct efi_info {
85struct boot_params { 85struct boot_params {
86 struct screen_info screen_info; /* 0x000 */ 86 struct screen_info screen_info; /* 0x000 */
87 struct apm_bios_info apm_bios_info; /* 0x040 */ 87 struct apm_bios_info apm_bios_info; /* 0x040 */
88 __u8 _pad2[12]; /* 0x054 */ 88 __u8 _pad2[4]; /* 0x054 */
89 __u64 tboot_addr; /* 0x058 */
89 struct ist_info ist_info; /* 0x060 */ 90 struct ist_info ist_info; /* 0x060 */
90 __u8 _pad3[16]; /* 0x070 */ 91 __u8 _pad3[16]; /* 0x070 */
91 __u8 hd0_info[16]; /* obsolete! */ /* 0x080 */ 92 __u8 hd0_info[16]; /* obsolete! */ /* 0x080 */
diff --git a/arch/x86/include/asm/cacheflush.h b/arch/x86/include/asm/cacheflush.h
index e55dfc1ad453..b54f6afe7ec4 100644
--- a/arch/x86/include/asm/cacheflush.h
+++ b/arch/x86/include/asm/cacheflush.h
@@ -43,8 +43,58 @@ static inline void copy_from_user_page(struct vm_area_struct *vma,
43 memcpy(dst, src, len); 43 memcpy(dst, src, len);
44} 44}
45 45
46#define PG_non_WB PG_arch_1 46#define PG_WC PG_arch_1
47PAGEFLAG(NonWB, non_WB) 47PAGEFLAG(WC, WC)
48
49#ifdef CONFIG_X86_PAT
50/*
51 * X86 PAT uses page flags WC and Uncached together to keep track of
52 * memory type of pages that have backing page struct. X86 PAT supports 3
53 * different memory types, _PAGE_CACHE_WB, _PAGE_CACHE_WC and
54 * _PAGE_CACHE_UC_MINUS and fourth state where page's memory type has not
55 * been changed from its default (value of -1 used to denote this).
56 * Note we do not support _PAGE_CACHE_UC here.
57 *
58 * Caller must hold memtype_lock for atomicity.
59 */
60static inline unsigned long get_page_memtype(struct page *pg)
61{
62 if (!PageUncached(pg) && !PageWC(pg))
63 return -1;
64 else if (!PageUncached(pg) && PageWC(pg))
65 return _PAGE_CACHE_WC;
66 else if (PageUncached(pg) && !PageWC(pg))
67 return _PAGE_CACHE_UC_MINUS;
68 else
69 return _PAGE_CACHE_WB;
70}
71
72static inline void set_page_memtype(struct page *pg, unsigned long memtype)
73{
74 switch (memtype) {
75 case _PAGE_CACHE_WC:
76 ClearPageUncached(pg);
77 SetPageWC(pg);
78 break;
79 case _PAGE_CACHE_UC_MINUS:
80 SetPageUncached(pg);
81 ClearPageWC(pg);
82 break;
83 case _PAGE_CACHE_WB:
84 SetPageUncached(pg);
85 SetPageWC(pg);
86 break;
87 default:
88 case -1:
89 ClearPageUncached(pg);
90 ClearPageWC(pg);
91 break;
92 }
93}
94#else
95static inline unsigned long get_page_memtype(struct page *pg) { return -1; }
96static inline void set_page_memtype(struct page *pg, unsigned long memtype) { }
97#endif
48 98
49/* 99/*
50 * The set_memory_* API can be used to change various attributes of a virtual 100 * The set_memory_* API can be used to change various attributes of a virtual
diff --git a/arch/x86/include/asm/cpufeature.h b/arch/x86/include/asm/cpufeature.h
index 847fee6493a2..9cfc88b97742 100644
--- a/arch/x86/include/asm/cpufeature.h
+++ b/arch/x86/include/asm/cpufeature.h
@@ -96,6 +96,7 @@
96#define X86_FEATURE_CLFLUSH_MONITOR (3*32+25) /* "" clflush reqd with monitor */ 96#define X86_FEATURE_CLFLUSH_MONITOR (3*32+25) /* "" clflush reqd with monitor */
97#define X86_FEATURE_EXTD_APICID (3*32+26) /* has extended APICID (8 bits) */ 97#define X86_FEATURE_EXTD_APICID (3*32+26) /* has extended APICID (8 bits) */
98#define X86_FEATURE_AMD_DCM (3*32+27) /* multi-node processor */ 98#define X86_FEATURE_AMD_DCM (3*32+27) /* multi-node processor */
99#define X86_FEATURE_APERFMPERF (3*32+28) /* APERFMPERF */
99 100
100/* Intel-defined CPU features, CPUID level 0x00000001 (ecx), word 4 */ 101/* Intel-defined CPU features, CPUID level 0x00000001 (ecx), word 4 */
101#define X86_FEATURE_XMM3 (4*32+ 0) /* "pni" SSE-3 */ 102#define X86_FEATURE_XMM3 (4*32+ 0) /* "pni" SSE-3 */
diff --git a/arch/x86/include/asm/elf.h b/arch/x86/include/asm/elf.h
index 83c1bc8d2e8a..456a304b8172 100644
--- a/arch/x86/include/asm/elf.h
+++ b/arch/x86/include/asm/elf.h
@@ -299,6 +299,8 @@ do { \
299 299
300#ifdef CONFIG_X86_32 300#ifdef CONFIG_X86_32
301 301
302#define STACK_RND_MASK (0x7ff)
303
302#define VDSO_HIGH_BASE (__fix_to_virt(FIX_VDSO)) 304#define VDSO_HIGH_BASE (__fix_to_virt(FIX_VDSO))
303 305
304#define ARCH_DLINFO ARCH_DLINFO_IA32(vdso_enabled) 306#define ARCH_DLINFO ARCH_DLINFO_IA32(vdso_enabled)
diff --git a/arch/x86/include/asm/entry_arch.h b/arch/x86/include/asm/entry_arch.h
index ff8cbfa07851..5e3f2044f0d3 100644
--- a/arch/x86/include/asm/entry_arch.h
+++ b/arch/x86/include/asm/entry_arch.h
@@ -61,7 +61,7 @@ BUILD_INTERRUPT(thermal_interrupt,THERMAL_APIC_VECTOR)
61BUILD_INTERRUPT(threshold_interrupt,THRESHOLD_APIC_VECTOR) 61BUILD_INTERRUPT(threshold_interrupt,THRESHOLD_APIC_VECTOR)
62#endif 62#endif
63 63
64#ifdef CONFIG_X86_NEW_MCE 64#ifdef CONFIG_X86_MCE
65BUILD_INTERRUPT(mce_self_interrupt,MCE_SELF_VECTOR) 65BUILD_INTERRUPT(mce_self_interrupt,MCE_SELF_VECTOR)
66#endif 66#endif
67 67
diff --git a/arch/x86/include/asm/fixmap.h b/arch/x86/include/asm/fixmap.h
index 7b2d71df39a6..14f9890eb495 100644
--- a/arch/x86/include/asm/fixmap.h
+++ b/arch/x86/include/asm/fixmap.h
@@ -132,6 +132,9 @@ enum fixed_addresses {
132#ifdef CONFIG_X86_32 132#ifdef CONFIG_X86_32
133 FIX_WP_TEST, 133 FIX_WP_TEST,
134#endif 134#endif
135#ifdef CONFIG_INTEL_TXT
136 FIX_TBOOT_BASE,
137#endif
135 __end_of_fixed_addresses 138 __end_of_fixed_addresses
136}; 139};
137 140
diff --git a/arch/x86/include/asm/iomap.h b/arch/x86/include/asm/iomap.h
index 0e9fe1d9d971..f35eb45d6576 100644
--- a/arch/x86/include/asm/iomap.h
+++ b/arch/x86/include/asm/iomap.h
@@ -26,13 +26,16 @@
26#include <asm/pgtable.h> 26#include <asm/pgtable.h>
27#include <asm/tlbflush.h> 27#include <asm/tlbflush.h>
28 28
29int
30is_io_mapping_possible(resource_size_t base, unsigned long size);
31
32void * 29void *
33iomap_atomic_prot_pfn(unsigned long pfn, enum km_type type, pgprot_t prot); 30iomap_atomic_prot_pfn(unsigned long pfn, enum km_type type, pgprot_t prot);
34 31
35void 32void
36iounmap_atomic(void *kvaddr, enum km_type type); 33iounmap_atomic(void *kvaddr, enum km_type type);
37 34
35int
36iomap_create_wc(resource_size_t base, unsigned long size, pgprot_t *prot);
37
38void
39iomap_free(resource_size_t base, unsigned long size);
40
38#endif /* _ASM_X86_IOMAP_H */ 41#endif /* _ASM_X86_IOMAP_H */
diff --git a/arch/x86/include/asm/mce.h b/arch/x86/include/asm/mce.h
index 5cdd8d100ec9..b608a64c5814 100644
--- a/arch/x86/include/asm/mce.h
+++ b/arch/x86/include/asm/mce.h
@@ -9,7 +9,7 @@
9 */ 9 */
10 10
11#define MCG_BANKCNT_MASK 0xff /* Number of Banks */ 11#define MCG_BANKCNT_MASK 0xff /* Number of Banks */
12#define MCG_CTL_P (1ULL<<8) /* MCG_CAP register available */ 12#define MCG_CTL_P (1ULL<<8) /* MCG_CTL register available */
13#define MCG_EXT_P (1ULL<<9) /* Extended registers available */ 13#define MCG_EXT_P (1ULL<<9) /* Extended registers available */
14#define MCG_CMCI_P (1ULL<<10) /* CMCI supported */ 14#define MCG_CMCI_P (1ULL<<10) /* CMCI supported */
15#define MCG_EXT_CNT_MASK 0xff0000 /* Number of Extended registers */ 15#define MCG_EXT_CNT_MASK 0xff0000 /* Number of Extended registers */
@@ -38,6 +38,14 @@
38#define MCM_ADDR_MEM 3 /* memory address */ 38#define MCM_ADDR_MEM 3 /* memory address */
39#define MCM_ADDR_GENERIC 7 /* generic */ 39#define MCM_ADDR_GENERIC 7 /* generic */
40 40
41#define MCJ_CTX_MASK 3
42#define MCJ_CTX(flags) ((flags) & MCJ_CTX_MASK)
43#define MCJ_CTX_RANDOM 0 /* inject context: random */
44#define MCJ_CTX_PROCESS 1 /* inject context: process */
45#define MCJ_CTX_IRQ 2 /* inject context: IRQ */
46#define MCJ_NMI_BROADCAST 4 /* do NMI broadcasting */
47#define MCJ_EXCEPTION 8 /* raise as exception */
48
41/* Fields are zero when not available */ 49/* Fields are zero when not available */
42struct mce { 50struct mce {
43 __u64 status; 51 __u64 status;
@@ -48,8 +56,8 @@ struct mce {
48 __u64 tsc; /* cpu time stamp counter */ 56 __u64 tsc; /* cpu time stamp counter */
49 __u64 time; /* wall time_t when error was detected */ 57 __u64 time; /* wall time_t when error was detected */
50 __u8 cpuvendor; /* cpu vendor as encoded in system.h */ 58 __u8 cpuvendor; /* cpu vendor as encoded in system.h */
51 __u8 pad1; 59 __u8 inject_flags; /* software inject flags */
52 __u16 pad2; 60 __u16 pad;
53 __u32 cpuid; /* CPUID 1 EAX */ 61 __u32 cpuid; /* CPUID 1 EAX */
54 __u8 cs; /* code segment */ 62 __u8 cs; /* code segment */
55 __u8 bank; /* machine check bank */ 63 __u8 bank; /* machine check bank */
@@ -115,13 +123,6 @@ void mcheck_init(struct cpuinfo_x86 *c);
115static inline void mcheck_init(struct cpuinfo_x86 *c) {} 123static inline void mcheck_init(struct cpuinfo_x86 *c) {}
116#endif 124#endif
117 125
118#ifdef CONFIG_X86_OLD_MCE
119extern int nr_mce_banks;
120void amd_mcheck_init(struct cpuinfo_x86 *c);
121void intel_p4_mcheck_init(struct cpuinfo_x86 *c);
122void intel_p6_mcheck_init(struct cpuinfo_x86 *c);
123#endif
124
125#ifdef CONFIG_X86_ANCIENT_MCE 126#ifdef CONFIG_X86_ANCIENT_MCE
126void intel_p5_mcheck_init(struct cpuinfo_x86 *c); 127void intel_p5_mcheck_init(struct cpuinfo_x86 *c);
127void winchip_mcheck_init(struct cpuinfo_x86 *c); 128void winchip_mcheck_init(struct cpuinfo_x86 *c);
@@ -137,10 +138,11 @@ void mce_log(struct mce *m);
137DECLARE_PER_CPU(struct sys_device, mce_dev); 138DECLARE_PER_CPU(struct sys_device, mce_dev);
138 139
139/* 140/*
140 * To support more than 128 would need to escape the predefined 141 * Maximum banks number.
141 * Linux defined extended banks first. 142 * This is the limit of the current register layout on
143 * Intel CPUs.
142 */ 144 */
143#define MAX_NR_BANKS (MCE_EXTENDED_BANK - 1) 145#define MAX_NR_BANKS 32
144 146
145#ifdef CONFIG_X86_MCE_INTEL 147#ifdef CONFIG_X86_MCE_INTEL
146extern int mce_cmci_disabled; 148extern int mce_cmci_disabled;
@@ -208,11 +210,7 @@ extern void (*threshold_cpu_callback)(unsigned long action, unsigned int cpu);
208 210
209void intel_init_thermal(struct cpuinfo_x86 *c); 211void intel_init_thermal(struct cpuinfo_x86 *c);
210 212
211#ifdef CONFIG_X86_NEW_MCE
212void mce_log_therm_throt_event(__u64 status); 213void mce_log_therm_throt_event(__u64 status);
213#else
214static inline void mce_log_therm_throt_event(__u64 status) {}
215#endif
216 214
217#endif /* __KERNEL__ */ 215#endif /* __KERNEL__ */
218#endif /* _ASM_X86_MCE_H */ 216#endif /* _ASM_X86_MCE_H */
diff --git a/arch/x86/include/asm/msr-index.h b/arch/x86/include/asm/msr-index.h
index bd5549034a95..4ffe09b2ad75 100644
--- a/arch/x86/include/asm/msr-index.h
+++ b/arch/x86/include/asm/msr-index.h
@@ -81,8 +81,15 @@
81#define MSR_IA32_MC0_ADDR 0x00000402 81#define MSR_IA32_MC0_ADDR 0x00000402
82#define MSR_IA32_MC0_MISC 0x00000403 82#define MSR_IA32_MC0_MISC 0x00000403
83 83
84#define MSR_IA32_MCx_CTL(x) (MSR_IA32_MC0_CTL + 4*(x))
85#define MSR_IA32_MCx_STATUS(x) (MSR_IA32_MC0_STATUS + 4*(x))
86#define MSR_IA32_MCx_ADDR(x) (MSR_IA32_MC0_ADDR + 4*(x))
87#define MSR_IA32_MCx_MISC(x) (MSR_IA32_MC0_MISC + 4*(x))
88
84/* These are consecutive and not in the normal 4er MCE bank block */ 89/* These are consecutive and not in the normal 4er MCE bank block */
85#define MSR_IA32_MC0_CTL2 0x00000280 90#define MSR_IA32_MC0_CTL2 0x00000280
91#define MSR_IA32_MCx_CTL2(x) (MSR_IA32_MC0_CTL2 + (x))
92
86#define CMCI_EN (1ULL << 30) 93#define CMCI_EN (1ULL << 30)
87#define CMCI_THRESHOLD_MASK 0xffffULL 94#define CMCI_THRESHOLD_MASK 0xffffULL
88 95
@@ -215,6 +222,10 @@
215 222
216#define THERM_STATUS_PROCHOT (1 << 0) 223#define THERM_STATUS_PROCHOT (1 << 0)
217 224
225#define MSR_THERM2_CTL 0x0000019d
226
227#define MSR_THERM2_CTL_TM_SELECT (1ULL << 16)
228
218#define MSR_IA32_MISC_ENABLE 0x000001a0 229#define MSR_IA32_MISC_ENABLE 0x000001a0
219 230
220/* MISC_ENABLE bits: architectural */ 231/* MISC_ENABLE bits: architectural */
diff --git a/arch/x86/include/asm/mtrr.h b/arch/x86/include/asm/mtrr.h
index a51ada8467de..4365ffdb461f 100644
--- a/arch/x86/include/asm/mtrr.h
+++ b/arch/x86/include/asm/mtrr.h
@@ -121,6 +121,9 @@ extern int mtrr_del_page(int reg, unsigned long base, unsigned long size);
121extern void mtrr_centaur_report_mcr(int mcr, u32 lo, u32 hi); 121extern void mtrr_centaur_report_mcr(int mcr, u32 lo, u32 hi);
122extern void mtrr_ap_init(void); 122extern void mtrr_ap_init(void);
123extern void mtrr_bp_init(void); 123extern void mtrr_bp_init(void);
124extern void set_mtrr_aps_delayed_init(void);
125extern void mtrr_aps_init(void);
126extern void mtrr_bp_restore(void);
124extern int mtrr_trim_uncached_memory(unsigned long end_pfn); 127extern int mtrr_trim_uncached_memory(unsigned long end_pfn);
125extern int amd_special_default_mtrr(void); 128extern int amd_special_default_mtrr(void);
126# else 129# else
@@ -161,6 +164,9 @@ static inline void mtrr_centaur_report_mcr(int mcr, u32 lo, u32 hi)
161 164
162#define mtrr_ap_init() do {} while (0) 165#define mtrr_ap_init() do {} while (0)
163#define mtrr_bp_init() do {} while (0) 166#define mtrr_bp_init() do {} while (0)
167#define set_mtrr_aps_delayed_init() do {} while (0)
168#define mtrr_aps_init() do {} while (0)
169#define mtrr_bp_restore() do {} while (0)
164# endif 170# endif
165 171
166#ifdef CONFIG_COMPAT 172#ifdef CONFIG_COMPAT
diff --git a/arch/x86/include/asm/nops.h b/arch/x86/include/asm/nops.h
index ad2668ee1aa7..6d8723a766cc 100644
--- a/arch/x86/include/asm/nops.h
+++ b/arch/x86/include/asm/nops.h
@@ -65,6 +65,8 @@
65 6: osp nopl 0x00(%eax,%eax,1) 65 6: osp nopl 0x00(%eax,%eax,1)
66 7: nopl 0x00000000(%eax) 66 7: nopl 0x00000000(%eax)
67 8: nopl 0x00000000(%eax,%eax,1) 67 8: nopl 0x00000000(%eax,%eax,1)
68 Note: All the above are assumed to be a single instruction.
69 There is kernel code that depends on this.
68*/ 70*/
69#define P6_NOP1 GENERIC_NOP1 71#define P6_NOP1 GENERIC_NOP1
70#define P6_NOP2 ".byte 0x66,0x90\n" 72#define P6_NOP2 ".byte 0x66,0x90\n"
diff --git a/arch/x86/include/asm/pat.h b/arch/x86/include/asm/pat.h
index 7af14e512f97..e2c1668dde7a 100644
--- a/arch/x86/include/asm/pat.h
+++ b/arch/x86/include/asm/pat.h
@@ -19,4 +19,9 @@ extern int free_memtype(u64 start, u64 end);
19extern int kernel_map_sync_memtype(u64 base, unsigned long size, 19extern int kernel_map_sync_memtype(u64 base, unsigned long size,
20 unsigned long flag); 20 unsigned long flag);
21 21
22int io_reserve_memtype(resource_size_t start, resource_size_t end,
23 unsigned long *type);
24
25void io_free_memtype(resource_size_t start, resource_size_t end);
26
22#endif /* _ASM_X86_PAT_H */ 27#endif /* _ASM_X86_PAT_H */
diff --git a/arch/x86/include/asm/pci.h b/arch/x86/include/asm/pci.h
index 1ff685ca221c..f76a162c082c 100644
--- a/arch/x86/include/asm/pci.h
+++ b/arch/x86/include/asm/pci.h
@@ -48,7 +48,6 @@ extern unsigned int pcibios_assign_all_busses(void);
48#else 48#else
49#define pcibios_assign_all_busses() 0 49#define pcibios_assign_all_busses() 0
50#endif 50#endif
51#define pcibios_scan_all_fns(a, b) 0
52 51
53extern unsigned long pci_mem_start; 52extern unsigned long pci_mem_start;
54#define PCIBIOS_MIN_IO 0x1000 53#define PCIBIOS_MIN_IO 0x1000
diff --git a/arch/x86/include/asm/percpu.h b/arch/x86/include/asm/percpu.h
index 04eacefcfd26..b65a36defeb7 100644
--- a/arch/x86/include/asm/percpu.h
+++ b/arch/x86/include/asm/percpu.h
@@ -168,15 +168,6 @@ do { \
168/* We can use this directly for local CPU (faster). */ 168/* We can use this directly for local CPU (faster). */
169DECLARE_PER_CPU(unsigned long, this_cpu_off); 169DECLARE_PER_CPU(unsigned long, this_cpu_off);
170 170
171#ifdef CONFIG_NEED_MULTIPLE_NODES
172void *pcpu_lpage_remapped(void *kaddr);
173#else
174static inline void *pcpu_lpage_remapped(void *kaddr)
175{
176 return NULL;
177}
178#endif
179
180#endif /* !__ASSEMBLY__ */ 171#endif /* !__ASSEMBLY__ */
181 172
182#ifdef CONFIG_SMP 173#ifdef CONFIG_SMP
diff --git a/arch/x86/include/asm/processor.h b/arch/x86/include/asm/processor.h
index e08ea043e085..c3429e8b2424 100644
--- a/arch/x86/include/asm/processor.h
+++ b/arch/x86/include/asm/processor.h
@@ -27,6 +27,7 @@ struct mm_struct;
27#include <linux/cpumask.h> 27#include <linux/cpumask.h>
28#include <linux/cache.h> 28#include <linux/cache.h>
29#include <linux/threads.h> 29#include <linux/threads.h>
30#include <linux/math64.h>
30#include <linux/init.h> 31#include <linux/init.h>
31 32
32/* 33/*
@@ -1020,4 +1021,35 @@ extern void start_thread(struct pt_regs *regs, unsigned long new_ip,
1020extern int get_tsc_mode(unsigned long adr); 1021extern int get_tsc_mode(unsigned long adr);
1021extern int set_tsc_mode(unsigned int val); 1022extern int set_tsc_mode(unsigned int val);
1022 1023
1024extern int amd_get_nb_id(int cpu);
1025
1026struct aperfmperf {
1027 u64 aperf, mperf;
1028};
1029
1030static inline void get_aperfmperf(struct aperfmperf *am)
1031{
1032 WARN_ON_ONCE(!boot_cpu_has(X86_FEATURE_APERFMPERF));
1033
1034 rdmsrl(MSR_IA32_APERF, am->aperf);
1035 rdmsrl(MSR_IA32_MPERF, am->mperf);
1036}
1037
1038#define APERFMPERF_SHIFT 10
1039
1040static inline
1041unsigned long calc_aperfmperf_ratio(struct aperfmperf *old,
1042 struct aperfmperf *new)
1043{
1044 u64 aperf = new->aperf - old->aperf;
1045 u64 mperf = new->mperf - old->mperf;
1046 unsigned long ratio = aperf;
1047
1048 mperf >>= APERFMPERF_SHIFT;
1049 if (mperf)
1050 ratio = div64_u64(aperf, mperf);
1051
1052 return ratio;
1053}
1054
1023#endif /* _ASM_X86_PROCESSOR_H */ 1055#endif /* _ASM_X86_PROCESSOR_H */
diff --git a/arch/x86/include/asm/topology.h b/arch/x86/include/asm/topology.h
index 26d06e052a18..6f0695d744bf 100644
--- a/arch/x86/include/asm/topology.h
+++ b/arch/x86/include/asm/topology.h
@@ -116,15 +116,11 @@ extern unsigned long node_remap_size[];
116 116
117# define SD_CACHE_NICE_TRIES 1 117# define SD_CACHE_NICE_TRIES 1
118# define SD_IDLE_IDX 1 118# define SD_IDLE_IDX 1
119# define SD_NEWIDLE_IDX 2
120# define SD_FORKEXEC_IDX 0
121 119
122#else 120#else
123 121
124# define SD_CACHE_NICE_TRIES 2 122# define SD_CACHE_NICE_TRIES 2
125# define SD_IDLE_IDX 2 123# define SD_IDLE_IDX 2
126# define SD_NEWIDLE_IDX 2
127# define SD_FORKEXEC_IDX 1
128 124
129#endif 125#endif
130 126
@@ -137,22 +133,20 @@ extern unsigned long node_remap_size[];
137 .cache_nice_tries = SD_CACHE_NICE_TRIES, \ 133 .cache_nice_tries = SD_CACHE_NICE_TRIES, \
138 .busy_idx = 3, \ 134 .busy_idx = 3, \
139 .idle_idx = SD_IDLE_IDX, \ 135 .idle_idx = SD_IDLE_IDX, \
140 .newidle_idx = SD_NEWIDLE_IDX, \ 136 .newidle_idx = 0, \
141 .wake_idx = 1, \ 137 .wake_idx = 0, \
142 .forkexec_idx = SD_FORKEXEC_IDX, \ 138 .forkexec_idx = 0, \
143 \ 139 \
144 .flags = 1*SD_LOAD_BALANCE \ 140 .flags = 1*SD_LOAD_BALANCE \
145 | 1*SD_BALANCE_NEWIDLE \ 141 | 1*SD_BALANCE_NEWIDLE \
146 | 1*SD_BALANCE_EXEC \ 142 | 1*SD_BALANCE_EXEC \
147 | 1*SD_BALANCE_FORK \ 143 | 1*SD_BALANCE_FORK \
148 | 0*SD_WAKE_IDLE \ 144 | 0*SD_BALANCE_WAKE \
149 | 1*SD_WAKE_AFFINE \ 145 | 1*SD_WAKE_AFFINE \
150 | 1*SD_WAKE_BALANCE \
151 | 0*SD_SHARE_CPUPOWER \ 146 | 0*SD_SHARE_CPUPOWER \
152 | 0*SD_POWERSAVINGS_BALANCE \ 147 | 0*SD_POWERSAVINGS_BALANCE \
153 | 0*SD_SHARE_PKG_RESOURCES \ 148 | 0*SD_SHARE_PKG_RESOURCES \
154 | 1*SD_SERIALIZE \ 149 | 1*SD_SERIALIZE \
155 | 1*SD_WAKE_IDLE_FAR \
156 | 0*SD_PREFER_SIBLING \ 150 | 0*SD_PREFER_SIBLING \
157 , \ 151 , \
158 .last_balance = jiffies, \ 152 .last_balance = jiffies, \
diff --git a/arch/x86/kernel/Makefile b/arch/x86/kernel/Makefile
index 430d5b24af7b..832cb838cb48 100644
--- a/arch/x86/kernel/Makefile
+++ b/arch/x86/kernel/Makefile
@@ -52,6 +52,7 @@ obj-$(CONFIG_X86_DS_SELFTEST) += ds_selftest.o
52obj-$(CONFIG_X86_32) += tls.o 52obj-$(CONFIG_X86_32) += tls.o
53obj-$(CONFIG_IA32_EMULATION) += tls.o 53obj-$(CONFIG_IA32_EMULATION) += tls.o
54obj-y += step.o 54obj-y += step.o
55obj-$(CONFIG_INTEL_TXT) += tboot.o
55obj-$(CONFIG_STACKTRACE) += stacktrace.o 56obj-$(CONFIG_STACKTRACE) += stacktrace.o
56obj-y += cpu/ 57obj-y += cpu/
57obj-y += acpi/ 58obj-y += acpi/
diff --git a/arch/x86/kernel/apic/nmi.c b/arch/x86/kernel/apic/nmi.c
index db7220220d09..cb66a22d98ad 100644
--- a/arch/x86/kernel/apic/nmi.c
+++ b/arch/x86/kernel/apic/nmi.c
@@ -66,7 +66,7 @@ static inline unsigned int get_nmi_count(int cpu)
66 66
67static inline int mce_in_progress(void) 67static inline int mce_in_progress(void)
68{ 68{
69#if defined(CONFIG_X86_NEW_MCE) 69#if defined(CONFIG_X86_MCE)
70 return atomic_read(&mce_entry) > 0; 70 return atomic_read(&mce_entry) > 0;
71#endif 71#endif
72 return 0; 72 return 0;
diff --git a/arch/x86/kernel/cpu/Makefile b/arch/x86/kernel/cpu/Makefile
index c1f253dac155..8dd30638fe44 100644
--- a/arch/x86/kernel/cpu/Makefile
+++ b/arch/x86/kernel/cpu/Makefile
@@ -13,7 +13,7 @@ CFLAGS_common.o := $(nostackp)
13 13
14obj-y := intel_cacheinfo.o addon_cpuid_features.o 14obj-y := intel_cacheinfo.o addon_cpuid_features.o
15obj-y += proc.o capflags.o powerflags.o common.o 15obj-y += proc.o capflags.o powerflags.o common.o
16obj-y += vmware.o hypervisor.o 16obj-y += vmware.o hypervisor.o sched.o
17 17
18obj-$(CONFIG_X86_32) += bugs.o cmpxchg.o 18obj-$(CONFIG_X86_32) += bugs.o cmpxchg.o
19obj-$(CONFIG_X86_64) += bugs_64.o 19obj-$(CONFIG_X86_64) += bugs_64.o
diff --git a/arch/x86/kernel/cpu/amd.c b/arch/x86/kernel/cpu/amd.c
index 22a47c82f3c0..f32fa71ccf97 100644
--- a/arch/x86/kernel/cpu/amd.c
+++ b/arch/x86/kernel/cpu/amd.c
@@ -333,6 +333,16 @@ static void __cpuinit amd_detect_cmp(struct cpuinfo_x86 *c)
333#endif 333#endif
334} 334}
335 335
336int amd_get_nb_id(int cpu)
337{
338 int id = 0;
339#ifdef CONFIG_SMP
340 id = per_cpu(cpu_llc_id, cpu);
341#endif
342 return id;
343}
344EXPORT_SYMBOL_GPL(amd_get_nb_id);
345
336static void __cpuinit srat_detect_node(struct cpuinfo_x86 *c) 346static void __cpuinit srat_detect_node(struct cpuinfo_x86 *c)
337{ 347{
338#if defined(CONFIG_NUMA) && defined(CONFIG_X86_64) 348#if defined(CONFIG_NUMA) && defined(CONFIG_X86_64)
diff --git a/arch/x86/kernel/cpu/cpu_debug.c b/arch/x86/kernel/cpu/cpu_debug.c
index 6b2a52dd0403..dca325c03999 100644
--- a/arch/x86/kernel/cpu/cpu_debug.c
+++ b/arch/x86/kernel/cpu/cpu_debug.c
@@ -30,8 +30,8 @@
30#include <asm/apic.h> 30#include <asm/apic.h>
31#include <asm/desc.h> 31#include <asm/desc.h>
32 32
33static DEFINE_PER_CPU(struct cpu_cpuX_base, cpu_arr[CPU_REG_ALL_BIT]); 33static DEFINE_PER_CPU(struct cpu_cpuX_base [CPU_REG_ALL_BIT], cpu_arr);
34static DEFINE_PER_CPU(struct cpu_private *, priv_arr[MAX_CPU_FILES]); 34static DEFINE_PER_CPU(struct cpu_private * [MAX_CPU_FILES], priv_arr);
35static DEFINE_PER_CPU(int, cpu_priv_count); 35static DEFINE_PER_CPU(int, cpu_priv_count);
36 36
37static DEFINE_MUTEX(cpu_debug_lock); 37static DEFINE_MUTEX(cpu_debug_lock);
diff --git a/arch/x86/kernel/cpu/cpufreq/acpi-cpufreq.c b/arch/x86/kernel/cpu/cpufreq/acpi-cpufreq.c
index ae9b503220ca..4109679863c1 100644
--- a/arch/x86/kernel/cpu/cpufreq/acpi-cpufreq.c
+++ b/arch/x86/kernel/cpu/cpufreq/acpi-cpufreq.c
@@ -60,7 +60,6 @@ enum {
60}; 60};
61 61
62#define INTEL_MSR_RANGE (0xffff) 62#define INTEL_MSR_RANGE (0xffff)
63#define CPUID_6_ECX_APERFMPERF_CAPABILITY (0x1)
64 63
65struct acpi_cpufreq_data { 64struct acpi_cpufreq_data {
66 struct acpi_processor_performance *acpi_data; 65 struct acpi_processor_performance *acpi_data;
@@ -71,11 +70,7 @@ struct acpi_cpufreq_data {
71 70
72static DEFINE_PER_CPU(struct acpi_cpufreq_data *, drv_data); 71static DEFINE_PER_CPU(struct acpi_cpufreq_data *, drv_data);
73 72
74struct acpi_msr_data { 73static DEFINE_PER_CPU(struct aperfmperf, old_perf);
75 u64 saved_aperf, saved_mperf;
76};
77
78static DEFINE_PER_CPU(struct acpi_msr_data, msr_data);
79 74
80DEFINE_TRACE(power_mark); 75DEFINE_TRACE(power_mark);
81 76
@@ -244,23 +239,12 @@ static u32 get_cur_val(const struct cpumask *mask)
244 return cmd.val; 239 return cmd.val;
245} 240}
246 241
247struct perf_pair {
248 union {
249 struct {
250 u32 lo;
251 u32 hi;
252 } split;
253 u64 whole;
254 } aperf, mperf;
255};
256
257/* Called via smp_call_function_single(), on the target CPU */ 242/* Called via smp_call_function_single(), on the target CPU */
258static void read_measured_perf_ctrs(void *_cur) 243static void read_measured_perf_ctrs(void *_cur)
259{ 244{
260 struct perf_pair *cur = _cur; 245 struct aperfmperf *am = _cur;
261 246
262 rdmsr(MSR_IA32_APERF, cur->aperf.split.lo, cur->aperf.split.hi); 247 get_aperfmperf(am);
263 rdmsr(MSR_IA32_MPERF, cur->mperf.split.lo, cur->mperf.split.hi);
264} 248}
265 249
266/* 250/*
@@ -279,63 +263,17 @@ static void read_measured_perf_ctrs(void *_cur)
279static unsigned int get_measured_perf(struct cpufreq_policy *policy, 263static unsigned int get_measured_perf(struct cpufreq_policy *policy,
280 unsigned int cpu) 264 unsigned int cpu)
281{ 265{
282 struct perf_pair readin, cur; 266 struct aperfmperf perf;
283 unsigned int perf_percent; 267 unsigned long ratio;
284 unsigned int retval; 268 unsigned int retval;
285 269
286 if (smp_call_function_single(cpu, read_measured_perf_ctrs, &readin, 1)) 270 if (smp_call_function_single(cpu, read_measured_perf_ctrs, &perf, 1))
287 return 0; 271 return 0;
288 272
289 cur.aperf.whole = readin.aperf.whole - 273 ratio = calc_aperfmperf_ratio(&per_cpu(old_perf, cpu), &perf);
290 per_cpu(msr_data, cpu).saved_aperf; 274 per_cpu(old_perf, cpu) = perf;
291 cur.mperf.whole = readin.mperf.whole -
292 per_cpu(msr_data, cpu).saved_mperf;
293 per_cpu(msr_data, cpu).saved_aperf = readin.aperf.whole;
294 per_cpu(msr_data, cpu).saved_mperf = readin.mperf.whole;
295
296#ifdef __i386__
297 /*
298 * We dont want to do 64 bit divide with 32 bit kernel
299 * Get an approximate value. Return failure in case we cannot get
300 * an approximate value.
301 */
302 if (unlikely(cur.aperf.split.hi || cur.mperf.split.hi)) {
303 int shift_count;
304 u32 h;
305
306 h = max_t(u32, cur.aperf.split.hi, cur.mperf.split.hi);
307 shift_count = fls(h);
308
309 cur.aperf.whole >>= shift_count;
310 cur.mperf.whole >>= shift_count;
311 }
312
313 if (((unsigned long)(-1) / 100) < cur.aperf.split.lo) {
314 int shift_count = 7;
315 cur.aperf.split.lo >>= shift_count;
316 cur.mperf.split.lo >>= shift_count;
317 }
318
319 if (cur.aperf.split.lo && cur.mperf.split.lo)
320 perf_percent = (cur.aperf.split.lo * 100) / cur.mperf.split.lo;
321 else
322 perf_percent = 0;
323 275
324#else 276 retval = (policy->cpuinfo.max_freq * ratio) >> APERFMPERF_SHIFT;
325 if (unlikely(((unsigned long)(-1) / 100) < cur.aperf.whole)) {
326 int shift_count = 7;
327 cur.aperf.whole >>= shift_count;
328 cur.mperf.whole >>= shift_count;
329 }
330
331 if (cur.aperf.whole && cur.mperf.whole)
332 perf_percent = (cur.aperf.whole * 100) / cur.mperf.whole;
333 else
334 perf_percent = 0;
335
336#endif
337
338 retval = (policy->cpuinfo.max_freq * perf_percent) / 100;
339 277
340 return retval; 278 return retval;
341} 279}
@@ -731,12 +669,8 @@ static int acpi_cpufreq_cpu_init(struct cpufreq_policy *policy)
731 acpi_processor_notify_smm(THIS_MODULE); 669 acpi_processor_notify_smm(THIS_MODULE);
732 670
733 /* Check for APERF/MPERF support in hardware */ 671 /* Check for APERF/MPERF support in hardware */
734 if (c->x86_vendor == X86_VENDOR_INTEL && c->cpuid_level >= 6) { 672 if (cpu_has(c, X86_FEATURE_APERFMPERF))
735 unsigned int ecx; 673 acpi_cpufreq_driver.getavg = get_measured_perf;
736 ecx = cpuid_ecx(6);
737 if (ecx & CPUID_6_ECX_APERFMPERF_CAPABILITY)
738 acpi_cpufreq_driver.getavg = get_measured_perf;
739 }
740 674
741 dprintk("CPU%u - ACPI performance management activated.\n", cpu); 675 dprintk("CPU%u - ACPI performance management activated.\n", cpu);
742 for (i = 0; i < perf->state_count; i++) 676 for (i = 0; i < perf->state_count; i++)
diff --git a/arch/x86/kernel/cpu/intel.c b/arch/x86/kernel/cpu/intel.c
index 80a722a071b5..40e1835b35e8 100644
--- a/arch/x86/kernel/cpu/intel.c
+++ b/arch/x86/kernel/cpu/intel.c
@@ -350,6 +350,12 @@ static void __cpuinit init_intel(struct cpuinfo_x86 *c)
350 set_cpu_cap(c, X86_FEATURE_ARCH_PERFMON); 350 set_cpu_cap(c, X86_FEATURE_ARCH_PERFMON);
351 } 351 }
352 352
353 if (c->cpuid_level > 6) {
354 unsigned ecx = cpuid_ecx(6);
355 if (ecx & 0x01)
356 set_cpu_cap(c, X86_FEATURE_APERFMPERF);
357 }
358
353 if (cpu_has_xmm2) 359 if (cpu_has_xmm2)
354 set_cpu_cap(c, X86_FEATURE_LFENCE_RDTSC); 360 set_cpu_cap(c, X86_FEATURE_LFENCE_RDTSC);
355 if (cpu_has_ds) { 361 if (cpu_has_ds) {
diff --git a/arch/x86/kernel/cpu/mcheck/Makefile b/arch/x86/kernel/cpu/mcheck/Makefile
index 188a1ca5ad2b..4ac6d48fe11b 100644
--- a/arch/x86/kernel/cpu/mcheck/Makefile
+++ b/arch/x86/kernel/cpu/mcheck/Makefile
@@ -1,11 +1,8 @@
1obj-y = mce.o 1obj-y = mce.o mce-severity.o
2 2
3obj-$(CONFIG_X86_NEW_MCE) += mce-severity.o
4obj-$(CONFIG_X86_OLD_MCE) += k7.o p4.o p6.o
5obj-$(CONFIG_X86_ANCIENT_MCE) += winchip.o p5.o 3obj-$(CONFIG_X86_ANCIENT_MCE) += winchip.o p5.o
6obj-$(CONFIG_X86_MCE_INTEL) += mce_intel.o 4obj-$(CONFIG_X86_MCE_INTEL) += mce_intel.o
7obj-$(CONFIG_X86_MCE_AMD) += mce_amd.o 5obj-$(CONFIG_X86_MCE_AMD) += mce_amd.o
8obj-$(CONFIG_X86_MCE_NONFATAL) += non-fatal.o
9obj-$(CONFIG_X86_MCE_THRESHOLD) += threshold.o 6obj-$(CONFIG_X86_MCE_THRESHOLD) += threshold.o
10obj-$(CONFIG_X86_MCE_INJECT) += mce-inject.o 7obj-$(CONFIG_X86_MCE_INJECT) += mce-inject.o
11 8
diff --git a/arch/x86/kernel/cpu/mcheck/k7.c b/arch/x86/kernel/cpu/mcheck/k7.c
deleted file mode 100644
index b945d5dbc609..000000000000
--- a/arch/x86/kernel/cpu/mcheck/k7.c
+++ /dev/null
@@ -1,116 +0,0 @@
1/*
2 * Athlon specific Machine Check Exception Reporting
3 * (C) Copyright 2002 Dave Jones <davej@redhat.com>
4 */
5#include <linux/interrupt.h>
6#include <linux/kernel.h>
7#include <linux/types.h>
8#include <linux/init.h>
9#include <linux/smp.h>
10
11#include <asm/processor.h>
12#include <asm/system.h>
13#include <asm/mce.h>
14#include <asm/msr.h>
15
16/* Machine Check Handler For AMD Athlon/Duron: */
17static void k7_machine_check(struct pt_regs *regs, long error_code)
18{
19 u32 alow, ahigh, high, low;
20 u32 mcgstl, mcgsth;
21 int recover = 1;
22 int i;
23
24 rdmsr(MSR_IA32_MCG_STATUS, mcgstl, mcgsth);
25 if (mcgstl & (1<<0)) /* Recoverable ? */
26 recover = 0;
27
28 printk(KERN_EMERG "CPU %d: Machine Check Exception: %08x%08x\n",
29 smp_processor_id(), mcgsth, mcgstl);
30
31 for (i = 1; i < nr_mce_banks; i++) {
32 rdmsr(MSR_IA32_MC0_STATUS+i*4, low, high);
33 if (high & (1<<31)) {
34 char misc[20];
35 char addr[24];
36
37 misc[0] = '\0';
38 addr[0] = '\0';
39
40 if (high & (1<<29))
41 recover |= 1;
42 if (high & (1<<25))
43 recover |= 2;
44 high &= ~(1<<31);
45
46 if (high & (1<<27)) {
47 rdmsr(MSR_IA32_MC0_MISC+i*4, alow, ahigh);
48 snprintf(misc, 20, "[%08x%08x]", ahigh, alow);
49 }
50 if (high & (1<<26)) {
51 rdmsr(MSR_IA32_MC0_ADDR+i*4, alow, ahigh);
52 snprintf(addr, 24, " at %08x%08x", ahigh, alow);
53 }
54
55 printk(KERN_EMERG "CPU %d: Bank %d: %08x%08x%s%s\n",
56 smp_processor_id(), i, high, low, misc, addr);
57
58 /* Clear it: */
59 wrmsr(MSR_IA32_MC0_STATUS+i*4, 0UL, 0UL);
60 /* Serialize: */
61 wmb();
62 add_taint(TAINT_MACHINE_CHECK);
63 }
64 }
65
66 if (recover & 2)
67 panic("CPU context corrupt");
68 if (recover & 1)
69 panic("Unable to continue");
70
71 printk(KERN_EMERG "Attempting to continue.\n");
72
73 mcgstl &= ~(1<<2);
74 wrmsr(MSR_IA32_MCG_STATUS, mcgstl, mcgsth);
75}
76
77
78/* AMD K7 machine check is Intel like: */
79void amd_mcheck_init(struct cpuinfo_x86 *c)
80{
81 u32 l, h;
82 int i;
83
84 if (!cpu_has(c, X86_FEATURE_MCE))
85 return;
86
87 machine_check_vector = k7_machine_check;
88 /* Make sure the vector pointer is visible before we enable MCEs: */
89 wmb();
90
91 printk(KERN_INFO "Intel machine check architecture supported.\n");
92
93 rdmsr(MSR_IA32_MCG_CAP, l, h);
94 if (l & (1<<8)) /* Control register present ? */
95 wrmsr(MSR_IA32_MCG_CTL, 0xffffffff, 0xffffffff);
96 nr_mce_banks = l & 0xff;
97
98 /*
99 * Clear status for MC index 0 separately, we don't touch CTL,
100 * as some K7 Athlons cause spurious MCEs when its enabled:
101 */
102 if (boot_cpu_data.x86 == 6) {
103 wrmsr(MSR_IA32_MC0_STATUS, 0x0, 0x0);
104 i = 1;
105 } else
106 i = 0;
107
108 for (; i < nr_mce_banks; i++) {
109 wrmsr(MSR_IA32_MC0_CTL+4*i, 0xffffffff, 0xffffffff);
110 wrmsr(MSR_IA32_MC0_STATUS+4*i, 0x0, 0x0);
111 }
112
113 set_in_cr4(X86_CR4_MCE);
114 printk(KERN_INFO "Intel machine check reporting enabled on CPU#%d.\n",
115 smp_processor_id());
116}
diff --git a/arch/x86/kernel/cpu/mcheck/mce-inject.c b/arch/x86/kernel/cpu/mcheck/mce-inject.c
index a3a235a53f09..7029f0e2acad 100644
--- a/arch/x86/kernel/cpu/mcheck/mce-inject.c
+++ b/arch/x86/kernel/cpu/mcheck/mce-inject.c
@@ -18,7 +18,12 @@
18#include <linux/string.h> 18#include <linux/string.h>
19#include <linux/fs.h> 19#include <linux/fs.h>
20#include <linux/smp.h> 20#include <linux/smp.h>
21#include <linux/notifier.h>
22#include <linux/kdebug.h>
23#include <linux/cpu.h>
24#include <linux/sched.h>
21#include <asm/mce.h> 25#include <asm/mce.h>
26#include <asm/apic.h>
22 27
23/* Update fake mce registers on current CPU. */ 28/* Update fake mce registers on current CPU. */
24static void inject_mce(struct mce *m) 29static void inject_mce(struct mce *m)
@@ -39,44 +44,141 @@ static void inject_mce(struct mce *m)
39 i->finished = 1; 44 i->finished = 1;
40} 45}
41 46
42struct delayed_mce { 47static void raise_poll(struct mce *m)
43 struct timer_list timer; 48{
44 struct mce m; 49 unsigned long flags;
45}; 50 mce_banks_t b;
46 51
47/* Inject mce on current CPU */ 52 memset(&b, 0xff, sizeof(mce_banks_t));
48static void raise_mce(unsigned long data) 53 local_irq_save(flags);
54 machine_check_poll(0, &b);
55 local_irq_restore(flags);
56 m->finished = 0;
57}
58
59static void raise_exception(struct mce *m, struct pt_regs *pregs)
49{ 60{
50 struct delayed_mce *dm = (struct delayed_mce *)data; 61 struct pt_regs regs;
51 struct mce *m = &dm->m; 62 unsigned long flags;
52 int cpu = m->extcpu;
53 63
54 inject_mce(m); 64 if (!pregs) {
55 if (m->status & MCI_STATUS_UC) {
56 struct pt_regs regs;
57 memset(&regs, 0, sizeof(struct pt_regs)); 65 memset(&regs, 0, sizeof(struct pt_regs));
58 regs.ip = m->ip; 66 regs.ip = m->ip;
59 regs.cs = m->cs; 67 regs.cs = m->cs;
68 pregs = &regs;
69 }
70 /* in mcheck exeception handler, irq will be disabled */
71 local_irq_save(flags);
72 do_machine_check(pregs, 0);
73 local_irq_restore(flags);
74 m->finished = 0;
75}
76
77static cpumask_t mce_inject_cpumask;
78
79static int mce_raise_notify(struct notifier_block *self,
80 unsigned long val, void *data)
81{
82 struct die_args *args = (struct die_args *)data;
83 int cpu = smp_processor_id();
84 struct mce *m = &__get_cpu_var(injectm);
85 if (val != DIE_NMI_IPI || !cpu_isset(cpu, mce_inject_cpumask))
86 return NOTIFY_DONE;
87 cpu_clear(cpu, mce_inject_cpumask);
88 if (m->inject_flags & MCJ_EXCEPTION)
89 raise_exception(m, args->regs);
90 else if (m->status)
91 raise_poll(m);
92 return NOTIFY_STOP;
93}
94
95static struct notifier_block mce_raise_nb = {
96 .notifier_call = mce_raise_notify,
97 .priority = 1000,
98};
99
100/* Inject mce on current CPU */
101static int raise_local(struct mce *m)
102{
103 int context = MCJ_CTX(m->inject_flags);
104 int ret = 0;
105 int cpu = m->extcpu;
106
107 if (m->inject_flags & MCJ_EXCEPTION) {
60 printk(KERN_INFO "Triggering MCE exception on CPU %d\n", cpu); 108 printk(KERN_INFO "Triggering MCE exception on CPU %d\n", cpu);
61 do_machine_check(&regs, 0); 109 switch (context) {
110 case MCJ_CTX_IRQ:
111 /*
112 * Could do more to fake interrupts like
113 * calling irq_enter, but the necessary
114 * machinery isn't exported currently.
115 */
116 /*FALL THROUGH*/
117 case MCJ_CTX_PROCESS:
118 raise_exception(m, NULL);
119 break;
120 default:
121 printk(KERN_INFO "Invalid MCE context\n");
122 ret = -EINVAL;
123 }
62 printk(KERN_INFO "MCE exception done on CPU %d\n", cpu); 124 printk(KERN_INFO "MCE exception done on CPU %d\n", cpu);
63 } else { 125 } else if (m->status) {
64 mce_banks_t b;
65 memset(&b, 0xff, sizeof(mce_banks_t));
66 printk(KERN_INFO "Starting machine check poll CPU %d\n", cpu); 126 printk(KERN_INFO "Starting machine check poll CPU %d\n", cpu);
67 machine_check_poll(0, &b); 127 raise_poll(m);
68 mce_notify_irq(); 128 mce_notify_irq();
69 printk(KERN_INFO "Finished machine check poll on CPU %d\n", 129 printk(KERN_INFO "Machine check poll done on CPU %d\n", cpu);
70 cpu); 130 } else
71 } 131 m->finished = 0;
72 kfree(dm); 132
133 return ret;
134}
135
136static void raise_mce(struct mce *m)
137{
138 int context = MCJ_CTX(m->inject_flags);
139
140 inject_mce(m);
141
142 if (context == MCJ_CTX_RANDOM)
143 return;
144
145#ifdef CONFIG_X86_LOCAL_APIC
146 if (m->inject_flags & MCJ_NMI_BROADCAST) {
147 unsigned long start;
148 int cpu;
149 get_online_cpus();
150 mce_inject_cpumask = cpu_online_map;
151 cpu_clear(get_cpu(), mce_inject_cpumask);
152 for_each_online_cpu(cpu) {
153 struct mce *mcpu = &per_cpu(injectm, cpu);
154 if (!mcpu->finished ||
155 MCJ_CTX(mcpu->inject_flags) != MCJ_CTX_RANDOM)
156 cpu_clear(cpu, mce_inject_cpumask);
157 }
158 if (!cpus_empty(mce_inject_cpumask))
159 apic->send_IPI_mask(&mce_inject_cpumask, NMI_VECTOR);
160 start = jiffies;
161 while (!cpus_empty(mce_inject_cpumask)) {
162 if (!time_before(jiffies, start + 2*HZ)) {
163 printk(KERN_ERR
164 "Timeout waiting for mce inject NMI %lx\n",
165 *cpus_addr(mce_inject_cpumask));
166 break;
167 }
168 cpu_relax();
169 }
170 raise_local(m);
171 put_cpu();
172 put_online_cpus();
173 } else
174#endif
175 raise_local(m);
73} 176}
74 177
75/* Error injection interface */ 178/* Error injection interface */
76static ssize_t mce_write(struct file *filp, const char __user *ubuf, 179static ssize_t mce_write(struct file *filp, const char __user *ubuf,
77 size_t usize, loff_t *off) 180 size_t usize, loff_t *off)
78{ 181{
79 struct delayed_mce *dm;
80 struct mce m; 182 struct mce m;
81 183
82 if (!capable(CAP_SYS_ADMIN)) 184 if (!capable(CAP_SYS_ADMIN))
@@ -96,19 +198,12 @@ static ssize_t mce_write(struct file *filp, const char __user *ubuf,
96 if (m.extcpu >= num_possible_cpus() || !cpu_online(m.extcpu)) 198 if (m.extcpu >= num_possible_cpus() || !cpu_online(m.extcpu))
97 return -EINVAL; 199 return -EINVAL;
98 200
99 dm = kmalloc(sizeof(struct delayed_mce), GFP_KERNEL);
100 if (!dm)
101 return -ENOMEM;
102
103 /* 201 /*
104 * Need to give user space some time to set everything up, 202 * Need to give user space some time to set everything up,
105 * so do it a jiffie or two later everywhere. 203 * so do it a jiffie or two later everywhere.
106 * Should we use a hrtimer here for better synchronization?
107 */ 204 */
108 memcpy(&dm->m, &m, sizeof(struct mce)); 205 schedule_timeout(2);
109 setup_timer(&dm->timer, raise_mce, (unsigned long)dm); 206 raise_mce(&m);
110 dm->timer.expires = jiffies + 2;
111 add_timer_on(&dm->timer, m.extcpu);
112 return usize; 207 return usize;
113} 208}
114 209
@@ -116,6 +211,7 @@ static int inject_init(void)
116{ 211{
117 printk(KERN_INFO "Machine check injector initialized\n"); 212 printk(KERN_INFO "Machine check injector initialized\n");
118 mce_chrdev_ops.write = mce_write; 213 mce_chrdev_ops.write = mce_write;
214 register_die_notifier(&mce_raise_nb);
119 return 0; 215 return 0;
120} 216}
121 217
diff --git a/arch/x86/kernel/cpu/mcheck/mce-internal.h b/arch/x86/kernel/cpu/mcheck/mce-internal.h
index 54dcb8ff12e5..32996f9fab67 100644
--- a/arch/x86/kernel/cpu/mcheck/mce-internal.h
+++ b/arch/x86/kernel/cpu/mcheck/mce-internal.h
@@ -1,3 +1,4 @@
1#include <linux/sysdev.h>
1#include <asm/mce.h> 2#include <asm/mce.h>
2 3
3enum severity_level { 4enum severity_level {
@@ -10,6 +11,20 @@ enum severity_level {
10 MCE_PANIC_SEVERITY, 11 MCE_PANIC_SEVERITY,
11}; 12};
12 13
14#define ATTR_LEN 16
15
16/* One object for each MCE bank, shared by all CPUs */
17struct mce_bank {
18 u64 ctl; /* subevents to enable */
19 unsigned char init; /* initialise bank? */
20 struct sysdev_attribute attr; /* sysdev attribute */
21 char attrname[ATTR_LEN]; /* attribute name */
22};
23
13int mce_severity(struct mce *a, int tolerant, char **msg); 24int mce_severity(struct mce *a, int tolerant, char **msg);
25struct dentry *mce_get_debugfs_dir(void);
14 26
15extern int mce_ser; 27extern int mce_ser;
28
29extern struct mce_bank *mce_banks;
30
diff --git a/arch/x86/kernel/cpu/mcheck/mce-severity.c b/arch/x86/kernel/cpu/mcheck/mce-severity.c
index ff0807f97056..8a85dd1b1aa1 100644
--- a/arch/x86/kernel/cpu/mcheck/mce-severity.c
+++ b/arch/x86/kernel/cpu/mcheck/mce-severity.c
@@ -139,6 +139,7 @@ int mce_severity(struct mce *a, int tolerant, char **msg)
139 } 139 }
140} 140}
141 141
142#ifdef CONFIG_DEBUG_FS
142static void *s_start(struct seq_file *f, loff_t *pos) 143static void *s_start(struct seq_file *f, loff_t *pos)
143{ 144{
144 if (*pos >= ARRAY_SIZE(severities)) 145 if (*pos >= ARRAY_SIZE(severities))
@@ -197,7 +198,7 @@ static int __init severities_debugfs_init(void)
197{ 198{
198 struct dentry *dmce = NULL, *fseverities_coverage = NULL; 199 struct dentry *dmce = NULL, *fseverities_coverage = NULL;
199 200
200 dmce = debugfs_create_dir("mce", NULL); 201 dmce = mce_get_debugfs_dir();
201 if (dmce == NULL) 202 if (dmce == NULL)
202 goto err_out; 203 goto err_out;
203 fseverities_coverage = debugfs_create_file("severities-coverage", 204 fseverities_coverage = debugfs_create_file("severities-coverage",
@@ -209,10 +210,7 @@ static int __init severities_debugfs_init(void)
209 return 0; 210 return 0;
210 211
211err_out: 212err_out:
212 if (fseverities_coverage)
213 debugfs_remove(fseverities_coverage);
214 if (dmce)
215 debugfs_remove(dmce);
216 return -ENOMEM; 213 return -ENOMEM;
217} 214}
218late_initcall(severities_debugfs_init); 215late_initcall(severities_debugfs_init);
216#endif
diff --git a/arch/x86/kernel/cpu/mcheck/mce.c b/arch/x86/kernel/cpu/mcheck/mce.c
index 9bfe9d2ea615..2f5aab26320e 100644
--- a/arch/x86/kernel/cpu/mcheck/mce.c
+++ b/arch/x86/kernel/cpu/mcheck/mce.c
@@ -34,6 +34,7 @@
34#include <linux/smp.h> 34#include <linux/smp.h>
35#include <linux/fs.h> 35#include <linux/fs.h>
36#include <linux/mm.h> 36#include <linux/mm.h>
37#include <linux/debugfs.h>
37 38
38#include <asm/processor.h> 39#include <asm/processor.h>
39#include <asm/hw_irq.h> 40#include <asm/hw_irq.h>
@@ -45,21 +46,8 @@
45 46
46#include "mce-internal.h" 47#include "mce-internal.h"
47 48
48/* Handle unconfigured int18 (should never happen) */
49static void unexpected_machine_check(struct pt_regs *regs, long error_code)
50{
51 printk(KERN_ERR "CPU#%d: Unexpected int18 (Machine Check).\n",
52 smp_processor_id());
53}
54
55/* Call the installed machine check handler for this CPU setup. */
56void (*machine_check_vector)(struct pt_regs *, long error_code) =
57 unexpected_machine_check;
58
59int mce_disabled __read_mostly; 49int mce_disabled __read_mostly;
60 50
61#ifdef CONFIG_X86_NEW_MCE
62
63#define MISC_MCELOG_MINOR 227 51#define MISC_MCELOG_MINOR 227
64 52
65#define SPINUNIT 100 /* 100ns */ 53#define SPINUNIT 100 /* 100ns */
@@ -77,7 +65,6 @@ DEFINE_PER_CPU(unsigned, mce_exception_count);
77 */ 65 */
78static int tolerant __read_mostly = 1; 66static int tolerant __read_mostly = 1;
79static int banks __read_mostly; 67static int banks __read_mostly;
80static u64 *bank __read_mostly;
81static int rip_msr __read_mostly; 68static int rip_msr __read_mostly;
82static int mce_bootlog __read_mostly = -1; 69static int mce_bootlog __read_mostly = -1;
83static int monarch_timeout __read_mostly = -1; 70static int monarch_timeout __read_mostly = -1;
@@ -87,13 +74,13 @@ int mce_cmci_disabled __read_mostly;
87int mce_ignore_ce __read_mostly; 74int mce_ignore_ce __read_mostly;
88int mce_ser __read_mostly; 75int mce_ser __read_mostly;
89 76
77struct mce_bank *mce_banks __read_mostly;
78
90/* User mode helper program triggered by machine check event */ 79/* User mode helper program triggered by machine check event */
91static unsigned long mce_need_notify; 80static unsigned long mce_need_notify;
92static char mce_helper[128]; 81static char mce_helper[128];
93static char *mce_helper_argv[2] = { mce_helper, NULL }; 82static char *mce_helper_argv[2] = { mce_helper, NULL };
94 83
95static unsigned long dont_init_banks;
96
97static DECLARE_WAIT_QUEUE_HEAD(mce_wait); 84static DECLARE_WAIT_QUEUE_HEAD(mce_wait);
98static DEFINE_PER_CPU(struct mce, mces_seen); 85static DEFINE_PER_CPU(struct mce, mces_seen);
99static int cpu_missing; 86static int cpu_missing;
@@ -104,11 +91,6 @@ DEFINE_PER_CPU(mce_banks_t, mce_poll_banks) = {
104 [0 ... BITS_TO_LONGS(MAX_NR_BANKS)-1] = ~0UL 91 [0 ... BITS_TO_LONGS(MAX_NR_BANKS)-1] = ~0UL
105}; 92};
106 93
107static inline int skip_bank_init(int i)
108{
109 return i < BITS_PER_LONG && test_bit(i, &dont_init_banks);
110}
111
112static DEFINE_PER_CPU(struct work_struct, mce_work); 94static DEFINE_PER_CPU(struct work_struct, mce_work);
113 95
114/* Do initial initialization of a struct mce */ 96/* Do initial initialization of a struct mce */
@@ -232,6 +214,9 @@ static void print_mce_tail(void)
232 214
233static atomic_t mce_paniced; 215static atomic_t mce_paniced;
234 216
217static int fake_panic;
218static atomic_t mce_fake_paniced;
219
235/* Panic in progress. Enable interrupts and wait for final IPI */ 220/* Panic in progress. Enable interrupts and wait for final IPI */
236static void wait_for_panic(void) 221static void wait_for_panic(void)
237{ 222{
@@ -249,15 +234,21 @@ static void mce_panic(char *msg, struct mce *final, char *exp)
249{ 234{
250 int i; 235 int i;
251 236
252 /* 237 if (!fake_panic) {
253 * Make sure only one CPU runs in machine check panic 238 /*
254 */ 239 * Make sure only one CPU runs in machine check panic
255 if (atomic_add_return(1, &mce_paniced) > 1) 240 */
256 wait_for_panic(); 241 if (atomic_inc_return(&mce_paniced) > 1)
257 barrier(); 242 wait_for_panic();
243 barrier();
258 244
259 bust_spinlocks(1); 245 bust_spinlocks(1);
260 console_verbose(); 246 console_verbose();
247 } else {
248 /* Don't log too much for fake panic */
249 if (atomic_inc_return(&mce_fake_paniced) > 1)
250 return;
251 }
261 print_mce_head(); 252 print_mce_head();
262 /* First print corrected ones that are still unlogged */ 253 /* First print corrected ones that are still unlogged */
263 for (i = 0; i < MCE_LOG_LEN; i++) { 254 for (i = 0; i < MCE_LOG_LEN; i++) {
@@ -284,9 +275,12 @@ static void mce_panic(char *msg, struct mce *final, char *exp)
284 print_mce_tail(); 275 print_mce_tail();
285 if (exp) 276 if (exp)
286 printk(KERN_EMERG "Machine check: %s\n", exp); 277 printk(KERN_EMERG "Machine check: %s\n", exp);
287 if (panic_timeout == 0) 278 if (!fake_panic) {
288 panic_timeout = mce_panic_timeout; 279 if (panic_timeout == 0)
289 panic(msg); 280 panic_timeout = mce_panic_timeout;
281 panic(msg);
282 } else
283 printk(KERN_EMERG "Fake kernel panic: %s\n", msg);
290} 284}
291 285
292/* Support code for software error injection */ 286/* Support code for software error injection */
@@ -296,11 +290,11 @@ static int msr_to_offset(u32 msr)
296 unsigned bank = __get_cpu_var(injectm.bank); 290 unsigned bank = __get_cpu_var(injectm.bank);
297 if (msr == rip_msr) 291 if (msr == rip_msr)
298 return offsetof(struct mce, ip); 292 return offsetof(struct mce, ip);
299 if (msr == MSR_IA32_MC0_STATUS + bank*4) 293 if (msr == MSR_IA32_MCx_STATUS(bank))
300 return offsetof(struct mce, status); 294 return offsetof(struct mce, status);
301 if (msr == MSR_IA32_MC0_ADDR + bank*4) 295 if (msr == MSR_IA32_MCx_ADDR(bank))
302 return offsetof(struct mce, addr); 296 return offsetof(struct mce, addr);
303 if (msr == MSR_IA32_MC0_MISC + bank*4) 297 if (msr == MSR_IA32_MCx_MISC(bank))
304 return offsetof(struct mce, misc); 298 return offsetof(struct mce, misc);
305 if (msr == MSR_IA32_MCG_STATUS) 299 if (msr == MSR_IA32_MCG_STATUS)
306 return offsetof(struct mce, mcgstatus); 300 return offsetof(struct mce, mcgstatus);
@@ -505,7 +499,7 @@ void machine_check_poll(enum mcp_flags flags, mce_banks_t *b)
505 499
506 m.mcgstatus = mce_rdmsrl(MSR_IA32_MCG_STATUS); 500 m.mcgstatus = mce_rdmsrl(MSR_IA32_MCG_STATUS);
507 for (i = 0; i < banks; i++) { 501 for (i = 0; i < banks; i++) {
508 if (!bank[i] || !test_bit(i, *b)) 502 if (!mce_banks[i].ctl || !test_bit(i, *b))
509 continue; 503 continue;
510 504
511 m.misc = 0; 505 m.misc = 0;
@@ -514,7 +508,7 @@ void machine_check_poll(enum mcp_flags flags, mce_banks_t *b)
514 m.tsc = 0; 508 m.tsc = 0;
515 509
516 barrier(); 510 barrier();
517 m.status = mce_rdmsrl(MSR_IA32_MC0_STATUS + i*4); 511 m.status = mce_rdmsrl(MSR_IA32_MCx_STATUS(i));
518 if (!(m.status & MCI_STATUS_VAL)) 512 if (!(m.status & MCI_STATUS_VAL))
519 continue; 513 continue;
520 514
@@ -529,9 +523,9 @@ void machine_check_poll(enum mcp_flags flags, mce_banks_t *b)
529 continue; 523 continue;
530 524
531 if (m.status & MCI_STATUS_MISCV) 525 if (m.status & MCI_STATUS_MISCV)
532 m.misc = mce_rdmsrl(MSR_IA32_MC0_MISC + i*4); 526 m.misc = mce_rdmsrl(MSR_IA32_MCx_MISC(i));
533 if (m.status & MCI_STATUS_ADDRV) 527 if (m.status & MCI_STATUS_ADDRV)
534 m.addr = mce_rdmsrl(MSR_IA32_MC0_ADDR + i*4); 528 m.addr = mce_rdmsrl(MSR_IA32_MCx_ADDR(i));
535 529
536 if (!(flags & MCP_TIMESTAMP)) 530 if (!(flags & MCP_TIMESTAMP))
537 m.tsc = 0; 531 m.tsc = 0;
@@ -547,7 +541,7 @@ void machine_check_poll(enum mcp_flags flags, mce_banks_t *b)
547 /* 541 /*
548 * Clear state for this bank. 542 * Clear state for this bank.
549 */ 543 */
550 mce_wrmsrl(MSR_IA32_MC0_STATUS+4*i, 0); 544 mce_wrmsrl(MSR_IA32_MCx_STATUS(i), 0);
551 } 545 }
552 546
553 /* 547 /*
@@ -568,7 +562,7 @@ static int mce_no_way_out(struct mce *m, char **msg)
568 int i; 562 int i;
569 563
570 for (i = 0; i < banks; i++) { 564 for (i = 0; i < banks; i++) {
571 m->status = mce_rdmsrl(MSR_IA32_MC0_STATUS + i*4); 565 m->status = mce_rdmsrl(MSR_IA32_MCx_STATUS(i));
572 if (mce_severity(m, tolerant, msg) >= MCE_PANIC_SEVERITY) 566 if (mce_severity(m, tolerant, msg) >= MCE_PANIC_SEVERITY)
573 return 1; 567 return 1;
574 } 568 }
@@ -628,7 +622,7 @@ out:
628 * This way we prevent any potential data corruption in a unrecoverable case 622 * This way we prevent any potential data corruption in a unrecoverable case
629 * and also makes sure always all CPU's errors are examined. 623 * and also makes sure always all CPU's errors are examined.
630 * 624 *
631 * Also this detects the case of an machine check event coming from outer 625 * Also this detects the case of a machine check event coming from outer
632 * space (not detected by any CPUs) In this case some external agent wants 626 * space (not detected by any CPUs) In this case some external agent wants
633 * us to shut down, so panic too. 627 * us to shut down, so panic too.
634 * 628 *
@@ -681,7 +675,7 @@ static void mce_reign(void)
681 * No machine check event found. Must be some external 675 * No machine check event found. Must be some external
682 * source or one CPU is hung. Panic. 676 * source or one CPU is hung. Panic.
683 */ 677 */
684 if (!m && tolerant < 3) 678 if (global_worst <= MCE_KEEP_SEVERITY && tolerant < 3)
685 mce_panic("Machine check from unknown source", NULL, NULL); 679 mce_panic("Machine check from unknown source", NULL, NULL);
686 680
687 /* 681 /*
@@ -715,7 +709,7 @@ static int mce_start(int *no_way_out)
715 * global_nwo should be updated before mce_callin 709 * global_nwo should be updated before mce_callin
716 */ 710 */
717 smp_wmb(); 711 smp_wmb();
718 order = atomic_add_return(1, &mce_callin); 712 order = atomic_inc_return(&mce_callin);
719 713
720 /* 714 /*
721 * Wait for everyone. 715 * Wait for everyone.
@@ -852,7 +846,7 @@ static void mce_clear_state(unsigned long *toclear)
852 846
853 for (i = 0; i < banks; i++) { 847 for (i = 0; i < banks; i++) {
854 if (test_bit(i, toclear)) 848 if (test_bit(i, toclear))
855 mce_wrmsrl(MSR_IA32_MC0_STATUS+4*i, 0); 849 mce_wrmsrl(MSR_IA32_MCx_STATUS(i), 0);
856 } 850 }
857} 851}
858 852
@@ -905,11 +899,11 @@ void do_machine_check(struct pt_regs *regs, long error_code)
905 mce_setup(&m); 899 mce_setup(&m);
906 900
907 m.mcgstatus = mce_rdmsrl(MSR_IA32_MCG_STATUS); 901 m.mcgstatus = mce_rdmsrl(MSR_IA32_MCG_STATUS);
908 no_way_out = mce_no_way_out(&m, &msg);
909
910 final = &__get_cpu_var(mces_seen); 902 final = &__get_cpu_var(mces_seen);
911 *final = m; 903 *final = m;
912 904
905 no_way_out = mce_no_way_out(&m, &msg);
906
913 barrier(); 907 barrier();
914 908
915 /* 909 /*
@@ -926,14 +920,14 @@ void do_machine_check(struct pt_regs *regs, long error_code)
926 order = mce_start(&no_way_out); 920 order = mce_start(&no_way_out);
927 for (i = 0; i < banks; i++) { 921 for (i = 0; i < banks; i++) {
928 __clear_bit(i, toclear); 922 __clear_bit(i, toclear);
929 if (!bank[i]) 923 if (!mce_banks[i].ctl)
930 continue; 924 continue;
931 925
932 m.misc = 0; 926 m.misc = 0;
933 m.addr = 0; 927 m.addr = 0;
934 m.bank = i; 928 m.bank = i;
935 929
936 m.status = mce_rdmsrl(MSR_IA32_MC0_STATUS + i*4); 930 m.status = mce_rdmsrl(MSR_IA32_MCx_STATUS(i));
937 if ((m.status & MCI_STATUS_VAL) == 0) 931 if ((m.status & MCI_STATUS_VAL) == 0)
938 continue; 932 continue;
939 933
@@ -974,9 +968,9 @@ void do_machine_check(struct pt_regs *regs, long error_code)
974 kill_it = 1; 968 kill_it = 1;
975 969
976 if (m.status & MCI_STATUS_MISCV) 970 if (m.status & MCI_STATUS_MISCV)
977 m.misc = mce_rdmsrl(MSR_IA32_MC0_MISC + i*4); 971 m.misc = mce_rdmsrl(MSR_IA32_MCx_MISC(i));
978 if (m.status & MCI_STATUS_ADDRV) 972 if (m.status & MCI_STATUS_ADDRV)
979 m.addr = mce_rdmsrl(MSR_IA32_MC0_ADDR + i*4); 973 m.addr = mce_rdmsrl(MSR_IA32_MCx_ADDR(i));
980 974
981 /* 975 /*
982 * Action optional error. Queue address for later processing. 976 * Action optional error. Queue address for later processing.
@@ -1101,7 +1095,7 @@ void mce_log_therm_throt_event(__u64 status)
1101 */ 1095 */
1102static int check_interval = 5 * 60; /* 5 minutes */ 1096static int check_interval = 5 * 60; /* 5 minutes */
1103 1097
1104static DEFINE_PER_CPU(int, next_interval); /* in jiffies */ 1098static DEFINE_PER_CPU(int, mce_next_interval); /* in jiffies */
1105static DEFINE_PER_CPU(struct timer_list, mce_timer); 1099static DEFINE_PER_CPU(struct timer_list, mce_timer);
1106 1100
1107static void mcheck_timer(unsigned long data) 1101static void mcheck_timer(unsigned long data)
@@ -1120,7 +1114,7 @@ static void mcheck_timer(unsigned long data)
1120 * Alert userspace if needed. If we logged an MCE, reduce the 1114 * Alert userspace if needed. If we logged an MCE, reduce the
1121 * polling interval, otherwise increase the polling interval. 1115 * polling interval, otherwise increase the polling interval.
1122 */ 1116 */
1123 n = &__get_cpu_var(next_interval); 1117 n = &__get_cpu_var(mce_next_interval);
1124 if (mce_notify_irq()) 1118 if (mce_notify_irq())
1125 *n = max(*n/2, HZ/100); 1119 *n = max(*n/2, HZ/100);
1126 else 1120 else
@@ -1169,10 +1163,25 @@ int mce_notify_irq(void)
1169} 1163}
1170EXPORT_SYMBOL_GPL(mce_notify_irq); 1164EXPORT_SYMBOL_GPL(mce_notify_irq);
1171 1165
1166static int mce_banks_init(void)
1167{
1168 int i;
1169
1170 mce_banks = kzalloc(banks * sizeof(struct mce_bank), GFP_KERNEL);
1171 if (!mce_banks)
1172 return -ENOMEM;
1173 for (i = 0; i < banks; i++) {
1174 struct mce_bank *b = &mce_banks[i];
1175 b->ctl = -1ULL;
1176 b->init = 1;
1177 }
1178 return 0;
1179}
1180
1172/* 1181/*
1173 * Initialize Machine Checks for a CPU. 1182 * Initialize Machine Checks for a CPU.
1174 */ 1183 */
1175static int mce_cap_init(void) 1184static int __cpuinit mce_cap_init(void)
1176{ 1185{
1177 unsigned b; 1186 unsigned b;
1178 u64 cap; 1187 u64 cap;
@@ -1192,11 +1201,10 @@ static int mce_cap_init(void)
1192 /* Don't support asymmetric configurations today */ 1201 /* Don't support asymmetric configurations today */
1193 WARN_ON(banks != 0 && b != banks); 1202 WARN_ON(banks != 0 && b != banks);
1194 banks = b; 1203 banks = b;
1195 if (!bank) { 1204 if (!mce_banks) {
1196 bank = kmalloc(banks * sizeof(u64), GFP_KERNEL); 1205 int err = mce_banks_init();
1197 if (!bank) 1206 if (err)
1198 return -ENOMEM; 1207 return err;
1199 memset(bank, 0xff, banks * sizeof(u64));
1200 } 1208 }
1201 1209
1202 /* Use accurate RIP reporting if available. */ 1210 /* Use accurate RIP reporting if available. */
@@ -1228,15 +1236,16 @@ static void mce_init(void)
1228 wrmsr(MSR_IA32_MCG_CTL, 0xffffffff, 0xffffffff); 1236 wrmsr(MSR_IA32_MCG_CTL, 0xffffffff, 0xffffffff);
1229 1237
1230 for (i = 0; i < banks; i++) { 1238 for (i = 0; i < banks; i++) {
1231 if (skip_bank_init(i)) 1239 struct mce_bank *b = &mce_banks[i];
1240 if (!b->init)
1232 continue; 1241 continue;
1233 wrmsrl(MSR_IA32_MC0_CTL+4*i, bank[i]); 1242 wrmsrl(MSR_IA32_MCx_CTL(i), b->ctl);
1234 wrmsrl(MSR_IA32_MC0_STATUS+4*i, 0); 1243 wrmsrl(MSR_IA32_MCx_STATUS(i), 0);
1235 } 1244 }
1236} 1245}
1237 1246
1238/* Add per CPU specific workarounds here */ 1247/* Add per CPU specific workarounds here */
1239static int mce_cpu_quirks(struct cpuinfo_x86 *c) 1248static int __cpuinit mce_cpu_quirks(struct cpuinfo_x86 *c)
1240{ 1249{
1241 if (c->x86_vendor == X86_VENDOR_UNKNOWN) { 1250 if (c->x86_vendor == X86_VENDOR_UNKNOWN) {
1242 pr_info("MCE: unknown CPU type - not enabling MCE support.\n"); 1251 pr_info("MCE: unknown CPU type - not enabling MCE support.\n");
@@ -1251,7 +1260,7 @@ static int mce_cpu_quirks(struct cpuinfo_x86 *c)
1251 * trips off incorrectly with the IOMMU & 3ware 1260 * trips off incorrectly with the IOMMU & 3ware
1252 * & Cerberus: 1261 * & Cerberus:
1253 */ 1262 */
1254 clear_bit(10, (unsigned long *)&bank[4]); 1263 clear_bit(10, (unsigned long *)&mce_banks[4].ctl);
1255 } 1264 }
1256 if (c->x86 <= 17 && mce_bootlog < 0) { 1265 if (c->x86 <= 17 && mce_bootlog < 0) {
1257 /* 1266 /*
@@ -1265,7 +1274,7 @@ static int mce_cpu_quirks(struct cpuinfo_x86 *c)
1265 * by default. 1274 * by default.
1266 */ 1275 */
1267 if (c->x86 == 6 && banks > 0) 1276 if (c->x86 == 6 && banks > 0)
1268 bank[0] = 0; 1277 mce_banks[0].ctl = 0;
1269 } 1278 }
1270 1279
1271 if (c->x86_vendor == X86_VENDOR_INTEL) { 1280 if (c->x86_vendor == X86_VENDOR_INTEL) {
@@ -1278,8 +1287,8 @@ static int mce_cpu_quirks(struct cpuinfo_x86 *c)
1278 * valid event later, merely don't write CTL0. 1287 * valid event later, merely don't write CTL0.
1279 */ 1288 */
1280 1289
1281 if (c->x86 == 6 && c->x86_model < 0x1A) 1290 if (c->x86 == 6 && c->x86_model < 0x1A && banks > 0)
1282 __set_bit(0, &dont_init_banks); 1291 mce_banks[0].init = 0;
1283 1292
1284 /* 1293 /*
1285 * All newer Intel systems support MCE broadcasting. Enable 1294 * All newer Intel systems support MCE broadcasting. Enable
@@ -1335,7 +1344,7 @@ static void mce_cpu_features(struct cpuinfo_x86 *c)
1335static void mce_init_timer(void) 1344static void mce_init_timer(void)
1336{ 1345{
1337 struct timer_list *t = &__get_cpu_var(mce_timer); 1346 struct timer_list *t = &__get_cpu_var(mce_timer);
1338 int *n = &__get_cpu_var(next_interval); 1347 int *n = &__get_cpu_var(mce_next_interval);
1339 1348
1340 if (mce_ignore_ce) 1349 if (mce_ignore_ce)
1341 return; 1350 return;
@@ -1348,6 +1357,17 @@ static void mce_init_timer(void)
1348 add_timer_on(t, smp_processor_id()); 1357 add_timer_on(t, smp_processor_id());
1349} 1358}
1350 1359
1360/* Handle unconfigured int18 (should never happen) */
1361static void unexpected_machine_check(struct pt_regs *regs, long error_code)
1362{
1363 printk(KERN_ERR "CPU#%d: Unexpected int18 (Machine Check).\n",
1364 smp_processor_id());
1365}
1366
1367/* Call the installed machine check handler for this CPU setup. */
1368void (*machine_check_vector)(struct pt_regs *, long error_code) =
1369 unexpected_machine_check;
1370
1351/* 1371/*
1352 * Called for each booted CPU to set up machine checks. 1372 * Called for each booted CPU to set up machine checks.
1353 * Must be called with preempt off: 1373 * Must be called with preempt off:
@@ -1561,8 +1581,10 @@ static struct miscdevice mce_log_device = {
1561 */ 1581 */
1562static int __init mcheck_enable(char *str) 1582static int __init mcheck_enable(char *str)
1563{ 1583{
1564 if (*str == 0) 1584 if (*str == 0) {
1565 enable_p5_mce(); 1585 enable_p5_mce();
1586 return 1;
1587 }
1566 if (*str == '=') 1588 if (*str == '=')
1567 str++; 1589 str++;
1568 if (!strcmp(str, "off")) 1590 if (!strcmp(str, "off"))
@@ -1603,8 +1625,9 @@ static int mce_disable(void)
1603 int i; 1625 int i;
1604 1626
1605 for (i = 0; i < banks; i++) { 1627 for (i = 0; i < banks; i++) {
1606 if (!skip_bank_init(i)) 1628 struct mce_bank *b = &mce_banks[i];
1607 wrmsrl(MSR_IA32_MC0_CTL + i*4, 0); 1629 if (b->init)
1630 wrmsrl(MSR_IA32_MCx_CTL(i), 0);
1608 } 1631 }
1609 return 0; 1632 return 0;
1610} 1633}
@@ -1679,14 +1702,15 @@ DEFINE_PER_CPU(struct sys_device, mce_dev);
1679__cpuinitdata 1702__cpuinitdata
1680void (*threshold_cpu_callback)(unsigned long action, unsigned int cpu); 1703void (*threshold_cpu_callback)(unsigned long action, unsigned int cpu);
1681 1704
1682static struct sysdev_attribute *bank_attrs; 1705static inline struct mce_bank *attr_to_bank(struct sysdev_attribute *attr)
1706{
1707 return container_of(attr, struct mce_bank, attr);
1708}
1683 1709
1684static ssize_t show_bank(struct sys_device *s, struct sysdev_attribute *attr, 1710static ssize_t show_bank(struct sys_device *s, struct sysdev_attribute *attr,
1685 char *buf) 1711 char *buf)
1686{ 1712{
1687 u64 b = bank[attr - bank_attrs]; 1713 return sprintf(buf, "%llx\n", attr_to_bank(attr)->ctl);
1688
1689 return sprintf(buf, "%llx\n", b);
1690} 1714}
1691 1715
1692static ssize_t set_bank(struct sys_device *s, struct sysdev_attribute *attr, 1716static ssize_t set_bank(struct sys_device *s, struct sysdev_attribute *attr,
@@ -1697,7 +1721,7 @@ static ssize_t set_bank(struct sys_device *s, struct sysdev_attribute *attr,
1697 if (strict_strtoull(buf, 0, &new) < 0) 1721 if (strict_strtoull(buf, 0, &new) < 0)
1698 return -EINVAL; 1722 return -EINVAL;
1699 1723
1700 bank[attr - bank_attrs] = new; 1724 attr_to_bank(attr)->ctl = new;
1701 mce_restart(); 1725 mce_restart();
1702 1726
1703 return size; 1727 return size;
@@ -1839,7 +1863,7 @@ static __cpuinit int mce_create_device(unsigned int cpu)
1839 } 1863 }
1840 for (j = 0; j < banks; j++) { 1864 for (j = 0; j < banks; j++) {
1841 err = sysdev_create_file(&per_cpu(mce_dev, cpu), 1865 err = sysdev_create_file(&per_cpu(mce_dev, cpu),
1842 &bank_attrs[j]); 1866 &mce_banks[j].attr);
1843 if (err) 1867 if (err)
1844 goto error2; 1868 goto error2;
1845 } 1869 }
@@ -1848,10 +1872,10 @@ static __cpuinit int mce_create_device(unsigned int cpu)
1848 return 0; 1872 return 0;
1849error2: 1873error2:
1850 while (--j >= 0) 1874 while (--j >= 0)
1851 sysdev_remove_file(&per_cpu(mce_dev, cpu), &bank_attrs[j]); 1875 sysdev_remove_file(&per_cpu(mce_dev, cpu), &mce_banks[j].attr);
1852error: 1876error:
1853 while (--i >= 0) 1877 while (--i >= 0)
1854 sysdev_remove_file(&per_cpu(mce_dev, cpu), mce_attrs[i]); 1878 sysdev_remove_file(&per_cpu(mce_dev, cpu), &mce_banks[i].attr);
1855 1879
1856 sysdev_unregister(&per_cpu(mce_dev, cpu)); 1880 sysdev_unregister(&per_cpu(mce_dev, cpu));
1857 1881
@@ -1869,7 +1893,7 @@ static __cpuinit void mce_remove_device(unsigned int cpu)
1869 sysdev_remove_file(&per_cpu(mce_dev, cpu), mce_attrs[i]); 1893 sysdev_remove_file(&per_cpu(mce_dev, cpu), mce_attrs[i]);
1870 1894
1871 for (i = 0; i < banks; i++) 1895 for (i = 0; i < banks; i++)
1872 sysdev_remove_file(&per_cpu(mce_dev, cpu), &bank_attrs[i]); 1896 sysdev_remove_file(&per_cpu(mce_dev, cpu), &mce_banks[i].attr);
1873 1897
1874 sysdev_unregister(&per_cpu(mce_dev, cpu)); 1898 sysdev_unregister(&per_cpu(mce_dev, cpu));
1875 cpumask_clear_cpu(cpu, mce_dev_initialized); 1899 cpumask_clear_cpu(cpu, mce_dev_initialized);
@@ -1886,8 +1910,9 @@ static void mce_disable_cpu(void *h)
1886 if (!(action & CPU_TASKS_FROZEN)) 1910 if (!(action & CPU_TASKS_FROZEN))
1887 cmci_clear(); 1911 cmci_clear();
1888 for (i = 0; i < banks; i++) { 1912 for (i = 0; i < banks; i++) {
1889 if (!skip_bank_init(i)) 1913 struct mce_bank *b = &mce_banks[i];
1890 wrmsrl(MSR_IA32_MC0_CTL + i*4, 0); 1914 if (b->init)
1915 wrmsrl(MSR_IA32_MCx_CTL(i), 0);
1891 } 1916 }
1892} 1917}
1893 1918
@@ -1902,8 +1927,9 @@ static void mce_reenable_cpu(void *h)
1902 if (!(action & CPU_TASKS_FROZEN)) 1927 if (!(action & CPU_TASKS_FROZEN))
1903 cmci_reenable(); 1928 cmci_reenable();
1904 for (i = 0; i < banks; i++) { 1929 for (i = 0; i < banks; i++) {
1905 if (!skip_bank_init(i)) 1930 struct mce_bank *b = &mce_banks[i];
1906 wrmsrl(MSR_IA32_MC0_CTL + i*4, bank[i]); 1931 if (b->init)
1932 wrmsrl(MSR_IA32_MCx_CTL(i), b->ctl);
1907 } 1933 }
1908} 1934}
1909 1935
@@ -1935,7 +1961,7 @@ mce_cpu_callback(struct notifier_block *nfb, unsigned long action, void *hcpu)
1935 case CPU_DOWN_FAILED: 1961 case CPU_DOWN_FAILED:
1936 case CPU_DOWN_FAILED_FROZEN: 1962 case CPU_DOWN_FAILED_FROZEN:
1937 t->expires = round_jiffies(jiffies + 1963 t->expires = round_jiffies(jiffies +
1938 __get_cpu_var(next_interval)); 1964 __get_cpu_var(mce_next_interval));
1939 add_timer_on(t, cpu); 1965 add_timer_on(t, cpu);
1940 smp_call_function_single(cpu, mce_reenable_cpu, &action, 1); 1966 smp_call_function_single(cpu, mce_reenable_cpu, &action, 1);
1941 break; 1967 break;
@@ -1951,35 +1977,21 @@ static struct notifier_block mce_cpu_notifier __cpuinitdata = {
1951 .notifier_call = mce_cpu_callback, 1977 .notifier_call = mce_cpu_callback,
1952}; 1978};
1953 1979
1954static __init int mce_init_banks(void) 1980static __init void mce_init_banks(void)
1955{ 1981{
1956 int i; 1982 int i;
1957 1983
1958 bank_attrs = kzalloc(sizeof(struct sysdev_attribute) * banks,
1959 GFP_KERNEL);
1960 if (!bank_attrs)
1961 return -ENOMEM;
1962
1963 for (i = 0; i < banks; i++) { 1984 for (i = 0; i < banks; i++) {
1964 struct sysdev_attribute *a = &bank_attrs[i]; 1985 struct mce_bank *b = &mce_banks[i];
1986 struct sysdev_attribute *a = &b->attr;
1965 1987
1966 a->attr.name = kasprintf(GFP_KERNEL, "bank%d", i); 1988 a->attr.name = b->attrname;
1967 if (!a->attr.name) 1989 snprintf(b->attrname, ATTR_LEN, "bank%d", i);
1968 goto nomem;
1969 1990
1970 a->attr.mode = 0644; 1991 a->attr.mode = 0644;
1971 a->show = show_bank; 1992 a->show = show_bank;
1972 a->store = set_bank; 1993 a->store = set_bank;
1973 } 1994 }
1974 return 0;
1975
1976nomem:
1977 while (--i >= 0)
1978 kfree(bank_attrs[i].attr.name);
1979 kfree(bank_attrs);
1980 bank_attrs = NULL;
1981
1982 return -ENOMEM;
1983} 1995}
1984 1996
1985static __init int mce_init_device(void) 1997static __init int mce_init_device(void)
@@ -1992,9 +2004,7 @@ static __init int mce_init_device(void)
1992 2004
1993 zalloc_cpumask_var(&mce_dev_initialized, GFP_KERNEL); 2005 zalloc_cpumask_var(&mce_dev_initialized, GFP_KERNEL);
1994 2006
1995 err = mce_init_banks(); 2007 mce_init_banks();
1996 if (err)
1997 return err;
1998 2008
1999 err = sysdev_class_register(&mce_sysclass); 2009 err = sysdev_class_register(&mce_sysclass);
2000 if (err) 2010 if (err)
@@ -2014,57 +2024,65 @@ static __init int mce_init_device(void)
2014 2024
2015device_initcall(mce_init_device); 2025device_initcall(mce_init_device);
2016 2026
2017#else /* CONFIG_X86_OLD_MCE: */ 2027/*
2018 2028 * Old style boot options parsing. Only for compatibility.
2019int nr_mce_banks; 2029 */
2020EXPORT_SYMBOL_GPL(nr_mce_banks); /* non-fatal.o */ 2030static int __init mcheck_disable(char *str)
2031{
2032 mce_disabled = 1;
2033 return 1;
2034}
2035__setup("nomce", mcheck_disable);
2021 2036
2022/* This has to be run for each processor */ 2037#ifdef CONFIG_DEBUG_FS
2023void mcheck_init(struct cpuinfo_x86 *c) 2038struct dentry *mce_get_debugfs_dir(void)
2024{ 2039{
2025 if (mce_disabled) 2040 static struct dentry *dmce;
2026 return;
2027 2041
2028 switch (c->x86_vendor) { 2042 if (!dmce)
2029 case X86_VENDOR_AMD: 2043 dmce = debugfs_create_dir("mce", NULL);
2030 amd_mcheck_init(c);
2031 break;
2032 2044
2033 case X86_VENDOR_INTEL: 2045 return dmce;
2034 if (c->x86 == 5) 2046}
2035 intel_p5_mcheck_init(c);
2036 if (c->x86 == 6)
2037 intel_p6_mcheck_init(c);
2038 if (c->x86 == 15)
2039 intel_p4_mcheck_init(c);
2040 break;
2041 2047
2042 case X86_VENDOR_CENTAUR: 2048static void mce_reset(void)
2043 if (c->x86 == 5) 2049{
2044 winchip_mcheck_init(c); 2050 cpu_missing = 0;
2045 break; 2051 atomic_set(&mce_fake_paniced, 0);
2052 atomic_set(&mce_executing, 0);
2053 atomic_set(&mce_callin, 0);
2054 atomic_set(&global_nwo, 0);
2055}
2046 2056
2047 default: 2057static int fake_panic_get(void *data, u64 *val)
2048 break; 2058{
2049 } 2059 *val = fake_panic;
2050 printk(KERN_INFO "mce: CPU supports %d MCE banks\n", nr_mce_banks); 2060 return 0;
2051} 2061}
2052 2062
2053static int __init mcheck_enable(char *str) 2063static int fake_panic_set(void *data, u64 val)
2054{ 2064{
2055 mce_p5_enabled = 1; 2065 mce_reset();
2056 return 1; 2066 fake_panic = val;
2067 return 0;
2057} 2068}
2058__setup("mce", mcheck_enable);
2059 2069
2060#endif /* CONFIG_X86_OLD_MCE */ 2070DEFINE_SIMPLE_ATTRIBUTE(fake_panic_fops, fake_panic_get,
2071 fake_panic_set, "%llu\n");
2061 2072
2062/* 2073static int __init mce_debugfs_init(void)
2063 * Old style boot options parsing. Only for compatibility.
2064 */
2065static int __init mcheck_disable(char *str)
2066{ 2074{
2067 mce_disabled = 1; 2075 struct dentry *dmce, *ffake_panic;
2068 return 1; 2076
2077 dmce = mce_get_debugfs_dir();
2078 if (!dmce)
2079 return -ENOMEM;
2080 ffake_panic = debugfs_create_file("fake_panic", 0444, dmce, NULL,
2081 &fake_panic_fops);
2082 if (!ffake_panic)
2083 return -ENOMEM;
2084
2085 return 0;
2069} 2086}
2070__setup("nomce", mcheck_disable); 2087late_initcall(mce_debugfs_init);
2088#endif
diff --git a/arch/x86/kernel/cpu/mcheck/mce_amd.c b/arch/x86/kernel/cpu/mcheck/mce_amd.c
index 1fecba404fd8..8cd5224943b5 100644
--- a/arch/x86/kernel/cpu/mcheck/mce_amd.c
+++ b/arch/x86/kernel/cpu/mcheck/mce_amd.c
@@ -69,7 +69,7 @@ struct threshold_bank {
69 struct threshold_block *blocks; 69 struct threshold_block *blocks;
70 cpumask_var_t cpus; 70 cpumask_var_t cpus;
71}; 71};
72static DEFINE_PER_CPU(struct threshold_bank *, threshold_banks[NR_BANKS]); 72static DEFINE_PER_CPU(struct threshold_bank * [NR_BANKS], threshold_banks);
73 73
74#ifdef CONFIG_SMP 74#ifdef CONFIG_SMP
75static unsigned char shared_bank[NR_BANKS] = { 75static unsigned char shared_bank[NR_BANKS] = {
diff --git a/arch/x86/kernel/cpu/mcheck/mce_intel.c b/arch/x86/kernel/cpu/mcheck/mce_intel.c
index e1acec0f7a32..889f665fe93d 100644
--- a/arch/x86/kernel/cpu/mcheck/mce_intel.c
+++ b/arch/x86/kernel/cpu/mcheck/mce_intel.c
@@ -90,7 +90,7 @@ static void cmci_discover(int banks, int boot)
90 if (test_bit(i, owned)) 90 if (test_bit(i, owned))
91 continue; 91 continue;
92 92
93 rdmsrl(MSR_IA32_MC0_CTL2 + i, val); 93 rdmsrl(MSR_IA32_MCx_CTL2(i), val);
94 94
95 /* Already owned by someone else? */ 95 /* Already owned by someone else? */
96 if (val & CMCI_EN) { 96 if (val & CMCI_EN) {
@@ -101,8 +101,8 @@ static void cmci_discover(int banks, int boot)
101 } 101 }
102 102
103 val |= CMCI_EN | CMCI_THRESHOLD; 103 val |= CMCI_EN | CMCI_THRESHOLD;
104 wrmsrl(MSR_IA32_MC0_CTL2 + i, val); 104 wrmsrl(MSR_IA32_MCx_CTL2(i), val);
105 rdmsrl(MSR_IA32_MC0_CTL2 + i, val); 105 rdmsrl(MSR_IA32_MCx_CTL2(i), val);
106 106
107 /* Did the enable bit stick? -- the bank supports CMCI */ 107 /* Did the enable bit stick? -- the bank supports CMCI */
108 if (val & CMCI_EN) { 108 if (val & CMCI_EN) {
@@ -152,9 +152,9 @@ void cmci_clear(void)
152 if (!test_bit(i, __get_cpu_var(mce_banks_owned))) 152 if (!test_bit(i, __get_cpu_var(mce_banks_owned)))
153 continue; 153 continue;
154 /* Disable CMCI */ 154 /* Disable CMCI */
155 rdmsrl(MSR_IA32_MC0_CTL2 + i, val); 155 rdmsrl(MSR_IA32_MCx_CTL2(i), val);
156 val &= ~(CMCI_EN|CMCI_THRESHOLD_MASK); 156 val &= ~(CMCI_EN|CMCI_THRESHOLD_MASK);
157 wrmsrl(MSR_IA32_MC0_CTL2 + i, val); 157 wrmsrl(MSR_IA32_MCx_CTL2(i), val);
158 __clear_bit(i, __get_cpu_var(mce_banks_owned)); 158 __clear_bit(i, __get_cpu_var(mce_banks_owned));
159 } 159 }
160 spin_unlock_irqrestore(&cmci_discover_lock, flags); 160 spin_unlock_irqrestore(&cmci_discover_lock, flags);
diff --git a/arch/x86/kernel/cpu/mcheck/non-fatal.c b/arch/x86/kernel/cpu/mcheck/non-fatal.c
deleted file mode 100644
index f5f2d6f71fb6..000000000000
--- a/arch/x86/kernel/cpu/mcheck/non-fatal.c
+++ /dev/null
@@ -1,94 +0,0 @@
1/*
2 * Non Fatal Machine Check Exception Reporting
3 *
4 * (C) Copyright 2002 Dave Jones. <davej@redhat.com>
5 *
6 * This file contains routines to check for non-fatal MCEs every 15s
7 *
8 */
9#include <linux/interrupt.h>
10#include <linux/workqueue.h>
11#include <linux/jiffies.h>
12#include <linux/kernel.h>
13#include <linux/module.h>
14#include <linux/types.h>
15#include <linux/init.h>
16#include <linux/smp.h>
17
18#include <asm/processor.h>
19#include <asm/system.h>
20#include <asm/mce.h>
21#include <asm/msr.h>
22
23static int firstbank;
24
25#define MCE_RATE (15*HZ) /* timer rate is 15s */
26
27static void mce_checkregs(void *info)
28{
29 u32 low, high;
30 int i;
31
32 for (i = firstbank; i < nr_mce_banks; i++) {
33 rdmsr(MSR_IA32_MC0_STATUS+i*4, low, high);
34
35 if (!(high & (1<<31)))
36 continue;
37
38 printk(KERN_INFO "MCE: The hardware reports a non fatal, "
39 "correctable incident occurred on CPU %d.\n",
40 smp_processor_id());
41
42 printk(KERN_INFO "Bank %d: %08x%08x\n", i, high, low);
43
44 /*
45 * Scrub the error so we don't pick it up in MCE_RATE
46 * seconds time:
47 */
48 wrmsr(MSR_IA32_MC0_STATUS+i*4, 0UL, 0UL);
49
50 /* Serialize: */
51 wmb();
52 add_taint(TAINT_MACHINE_CHECK);
53 }
54}
55
56static void mce_work_fn(struct work_struct *work);
57static DECLARE_DELAYED_WORK(mce_work, mce_work_fn);
58
59static void mce_work_fn(struct work_struct *work)
60{
61 on_each_cpu(mce_checkregs, NULL, 1);
62 schedule_delayed_work(&mce_work, round_jiffies_relative(MCE_RATE));
63}
64
65static int __init init_nonfatal_mce_checker(void)
66{
67 struct cpuinfo_x86 *c = &boot_cpu_data;
68
69 /* Check for MCE support */
70 if (!cpu_has(c, X86_FEATURE_MCE))
71 return -ENODEV;
72
73 /* Check for PPro style MCA */
74 if (!cpu_has(c, X86_FEATURE_MCA))
75 return -ENODEV;
76
77 /* Some Athlons misbehave when we frob bank 0 */
78 if (boot_cpu_data.x86_vendor == X86_VENDOR_AMD &&
79 boot_cpu_data.x86 == 6)
80 firstbank = 1;
81 else
82 firstbank = 0;
83
84 /*
85 * Check for non-fatal errors every MCE_RATE s
86 */
87 schedule_delayed_work(&mce_work, round_jiffies_relative(MCE_RATE));
88 printk(KERN_INFO "Machine check exception polling timer started.\n");
89
90 return 0;
91}
92module_init(init_nonfatal_mce_checker);
93
94MODULE_LICENSE("GPL");
diff --git a/arch/x86/kernel/cpu/mcheck/p4.c b/arch/x86/kernel/cpu/mcheck/p4.c
deleted file mode 100644
index 4482aea9aa2e..000000000000
--- a/arch/x86/kernel/cpu/mcheck/p4.c
+++ /dev/null
@@ -1,163 +0,0 @@
1/*
2 * P4 specific Machine Check Exception Reporting
3 */
4#include <linux/kernel.h>
5#include <linux/types.h>
6#include <linux/init.h>
7#include <linux/smp.h>
8
9#include <asm/processor.h>
10#include <asm/mce.h>
11#include <asm/msr.h>
12
13/* as supported by the P4/Xeon family */
14struct intel_mce_extended_msrs {
15 u32 eax;
16 u32 ebx;
17 u32 ecx;
18 u32 edx;
19 u32 esi;
20 u32 edi;
21 u32 ebp;
22 u32 esp;
23 u32 eflags;
24 u32 eip;
25 /* u32 *reserved[]; */
26};
27
28static int mce_num_extended_msrs;
29
30/* P4/Xeon Extended MCE MSR retrieval, return 0 if unsupported */
31static void intel_get_extended_msrs(struct intel_mce_extended_msrs *r)
32{
33 u32 h;
34
35 rdmsr(MSR_IA32_MCG_EAX, r->eax, h);
36 rdmsr(MSR_IA32_MCG_EBX, r->ebx, h);
37 rdmsr(MSR_IA32_MCG_ECX, r->ecx, h);
38 rdmsr(MSR_IA32_MCG_EDX, r->edx, h);
39 rdmsr(MSR_IA32_MCG_ESI, r->esi, h);
40 rdmsr(MSR_IA32_MCG_EDI, r->edi, h);
41 rdmsr(MSR_IA32_MCG_EBP, r->ebp, h);
42 rdmsr(MSR_IA32_MCG_ESP, r->esp, h);
43 rdmsr(MSR_IA32_MCG_EFLAGS, r->eflags, h);
44 rdmsr(MSR_IA32_MCG_EIP, r->eip, h);
45}
46
47static void intel_machine_check(struct pt_regs *regs, long error_code)
48{
49 u32 alow, ahigh, high, low;
50 u32 mcgstl, mcgsth;
51 int recover = 1;
52 int i;
53
54 rdmsr(MSR_IA32_MCG_STATUS, mcgstl, mcgsth);
55 if (mcgstl & (1<<0)) /* Recoverable ? */
56 recover = 0;
57
58 printk(KERN_EMERG "CPU %d: Machine Check Exception: %08x%08x\n",
59 smp_processor_id(), mcgsth, mcgstl);
60
61 if (mce_num_extended_msrs > 0) {
62 struct intel_mce_extended_msrs dbg;
63
64 intel_get_extended_msrs(&dbg);
65
66 printk(KERN_DEBUG "CPU %d: EIP: %08x EFLAGS: %08x\n"
67 "\teax: %08x ebx: %08x ecx: %08x edx: %08x\n"
68 "\tesi: %08x edi: %08x ebp: %08x esp: %08x\n",
69 smp_processor_id(), dbg.eip, dbg.eflags,
70 dbg.eax, dbg.ebx, dbg.ecx, dbg.edx,
71 dbg.esi, dbg.edi, dbg.ebp, dbg.esp);
72 }
73
74 for (i = 0; i < nr_mce_banks; i++) {
75 rdmsr(MSR_IA32_MC0_STATUS+i*4, low, high);
76 if (high & (1<<31)) {
77 char misc[20];
78 char addr[24];
79
80 misc[0] = addr[0] = '\0';
81 if (high & (1<<29))
82 recover |= 1;
83 if (high & (1<<25))
84 recover |= 2;
85 high &= ~(1<<31);
86 if (high & (1<<27)) {
87 rdmsr(MSR_IA32_MC0_MISC+i*4, alow, ahigh);
88 snprintf(misc, 20, "[%08x%08x]", ahigh, alow);
89 }
90 if (high & (1<<26)) {
91 rdmsr(MSR_IA32_MC0_ADDR+i*4, alow, ahigh);
92 snprintf(addr, 24, " at %08x%08x", ahigh, alow);
93 }
94 printk(KERN_EMERG "CPU %d: Bank %d: %08x%08x%s%s\n",
95 smp_processor_id(), i, high, low, misc, addr);
96 }
97 }
98
99 if (recover & 2)
100 panic("CPU context corrupt");
101 if (recover & 1)
102 panic("Unable to continue");
103
104 printk(KERN_EMERG "Attempting to continue.\n");
105
106 /*
107 * Do not clear the MSR_IA32_MCi_STATUS if the error is not
108 * recoverable/continuable.This will allow BIOS to look at the MSRs
109 * for errors if the OS could not log the error.
110 */
111 for (i = 0; i < nr_mce_banks; i++) {
112 u32 msr;
113 msr = MSR_IA32_MC0_STATUS+i*4;
114 rdmsr(msr, low, high);
115 if (high&(1<<31)) {
116 /* Clear it */
117 wrmsr(msr, 0UL, 0UL);
118 /* Serialize */
119 wmb();
120 add_taint(TAINT_MACHINE_CHECK);
121 }
122 }
123 mcgstl &= ~(1<<2);
124 wrmsr(MSR_IA32_MCG_STATUS, mcgstl, mcgsth);
125}
126
127void intel_p4_mcheck_init(struct cpuinfo_x86 *c)
128{
129 u32 l, h;
130 int i;
131
132 machine_check_vector = intel_machine_check;
133 wmb();
134
135 printk(KERN_INFO "Intel machine check architecture supported.\n");
136 rdmsr(MSR_IA32_MCG_CAP, l, h);
137 if (l & (1<<8)) /* Control register present ? */
138 wrmsr(MSR_IA32_MCG_CTL, 0xffffffff, 0xffffffff);
139 nr_mce_banks = l & 0xff;
140
141 for (i = 0; i < nr_mce_banks; i++) {
142 wrmsr(MSR_IA32_MC0_CTL+4*i, 0xffffffff, 0xffffffff);
143 wrmsr(MSR_IA32_MC0_STATUS+4*i, 0x0, 0x0);
144 }
145
146 set_in_cr4(X86_CR4_MCE);
147 printk(KERN_INFO "Intel machine check reporting enabled on CPU#%d.\n",
148 smp_processor_id());
149
150 /* Check for P4/Xeon extended MCE MSRs */
151 rdmsr(MSR_IA32_MCG_CAP, l, h);
152 if (l & (1<<9)) {/* MCG_EXT_P */
153 mce_num_extended_msrs = (l >> 16) & 0xff;
154 printk(KERN_INFO "CPU%d: Intel P4/Xeon Extended MCE MSRs (%d)"
155 " available\n",
156 smp_processor_id(), mce_num_extended_msrs);
157
158#ifdef CONFIG_X86_MCE_P4THERMAL
159 /* Check for P4/Xeon Thermal monitor */
160 intel_init_thermal(c);
161#endif
162 }
163}
diff --git a/arch/x86/kernel/cpu/mcheck/p6.c b/arch/x86/kernel/cpu/mcheck/p6.c
deleted file mode 100644
index 01e4f8178183..000000000000
--- a/arch/x86/kernel/cpu/mcheck/p6.c
+++ /dev/null
@@ -1,127 +0,0 @@
1/*
2 * P6 specific Machine Check Exception Reporting
3 * (C) Copyright 2002 Alan Cox <alan@lxorguk.ukuu.org.uk>
4 */
5#include <linux/interrupt.h>
6#include <linux/kernel.h>
7#include <linux/types.h>
8#include <linux/init.h>
9#include <linux/smp.h>
10
11#include <asm/processor.h>
12#include <asm/system.h>
13#include <asm/mce.h>
14#include <asm/msr.h>
15
16/* Machine Check Handler For PII/PIII */
17static void intel_machine_check(struct pt_regs *regs, long error_code)
18{
19 u32 alow, ahigh, high, low;
20 u32 mcgstl, mcgsth;
21 int recover = 1;
22 int i;
23
24 rdmsr(MSR_IA32_MCG_STATUS, mcgstl, mcgsth);
25 if (mcgstl & (1<<0)) /* Recoverable ? */
26 recover = 0;
27
28 printk(KERN_EMERG "CPU %d: Machine Check Exception: %08x%08x\n",
29 smp_processor_id(), mcgsth, mcgstl);
30
31 for (i = 0; i < nr_mce_banks; i++) {
32 rdmsr(MSR_IA32_MC0_STATUS+i*4, low, high);
33 if (high & (1<<31)) {
34 char misc[20];
35 char addr[24];
36
37 misc[0] = '\0';
38 addr[0] = '\0';
39
40 if (high & (1<<29))
41 recover |= 1;
42 if (high & (1<<25))
43 recover |= 2;
44 high &= ~(1<<31);
45
46 if (high & (1<<27)) {
47 rdmsr(MSR_IA32_MC0_MISC+i*4, alow, ahigh);
48 snprintf(misc, 20, "[%08x%08x]", ahigh, alow);
49 }
50 if (high & (1<<26)) {
51 rdmsr(MSR_IA32_MC0_ADDR+i*4, alow, ahigh);
52 snprintf(addr, 24, " at %08x%08x", ahigh, alow);
53 }
54
55 printk(KERN_EMERG "CPU %d: Bank %d: %08x%08x%s%s\n",
56 smp_processor_id(), i, high, low, misc, addr);
57 }
58 }
59
60 if (recover & 2)
61 panic("CPU context corrupt");
62 if (recover & 1)
63 panic("Unable to continue");
64
65 printk(KERN_EMERG "Attempting to continue.\n");
66 /*
67 * Do not clear the MSR_IA32_MCi_STATUS if the error is not
68 * recoverable/continuable.This will allow BIOS to look at the MSRs
69 * for errors if the OS could not log the error:
70 */
71 for (i = 0; i < nr_mce_banks; i++) {
72 unsigned int msr;
73
74 msr = MSR_IA32_MC0_STATUS+i*4;
75 rdmsr(msr, low, high);
76 if (high & (1<<31)) {
77 /* Clear it: */
78 wrmsr(msr, 0UL, 0UL);
79 /* Serialize: */
80 wmb();
81 add_taint(TAINT_MACHINE_CHECK);
82 }
83 }
84 mcgstl &= ~(1<<2);
85 wrmsr(MSR_IA32_MCG_STATUS, mcgstl, mcgsth);
86}
87
88/* Set up machine check reporting for processors with Intel style MCE: */
89void intel_p6_mcheck_init(struct cpuinfo_x86 *c)
90{
91 u32 l, h;
92 int i;
93
94 /* Check for MCE support */
95 if (!cpu_has(c, X86_FEATURE_MCE))
96 return;
97
98 /* Check for PPro style MCA */
99 if (!cpu_has(c, X86_FEATURE_MCA))
100 return;
101
102 /* Ok machine check is available */
103 machine_check_vector = intel_machine_check;
104 /* Make sure the vector pointer is visible before we enable MCEs: */
105 wmb();
106
107 printk(KERN_INFO "Intel machine check architecture supported.\n");
108 rdmsr(MSR_IA32_MCG_CAP, l, h);
109 if (l & (1<<8)) /* Control register present ? */
110 wrmsr(MSR_IA32_MCG_CTL, 0xffffffff, 0xffffffff);
111 nr_mce_banks = l & 0xff;
112
113 /*
114 * Following the example in IA-32 SDM Vol 3:
115 * - MC0_CTL should not be written
116 * - Status registers on all banks should be cleared on reset
117 */
118 for (i = 1; i < nr_mce_banks; i++)
119 wrmsr(MSR_IA32_MC0_CTL+4*i, 0xffffffff, 0xffffffff);
120
121 for (i = 0; i < nr_mce_banks; i++)
122 wrmsr(MSR_IA32_MC0_STATUS+4*i, 0x0, 0x0);
123
124 set_in_cr4(X86_CR4_MCE);
125 printk(KERN_INFO "Intel machine check reporting enabled on CPU#%d.\n",
126 smp_processor_id());
127}
diff --git a/arch/x86/kernel/cpu/mcheck/therm_throt.c b/arch/x86/kernel/cpu/mcheck/therm_throt.c
index 5957a93e5173..63a56d147e4a 100644
--- a/arch/x86/kernel/cpu/mcheck/therm_throt.c
+++ b/arch/x86/kernel/cpu/mcheck/therm_throt.c
@@ -260,9 +260,6 @@ void intel_init_thermal(struct cpuinfo_x86 *c)
260 return; 260 return;
261 } 261 }
262 262
263 if (cpu_has(c, X86_FEATURE_TM2) && (l & MSR_IA32_MISC_ENABLE_TM2))
264 tm2 = 1;
265
266 /* Check whether a vector already exists */ 263 /* Check whether a vector already exists */
267 if (h & APIC_VECTOR_MASK) { 264 if (h & APIC_VECTOR_MASK) {
268 printk(KERN_DEBUG 265 printk(KERN_DEBUG
@@ -271,6 +268,16 @@ void intel_init_thermal(struct cpuinfo_x86 *c)
271 return; 268 return;
272 } 269 }
273 270
271 /* early Pentium M models use different method for enabling TM2 */
272 if (cpu_has(c, X86_FEATURE_TM2)) {
273 if (c->x86 == 6 && (c->x86_model == 9 || c->x86_model == 13)) {
274 rdmsr(MSR_THERM2_CTL, l, h);
275 if (l & MSR_THERM2_CTL_TM_SELECT)
276 tm2 = 1;
277 } else if (l & MSR_IA32_MISC_ENABLE_TM2)
278 tm2 = 1;
279 }
280
274 /* We'll mask the thermal vector in the lapic till we're ready: */ 281 /* We'll mask the thermal vector in the lapic till we're ready: */
275 h = THERMAL_APIC_VECTOR | APIC_DM_FIXED | APIC_LVT_MASKED; 282 h = THERMAL_APIC_VECTOR | APIC_DM_FIXED | APIC_LVT_MASKED;
276 apic_write(APIC_LVTTHMR, h); 283 apic_write(APIC_LVTTHMR, h);
diff --git a/arch/x86/kernel/cpu/mtrr/main.c b/arch/x86/kernel/cpu/mtrr/main.c
index 7af0f88a4163..84e83de54575 100644
--- a/arch/x86/kernel/cpu/mtrr/main.c
+++ b/arch/x86/kernel/cpu/mtrr/main.c
@@ -58,6 +58,7 @@ unsigned int mtrr_usage_table[MTRR_MAX_VAR_RANGES];
58static DEFINE_MUTEX(mtrr_mutex); 58static DEFINE_MUTEX(mtrr_mutex);
59 59
60u64 size_or_mask, size_and_mask; 60u64 size_or_mask, size_and_mask;
61static bool mtrr_aps_delayed_init;
61 62
62static struct mtrr_ops *mtrr_ops[X86_VENDOR_NUM]; 63static struct mtrr_ops *mtrr_ops[X86_VENDOR_NUM];
63 64
@@ -163,7 +164,10 @@ static void ipi_handler(void *info)
163 if (data->smp_reg != ~0U) { 164 if (data->smp_reg != ~0U) {
164 mtrr_if->set(data->smp_reg, data->smp_base, 165 mtrr_if->set(data->smp_reg, data->smp_base,
165 data->smp_size, data->smp_type); 166 data->smp_size, data->smp_type);
166 } else { 167 } else if (mtrr_aps_delayed_init) {
168 /*
169 * Initialize the MTRRs inaddition to the synchronisation.
170 */
167 mtrr_if->set_all(); 171 mtrr_if->set_all();
168 } 172 }
169 173
@@ -265,6 +269,8 @@ set_mtrr(unsigned int reg, unsigned long base, unsigned long size, mtrr_type typ
265 */ 269 */
266 if (reg != ~0U) 270 if (reg != ~0U)
267 mtrr_if->set(reg, base, size, type); 271 mtrr_if->set(reg, base, size, type);
272 else if (!mtrr_aps_delayed_init)
273 mtrr_if->set_all();
268 274
269 /* Wait for the others */ 275 /* Wait for the others */
270 while (atomic_read(&data.count)) 276 while (atomic_read(&data.count))
@@ -721,9 +727,7 @@ void __init mtrr_bp_init(void)
721 727
722void mtrr_ap_init(void) 728void mtrr_ap_init(void)
723{ 729{
724 unsigned long flags; 730 if (!use_intel() || mtrr_aps_delayed_init)
725
726 if (!mtrr_if || !use_intel())
727 return; 731 return;
728 /* 732 /*
729 * Ideally we should hold mtrr_mutex here to avoid mtrr entries 733 * Ideally we should hold mtrr_mutex here to avoid mtrr entries
@@ -738,11 +742,7 @@ void mtrr_ap_init(void)
738 * 2. cpu hotadd time. We let mtrr_add/del_page hold cpuhotplug 742 * 2. cpu hotadd time. We let mtrr_add/del_page hold cpuhotplug
739 * lock to prevent mtrr entry changes 743 * lock to prevent mtrr entry changes
740 */ 744 */
741 local_irq_save(flags); 745 set_mtrr(~0U, 0, 0, 0);
742
743 mtrr_if->set_all();
744
745 local_irq_restore(flags);
746} 746}
747 747
748/** 748/**
@@ -753,6 +753,34 @@ void mtrr_save_state(void)
753 smp_call_function_single(0, mtrr_save_fixed_ranges, NULL, 1); 753 smp_call_function_single(0, mtrr_save_fixed_ranges, NULL, 1);
754} 754}
755 755
756void set_mtrr_aps_delayed_init(void)
757{
758 if (!use_intel())
759 return;
760
761 mtrr_aps_delayed_init = true;
762}
763
764/*
765 * MTRR initialization for all AP's
766 */
767void mtrr_aps_init(void)
768{
769 if (!use_intel())
770 return;
771
772 set_mtrr(~0U, 0, 0, 0);
773 mtrr_aps_delayed_init = false;
774}
775
776void mtrr_bp_restore(void)
777{
778 if (!use_intel())
779 return;
780
781 mtrr_if->set_all();
782}
783
756static int __init mtrr_init_finialize(void) 784static int __init mtrr_init_finialize(void)
757{ 785{
758 if (!mtrr_if) 786 if (!mtrr_if)
diff --git a/arch/x86/kernel/cpu/perf_counter.c b/arch/x86/kernel/cpu/perf_counter.c
index f9cd0849bd42..2732e2c1e4d3 100644
--- a/arch/x86/kernel/cpu/perf_counter.c
+++ b/arch/x86/kernel/cpu/perf_counter.c
@@ -1211,7 +1211,7 @@ amd_pmu_disable_counter(struct hw_perf_counter *hwc, int idx)
1211 x86_pmu_disable_counter(hwc, idx); 1211 x86_pmu_disable_counter(hwc, idx);
1212} 1212}
1213 1213
1214static DEFINE_PER_CPU(u64, prev_left[X86_PMC_IDX_MAX]); 1214static DEFINE_PER_CPU(u64 [X86_PMC_IDX_MAX], pmc_prev_left);
1215 1215
1216/* 1216/*
1217 * Set the next IRQ period, based on the hwc->period_left value. 1217 * Set the next IRQ period, based on the hwc->period_left value.
@@ -1253,7 +1253,7 @@ x86_perf_counter_set_period(struct perf_counter *counter,
1253 if (left > x86_pmu.max_period) 1253 if (left > x86_pmu.max_period)
1254 left = x86_pmu.max_period; 1254 left = x86_pmu.max_period;
1255 1255
1256 per_cpu(prev_left[idx], smp_processor_id()) = left; 1256 per_cpu(pmc_prev_left[idx], smp_processor_id()) = left;
1257 1257
1258 /* 1258 /*
1259 * The hw counter starts counting from this counter offset, 1259 * The hw counter starts counting from this counter offset,
@@ -1470,7 +1470,7 @@ void perf_counter_print_debug(void)
1470 rdmsrl(x86_pmu.eventsel + idx, pmc_ctrl); 1470 rdmsrl(x86_pmu.eventsel + idx, pmc_ctrl);
1471 rdmsrl(x86_pmu.perfctr + idx, pmc_count); 1471 rdmsrl(x86_pmu.perfctr + idx, pmc_count);
1472 1472
1473 prev_left = per_cpu(prev_left[idx], cpu); 1473 prev_left = per_cpu(pmc_prev_left[idx], cpu);
1474 1474
1475 pr_info("CPU#%d: gen-PMC%d ctrl: %016llx\n", 1475 pr_info("CPU#%d: gen-PMC%d ctrl: %016llx\n",
1476 cpu, idx, pmc_ctrl); 1476 cpu, idx, pmc_ctrl);
@@ -2110,8 +2110,8 @@ void callchain_store(struct perf_callchain_entry *entry, u64 ip)
2110 entry->ip[entry->nr++] = ip; 2110 entry->ip[entry->nr++] = ip;
2111} 2111}
2112 2112
2113static DEFINE_PER_CPU(struct perf_callchain_entry, irq_entry); 2113static DEFINE_PER_CPU(struct perf_callchain_entry, pmc_irq_entry);
2114static DEFINE_PER_CPU(struct perf_callchain_entry, nmi_entry); 2114static DEFINE_PER_CPU(struct perf_callchain_entry, pmc_nmi_entry);
2115static DEFINE_PER_CPU(int, in_nmi_frame); 2115static DEFINE_PER_CPU(int, in_nmi_frame);
2116 2116
2117 2117
@@ -2264,9 +2264,9 @@ struct perf_callchain_entry *perf_callchain(struct pt_regs *regs)
2264 struct perf_callchain_entry *entry; 2264 struct perf_callchain_entry *entry;
2265 2265
2266 if (in_nmi()) 2266 if (in_nmi())
2267 entry = &__get_cpu_var(nmi_entry); 2267 entry = &__get_cpu_var(pmc_nmi_entry);
2268 else 2268 else
2269 entry = &__get_cpu_var(irq_entry); 2269 entry = &__get_cpu_var(pmc_irq_entry);
2270 2270
2271 entry->nr = 0; 2271 entry->nr = 0;
2272 2272
diff --git a/arch/x86/kernel/cpu/sched.c b/arch/x86/kernel/cpu/sched.c
new file mode 100644
index 000000000000..a640ae5ad201
--- /dev/null
+++ b/arch/x86/kernel/cpu/sched.c
@@ -0,0 +1,55 @@
1#include <linux/sched.h>
2#include <linux/math64.h>
3#include <linux/percpu.h>
4#include <linux/irqflags.h>
5
6#include <asm/cpufeature.h>
7#include <asm/processor.h>
8
9#ifdef CONFIG_SMP
10
11static DEFINE_PER_CPU(struct aperfmperf, old_perf_sched);
12
13static unsigned long scale_aperfmperf(void)
14{
15 struct aperfmperf val, *old = &__get_cpu_var(old_perf_sched);
16 unsigned long ratio, flags;
17
18 local_irq_save(flags);
19 get_aperfmperf(&val);
20 local_irq_restore(flags);
21
22 ratio = calc_aperfmperf_ratio(old, &val);
23 *old = val;
24
25 return ratio;
26}
27
28unsigned long arch_scale_freq_power(struct sched_domain *sd, int cpu)
29{
30 /*
31 * do aperf/mperf on the cpu level because it includes things
32 * like turbo mode, which are relevant to full cores.
33 */
34 if (boot_cpu_has(X86_FEATURE_APERFMPERF))
35 return scale_aperfmperf();
36
37 /*
38 * maybe have something cpufreq here
39 */
40
41 return default_scale_freq_power(sd, cpu);
42}
43
44unsigned long arch_scale_smt_power(struct sched_domain *sd, int cpu)
45{
46 /*
47 * aperf/mperf already includes the smt gain
48 */
49 if (boot_cpu_has(X86_FEATURE_APERFMPERF))
50 return SCHED_LOAD_SCALE;
51
52 return default_scale_smt_power(sd, cpu);
53}
54
55#endif
diff --git a/arch/x86/kernel/entry_64.S b/arch/x86/kernel/entry_64.S
index c251be745107..d59fe323807e 100644
--- a/arch/x86/kernel/entry_64.S
+++ b/arch/x86/kernel/entry_64.S
@@ -146,7 +146,7 @@ ENTRY(ftrace_graph_caller)
146END(ftrace_graph_caller) 146END(ftrace_graph_caller)
147 147
148GLOBAL(return_to_handler) 148GLOBAL(return_to_handler)
149 subq $80, %rsp 149 subq $24, %rsp
150 150
151 /* Save the return values */ 151 /* Save the return values */
152 movq %rax, (%rsp) 152 movq %rax, (%rsp)
@@ -155,10 +155,10 @@ GLOBAL(return_to_handler)
155 155
156 call ftrace_return_to_handler 156 call ftrace_return_to_handler
157 157
158 movq %rax, 72(%rsp) 158 movq %rax, 16(%rsp)
159 movq 8(%rsp), %rdx 159 movq 8(%rsp), %rdx
160 movq (%rsp), %rax 160 movq (%rsp), %rax
161 addq $72, %rsp 161 addq $16, %rsp
162 retq 162 retq
163#endif 163#endif
164 164
diff --git a/arch/x86/kernel/irq.c b/arch/x86/kernel/irq.c
index b0cdde6932f5..74656d1d4e30 100644
--- a/arch/x86/kernel/irq.c
+++ b/arch/x86/kernel/irq.c
@@ -104,7 +104,7 @@ static int show_other_interrupts(struct seq_file *p, int prec)
104 seq_printf(p, " Threshold APIC interrupts\n"); 104 seq_printf(p, " Threshold APIC interrupts\n");
105# endif 105# endif
106#endif 106#endif
107#ifdef CONFIG_X86_NEW_MCE 107#ifdef CONFIG_X86_MCE
108 seq_printf(p, "%*s: ", prec, "MCE"); 108 seq_printf(p, "%*s: ", prec, "MCE");
109 for_each_online_cpu(j) 109 for_each_online_cpu(j)
110 seq_printf(p, "%10u ", per_cpu(mce_exception_count, j)); 110 seq_printf(p, "%10u ", per_cpu(mce_exception_count, j));
@@ -200,7 +200,7 @@ u64 arch_irq_stat_cpu(unsigned int cpu)
200 sum += irq_stats(cpu)->irq_threshold_count; 200 sum += irq_stats(cpu)->irq_threshold_count;
201# endif 201# endif
202#endif 202#endif
203#ifdef CONFIG_X86_NEW_MCE 203#ifdef CONFIG_X86_MCE
204 sum += per_cpu(mce_exception_count, cpu); 204 sum += per_cpu(mce_exception_count, cpu);
205 sum += per_cpu(mce_poll_count, cpu); 205 sum += per_cpu(mce_poll_count, cpu);
206#endif 206#endif
diff --git a/arch/x86/kernel/irqinit.c b/arch/x86/kernel/irqinit.c
index 92b7703d3d58..ccf8ab54f31a 100644
--- a/arch/x86/kernel/irqinit.c
+++ b/arch/x86/kernel/irqinit.c
@@ -190,7 +190,7 @@ static void __init apic_intr_init(void)
190#ifdef CONFIG_X86_MCE_THRESHOLD 190#ifdef CONFIG_X86_MCE_THRESHOLD
191 alloc_intr_gate(THRESHOLD_APIC_VECTOR, threshold_interrupt); 191 alloc_intr_gate(THRESHOLD_APIC_VECTOR, threshold_interrupt);
192#endif 192#endif
193#if defined(CONFIG_X86_NEW_MCE) && defined(CONFIG_X86_LOCAL_APIC) 193#if defined(CONFIG_X86_MCE) && defined(CONFIG_X86_LOCAL_APIC)
194 alloc_intr_gate(MCE_SELF_VECTOR, mce_self_interrupt); 194 alloc_intr_gate(MCE_SELF_VECTOR, mce_self_interrupt);
195#endif 195#endif
196 196
diff --git a/arch/x86/kernel/pci-dma.c b/arch/x86/kernel/pci-dma.c
index d71c8655905b..64b838eac18c 100644
--- a/arch/x86/kernel/pci-dma.c
+++ b/arch/x86/kernel/pci-dma.c
@@ -225,10 +225,8 @@ static __init int iommu_setup(char *p)
225 if (!strncmp(p, "soft", 4)) 225 if (!strncmp(p, "soft", 4))
226 swiotlb = 1; 226 swiotlb = 1;
227#endif 227#endif
228 if (!strncmp(p, "pt", 2)) { 228 if (!strncmp(p, "pt", 2))
229 iommu_pass_through = 1; 229 iommu_pass_through = 1;
230 return 1;
231 }
232 230
233 gart_parse_options(p); 231 gart_parse_options(p);
234 232
diff --git a/arch/x86/kernel/quirks.c b/arch/x86/kernel/quirks.c
index af71d06624bf..6c3b2c6fd772 100644
--- a/arch/x86/kernel/quirks.c
+++ b/arch/x86/kernel/quirks.c
@@ -508,7 +508,7 @@ static void __init quirk_amd_nb_node(struct pci_dev *dev)
508 508
509 pci_read_config_dword(nb_ht, 0x60, &val); 509 pci_read_config_dword(nb_ht, 0x60, &val);
510 set_dev_node(&dev->dev, val & 7); 510 set_dev_node(&dev->dev, val & 7);
511 pci_dev_put(dev); 511 pci_dev_put(nb_ht);
512} 512}
513 513
514DECLARE_PCI_FIXUP_FINAL(PCI_VENDOR_ID_AMD, PCI_DEVICE_ID_AMD_K8_NB, 514DECLARE_PCI_FIXUP_FINAL(PCI_VENDOR_ID_AMD, PCI_DEVICE_ID_AMD_K8_NB,
diff --git a/arch/x86/kernel/reboot.c b/arch/x86/kernel/reboot.c
index a06e8d101844..27349f92a6d7 100644
--- a/arch/x86/kernel/reboot.c
+++ b/arch/x86/kernel/reboot.c
@@ -4,6 +4,7 @@
4#include <linux/pm.h> 4#include <linux/pm.h>
5#include <linux/efi.h> 5#include <linux/efi.h>
6#include <linux/dmi.h> 6#include <linux/dmi.h>
7#include <linux/tboot.h>
7#include <acpi/reboot.h> 8#include <acpi/reboot.h>
8#include <asm/io.h> 9#include <asm/io.h>
9#include <asm/apic.h> 10#include <asm/apic.h>
@@ -508,6 +509,8 @@ static void native_machine_emergency_restart(void)
508 if (reboot_emergency) 509 if (reboot_emergency)
509 emergency_vmx_disable_all(); 510 emergency_vmx_disable_all();
510 511
512 tboot_shutdown(TB_SHUTDOWN_REBOOT);
513
511 /* Tell the BIOS if we want cold or warm reboot */ 514 /* Tell the BIOS if we want cold or warm reboot */
512 *((unsigned short *)__va(0x472)) = reboot_mode; 515 *((unsigned short *)__va(0x472)) = reboot_mode;
513 516
@@ -634,6 +637,8 @@ static void native_machine_halt(void)
634 /* stop other cpus and apics */ 637 /* stop other cpus and apics */
635 machine_shutdown(); 638 machine_shutdown();
636 639
640 tboot_shutdown(TB_SHUTDOWN_HALT);
641
637 /* stop this cpu */ 642 /* stop this cpu */
638 stop_this_cpu(NULL); 643 stop_this_cpu(NULL);
639} 644}
@@ -645,6 +650,8 @@ static void native_machine_power_off(void)
645 machine_shutdown(); 650 machine_shutdown();
646 pm_power_off(); 651 pm_power_off();
647 } 652 }
653 /* a fallback in case there is no PM info available */
654 tboot_shutdown(TB_SHUTDOWN_HALT);
648} 655}
649 656
650struct machine_ops machine_ops = { 657struct machine_ops machine_ops = {
diff --git a/arch/x86/kernel/setup.c b/arch/x86/kernel/setup.c
index 63f32d220ef2..19f15c4076fb 100644
--- a/arch/x86/kernel/setup.c
+++ b/arch/x86/kernel/setup.c
@@ -66,6 +66,7 @@
66 66
67#include <linux/percpu.h> 67#include <linux/percpu.h>
68#include <linux/crash_dump.h> 68#include <linux/crash_dump.h>
69#include <linux/tboot.h>
69 70
70#include <video/edid.h> 71#include <video/edid.h>
71 72
@@ -711,6 +712,21 @@ void __init setup_arch(char **cmdline_p)
711 printk(KERN_INFO "Command line: %s\n", boot_command_line); 712 printk(KERN_INFO "Command line: %s\n", boot_command_line);
712#endif 713#endif
713 714
715 strlcpy(command_line, boot_command_line, COMMAND_LINE_SIZE);
716 *cmdline_p = command_line;
717
718#ifdef CONFIG_X86_64
719 /*
720 * Must call this twice: Once just to detect whether hardware doesn't
721 * support NX (so that the early EHCI debug console setup can safely
722 * call set_fixmap(), and then again after parsing early parameters to
723 * honor the respective command line option.
724 */
725 check_efer();
726#endif
727
728 parse_early_param();
729
714 /* VMI may relocate the fixmap; do this before touching ioremap area */ 730 /* VMI may relocate the fixmap; do this before touching ioremap area */
715 vmi_init(); 731 vmi_init();
716 732
@@ -793,11 +809,6 @@ void __init setup_arch(char **cmdline_p)
793#endif 809#endif
794#endif 810#endif
795 811
796 strlcpy(command_line, boot_command_line, COMMAND_LINE_SIZE);
797 *cmdline_p = command_line;
798
799 parse_early_param();
800
801#ifdef CONFIG_X86_64 812#ifdef CONFIG_X86_64
802 check_efer(); 813 check_efer();
803#endif 814#endif
@@ -977,6 +988,8 @@ void __init setup_arch(char **cmdline_p)
977 paravirt_pagetable_setup_done(swapper_pg_dir); 988 paravirt_pagetable_setup_done(swapper_pg_dir);
978 paravirt_post_allocator_init(); 989 paravirt_post_allocator_init();
979 990
991 tboot_probe();
992
980#ifdef CONFIG_X86_64 993#ifdef CONFIG_X86_64
981 map_vsyscall(); 994 map_vsyscall();
982#endif 995#endif
diff --git a/arch/x86/kernel/setup_percpu.c b/arch/x86/kernel/setup_percpu.c
index 07d81916f212..d559af913e1f 100644
--- a/arch/x86/kernel/setup_percpu.c
+++ b/arch/x86/kernel/setup_percpu.c
@@ -55,6 +55,7 @@ EXPORT_SYMBOL(__per_cpu_offset);
55#define PERCPU_FIRST_CHUNK_RESERVE 0 55#define PERCPU_FIRST_CHUNK_RESERVE 0
56#endif 56#endif
57 57
58#ifdef CONFIG_X86_32
58/** 59/**
59 * pcpu_need_numa - determine percpu allocation needs to consider NUMA 60 * pcpu_need_numa - determine percpu allocation needs to consider NUMA
60 * 61 *
@@ -83,6 +84,7 @@ static bool __init pcpu_need_numa(void)
83#endif 84#endif
84 return false; 85 return false;
85} 86}
87#endif
86 88
87/** 89/**
88 * pcpu_alloc_bootmem - NUMA friendly alloc_bootmem wrapper for percpu 90 * pcpu_alloc_bootmem - NUMA friendly alloc_bootmem wrapper for percpu
@@ -124,308 +126,35 @@ static void * __init pcpu_alloc_bootmem(unsigned int cpu, unsigned long size,
124} 126}
125 127
126/* 128/*
127 * Large page remap allocator 129 * Helpers for first chunk memory allocation
128 *
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.
131 * As PMD page is quite large, only part of it is used for the first
132 * chunk. Unused part is returned to the bootmem allocator.
133 *
134 * So, the PMD pages are mapped twice - once to the physical mapping
135 * and to the vmalloc area for the first percpu chunk. The double
136 * mapping does add one more PMD TLB entry pressure but still is much
137 * better than only using 4k mappings while still being NUMA friendly.
138 */ 130 */
139#ifdef CONFIG_NEED_MULTIPLE_NODES 131static void * __init pcpu_fc_alloc(unsigned int cpu, size_t size, size_t align)
140struct pcpul_ent {
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;
148
149static struct page * __init pcpul_get_page(unsigned int cpu, int pageno)
150{ 132{
151 size_t off = (size_t)pageno << PAGE_SHIFT; 133 return pcpu_alloc_bootmem(cpu, size, align);
152
153 if (off >= pcpul_size)
154 return NULL;
155
156 return virt_to_page(pcpul_map[cpu].ptr + off);
157} 134}
158 135
159static ssize_t __init setup_pcpu_lpage(size_t static_size, bool chosen) 136static void __init pcpu_fc_free(void *ptr, size_t size)
160{ 137{
161 size_t map_size, dyn_size; 138 free_bootmem(__pa(ptr), size);
162 unsigned int cpu;
163 int i, j;
164 ssize_t ret;
165
166 if (!chosen) {
167 size_t vm_size = VMALLOC_END - VMALLOC_START;
168 size_t tot_size = nr_cpu_ids * PMD_SIZE;
169
170 /* on non-NUMA, embedding is better */
171 if (!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");
185 return -EINVAL;
186 }
187
188 /*
189 * Currently supports only single page. Supporting multiple
190 * pages won't be too difficult if it ever becomes necessary.
191 */
192 pcpul_size = PFN_ALIGN(static_size + PERCPU_MODULE_RESERVE +
193 PERCPU_DYNAMIC_RESERVE);
194 if (pcpul_size > PMD_SIZE) {
195 pr_warning("PERCPU: static data is larger than large page, "
196 "can't use large page\n");
197 return -EINVAL;
198 }
199 dyn_size = pcpul_size - static_size - PERCPU_FIRST_CHUNK_RESERVE;
200
201 /* allocate pointer array and alloc large pages */
202 map_size = PFN_ALIGN(nr_cpu_ids * sizeof(pcpul_map[0]));
203 pcpul_map = alloc_bootmem(map_size);
204
205 for_each_possible_cpu(cpu) {
206 pcpul_map[cpu].cpu = 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);
212 goto enomem;
213 }
214
215 /*
216 * Only use pcpul_size bytes and give back the rest.
217 *
218 * Ingo: The 2MB up-rounding bootmem is needed to make
219 * sure the partial 2MB page is still fully RAM - it's
220 * not well-specified to have a PAT-incompatible area
221 * (unmapped RAM, device memory, etc.) in that hole.
222 */
223 free_bootmem(__pa(pcpul_map[cpu].ptr + pcpul_size),
224 PMD_SIZE - pcpul_size);
225
226 memcpy(pcpul_map[cpu].ptr, __per_cpu_load, static_size);
227 }
228
229 /* allocate address and map */
230 pcpul_vm.flags = VM_ALLOC;
231 pcpul_vm.size = nr_cpu_ids * PMD_SIZE;
232 vm_area_register_early(&pcpul_vm, PMD_SIZE);
233
234 for_each_possible_cpu(cpu) {
235 pmd_t *pmd, pmd_v;
236
237 pmd = populate_extra_pmd((unsigned long)pcpul_vm.addr +
238 cpu * PMD_SIZE);
239 pmd_v = pfn_pmd(page_to_pfn(virt_to_page(pcpul_map[cpu].ptr)),
240 PAGE_KERNEL_LARGE);
241 set_pmd(pmd, pmd_v);
242 }
243
244 /* we're ready, commit */
245 pr_info("PERCPU: Remapped at %p with large pages, static data "
246 "%zu bytes\n", pcpul_vm.addr, static_size);
247
248 ret = pcpu_setup_first_chunk(pcpul_get_page, static_size,
249 PERCPU_FIRST_CHUNK_RESERVE, dyn_size,
250 PMD_SIZE, pcpul_vm.addr, NULL);
251
252 /* sort pcpul_map array for pcpu_lpage_remapped() */
253 for (i = 0; i < nr_cpu_ids - 1; i++)
254 for (j = i + 1; j < nr_cpu_ids; 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;
262
263enomem:
264 for_each_possible_cpu(cpu)
265 if (pcpul_map[cpu].ptr)
266 free_bootmem(__pa(pcpul_map[cpu].ptr), pcpul_size);
267 free_bootmem(__pa(pcpul_map), map_size);
268 return -ENOMEM;
269} 139}
270 140
271/** 141static int __init pcpu_cpu_distance(unsigned int from, unsigned int to)
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{ 142{
289 void *pmd_addr = (void *)((unsigned long)kaddr & PMD_MASK); 143#ifdef CONFIG_NEED_MULTIPLE_NODES
290 unsigned long offset = (unsigned long)kaddr & ~PMD_MASK; 144 if (early_cpu_to_node(from) == early_cpu_to_node(to))
291 int left = 0, right = nr_cpu_ids - 1; 145 return LOCAL_DISTANCE;
292 int pos; 146 else
293 147 return REMOTE_DISTANCE;
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;
316}
317#else 148#else
318static ssize_t __init setup_pcpu_lpage(size_t static_size, bool chosen) 149 return LOCAL_DISTANCE;
319{
320 return -EINVAL;
321}
322#endif 150#endif
323
324/*
325 * Embedding allocator
326 *
327 * The first chunk is sized to just contain the static area plus
328 * module and dynamic reserves and embedded into linear physical
329 * mapping so that it can use PMD mapping without additional TLB
330 * pressure.
331 */
332static ssize_t __init setup_pcpu_embed(size_t static_size, bool chosen)
333{
334 size_t reserve = PERCPU_MODULE_RESERVE + PERCPU_DYNAMIC_RESERVE;
335
336 /*
337 * If large page isn't supported, there's no benefit in doing
338 * this. Also, embedding allocation doesn't play well with
339 * NUMA.
340 */
341 if (!chosen && (!cpu_has_pse || pcpu_need_numa()))
342 return -EINVAL;
343
344 return pcpu_embed_first_chunk(static_size, PERCPU_FIRST_CHUNK_RESERVE,
345 reserve - PERCPU_FIRST_CHUNK_RESERVE, -1);
346} 151}
347 152
348/* 153static void __init pcpup_populate_pte(unsigned long addr)
349 * 4k page allocator
350 *
351 * This is the basic allocator. Static percpu area is allocated
352 * page-by-page and most of initialization is done by the generic
353 * setup function.
354 */
355static struct page **pcpu4k_pages __initdata;
356static int pcpu4k_nr_static_pages __initdata;
357
358static struct page * __init pcpu4k_get_page(unsigned int cpu, int pageno)
359{
360 if (pageno < pcpu4k_nr_static_pages)
361 return pcpu4k_pages[cpu * pcpu4k_nr_static_pages + pageno];
362 return NULL;
363}
364
365static void __init pcpu4k_populate_pte(unsigned long addr)
366{ 154{
367 populate_extra_pte(addr); 155 populate_extra_pte(addr);
368} 156}
369 157
370static ssize_t __init setup_pcpu_4k(size_t static_size)
371{
372 size_t pages_size;
373 unsigned int cpu;
374 int i, j;
375 ssize_t ret;
376
377 pcpu4k_nr_static_pages = PFN_UP(static_size);
378
379 /* unaligned allocations can't be freed, round up to page size */
380 pages_size = PFN_ALIGN(pcpu4k_nr_static_pages * nr_cpu_ids
381 * sizeof(pcpu4k_pages[0]));
382 pcpu4k_pages = alloc_bootmem(pages_size);
383
384 /* allocate and copy */
385 j = 0;
386 for_each_possible_cpu(cpu)
387 for (i = 0; i < pcpu4k_nr_static_pages; i++) {
388 void *ptr;
389
390 ptr = pcpu_alloc_bootmem(cpu, PAGE_SIZE, PAGE_SIZE);
391 if (!ptr) {
392 pr_warning("PERCPU: failed to allocate "
393 "4k page for cpu%u\n", cpu);
394 goto enomem;
395 }
396
397 memcpy(ptr, __per_cpu_load + i * PAGE_SIZE, PAGE_SIZE);
398 pcpu4k_pages[j++] = virt_to_page(ptr);
399 }
400
401 /* we're ready, commit */
402 pr_info("PERCPU: Allocated %d 4k pages, static data %zu bytes\n",
403 pcpu4k_nr_static_pages, static_size);
404
405 ret = pcpu_setup_first_chunk(pcpu4k_get_page, static_size,
406 PERCPU_FIRST_CHUNK_RESERVE, -1,
407 -1, NULL, pcpu4k_populate_pte);
408 goto out_free_ar;
409
410enomem:
411 while (--j >= 0)
412 free_bootmem(__pa(page_address(pcpu4k_pages[j])), PAGE_SIZE);
413 ret = -ENOMEM;
414out_free_ar:
415 free_bootmem(__pa(pcpu4k_pages), pages_size);
416 return ret;
417}
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
429static inline void setup_percpu_segment(int cpu) 158static inline void setup_percpu_segment(int cpu)
430{ 159{
431#ifdef CONFIG_X86_32 160#ifdef CONFIG_X86_32
@@ -441,52 +170,49 @@ static inline void setup_percpu_segment(int cpu)
441 170
442void __init setup_per_cpu_areas(void) 171void __init setup_per_cpu_areas(void)
443{ 172{
444 size_t static_size = __per_cpu_end - __per_cpu_start;
445 unsigned int cpu; 173 unsigned int cpu;
446 unsigned long delta; 174 unsigned long delta;
447 size_t pcpu_unit_size; 175 int rc;
448 ssize_t ret;
449 176
450 pr_info("NR_CPUS:%d nr_cpumask_bits:%d nr_cpu_ids:%d nr_node_ids:%d\n", 177 pr_info("NR_CPUS:%d nr_cpumask_bits:%d nr_cpu_ids:%d nr_node_ids:%d\n",
451 NR_CPUS, nr_cpumask_bits, nr_cpu_ids, nr_node_ids); 178 NR_CPUS, nr_cpumask_bits, nr_cpu_ids, nr_node_ids);
452 179
453 /* 180 /*
454 * Allocate percpu area. If PSE is supported, try to make use 181 * Allocate percpu area. Embedding allocator is our favorite;
455 * of large page mappings. Please read comments on top of 182 * however, on NUMA configurations, it can result in very
456 * each allocator for details. 183 * sparse unit mapping and vmalloc area isn't spacious enough
184 * on 32bit. Use page in that case.
457 */ 185 */
458 ret = -EINVAL; 186#ifdef CONFIG_X86_32
459 if (strlen(pcpu_chosen_alloc)) { 187 if (pcpu_chosen_fc == PCPU_FC_AUTO && pcpu_need_numa())
460 if (strcmp(pcpu_chosen_alloc, "4k")) { 188 pcpu_chosen_fc = PCPU_FC_PAGE;
461 if (!strcmp(pcpu_chosen_alloc, "lpage")) 189#endif
462 ret = setup_pcpu_lpage(static_size, true); 190 rc = -EINVAL;
463 else if (!strcmp(pcpu_chosen_alloc, "embed")) 191 if (pcpu_chosen_fc != PCPU_FC_PAGE) {
464 ret = setup_pcpu_embed(static_size, true); 192 const size_t atom_size = cpu_has_pse ? PMD_SIZE : PAGE_SIZE;
465 else 193 const size_t dyn_size = PERCPU_MODULE_RESERVE +
466 pr_warning("PERCPU: unknown allocator %s " 194 PERCPU_DYNAMIC_RESERVE - PERCPU_FIRST_CHUNK_RESERVE;
467 "specified\n", pcpu_chosen_alloc); 195
468 if (ret < 0) 196 rc = pcpu_embed_first_chunk(PERCPU_FIRST_CHUNK_RESERVE,
469 pr_warning("PERCPU: %s allocator failed (%zd), " 197 dyn_size, atom_size,
470 "falling back to 4k\n", 198 pcpu_cpu_distance,
471 pcpu_chosen_alloc, ret); 199 pcpu_fc_alloc, pcpu_fc_free);
472 } 200 if (rc < 0)
473 } else { 201 pr_warning("PERCPU: %s allocator failed (%d), "
474 ret = setup_pcpu_lpage(static_size, false); 202 "falling back to page size\n",
475 if (ret < 0) 203 pcpu_fc_names[pcpu_chosen_fc], rc);
476 ret = setup_pcpu_embed(static_size, false);
477 } 204 }
478 if (ret < 0) 205 if (rc < 0)
479 ret = setup_pcpu_4k(static_size); 206 rc = pcpu_page_first_chunk(PERCPU_FIRST_CHUNK_RESERVE,
480 if (ret < 0) 207 pcpu_fc_alloc, pcpu_fc_free,
481 panic("cannot allocate static percpu area (%zu bytes, err=%zd)", 208 pcpup_populate_pte);
482 static_size, ret); 209 if (rc < 0)
483 210 panic("cannot initialize percpu area (err=%d)", rc);
484 pcpu_unit_size = ret;
485 211
486 /* alrighty, percpu areas up and running */ 212 /* alrighty, percpu areas up and running */
487 delta = (unsigned long)pcpu_base_addr - (unsigned long)__per_cpu_start; 213 delta = (unsigned long)pcpu_base_addr - (unsigned long)__per_cpu_start;
488 for_each_possible_cpu(cpu) { 214 for_each_possible_cpu(cpu) {
489 per_cpu_offset(cpu) = delta + cpu * pcpu_unit_size; 215 per_cpu_offset(cpu) = delta + pcpu_unit_offsets[cpu];
490 per_cpu(this_cpu_off, cpu) = per_cpu_offset(cpu); 216 per_cpu(this_cpu_off, cpu) = per_cpu_offset(cpu);
491 per_cpu(cpu_number, cpu) = cpu; 217 per_cpu(cpu_number, cpu) = cpu;
492 setup_percpu_segment(cpu); 218 setup_percpu_segment(cpu);
diff --git a/arch/x86/kernel/signal.c b/arch/x86/kernel/signal.c
index 81e58238c4ce..6a44a76055ad 100644
--- a/arch/x86/kernel/signal.c
+++ b/arch/x86/kernel/signal.c
@@ -856,7 +856,7 @@ static void do_signal(struct pt_regs *regs)
856void 856void
857do_notify_resume(struct pt_regs *regs, void *unused, __u32 thread_info_flags) 857do_notify_resume(struct pt_regs *regs, void *unused, __u32 thread_info_flags)
858{ 858{
859#ifdef CONFIG_X86_NEW_MCE 859#ifdef CONFIG_X86_MCE
860 /* notify userspace of pending MCEs */ 860 /* notify userspace of pending MCEs */
861 if (thread_info_flags & _TIF_MCE_NOTIFY) 861 if (thread_info_flags & _TIF_MCE_NOTIFY)
862 mce_notify_process(); 862 mce_notify_process();
diff --git a/arch/x86/kernel/smpboot.c b/arch/x86/kernel/smpboot.c
index c36cc1452cdc..a25eeec00080 100644
--- a/arch/x86/kernel/smpboot.c
+++ b/arch/x86/kernel/smpboot.c
@@ -47,6 +47,7 @@
47#include <linux/bootmem.h> 47#include <linux/bootmem.h>
48#include <linux/err.h> 48#include <linux/err.h>
49#include <linux/nmi.h> 49#include <linux/nmi.h>
50#include <linux/tboot.h>
50 51
51#include <asm/acpi.h> 52#include <asm/acpi.h>
52#include <asm/desc.h> 53#include <asm/desc.h>
@@ -1117,9 +1118,22 @@ void __init native_smp_prepare_cpus(unsigned int max_cpus)
1117 1118
1118 if (is_uv_system()) 1119 if (is_uv_system())
1119 uv_system_init(); 1120 uv_system_init();
1121
1122 set_mtrr_aps_delayed_init();
1120out: 1123out:
1121 preempt_enable(); 1124 preempt_enable();
1122} 1125}
1126
1127void arch_enable_nonboot_cpus_begin(void)
1128{
1129 set_mtrr_aps_delayed_init();
1130}
1131
1132void arch_enable_nonboot_cpus_end(void)
1133{
1134 mtrr_aps_init();
1135}
1136
1123/* 1137/*
1124 * Early setup to make printk work. 1138 * Early setup to make printk work.
1125 */ 1139 */
@@ -1141,6 +1155,7 @@ void __init native_smp_cpus_done(unsigned int max_cpus)
1141 setup_ioapic_dest(); 1155 setup_ioapic_dest();
1142#endif 1156#endif
1143 check_nmi_watchdog(); 1157 check_nmi_watchdog();
1158 mtrr_aps_init();
1144} 1159}
1145 1160
1146static int __initdata setup_possible_cpus = -1; 1161static int __initdata setup_possible_cpus = -1;
@@ -1318,6 +1333,7 @@ void play_dead_common(void)
1318void native_play_dead(void) 1333void native_play_dead(void)
1319{ 1334{
1320 play_dead_common(); 1335 play_dead_common();
1336 tboot_shutdown(TB_SHUTDOWN_WFS);
1321 wbinvd_halt(); 1337 wbinvd_halt();
1322} 1338}
1323 1339
diff --git a/arch/x86/kernel/tboot.c b/arch/x86/kernel/tboot.c
new file mode 100644
index 000000000000..86c9f91b48ae
--- /dev/null
+++ b/arch/x86/kernel/tboot.c
@@ -0,0 +1,447 @@
1/*
2 * tboot.c: main implementation of helper functions used by kernel for
3 * runtime support of Intel(R) Trusted Execution Technology
4 *
5 * Copyright (c) 2006-2009, Intel Corporation
6 *
7 * This program is free software; you can redistribute it and/or modify it
8 * under the terms and conditions of the GNU General Public License,
9 * version 2, as published by the Free Software Foundation.
10 *
11 * This program is distributed in the hope it will be useful, but WITHOUT
12 * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
13 * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for
14 * more details.
15 *
16 * You should have received a copy of the GNU General Public License along with
17 * this program; if not, write to the Free Software Foundation, Inc.,
18 * 51 Franklin St - Fifth Floor, Boston, MA 02110-1301 USA.
19 *
20 */
21
22#include <linux/dma_remapping.h>
23#include <linux/init_task.h>
24#include <linux/spinlock.h>
25#include <linux/delay.h>
26#include <linux/sched.h>
27#include <linux/init.h>
28#include <linux/dmar.h>
29#include <linux/cpu.h>
30#include <linux/pfn.h>
31#include <linux/mm.h>
32#include <linux/tboot.h>
33
34#include <asm/trampoline.h>
35#include <asm/processor.h>
36#include <asm/bootparam.h>
37#include <asm/pgtable.h>
38#include <asm/pgalloc.h>
39#include <asm/fixmap.h>
40#include <asm/proto.h>
41#include <asm/setup.h>
42#include <asm/e820.h>
43#include <asm/io.h>
44
45#include "acpi/realmode/wakeup.h"
46
47/* Global pointer to shared data; NULL means no measured launch. */
48struct tboot *tboot __read_mostly;
49
50/* timeout for APs (in secs) to enter wait-for-SIPI state during shutdown */
51#define AP_WAIT_TIMEOUT 1
52
53#undef pr_fmt
54#define pr_fmt(fmt) "tboot: " fmt
55
56static u8 tboot_uuid[16] __initdata = TBOOT_UUID;
57
58void __init tboot_probe(void)
59{
60 /* Look for valid page-aligned address for shared page. */
61 if (!boot_params.tboot_addr)
62 return;
63 /*
64 * also verify that it is mapped as we expect it before calling
65 * set_fixmap(), to reduce chance of garbage value causing crash
66 */
67 if (!e820_any_mapped(boot_params.tboot_addr,
68 boot_params.tboot_addr, E820_RESERVED)) {
69 pr_warning("non-0 tboot_addr but it is not of type E820_RESERVED\n");
70 return;
71 }
72
73 /* only a natively booted kernel should be using TXT */
74 if (paravirt_enabled()) {
75 pr_warning("non-0 tboot_addr but pv_ops is enabled\n");
76 return;
77 }
78
79 /* Map and check for tboot UUID. */
80 set_fixmap(FIX_TBOOT_BASE, boot_params.tboot_addr);
81 tboot = (struct tboot *)fix_to_virt(FIX_TBOOT_BASE);
82 if (memcmp(&tboot_uuid, &tboot->uuid, sizeof(tboot->uuid))) {
83 pr_warning("tboot at 0x%llx is invalid\n",
84 boot_params.tboot_addr);
85 tboot = NULL;
86 return;
87 }
88 if (tboot->version < 5) {
89 pr_warning("tboot version is invalid: %u\n", tboot->version);
90 tboot = NULL;
91 return;
92 }
93
94 pr_info("found shared page at phys addr 0x%llx:\n",
95 boot_params.tboot_addr);
96 pr_debug("version: %d\n", tboot->version);
97 pr_debug("log_addr: 0x%08x\n", tboot->log_addr);
98 pr_debug("shutdown_entry: 0x%x\n", tboot->shutdown_entry);
99 pr_debug("tboot_base: 0x%08x\n", tboot->tboot_base);
100 pr_debug("tboot_size: 0x%x\n", tboot->tboot_size);
101}
102
103static pgd_t *tboot_pg_dir;
104static struct mm_struct tboot_mm = {
105 .mm_rb = RB_ROOT,
106 .pgd = swapper_pg_dir,
107 .mm_users = ATOMIC_INIT(2),
108 .mm_count = ATOMIC_INIT(1),
109 .mmap_sem = __RWSEM_INITIALIZER(init_mm.mmap_sem),
110 .page_table_lock = __SPIN_LOCK_UNLOCKED(init_mm.page_table_lock),
111 .mmlist = LIST_HEAD_INIT(init_mm.mmlist),
112 .cpu_vm_mask = CPU_MASK_ALL,
113};
114
115static inline void switch_to_tboot_pt(void)
116{
117 write_cr3(virt_to_phys(tboot_pg_dir));
118}
119
120static int map_tboot_page(unsigned long vaddr, unsigned long pfn,
121 pgprot_t prot)
122{
123 pgd_t *pgd;
124 pud_t *pud;
125 pmd_t *pmd;
126 pte_t *pte;
127
128 pgd = pgd_offset(&tboot_mm, vaddr);
129 pud = pud_alloc(&tboot_mm, pgd, vaddr);
130 if (!pud)
131 return -1;
132 pmd = pmd_alloc(&tboot_mm, pud, vaddr);
133 if (!pmd)
134 return -1;
135 pte = pte_alloc_map(&tboot_mm, pmd, vaddr);
136 if (!pte)
137 return -1;
138 set_pte_at(&tboot_mm, vaddr, pte, pfn_pte(pfn, prot));
139 pte_unmap(pte);
140 return 0;
141}
142
143static int map_tboot_pages(unsigned long vaddr, unsigned long start_pfn,
144 unsigned long nr)
145{
146 /* Reuse the original kernel mapping */
147 tboot_pg_dir = pgd_alloc(&tboot_mm);
148 if (!tboot_pg_dir)
149 return -1;
150
151 for (; nr > 0; nr--, vaddr += PAGE_SIZE, start_pfn++) {
152 if (map_tboot_page(vaddr, start_pfn, PAGE_KERNEL_EXEC))
153 return -1;
154 }
155
156 return 0;
157}
158
159static void tboot_create_trampoline(void)
160{
161 u32 map_base, map_size;
162
163 /* Create identity map for tboot shutdown code. */
164 map_base = PFN_DOWN(tboot->tboot_base);
165 map_size = PFN_UP(tboot->tboot_size);
166 if (map_tboot_pages(map_base << PAGE_SHIFT, map_base, map_size))
167 panic("tboot: Error mapping tboot pages (mfns) @ 0x%x, 0x%x\n",
168 map_base, map_size);
169}
170
171#ifdef CONFIG_ACPI_SLEEP
172
173static void add_mac_region(phys_addr_t start, unsigned long size)
174{
175 struct tboot_mac_region *mr;
176 phys_addr_t end = start + size;
177
178 if (start && size) {
179 mr = &tboot->mac_regions[tboot->num_mac_regions++];
180 mr->start = round_down(start, PAGE_SIZE);
181 mr->size = round_up(end, PAGE_SIZE) - mr->start;
182 }
183}
184
185static int tboot_setup_sleep(void)
186{
187 tboot->num_mac_regions = 0;
188
189 /* S3 resume code */
190 add_mac_region(acpi_wakeup_address, WAKEUP_SIZE);
191
192#ifdef CONFIG_X86_TRAMPOLINE
193 /* AP trampoline code */
194 add_mac_region(virt_to_phys(trampoline_base), TRAMPOLINE_SIZE);
195#endif
196
197 /* kernel code + data + bss */
198 add_mac_region(virt_to_phys(_text), _end - _text);
199
200 tboot->acpi_sinfo.kernel_s3_resume_vector = acpi_wakeup_address;
201
202 return 0;
203}
204
205#else /* no CONFIG_ACPI_SLEEP */
206
207static int tboot_setup_sleep(void)
208{
209 /* S3 shutdown requested, but S3 not supported by the kernel... */
210 BUG();
211 return -1;
212}
213
214#endif
215
216void tboot_shutdown(u32 shutdown_type)
217{
218 void (*shutdown)(void);
219
220 if (!tboot_enabled())
221 return;
222
223 /*
224 * if we're being called before the 1:1 mapping is set up then just
225 * return and let the normal shutdown happen; this should only be
226 * due to very early panic()
227 */
228 if (!tboot_pg_dir)
229 return;
230
231 /* if this is S3 then set regions to MAC */
232 if (shutdown_type == TB_SHUTDOWN_S3)
233 if (tboot_setup_sleep())
234 return;
235
236 tboot->shutdown_type = shutdown_type;
237
238 switch_to_tboot_pt();
239
240 shutdown = (void(*)(void))(unsigned long)tboot->shutdown_entry;
241 shutdown();
242
243 /* should not reach here */
244 while (1)
245 halt();
246}
247
248static void tboot_copy_fadt(const struct acpi_table_fadt *fadt)
249{
250#define TB_COPY_GAS(tbg, g) \
251 tbg.space_id = g.space_id; \
252 tbg.bit_width = g.bit_width; \
253 tbg.bit_offset = g.bit_offset; \
254 tbg.access_width = g.access_width; \
255 tbg.address = g.address;
256
257 TB_COPY_GAS(tboot->acpi_sinfo.pm1a_cnt_blk, fadt->xpm1a_control_block);
258 TB_COPY_GAS(tboot->acpi_sinfo.pm1b_cnt_blk, fadt->xpm1b_control_block);
259 TB_COPY_GAS(tboot->acpi_sinfo.pm1a_evt_blk, fadt->xpm1a_event_block);
260 TB_COPY_GAS(tboot->acpi_sinfo.pm1b_evt_blk, fadt->xpm1b_event_block);
261
262 /*
263 * We need phys addr of waking vector, but can't use virt_to_phys() on
264 * &acpi_gbl_FACS because it is ioremap'ed, so calc from FACS phys
265 * addr.
266 */
267 tboot->acpi_sinfo.wakeup_vector = fadt->facs +
268 offsetof(struct acpi_table_facs, firmware_waking_vector);
269}
270
271void tboot_sleep(u8 sleep_state, u32 pm1a_control, u32 pm1b_control)
272{
273 static u32 acpi_shutdown_map[ACPI_S_STATE_COUNT] = {
274 /* S0,1,2: */ -1, -1, -1,
275 /* S3: */ TB_SHUTDOWN_S3,
276 /* S4: */ TB_SHUTDOWN_S4,
277 /* S5: */ TB_SHUTDOWN_S5 };
278
279 if (!tboot_enabled())
280 return;
281
282 tboot_copy_fadt(&acpi_gbl_FADT);
283 tboot->acpi_sinfo.pm1a_cnt_val = pm1a_control;
284 tboot->acpi_sinfo.pm1b_cnt_val = pm1b_control;
285 /* we always use the 32b wakeup vector */
286 tboot->acpi_sinfo.vector_width = 32;
287
288 if (sleep_state >= ACPI_S_STATE_COUNT ||
289 acpi_shutdown_map[sleep_state] == -1) {
290 pr_warning("unsupported sleep state 0x%x\n", sleep_state);
291 return;
292 }
293
294 tboot_shutdown(acpi_shutdown_map[sleep_state]);
295}
296
297static atomic_t ap_wfs_count;
298
299static int tboot_wait_for_aps(int num_aps)
300{
301 unsigned long timeout;
302
303 timeout = AP_WAIT_TIMEOUT*HZ;
304 while (atomic_read((atomic_t *)&tboot->num_in_wfs) != num_aps &&
305 timeout) {
306 mdelay(1);
307 timeout--;
308 }
309
310 if (timeout)
311 pr_warning("tboot wait for APs timeout\n");
312
313 return !(atomic_read((atomic_t *)&tboot->num_in_wfs) == num_aps);
314}
315
316static int __cpuinit tboot_cpu_callback(struct notifier_block *nfb,
317 unsigned long action, void *hcpu)
318{
319 switch (action) {
320 case CPU_DYING:
321 atomic_inc(&ap_wfs_count);
322 if (num_online_cpus() == 1)
323 if (tboot_wait_for_aps(atomic_read(&ap_wfs_count)))
324 return NOTIFY_BAD;
325 break;
326 }
327 return NOTIFY_OK;
328}
329
330static struct notifier_block tboot_cpu_notifier __cpuinitdata =
331{
332 .notifier_call = tboot_cpu_callback,
333};
334
335static __init int tboot_late_init(void)
336{
337 if (!tboot_enabled())
338 return 0;
339
340 tboot_create_trampoline();
341
342 atomic_set(&ap_wfs_count, 0);
343 register_hotcpu_notifier(&tboot_cpu_notifier);
344 return 0;
345}
346
347late_initcall(tboot_late_init);
348
349/*
350 * TXT configuration registers (offsets from TXT_{PUB, PRIV}_CONFIG_REGS_BASE)
351 */
352
353#define TXT_PUB_CONFIG_REGS_BASE 0xfed30000
354#define TXT_PRIV_CONFIG_REGS_BASE 0xfed20000
355
356/* # pages for each config regs space - used by fixmap */
357#define NR_TXT_CONFIG_PAGES ((TXT_PUB_CONFIG_REGS_BASE - \
358 TXT_PRIV_CONFIG_REGS_BASE) >> PAGE_SHIFT)
359
360/* offsets from pub/priv config space */
361#define TXTCR_HEAP_BASE 0x0300
362#define TXTCR_HEAP_SIZE 0x0308
363
364#define SHA1_SIZE 20
365
366struct sha1_hash {
367 u8 hash[SHA1_SIZE];
368};
369
370struct sinit_mle_data {
371 u32 version; /* currently 6 */
372 struct sha1_hash bios_acm_id;
373 u32 edx_senter_flags;
374 u64 mseg_valid;
375 struct sha1_hash sinit_hash;
376 struct sha1_hash mle_hash;
377 struct sha1_hash stm_hash;
378 struct sha1_hash lcp_policy_hash;
379 u32 lcp_policy_control;
380 u32 rlp_wakeup_addr;
381 u32 reserved;
382 u32 num_mdrs;
383 u32 mdrs_off;
384 u32 num_vtd_dmars;
385 u32 vtd_dmars_off;
386} __packed;
387
388struct acpi_table_header *tboot_get_dmar_table(struct acpi_table_header *dmar_tbl)
389{
390 void *heap_base, *heap_ptr, *config;
391
392 if (!tboot_enabled())
393 return dmar_tbl;
394
395 /*
396 * ACPI tables may not be DMA protected by tboot, so use DMAR copy
397 * SINIT saved in SinitMleData in TXT heap (which is DMA protected)
398 */
399
400 /* map config space in order to get heap addr */
401 config = ioremap(TXT_PUB_CONFIG_REGS_BASE, NR_TXT_CONFIG_PAGES *
402 PAGE_SIZE);
403 if (!config)
404 return NULL;
405
406 /* now map TXT heap */
407 heap_base = ioremap(*(u64 *)(config + TXTCR_HEAP_BASE),
408 *(u64 *)(config + TXTCR_HEAP_SIZE));
409 iounmap(config);
410 if (!heap_base)
411 return NULL;
412
413 /* walk heap to SinitMleData */
414 /* skip BiosData */
415 heap_ptr = heap_base + *(u64 *)heap_base;
416 /* skip OsMleData */
417 heap_ptr += *(u64 *)heap_ptr;
418 /* skip OsSinitData */
419 heap_ptr += *(u64 *)heap_ptr;
420 /* now points to SinitMleDataSize; set to SinitMleData */
421 heap_ptr += sizeof(u64);
422 /* get addr of DMAR table */
423 dmar_tbl = (struct acpi_table_header *)(heap_ptr +
424 ((struct sinit_mle_data *)heap_ptr)->vtd_dmars_off -
425 sizeof(u64));
426
427 /* don't unmap heap because dmar.c needs access to this */
428
429 return dmar_tbl;
430}
431
432int tboot_force_iommu(void)
433{
434 if (!tboot_enabled())
435 return 0;
436
437 if (no_iommu || swiotlb || dmar_disabled)
438 pr_warning("Forcing Intel-IOMMU to enabled\n");
439
440 dmar_disabled = 0;
441#ifdef CONFIG_SWIOTLB
442 swiotlb = 0;
443#endif
444 no_iommu = 0;
445
446 return 1;
447}
diff --git a/arch/x86/kernel/vmlinux.lds.S b/arch/x86/kernel/vmlinux.lds.S
index 9fc178255c04..0ccb57d5ee35 100644
--- a/arch/x86/kernel/vmlinux.lds.S
+++ b/arch/x86/kernel/vmlinux.lds.S
@@ -348,15 +348,12 @@ SECTIONS
348 _end = .; 348 _end = .;
349 } 349 }
350 350
351 /* Sections to be discarded */
352 /DISCARD/ : {
353 *(.exitcall.exit)
354 *(.eh_frame)
355 *(.discard)
356 }
357
358 STABS_DEBUG 351 STABS_DEBUG
359 DWARF_DEBUG 352 DWARF_DEBUG
353
354 /* Sections to be discarded */
355 DISCARDS
356 /DISCARD/ : { *(.eh_frame) }
360} 357}
361 358
362 359
diff --git a/arch/x86/mm/iomap_32.c b/arch/x86/mm/iomap_32.c
index fe6f84ca121e..84e236ce76ba 100644
--- a/arch/x86/mm/iomap_32.c
+++ b/arch/x86/mm/iomap_32.c
@@ -21,7 +21,7 @@
21#include <linux/module.h> 21#include <linux/module.h>
22#include <linux/highmem.h> 22#include <linux/highmem.h>
23 23
24int is_io_mapping_possible(resource_size_t base, unsigned long size) 24static int is_io_mapping_possible(resource_size_t base, unsigned long size)
25{ 25{
26#if !defined(CONFIG_X86_PAE) && defined(CONFIG_PHYS_ADDR_T_64BIT) 26#if !defined(CONFIG_X86_PAE) && defined(CONFIG_PHYS_ADDR_T_64BIT)
27 /* There is no way to map greater than 1 << 32 address without PAE */ 27 /* There is no way to map greater than 1 << 32 address without PAE */
@@ -30,7 +30,30 @@ int is_io_mapping_possible(resource_size_t base, unsigned long size)
30#endif 30#endif
31 return 1; 31 return 1;
32} 32}
33EXPORT_SYMBOL_GPL(is_io_mapping_possible); 33
34int iomap_create_wc(resource_size_t base, unsigned long size, pgprot_t *prot)
35{
36 unsigned long flag = _PAGE_CACHE_WC;
37 int ret;
38
39 if (!is_io_mapping_possible(base, size))
40 return -EINVAL;
41
42 ret = io_reserve_memtype(base, base + size, &flag);
43 if (ret)
44 return ret;
45
46 *prot = __pgprot(__PAGE_KERNEL | flag);
47 return 0;
48}
49EXPORT_SYMBOL_GPL(iomap_create_wc);
50
51void
52iomap_free(resource_size_t base, unsigned long size)
53{
54 io_free_memtype(base, base + size);
55}
56EXPORT_SYMBOL_GPL(iomap_free);
34 57
35void *kmap_atomic_prot_pfn(unsigned long pfn, enum km_type type, pgprot_t prot) 58void *kmap_atomic_prot_pfn(unsigned long pfn, enum km_type type, pgprot_t prot)
36{ 59{
diff --git a/arch/x86/mm/ioremap.c b/arch/x86/mm/ioremap.c
index 04e1ad60c63a..334e63ca7b2b 100644
--- a/arch/x86/mm/ioremap.c
+++ b/arch/x86/mm/ioremap.c
@@ -158,24 +158,14 @@ static void __iomem *__ioremap_caller(resource_size_t phys_addr,
158 retval = reserve_memtype(phys_addr, (u64)phys_addr + size, 158 retval = reserve_memtype(phys_addr, (u64)phys_addr + size,
159 prot_val, &new_prot_val); 159 prot_val, &new_prot_val);
160 if (retval) { 160 if (retval) {
161 pr_debug("Warning: reserve_memtype returned %d\n", retval); 161 printk(KERN_ERR "ioremap reserve_memtype failed %d\n", retval);
162 return NULL; 162 return NULL;
163 } 163 }
164 164
165 if (prot_val != new_prot_val) { 165 if (prot_val != new_prot_val) {
166 /* 166 if (!is_new_memtype_allowed(phys_addr, size,
167 * Do not fallback to certain memory types with certain 167 prot_val, new_prot_val)) {
168 * requested type: 168 printk(KERN_ERR
169 * - request is uc-, return cannot be write-back
170 * - request is uc-, return cannot be write-combine
171 * - request is write-combine, return cannot be write-back
172 */
173 if ((prot_val == _PAGE_CACHE_UC_MINUS &&
174 (new_prot_val == _PAGE_CACHE_WB ||
175 new_prot_val == _PAGE_CACHE_WC)) ||
176 (prot_val == _PAGE_CACHE_WC &&
177 new_prot_val == _PAGE_CACHE_WB)) {
178 pr_debug(
179 "ioremap error for 0x%llx-0x%llx, requested 0x%lx, got 0x%lx\n", 169 "ioremap error for 0x%llx-0x%llx, requested 0x%lx, got 0x%lx\n",
180 (unsigned long long)phys_addr, 170 (unsigned long long)phys_addr,
181 (unsigned long long)(phys_addr + size), 171 (unsigned long long)(phys_addr + size),
diff --git a/arch/x86/mm/mmap.c b/arch/x86/mm/mmap.c
index 165829600566..c8191defc38a 100644
--- a/arch/x86/mm/mmap.c
+++ b/arch/x86/mm/mmap.c
@@ -29,13 +29,26 @@
29#include <linux/random.h> 29#include <linux/random.h>
30#include <linux/limits.h> 30#include <linux/limits.h>
31#include <linux/sched.h> 31#include <linux/sched.h>
32#include <asm/elf.h>
33
34static unsigned int stack_maxrandom_size(void)
35{
36 unsigned int max = 0;
37 if ((current->flags & PF_RANDOMIZE) &&
38 !(current->personality & ADDR_NO_RANDOMIZE)) {
39 max = ((-1U) & STACK_RND_MASK) << PAGE_SHIFT;
40 }
41
42 return max;
43}
44
32 45
33/* 46/*
34 * Top of mmap area (just below the process stack). 47 * Top of mmap area (just below the process stack).
35 * 48 *
36 * Leave an at least ~128 MB hole. 49 * Leave an at least ~128 MB hole with possible stack randomization.
37 */ 50 */
38#define MIN_GAP (128*1024*1024) 51#define MIN_GAP (128*1024*1024UL + stack_maxrandom_size())
39#define MAX_GAP (TASK_SIZE/6*5) 52#define MAX_GAP (TASK_SIZE/6*5)
40 53
41/* 54/*
diff --git a/arch/x86/mm/pageattr.c b/arch/x86/mm/pageattr.c
index 7e600c1962db..24952fdc7e40 100644
--- a/arch/x86/mm/pageattr.c
+++ b/arch/x86/mm/pageattr.c
@@ -12,6 +12,7 @@
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#include <linux/pfn.h>
15#include <linux/percpu.h>
15 16
16#include <asm/e820.h> 17#include <asm/e820.h>
17#include <asm/processor.h> 18#include <asm/processor.h>
@@ -686,7 +687,7 @@ static int cpa_process_alias(struct cpa_data *cpa)
686{ 687{
687 struct cpa_data alias_cpa; 688 struct cpa_data alias_cpa;
688 unsigned long laddr = (unsigned long)__va(cpa->pfn << PAGE_SHIFT); 689 unsigned long laddr = (unsigned long)__va(cpa->pfn << PAGE_SHIFT);
689 unsigned long vaddr, remapped; 690 unsigned long vaddr;
690 int ret; 691 int ret;
691 692
692 if (cpa->pfn >= max_pfn_mapped) 693 if (cpa->pfn >= max_pfn_mapped)
@@ -744,24 +745,6 @@ static int cpa_process_alias(struct cpa_data *cpa)
744 } 745 }
745#endif 746#endif
746 747
747 /*
748 * If the PMD page was partially used for per-cpu remapping,
749 * the recycled area needs to be split and modified. Because
750 * the area is always proper subset of a PMD page
751 * cpa->numpages is guaranteed to be 1 for these areas, so
752 * there's no need to loop over and check for further remaps.
753 */
754 remapped = (unsigned long)pcpu_lpage_remapped((void *)laddr);
755 if (remapped) {
756 WARN_ON(cpa->numpages > 1);
757 alias_cpa = *cpa;
758 alias_cpa.vaddr = &remapped;
759 alias_cpa.flags &= ~(CPA_PAGES_ARRAY | CPA_ARRAY);
760 ret = __change_page_attr_set_clr(&alias_cpa, 0);
761 if (ret)
762 return ret;
763 }
764
765 return 0; 748 return 0;
766} 749}
767 750
@@ -822,6 +805,7 @@ static int change_page_attr_set_clr(unsigned long *addr, int numpages,
822{ 805{
823 struct cpa_data cpa; 806 struct cpa_data cpa;
824 int ret, cache, checkalias; 807 int ret, cache, checkalias;
808 unsigned long baddr = 0;
825 809
826 /* 810 /*
827 * Check, if we are requested to change a not supported 811 * Check, if we are requested to change a not supported
@@ -853,6 +837,11 @@ static int change_page_attr_set_clr(unsigned long *addr, int numpages,
853 */ 837 */
854 WARN_ON_ONCE(1); 838 WARN_ON_ONCE(1);
855 } 839 }
840 /*
841 * Save address for cache flush. *addr is modified in the call
842 * to __change_page_attr_set_clr() below.
843 */
844 baddr = *addr;
856 } 845 }
857 846
858 /* Must avoid aliasing mappings in the highmem code */ 847 /* Must avoid aliasing mappings in the highmem code */
@@ -900,7 +889,7 @@ static int change_page_attr_set_clr(unsigned long *addr, int numpages,
900 cpa_flush_array(addr, numpages, cache, 889 cpa_flush_array(addr, numpages, cache,
901 cpa.flags, pages); 890 cpa.flags, pages);
902 } else 891 } else
903 cpa_flush_range(*addr, numpages, cache); 892 cpa_flush_range(baddr, numpages, cache);
904 } else 893 } else
905 cpa_flush_all(cache); 894 cpa_flush_all(cache);
906 895
diff --git a/arch/x86/mm/pat.c b/arch/x86/mm/pat.c
index b2f7d3e59b86..7257cf3decf9 100644
--- a/arch/x86/mm/pat.c
+++ b/arch/x86/mm/pat.c
@@ -15,6 +15,7 @@
15#include <linux/gfp.h> 15#include <linux/gfp.h>
16#include <linux/mm.h> 16#include <linux/mm.h>
17#include <linux/fs.h> 17#include <linux/fs.h>
18#include <linux/rbtree.h>
18 19
19#include <asm/cacheflush.h> 20#include <asm/cacheflush.h>
20#include <asm/processor.h> 21#include <asm/processor.h>
@@ -148,11 +149,10 @@ static char *cattr_name(unsigned long flags)
148 * areas). All the aliases have the same cache attributes of course. 149 * areas). All the aliases have the same cache attributes of course.
149 * Zero attributes are represented as holes. 150 * Zero attributes are represented as holes.
150 * 151 *
151 * Currently the data structure is a list because the number of mappings 152 * The data structure is a list that is also organized as an rbtree
152 * are expected to be relatively small. If this should be a problem 153 * sorted on the start address of memtype range.
153 * it could be changed to a rbtree or similar.
154 * 154 *
155 * memtype_lock protects the whole list. 155 * memtype_lock protects both the linear list and rbtree.
156 */ 156 */
157 157
158struct memtype { 158struct memtype {
@@ -160,11 +160,53 @@ struct memtype {
160 u64 end; 160 u64 end;
161 unsigned long type; 161 unsigned long type;
162 struct list_head nd; 162 struct list_head nd;
163 struct rb_node rb;
163}; 164};
164 165
166static struct rb_root memtype_rbroot = RB_ROOT;
165static LIST_HEAD(memtype_list); 167static LIST_HEAD(memtype_list);
166static DEFINE_SPINLOCK(memtype_lock); /* protects memtype list */ 168static DEFINE_SPINLOCK(memtype_lock); /* protects memtype list */
167 169
170static struct memtype *memtype_rb_search(struct rb_root *root, u64 start)
171{
172 struct rb_node *node = root->rb_node;
173 struct memtype *last_lower = NULL;
174
175 while (node) {
176 struct memtype *data = container_of(node, struct memtype, rb);
177
178 if (data->start < start) {
179 last_lower = data;
180 node = node->rb_right;
181 } else if (data->start > start) {
182 node = node->rb_left;
183 } else
184 return data;
185 }
186
187 /* Will return NULL if there is no entry with its start <= start */
188 return last_lower;
189}
190
191static void memtype_rb_insert(struct rb_root *root, struct memtype *data)
192{
193 struct rb_node **new = &(root->rb_node);
194 struct rb_node *parent = NULL;
195
196 while (*new) {
197 struct memtype *this = container_of(*new, struct memtype, rb);
198
199 parent = *new;
200 if (data->start <= this->start)
201 new = &((*new)->rb_left);
202 else if (data->start > this->start)
203 new = &((*new)->rb_right);
204 }
205
206 rb_link_node(&data->rb, parent, new);
207 rb_insert_color(&data->rb, root);
208}
209
168/* 210/*
169 * Does intersection of PAT memory type and MTRR memory type and returns 211 * Does intersection of PAT memory type and MTRR memory type and returns
170 * the resulting memory type as PAT understands it. 212 * the resulting memory type as PAT understands it.
@@ -218,9 +260,6 @@ chk_conflict(struct memtype *new, struct memtype *entry, unsigned long *type)
218 return -EBUSY; 260 return -EBUSY;
219} 261}
220 262
221static struct memtype *cached_entry;
222static u64 cached_start;
223
224static int pat_pagerange_is_ram(unsigned long start, unsigned long end) 263static int pat_pagerange_is_ram(unsigned long start, unsigned long end)
225{ 264{
226 int ram_page = 0, not_rampage = 0; 265 int ram_page = 0, not_rampage = 0;
@@ -249,63 +288,61 @@ static int pat_pagerange_is_ram(unsigned long start, unsigned long end)
249} 288}
250 289
251/* 290/*
252 * For RAM pages, mark the pages as non WB memory type using 291 * For RAM pages, we use page flags to mark the pages with appropriate type.
253 * PageNonWB (PG_arch_1). We allow only one set_memory_uc() or 292 * Here we do two pass:
254 * set_memory_wc() on a RAM page at a time before marking it as WB again. 293 * - Find the memtype of all the pages in the range, look for any conflicts
255 * This is ok, because only one driver will be owning the page and 294 * - In case of no conflicts, set the new memtype for pages in the range
256 * doing set_memory_*() calls.
257 * 295 *
258 * For now, we use PageNonWB to track that the RAM page is being mapped 296 * Caller must hold memtype_lock for atomicity.
259 * as non WB. In future, we will have to use one more flag
260 * (or some other mechanism in page_struct) to distinguish between
261 * UC and WC mapping.
262 */ 297 */
263static int reserve_ram_pages_type(u64 start, u64 end, unsigned long req_type, 298static int reserve_ram_pages_type(u64 start, u64 end, unsigned long req_type,
264 unsigned long *new_type) 299 unsigned long *new_type)
265{ 300{
266 struct page *page; 301 struct page *page;
267 u64 pfn, end_pfn; 302 u64 pfn;
303
304 if (req_type == _PAGE_CACHE_UC) {
305 /* We do not support strong UC */
306 WARN_ON_ONCE(1);
307 req_type = _PAGE_CACHE_UC_MINUS;
308 }
268 309
269 for (pfn = (start >> PAGE_SHIFT); pfn < (end >> PAGE_SHIFT); ++pfn) { 310 for (pfn = (start >> PAGE_SHIFT); pfn < (end >> PAGE_SHIFT); ++pfn) {
270 page = pfn_to_page(pfn); 311 unsigned long type;
271 if (page_mapped(page) || PageNonWB(page))
272 goto out;
273 312
274 SetPageNonWB(page); 313 page = pfn_to_page(pfn);
314 type = get_page_memtype(page);
315 if (type != -1) {
316 printk(KERN_INFO "reserve_ram_pages_type failed "
317 "0x%Lx-0x%Lx, track 0x%lx, req 0x%lx\n",
318 start, end, type, req_type);
319 if (new_type)
320 *new_type = type;
321
322 return -EBUSY;
323 }
275 } 324 }
276 return 0;
277 325
278out: 326 if (new_type)
279 end_pfn = pfn; 327 *new_type = req_type;
280 for (pfn = (start >> PAGE_SHIFT); pfn < end_pfn; ++pfn) { 328
329 for (pfn = (start >> PAGE_SHIFT); pfn < (end >> PAGE_SHIFT); ++pfn) {
281 page = pfn_to_page(pfn); 330 page = pfn_to_page(pfn);
282 ClearPageNonWB(page); 331 set_page_memtype(page, req_type);
283 } 332 }
284 333 return 0;
285 return -EINVAL;
286} 334}
287 335
288static int free_ram_pages_type(u64 start, u64 end) 336static int free_ram_pages_type(u64 start, u64 end)
289{ 337{
290 struct page *page; 338 struct page *page;
291 u64 pfn, end_pfn; 339 u64 pfn;
292 340
293 for (pfn = (start >> PAGE_SHIFT); pfn < (end >> PAGE_SHIFT); ++pfn) { 341 for (pfn = (start >> PAGE_SHIFT); pfn < (end >> PAGE_SHIFT); ++pfn) {
294 page = pfn_to_page(pfn); 342 page = pfn_to_page(pfn);
295 if (page_mapped(page) || !PageNonWB(page)) 343 set_page_memtype(page, -1);
296 goto out;
297
298 ClearPageNonWB(page);
299 } 344 }
300 return 0; 345 return 0;
301
302out:
303 end_pfn = pfn;
304 for (pfn = (start >> PAGE_SHIFT); pfn < end_pfn; ++pfn) {
305 page = pfn_to_page(pfn);
306 SetPageNonWB(page);
307 }
308 return -EINVAL;
309} 346}
310 347
311/* 348/*
@@ -339,6 +376,8 @@ int reserve_memtype(u64 start, u64 end, unsigned long req_type,
339 if (new_type) { 376 if (new_type) {
340 if (req_type == -1) 377 if (req_type == -1)
341 *new_type = _PAGE_CACHE_WB; 378 *new_type = _PAGE_CACHE_WB;
379 else if (req_type == _PAGE_CACHE_WC)
380 *new_type = _PAGE_CACHE_UC_MINUS;
342 else 381 else
343 *new_type = req_type & _PAGE_CACHE_MASK; 382 *new_type = req_type & _PAGE_CACHE_MASK;
344 } 383 }
@@ -364,11 +403,16 @@ int reserve_memtype(u64 start, u64 end, unsigned long req_type,
364 *new_type = actual_type; 403 *new_type = actual_type;
365 404
366 is_range_ram = pat_pagerange_is_ram(start, end); 405 is_range_ram = pat_pagerange_is_ram(start, end);
367 if (is_range_ram == 1) 406 if (is_range_ram == 1) {
368 return reserve_ram_pages_type(start, end, req_type, 407
369 new_type); 408 spin_lock(&memtype_lock);
370 else if (is_range_ram < 0) 409 err = reserve_ram_pages_type(start, end, req_type, new_type);
410 spin_unlock(&memtype_lock);
411
412 return err;
413 } else if (is_range_ram < 0) {
371 return -EINVAL; 414 return -EINVAL;
415 }
372 416
373 new = kmalloc(sizeof(struct memtype), GFP_KERNEL); 417 new = kmalloc(sizeof(struct memtype), GFP_KERNEL);
374 if (!new) 418 if (!new)
@@ -380,17 +424,11 @@ int reserve_memtype(u64 start, u64 end, unsigned long req_type,
380 424
381 spin_lock(&memtype_lock); 425 spin_lock(&memtype_lock);
382 426
383 if (cached_entry && start >= cached_start)
384 entry = cached_entry;
385 else
386 entry = list_entry(&memtype_list, struct memtype, nd);
387
388 /* Search for existing mapping that overlaps the current range */ 427 /* Search for existing mapping that overlaps the current range */
389 where = NULL; 428 where = NULL;
390 list_for_each_entry_continue(entry, &memtype_list, nd) { 429 list_for_each_entry(entry, &memtype_list, nd) {
391 if (end <= entry->start) { 430 if (end <= entry->start) {
392 where = entry->nd.prev; 431 where = entry->nd.prev;
393 cached_entry = list_entry(where, struct memtype, nd);
394 break; 432 break;
395 } else if (start <= entry->start) { /* end > entry->start */ 433 } else if (start <= entry->start) { /* end > entry->start */
396 err = chk_conflict(new, entry, new_type); 434 err = chk_conflict(new, entry, new_type);
@@ -398,8 +436,6 @@ int reserve_memtype(u64 start, u64 end, unsigned long req_type,
398 dprintk("Overlap at 0x%Lx-0x%Lx\n", 436 dprintk("Overlap at 0x%Lx-0x%Lx\n",
399 entry->start, entry->end); 437 entry->start, entry->end);
400 where = entry->nd.prev; 438 where = entry->nd.prev;
401 cached_entry = list_entry(where,
402 struct memtype, nd);
403 } 439 }
404 break; 440 break;
405 } else if (start < entry->end) { /* start > entry->start */ 441 } else if (start < entry->end) { /* start > entry->start */
@@ -407,8 +443,6 @@ int reserve_memtype(u64 start, u64 end, unsigned long req_type,
407 if (!err) { 443 if (!err) {
408 dprintk("Overlap at 0x%Lx-0x%Lx\n", 444 dprintk("Overlap at 0x%Lx-0x%Lx\n",
409 entry->start, entry->end); 445 entry->start, entry->end);
410 cached_entry = list_entry(entry->nd.prev,
411 struct memtype, nd);
412 446
413 /* 447 /*
414 * Move to right position in the linked 448 * Move to right position in the linked
@@ -436,13 +470,13 @@ int reserve_memtype(u64 start, u64 end, unsigned long req_type,
436 return err; 470 return err;
437 } 471 }
438 472
439 cached_start = start;
440
441 if (where) 473 if (where)
442 list_add(&new->nd, where); 474 list_add(&new->nd, where);
443 else 475 else
444 list_add_tail(&new->nd, &memtype_list); 476 list_add_tail(&new->nd, &memtype_list);
445 477
478 memtype_rb_insert(&memtype_rbroot, new);
479
446 spin_unlock(&memtype_lock); 480 spin_unlock(&memtype_lock);
447 481
448 dprintk("reserve_memtype added 0x%Lx-0x%Lx, track %s, req %s, ret %s\n", 482 dprintk("reserve_memtype added 0x%Lx-0x%Lx, track %s, req %s, ret %s\n",
@@ -454,7 +488,7 @@ int reserve_memtype(u64 start, u64 end, unsigned long req_type,
454 488
455int free_memtype(u64 start, u64 end) 489int free_memtype(u64 start, u64 end)
456{ 490{
457 struct memtype *entry; 491 struct memtype *entry, *saved_entry;
458 int err = -EINVAL; 492 int err = -EINVAL;
459 int is_range_ram; 493 int is_range_ram;
460 494
@@ -466,23 +500,58 @@ int free_memtype(u64 start, u64 end)
466 return 0; 500 return 0;
467 501
468 is_range_ram = pat_pagerange_is_ram(start, end); 502 is_range_ram = pat_pagerange_is_ram(start, end);
469 if (is_range_ram == 1) 503 if (is_range_ram == 1) {
470 return free_ram_pages_type(start, end); 504
471 else if (is_range_ram < 0) 505 spin_lock(&memtype_lock);
506 err = free_ram_pages_type(start, end);
507 spin_unlock(&memtype_lock);
508
509 return err;
510 } else if (is_range_ram < 0) {
472 return -EINVAL; 511 return -EINVAL;
512 }
473 513
474 spin_lock(&memtype_lock); 514 spin_lock(&memtype_lock);
475 list_for_each_entry(entry, &memtype_list, nd) { 515
516 entry = memtype_rb_search(&memtype_rbroot, start);
517 if (unlikely(entry == NULL))
518 goto unlock_ret;
519
520 /*
521 * Saved entry points to an entry with start same or less than what
522 * we searched for. Now go through the list in both directions to look
523 * for the entry that matches with both start and end, with list stored
524 * in sorted start address
525 */
526 saved_entry = entry;
527 list_for_each_entry_from(entry, &memtype_list, nd) {
476 if (entry->start == start && entry->end == end) { 528 if (entry->start == start && entry->end == end) {
477 if (cached_entry == entry || cached_start == start) 529 rb_erase(&entry->rb, &memtype_rbroot);
478 cached_entry = NULL; 530 list_del(&entry->nd);
531 kfree(entry);
532 err = 0;
533 break;
534 } else if (entry->start > start) {
535 break;
536 }
537 }
538
539 if (!err)
540 goto unlock_ret;
479 541
542 entry = saved_entry;
543 list_for_each_entry_reverse(entry, &memtype_list, nd) {
544 if (entry->start == start && entry->end == end) {
545 rb_erase(&entry->rb, &memtype_rbroot);
480 list_del(&entry->nd); 546 list_del(&entry->nd);
481 kfree(entry); 547 kfree(entry);
482 err = 0; 548 err = 0;
483 break; 549 break;
550 } else if (entry->start < start) {
551 break;
484 } 552 }
485 } 553 }
554unlock_ret:
486 spin_unlock(&memtype_lock); 555 spin_unlock(&memtype_lock);
487 556
488 if (err) { 557 if (err) {
@@ -496,6 +565,101 @@ int free_memtype(u64 start, u64 end)
496} 565}
497 566
498 567
568/**
569 * lookup_memtype - Looksup the memory type for a physical address
570 * @paddr: physical address of which memory type needs to be looked up
571 *
572 * Only to be called when PAT is enabled
573 *
574 * Returns _PAGE_CACHE_WB, _PAGE_CACHE_WC, _PAGE_CACHE_UC_MINUS or
575 * _PAGE_CACHE_UC
576 */
577static unsigned long lookup_memtype(u64 paddr)
578{
579 int rettype = _PAGE_CACHE_WB;
580 struct memtype *entry;
581
582 if (is_ISA_range(paddr, paddr + PAGE_SIZE - 1))
583 return rettype;
584
585 if (pat_pagerange_is_ram(paddr, paddr + PAGE_SIZE)) {
586 struct page *page;
587 spin_lock(&memtype_lock);
588 page = pfn_to_page(paddr >> PAGE_SHIFT);
589 rettype = get_page_memtype(page);
590 spin_unlock(&memtype_lock);
591 /*
592 * -1 from get_page_memtype() implies RAM page is in its
593 * default state and not reserved, and hence of type WB
594 */
595 if (rettype == -1)
596 rettype = _PAGE_CACHE_WB;
597
598 return rettype;
599 }
600
601 spin_lock(&memtype_lock);
602
603 entry = memtype_rb_search(&memtype_rbroot, paddr);
604 if (entry != NULL)
605 rettype = entry->type;
606 else
607 rettype = _PAGE_CACHE_UC_MINUS;
608
609 spin_unlock(&memtype_lock);
610 return rettype;
611}
612
613/**
614 * io_reserve_memtype - Request a memory type mapping for a region of memory
615 * @start: start (physical address) of the region
616 * @end: end (physical address) of the region
617 * @type: A pointer to memtype, with requested type. On success, requested
618 * or any other compatible type that was available for the region is returned
619 *
620 * On success, returns 0
621 * On failure, returns non-zero
622 */
623int io_reserve_memtype(resource_size_t start, resource_size_t end,
624 unsigned long *type)
625{
626 resource_size_t size = end - start;
627 unsigned long req_type = *type;
628 unsigned long new_type;
629 int ret;
630
631 WARN_ON_ONCE(iomem_map_sanity_check(start, size));
632
633 ret = reserve_memtype(start, end, req_type, &new_type);
634 if (ret)
635 goto out_err;
636
637 if (!is_new_memtype_allowed(start, size, req_type, new_type))
638 goto out_free;
639
640 if (kernel_map_sync_memtype(start, size, new_type) < 0)
641 goto out_free;
642
643 *type = new_type;
644 return 0;
645
646out_free:
647 free_memtype(start, end);
648 ret = -EBUSY;
649out_err:
650 return ret;
651}
652
653/**
654 * io_free_memtype - Release a memory type mapping for a region of memory
655 * @start: start (physical address) of the region
656 * @end: end (physical address) of the region
657 */
658void io_free_memtype(resource_size_t start, resource_size_t end)
659{
660 free_memtype(start, end);
661}
662
499pgprot_t phys_mem_access_prot(struct file *file, unsigned long pfn, 663pgprot_t phys_mem_access_prot(struct file *file, unsigned long pfn,
500 unsigned long size, pgprot_t vma_prot) 664 unsigned long size, pgprot_t vma_prot)
501{ 665{
@@ -577,7 +741,7 @@ int kernel_map_sync_memtype(u64 base, unsigned long size, unsigned long flags)
577{ 741{
578 unsigned long id_sz; 742 unsigned long id_sz;
579 743
580 if (!pat_enabled || base >= __pa(high_memory)) 744 if (base >= __pa(high_memory))
581 return 0; 745 return 0;
582 746
583 id_sz = (__pa(high_memory) < base + size) ? 747 id_sz = (__pa(high_memory) < base + size) ?
@@ -612,11 +776,29 @@ static int reserve_pfn_range(u64 paddr, unsigned long size, pgprot_t *vma_prot,
612 is_ram = pat_pagerange_is_ram(paddr, paddr + size); 776 is_ram = pat_pagerange_is_ram(paddr, paddr + size);
613 777
614 /* 778 /*
615 * reserve_pfn_range() doesn't support RAM pages. Maintain the current 779 * reserve_pfn_range() for RAM pages. We do not refcount to keep
616 * behavior with RAM pages by returning success. 780 * track of number of mappings of RAM pages. We can assert that
781 * the type requested matches the type of first page in the range.
617 */ 782 */
618 if (is_ram != 0) 783 if (is_ram) {
784 if (!pat_enabled)
785 return 0;
786
787 flags = lookup_memtype(paddr);
788 if (want_flags != flags) {
789 printk(KERN_WARNING
790 "%s:%d map pfn RAM range req %s for %Lx-%Lx, got %s\n",
791 current->comm, current->pid,
792 cattr_name(want_flags),
793 (unsigned long long)paddr,
794 (unsigned long long)(paddr + size),
795 cattr_name(flags));
796 *vma_prot = __pgprot((pgprot_val(*vma_prot) &
797 (~_PAGE_CACHE_MASK)) |
798 flags);
799 }
619 return 0; 800 return 0;
801 }
620 802
621 ret = reserve_memtype(paddr, paddr + size, want_flags, &flags); 803 ret = reserve_memtype(paddr, paddr + size, want_flags, &flags);
622 if (ret) 804 if (ret)
@@ -678,14 +860,6 @@ int track_pfn_vma_copy(struct vm_area_struct *vma)
678 unsigned long vma_size = vma->vm_end - vma->vm_start; 860 unsigned long vma_size = vma->vm_end - vma->vm_start;
679 pgprot_t pgprot; 861 pgprot_t pgprot;
680 862
681 if (!pat_enabled)
682 return 0;
683
684 /*
685 * For now, only handle remap_pfn_range() vmas where
686 * is_linear_pfn_mapping() == TRUE. Handling of
687 * vm_insert_pfn() is TBD.
688 */
689 if (is_linear_pfn_mapping(vma)) { 863 if (is_linear_pfn_mapping(vma)) {
690 /* 864 /*
691 * reserve the whole chunk covered by vma. We need the 865 * reserve the whole chunk covered by vma. We need the
@@ -713,23 +887,24 @@ int track_pfn_vma_copy(struct vm_area_struct *vma)
713int track_pfn_vma_new(struct vm_area_struct *vma, pgprot_t *prot, 887int track_pfn_vma_new(struct vm_area_struct *vma, pgprot_t *prot,
714 unsigned long pfn, unsigned long size) 888 unsigned long pfn, unsigned long size)
715{ 889{
890 unsigned long flags;
716 resource_size_t paddr; 891 resource_size_t paddr;
717 unsigned long vma_size = vma->vm_end - vma->vm_start; 892 unsigned long vma_size = vma->vm_end - vma->vm_start;
718 893
719 if (!pat_enabled)
720 return 0;
721
722 /*
723 * For now, only handle remap_pfn_range() vmas where
724 * is_linear_pfn_mapping() == TRUE. Handling of
725 * vm_insert_pfn() is TBD.
726 */
727 if (is_linear_pfn_mapping(vma)) { 894 if (is_linear_pfn_mapping(vma)) {
728 /* reserve the whole chunk starting from vm_pgoff */ 895 /* reserve the whole chunk starting from vm_pgoff */
729 paddr = (resource_size_t)vma->vm_pgoff << PAGE_SHIFT; 896 paddr = (resource_size_t)vma->vm_pgoff << PAGE_SHIFT;
730 return reserve_pfn_range(paddr, vma_size, prot, 0); 897 return reserve_pfn_range(paddr, vma_size, prot, 0);
731 } 898 }
732 899
900 if (!pat_enabled)
901 return 0;
902
903 /* for vm_insert_pfn and friends, we set prot based on lookup */
904 flags = lookup_memtype(pfn << PAGE_SHIFT);
905 *prot = __pgprot((pgprot_val(vma->vm_page_prot) & (~_PAGE_CACHE_MASK)) |
906 flags);
907
733 return 0; 908 return 0;
734} 909}
735 910
@@ -744,14 +919,6 @@ void untrack_pfn_vma(struct vm_area_struct *vma, unsigned long pfn,
744 resource_size_t paddr; 919 resource_size_t paddr;
745 unsigned long vma_size = vma->vm_end - vma->vm_start; 920 unsigned long vma_size = vma->vm_end - vma->vm_start;
746 921
747 if (!pat_enabled)
748 return;
749
750 /*
751 * For now, only handle remap_pfn_range() vmas where
752 * is_linear_pfn_mapping() == TRUE. Handling of
753 * vm_insert_pfn() is TBD.
754 */
755 if (is_linear_pfn_mapping(vma)) { 922 if (is_linear_pfn_mapping(vma)) {
756 /* free the whole chunk starting from vm_pgoff */ 923 /* free the whole chunk starting from vm_pgoff */
757 paddr = (resource_size_t)vma->vm_pgoff << PAGE_SHIFT; 924 paddr = (resource_size_t)vma->vm_pgoff << PAGE_SHIFT;
diff --git a/arch/x86/pci/amd_bus.c b/arch/x86/pci/amd_bus.c
index 3ffa10df20b9..572ee9782f2a 100644
--- a/arch/x86/pci/amd_bus.c
+++ b/arch/x86/pci/amd_bus.c
@@ -15,63 +15,6 @@
15 * also get peer root bus resource for io,mmio 15 * also get peer root bus resource for io,mmio
16 */ 16 */
17 17
18#ifdef CONFIG_NUMA
19
20#define BUS_NR 256
21
22#ifdef CONFIG_X86_64
23
24static int mp_bus_to_node[BUS_NR];
25
26void set_mp_bus_to_node(int busnum, int node)
27{
28 if (busnum >= 0 && busnum < BUS_NR)
29 mp_bus_to_node[busnum] = node;
30}
31
32int get_mp_bus_to_node(int busnum)
33{
34 int node = -1;
35
36 if (busnum < 0 || busnum > (BUS_NR - 1))
37 return node;
38
39 node = mp_bus_to_node[busnum];
40
41 /*
42 * let numa_node_id to decide it later in dma_alloc_pages
43 * if there is no ram on that node
44 */
45 if (node != -1 && !node_online(node))
46 node = -1;
47
48 return node;
49}
50
51#else /* CONFIG_X86_32 */
52
53static unsigned char mp_bus_to_node[BUS_NR];
54
55void set_mp_bus_to_node(int busnum, int node)
56{
57 if (busnum >= 0 && busnum < BUS_NR)
58 mp_bus_to_node[busnum] = (unsigned char) node;
59}
60
61int get_mp_bus_to_node(int busnum)
62{
63 int node;
64
65 if (busnum < 0 || busnum > (BUS_NR - 1))
66 return 0;
67 node = mp_bus_to_node[busnum];
68 return node;
69}
70
71#endif /* CONFIG_X86_32 */
72
73#endif /* CONFIG_NUMA */
74
75#ifdef CONFIG_X86_64 18#ifdef CONFIG_X86_64
76 19
77/* 20/*
@@ -301,11 +244,6 @@ static int __init early_fill_mp_bus_info(void)
301 u64 val; 244 u64 val;
302 u32 address; 245 u32 address;
303 246
304#ifdef CONFIG_NUMA
305 for (i = 0; i < BUS_NR; i++)
306 mp_bus_to_node[i] = -1;
307#endif
308
309 if (!early_pci_allowed()) 247 if (!early_pci_allowed())
310 return -1; 248 return -1;
311 249
@@ -346,7 +284,7 @@ static int __init early_fill_mp_bus_info(void)
346 node = (reg >> 4) & 0x07; 284 node = (reg >> 4) & 0x07;
347#ifdef CONFIG_NUMA 285#ifdef CONFIG_NUMA
348 for (j = min_bus; j <= max_bus; j++) 286 for (j = min_bus; j <= max_bus; j++)
349 mp_bus_to_node[j] = (unsigned char) node; 287 set_mp_bus_to_node(j, node);
350#endif 288#endif
351 link = (reg >> 8) & 0x03; 289 link = (reg >> 8) & 0x03;
352 290
diff --git a/arch/x86/pci/common.c b/arch/x86/pci/common.c
index 2202b6257b82..5db96d4304de 100644
--- a/arch/x86/pci/common.c
+++ b/arch/x86/pci/common.c
@@ -600,3 +600,72 @@ struct pci_bus * __devinit pci_scan_bus_with_sysdata(int busno)
600{ 600{
601 return pci_scan_bus_on_node(busno, &pci_root_ops, -1); 601 return pci_scan_bus_on_node(busno, &pci_root_ops, -1);
602} 602}
603
604/*
605 * NUMA info for PCI busses
606 *
607 * Early arch code is responsible for filling in reasonable values here.
608 * A node id of "-1" means "use current node". In other words, if a bus
609 * has a -1 node id, it's not tightly coupled to any particular chunk
610 * of memory (as is the case on some Nehalem systems).
611 */
612#ifdef CONFIG_NUMA
613
614#define BUS_NR 256
615
616#ifdef CONFIG_X86_64
617
618static int mp_bus_to_node[BUS_NR] = {
619 [0 ... BUS_NR - 1] = -1
620};
621
622void set_mp_bus_to_node(int busnum, int node)
623{
624 if (busnum >= 0 && busnum < BUS_NR)
625 mp_bus_to_node[busnum] = node;
626}
627
628int get_mp_bus_to_node(int busnum)
629{
630 int node = -1;
631
632 if (busnum < 0 || busnum > (BUS_NR - 1))
633 return node;
634
635 node = mp_bus_to_node[busnum];
636
637 /*
638 * let numa_node_id to decide it later in dma_alloc_pages
639 * if there is no ram on that node
640 */
641 if (node != -1 && !node_online(node))
642 node = -1;
643
644 return node;
645}
646
647#else /* CONFIG_X86_32 */
648
649static unsigned char mp_bus_to_node[BUS_NR] = {
650 [0 ... BUS_NR - 1] = -1
651};
652
653void set_mp_bus_to_node(int busnum, int node)
654{
655 if (busnum >= 0 && busnum < BUS_NR)
656 mp_bus_to_node[busnum] = (unsigned char) node;
657}
658
659int get_mp_bus_to_node(int busnum)
660{
661 int node;
662
663 if (busnum < 0 || busnum > (BUS_NR - 1))
664 return 0;
665 node = mp_bus_to_node[busnum];
666 return node;
667}
668
669#endif /* CONFIG_X86_32 */
670
671#endif /* CONFIG_NUMA */
diff --git a/arch/x86/power/cpu.c b/arch/x86/power/cpu.c
index b3d20b9cac63..417c9f5b4afa 100644
--- a/arch/x86/power/cpu.c
+++ b/arch/x86/power/cpu.c
@@ -242,7 +242,7 @@ static void __restore_processor_state(struct saved_context *ctxt)
242 fix_processor_context(); 242 fix_processor_context();
243 243
244 do_fpu_end(); 244 do_fpu_end();
245 mtrr_ap_init(); 245 mtrr_bp_restore();
246 246
247#ifdef CONFIG_X86_OLD_MCE 247#ifdef CONFIG_X86_OLD_MCE
248 mcheck_init(&boot_cpu_data); 248 mcheck_init(&boot_cpu_data);
diff --git a/arch/xtensa/kernel/vmlinux.lds.S b/arch/xtensa/kernel/vmlinux.lds.S
index 41c159cd872f..921b6ff3b645 100644
--- a/arch/xtensa/kernel/vmlinux.lds.S
+++ b/arch/xtensa/kernel/vmlinux.lds.S
@@ -280,15 +280,6 @@ SECTIONS
280 *(.ResetVector.text) 280 *(.ResetVector.text)
281 } 281 }
282 282
283 /* Sections to be discarded */
284 /DISCARD/ :
285 {
286 *(.exit.literal)
287 EXIT_TEXT
288 EXIT_DATA
289 *(.exitcall.exit)
290 }
291
292 .xt.lit : { *(.xt.lit) } 283 .xt.lit : { *(.xt.lit) }
293 .xt.prop : { *(.xt.prop) } 284 .xt.prop : { *(.xt.prop) }
294 285
@@ -321,4 +312,8 @@ SECTIONS
321 *(.xt.lit) 312 *(.xt.lit)
322 *(.gnu.linkonce.p*) 313 *(.gnu.linkonce.p*)
323 } 314 }
315
316 /* Sections to be discarded */
317 DISCARDS
318 /DISCARD/ : { *(.exit.literal) }
324} 319}